diff --git a/package-lock.json b/package-lock.json index 553e96cb..76187753 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,20 +10,19 @@ "dependencies": { "@casl/ability": "4.1.6", "@casl/vue": "1.1.1", - "@cosmjs/amino": "^0.26.0", - "@cosmjs/crypto": "^0.26.0", - "@cosmjs/encoding": "^0.26.0", - "@cosmjs/launchpad": "^0.26.0", - "@cosmjs/ledger-amino": "^0.26.0", - "@cosmjs/math": "^0.26.0", - "@cosmjs/proto-signing": "^0.26.0", - "@cosmjs/stargate": "0.26.0", + "@cosmjs/amino": "^0.26.5", + "@cosmjs/crypto": "^0.26.5", + "@cosmjs/encoding": "^0.26.5", + "@cosmjs/launchpad": "^0.26.5", + "@cosmjs/ledger-amino": "^0.26.5", + "@cosmjs/math": "^0.26.5", + "@cosmjs/proto-signing": "^0.26.5", + "@cosmjs/stargate": "0.26.5", "@cosmostation/cosmosjs": "^0.10.6", "@intlify/vue-i18n-loader": "^2.1.2", "@ledgerhq/hw-app-cosmos": "^6.3.0", "@ledgerhq/hw-transport-web-ble": "^6.3.0", "@ledgerhq/hw-transport-webusb": "^6.3.0", - "@vue/composition-api": "^1.0.0-beta.22", "@vueuse/core": "4.0.0", "animate.css": "4.1.1", "apexcharts": "3.24.0", @@ -44,7 +43,10 @@ "portal-vue": "2.1.7", "postcss-rtl": "1.7.3", "prismjs": "1.24.0", + "protobufjs-cli-dbx": "^7.0.7", + "protobufjs-dbx": "^7.0.0", "swiper": "6.5.1", + "trading-vue-js": "^1.0.2", "uuid": "8.3.2", "vee-validate": "3.4.5", "vue": "2.x", @@ -563,7 +565,6 @@ "version": "7.14.7", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.7.tgz", "integrity": "sha512-X67Z5y+VBJuHB/RjwECp8kSl5uYi0BvRbNeWqkaJCVh+LiTPl19WBUfG627psSgp9rSf6ojuXghQM3ha6qHHdA==", - "dev": true, "bin": { "parser": "bin/babel-parser.js" }, @@ -1806,24 +1807,24 @@ } }, "node_modules/@cosmjs/amino": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.26.1.tgz", - "integrity": "sha512-8jcEwsLrLW2ltJdNQzdbx+g6Ii9lgG3j7hqaSatnqJE+8OyUjjLH1beigrpz9PhRF3qzQS8WFweTNkkTgNEcSA==", + "version": "0.26.5", + "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.26.5.tgz", + "integrity": "sha512-RFf9P1eb7O60JEWaZ5jbQA0wVbwU4SiBJINEjZkhkB1vUrAxCkfSHBZdJrVg8+IIRSWxPUUVr8PMuIyWlORV3A==", "dependencies": { - "@cosmjs/crypto": "0.26.1", - "@cosmjs/encoding": "0.26.1", - "@cosmjs/math": "0.26.1", - "@cosmjs/utils": "0.26.1" + "@cosmjs/crypto": "0.26.5", + "@cosmjs/encoding": "0.26.5", + "@cosmjs/math": "0.26.5", + "@cosmjs/utils": "0.26.5" } }, "node_modules/@cosmjs/crypto": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.26.1.tgz", - "integrity": "sha512-KzX++HMvCYjekdYr6vRRfJmAzJvdB10nRSyudzirn4/055yKh9oKk/wgjq9QGOIrMzEZNoQJNE0RndbS3nRccA==", + "version": "0.26.5", + "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.26.5.tgz", + "integrity": "sha512-ab7+qR/gdRi/DIdOLrjyimRdyD/2K/JdpRaFY1bl6Drr3ktVjDQrGsv53THvHONy33yCwD+YS+328ayQRv/pQA==", "dependencies": { - "@cosmjs/encoding": "0.26.1", - "@cosmjs/math": "0.26.1", - "@cosmjs/utils": "0.26.1", + "@cosmjs/encoding": "0.26.5", + "@cosmjs/math": "0.26.5", + "@cosmjs/utils": "0.26.5", "bip39": "^3.0.2", "bn.js": "^4.11.8", "elliptic": "^6.5.3", @@ -1834,9 +1835,9 @@ } }, "node_modules/@cosmjs/encoding": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.26.1.tgz", - "integrity": "sha512-wDFRvSQrTVIX7k4dPPSS/NmaytTU8ludDXi06TsaqVrgL/OR1hcGEkHhoKjodhZ2NS4gLvncI8XagV3SFySGhA==", + "version": "0.26.5", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.26.5.tgz", + "integrity": "sha512-lkw2mLvDZJqVCOZCBqdMzoGUtC4CN7c4+WMCGKDej3TpC0khsv7KZ1eFcsnN6EuZwHyGH67uyyjrs5x0ah9rYg==", "dependencies": { "base64-js": "^1.3.0", "bech32": "^1.1.4", @@ -1844,24 +1845,24 @@ } }, "node_modules/@cosmjs/json-rpc": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.26.0.tgz", - "integrity": "sha512-Jc+O0fDZjb8bxKSwH8SG9lJxV/y6lN4bYhiUqHNU6AUDUD9wzVr1mPgMudCJQ1DkQrgz8dQg2cDwgFp6eN428g==", + "version": "0.26.5", + "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.26.5.tgz", + "integrity": "sha512-SFGm5MlY54v3I26hXThwVteh91U+/DKS+KGqFL5lPLHZ2EHxggASqhKMiTJBMJVUDWvnmv1ikjFndkWNhpTPNw==", "dependencies": { - "@cosmjs/stream": "0.26.0", + "@cosmjs/stream": "0.26.5", "xstream": "^11.14.0" } }, "node_modules/@cosmjs/launchpad": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/@cosmjs/launchpad/-/launchpad-0.26.1.tgz", - "integrity": "sha512-RCwBRbIBAJa3AsjLTjGHHUWmq1eIoAIinQLz0BJ1FF9FI1WuAjlwr/m9KRGhoNZvMeEzAtQvxNFxFzL+BOotEQ==", + "version": "0.26.5", + "resolved": "https://registry.npmjs.org/@cosmjs/launchpad/-/launchpad-0.26.5.tgz", + "integrity": "sha512-V+9bLlvlybm9TeqXAoD10KxFHK5exoUYHIoKdj03g78E2oOn82bLRMNs9ti5UtWWOzIe9suyv5/OvunTSlvA7Q==", "dependencies": { - "@cosmjs/amino": "0.26.1", - "@cosmjs/crypto": "0.26.1", - "@cosmjs/encoding": "0.26.1", - "@cosmjs/math": "0.26.1", - "@cosmjs/utils": "0.26.1", + "@cosmjs/amino": "0.26.5", + "@cosmjs/crypto": "0.26.5", + "@cosmjs/encoding": "0.26.5", + "@cosmjs/math": "0.26.5", + "@cosmjs/utils": "0.26.5", "axios": "^0.21.2", "fast-deep-equal": "^3.1.3" } @@ -1875,15 +1876,15 @@ } }, "node_modules/@cosmjs/ledger-amino": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/@cosmjs/ledger-amino/-/ledger-amino-0.26.1.tgz", - "integrity": "sha512-A0hnujAhezAkIAc+NCQurN8si16Ub211AVTZvO6xQXCk8/3XRkub7YAvctxyQfM9fOb/a2mGGPGk6dne51tpBA==", + "version": "0.26.5", + "resolved": "https://registry.npmjs.org/@cosmjs/ledger-amino/-/ledger-amino-0.26.5.tgz", + "integrity": "sha512-UY3OsohGamLXp1P3M7hIW/Wk7Jj04xfFipyw+n4JQ0KSFrniju5idM89kqLELTimXptdI15TaivfHb4MJqfh7g==", "dependencies": { - "@cosmjs/amino": "0.26.1", - "@cosmjs/crypto": "0.26.1", - "@cosmjs/encoding": "0.26.1", - "@cosmjs/math": "0.26.1", - "@cosmjs/utils": "0.26.1", + "@cosmjs/amino": "0.26.5", + "@cosmjs/crypto": "0.26.5", + "@cosmjs/encoding": "0.26.5", + "@cosmjs/math": "0.26.5", + "@cosmjs/utils": "0.26.5", "ledger-cosmos-js": "^2.1.8", "semver": "^7.3.2" } @@ -1914,41 +1915,41 @@ } }, "node_modules/@cosmjs/math": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.26.1.tgz", - "integrity": "sha512-FvCpguKswL2PYsONXHDzbcaq1gFQteFUz2w7DasVXvVlnzStDS8ePz8k36psNQ1efyX6oF62ZqMizxOZgCW33A==", + "version": "0.26.5", + "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.26.5.tgz", + "integrity": "sha512-1G7NgLJ35g4jUupvyu7Igtgu/fj2NmgpOofpNk1JqIwMXrm3Tx7lOWbxJq8Wrjj2EoH7FNytSO1dXNGeK15UJw==", "dependencies": { "bn.js": "^4.11.8" } }, "node_modules/@cosmjs/proto-signing": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.26.1.tgz", - "integrity": "sha512-R6vHulxH5njTru9Ezr8k5+u6fBzenNRE3EbQtbVreL++TLV/jKu0Vl2CFz89X8su7BqWZImqzE9+BAesLUKVfw==", + "version": "0.26.5", + "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.26.5.tgz", + "integrity": "sha512-F94Uh+PX9nF5zGzUHMdEGgys+YCOudaWQehiHBfOjbHUIv0khufcRXs3l9/5dKzizz9ouQ5DHQAiWq/nYKZKqA==", "dependencies": { - "@cosmjs/amino": "0.26.1", - "@cosmjs/crypto": "0.26.1", - "@cosmjs/math": "0.26.1", + "@cosmjs/amino": "0.26.5", + "@cosmjs/crypto": "0.26.5", + "@cosmjs/math": "0.26.5", "cosmjs-types": "^0.2.0", "long": "^4.0.0", "protobufjs": "~6.10.2" } }, "node_modules/@cosmjs/socket": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.26.0.tgz", - "integrity": "sha512-eLGRWDpu7ywHEAvO5B5+75pP8xT5yta4OP/nvMYa4zMtwQgLxZQsGlzQhfeIclB/G57zrupgHECtQFGIttbZPg==", + "version": "0.26.5", + "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.26.5.tgz", + "integrity": "sha512-kBpXw9wuNHkO1AGuKgDA4/DOA+jZ6Lt0GVJVJIJ6bfjGbsewsNVocktAiH+1dGb47xXg2oH7OwGJL+B/PB3qPQ==", "dependencies": { - "@cosmjs/stream": "0.26.0", + "@cosmjs/stream": "0.26.5", "isomorphic-ws": "^4.0.1", "ws": "^7", "xstream": "^11.14.0" } }, "node_modules/@cosmjs/socket/node_modules/ws": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz", - "integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==", + "version": "7.5.6", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.6.tgz", + "integrity": "sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA==", "engines": { "node": ">=8.3.0" }, @@ -1966,156 +1967,60 @@ } }, "node_modules/@cosmjs/stargate": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.26.0.tgz", - "integrity": "sha512-+60Mbu5Y3x+vDRGfs9DgyQYx7QqKXQ7t4dH8Y0JIs+4Gn38WbrcAHaqcT58K/sQHSZPueRsBGkZTZdQkJII2zw==", + "version": "0.26.5", + "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.26.5.tgz", + "integrity": "sha512-rnRptbn01zXAa29272XZgxvH6zemPAvlE9/qGouRXpUm3ilHU+PscAq2k1pD17qtOKWRBLY2+x4feXYHwJg9VA==", "dependencies": { "@confio/ics23": "^0.6.3", - "@cosmjs/amino": "0.26.0", - "@cosmjs/encoding": "0.26.0", - "@cosmjs/math": "0.26.0", - "@cosmjs/proto-signing": "0.26.0", - "@cosmjs/stream": "0.26.0", - "@cosmjs/tendermint-rpc": "0.26.0", - "@cosmjs/utils": "0.26.0", + "@cosmjs/amino": "0.26.5", + "@cosmjs/encoding": "0.26.5", + "@cosmjs/math": "0.26.5", + "@cosmjs/proto-signing": "0.26.5", + "@cosmjs/stream": "0.26.5", + "@cosmjs/tendermint-rpc": "0.26.5", + "@cosmjs/utils": "0.26.5", "cosmjs-types": "^0.2.0", "long": "^4.0.0", "protobufjs": "~6.10.2", "xstream": "^11.14.0" } }, - "node_modules/@cosmjs/stargate/node_modules/@cosmjs/amino": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.26.0.tgz", - "integrity": "sha512-CDGCdGYsxrJxhiI57e7no25LPuzKQOe4DdsJQyLrOzAnFnGHYJvPh0NAX4eEh3dOfwJCwMNnA1w79JNm0lzhOA==", - "dependencies": { - "@cosmjs/crypto": "0.26.0", - "@cosmjs/encoding": "0.26.0", - "@cosmjs/math": "0.26.0", - "@cosmjs/utils": "0.26.0" - } - }, - "node_modules/@cosmjs/stargate/node_modules/@cosmjs/crypto": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.26.0.tgz", - "integrity": "sha512-/36R7BzBNag1QRA2tpOrnr7x02B/YuaCgXKmKGLNd1+62Ud6aKkORyZMDvEt65SKoLhbDUzvNpSHAUjMsUbDfg==", - "dependencies": { - "@cosmjs/encoding": "0.26.0", - "@cosmjs/math": "0.26.0", - "@cosmjs/utils": "0.26.0", - "bip39": "^3.0.2", - "bn.js": "^4.11.8", - "elliptic": "^6.5.3", - "js-sha3": "^0.8.0", - "libsodium-wrappers": "^0.7.6", - "ripemd160": "^2.0.2", - "sha.js": "^2.4.11" - } - }, - "node_modules/@cosmjs/stargate/node_modules/@cosmjs/encoding": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.26.0.tgz", - "integrity": "sha512-ctw6cBDsQSd0OJFWEwU6fJYrAXf63JNhOS3mjawo/hRyEFpVSBSEKEHvfICPc+4dT40v9L3eYEr8LXDYxat4AA==", - "dependencies": { - "base64-js": "^1.3.0", - "bech32": "^1.1.4", - "readonly-date": "^1.0.0" - } - }, - "node_modules/@cosmjs/stargate/node_modules/@cosmjs/math": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.26.0.tgz", - "integrity": "sha512-wfzdK/PnEnIA+CXM6VCyUr2daiEMvaF/iBaK3YCpkbXLfHUXQB+7bNh1HAHgJmp+PaYn3MhgBTnQbsmMsE3cKw==", - "dependencies": { - "bn.js": "^4.11.8" - } - }, - "node_modules/@cosmjs/stargate/node_modules/@cosmjs/proto-signing": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.26.0.tgz", - "integrity": "sha512-hNiebrGiDCf3tq6SMHtrf4Qhd8Fn4Z868mWJrbIxamR3EsGuAPb5fKFWYEmpS8IXDfD6qRkO845oMAfnmh5Oxg==", - "dependencies": { - "@cosmjs/amino": "0.26.0", - "@cosmjs/crypto": "0.26.0", - "@cosmjs/math": "0.26.0", - "cosmjs-types": "^0.2.0", - "long": "^4.0.0", - "protobufjs": "~6.10.2" - } - }, - "node_modules/@cosmjs/stargate/node_modules/@cosmjs/utils": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.26.0.tgz", - "integrity": "sha512-InTQ3P1noUR0U5zJs8ssqnToIGH2NKbFb+hS5wmYGLB0XRdlNk0UGcb9pjbAzaWRQPWxTd08YQvXg6IK/WE4fA==" - }, "node_modules/@cosmjs/stream": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.26.0.tgz", - "integrity": "sha512-TaB8aXj5vskllj39fFTlsJviqm+bZjrV6JzBneJMjV0ltuXEaocKo4x+EOe68ZLjF6+lK4XUu1g2rP1iAPdmAQ==", + "version": "0.26.5", + "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.26.5.tgz", + "integrity": "sha512-CIr/8bkRlLl36LAtbapsKxA7cMVhmPPWTihAcXgBXik1FM/0XCVNETPTQ64HX47eNQuP5AhWwaMoO553Sf9T2w==", "dependencies": { "xstream": "^11.14.0" } }, "node_modules/@cosmjs/tendermint-rpc": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.26.0.tgz", - "integrity": "sha512-PQbDLerUGAm8GwRiobVfdy7SM5nI9PzFQVDYOAnwwDME0kDsLGy83e7QNTG2DE1G+8861z9CXne5qz+54NbKwQ==", + "version": "0.26.5", + "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.26.5.tgz", + "integrity": "sha512-bBcFgpTHEP15m8n/bG3cx/LO110sScpEvYvurZDewfy7MW8WETF6sYZaPCGfVDGWde1EPjFLwKKxQ1Da/XoK0A==", "dependencies": { - "@cosmjs/crypto": "0.26.0", - "@cosmjs/encoding": "0.26.0", - "@cosmjs/json-rpc": "0.26.0", - "@cosmjs/math": "0.26.0", - "@cosmjs/socket": "0.26.0", - "@cosmjs/stream": "0.26.0", - "axios": "^0.21.1", + "@cosmjs/crypto": "0.26.5", + "@cosmjs/encoding": "0.26.5", + "@cosmjs/json-rpc": "0.26.5", + "@cosmjs/math": "0.26.5", + "@cosmjs/socket": "0.26.5", + "@cosmjs/stream": "0.26.5", + "axios": "^0.21.2", "readonly-date": "^1.0.0", "xstream": "^11.14.0" } }, - "node_modules/@cosmjs/tendermint-rpc/node_modules/@cosmjs/crypto": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.26.0.tgz", - "integrity": "sha512-/36R7BzBNag1QRA2tpOrnr7x02B/YuaCgXKmKGLNd1+62Ud6aKkORyZMDvEt65SKoLhbDUzvNpSHAUjMsUbDfg==", + "node_modules/@cosmjs/tendermint-rpc/node_modules/axios": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", "dependencies": { - "@cosmjs/encoding": "0.26.0", - "@cosmjs/math": "0.26.0", - "@cosmjs/utils": "0.26.0", - "bip39": "^3.0.2", - "bn.js": "^4.11.8", - "elliptic": "^6.5.3", - "js-sha3": "^0.8.0", - "libsodium-wrappers": "^0.7.6", - "ripemd160": "^2.0.2", - "sha.js": "^2.4.11" + "follow-redirects": "^1.14.0" } }, - "node_modules/@cosmjs/tendermint-rpc/node_modules/@cosmjs/encoding": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.26.0.tgz", - "integrity": "sha512-ctw6cBDsQSd0OJFWEwU6fJYrAXf63JNhOS3mjawo/hRyEFpVSBSEKEHvfICPc+4dT40v9L3eYEr8LXDYxat4AA==", - "dependencies": { - "base64-js": "^1.3.0", - "bech32": "^1.1.4", - "readonly-date": "^1.0.0" - } - }, - "node_modules/@cosmjs/tendermint-rpc/node_modules/@cosmjs/math": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.26.0.tgz", - "integrity": "sha512-wfzdK/PnEnIA+CXM6VCyUr2daiEMvaF/iBaK3YCpkbXLfHUXQB+7bNh1HAHgJmp+PaYn3MhgBTnQbsmMsE3cKw==", - "dependencies": { - "bn.js": "^4.11.8" - } - }, - "node_modules/@cosmjs/tendermint-rpc/node_modules/@cosmjs/utils": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.26.0.tgz", - "integrity": "sha512-InTQ3P1noUR0U5zJs8ssqnToIGH2NKbFb+hS5wmYGLB0XRdlNk0UGcb9pjbAzaWRQPWxTd08YQvXg6IK/WE4fA==" - }, "node_modules/@cosmjs/utils": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.26.1.tgz", - "integrity": "sha512-E7sYhHfcq2V4oB504FNSt8nx6QInTea1KZT5FrtyqONmgQwccfTv5+E2PuRbQs91i56YzHORHuP57rhV7NPn3g==" + "version": "0.26.5", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.26.5.tgz", + "integrity": "sha512-VB4Z7lEIXA36q0RON15KexzEosToUtdDyMv7UXSBHSl4mLG/fIZgBIpBEYsaPZ1kh43xyINeKQJiGCp2z5rI+g==" }, "node_modules/@cosmostation/cosmosjs": { "version": "0.10.8", @@ -3843,11 +3748,11 @@ } }, "node_modules/@vue/composition-api": { - "version": "1.0.0-beta.22", - "resolved": "https://registry.npmjs.org/@vue/composition-api/-/composition-api-1.0.0-beta.22.tgz", - "integrity": "sha512-KkTeHVWgsJbtoA5t6pUien/ARw7JhVM7QZh05ko/UdgzALYMGwJsBf4WlcvbpMKE5eAu4ONYJypQ+r8LwBIOhA==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@vue/composition-api/-/composition-api-1.4.1.tgz", + "integrity": "sha512-ZTat9ru/rwecveRnFzlO2mduOBpGfnBdXn+WtBcFLV9UsL/D+6nX47RWuLiVdNxNDX0qphGZRC+JDjwt+YTnRA==", "dependencies": { - "tslib": "^2.0.1" + "tslib": "^2.3.1" }, "peerDependencies": { "vue": ">= 2.5 < 3" @@ -4447,6 +4352,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/arrayslicer": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/arrayslicer/-/arrayslicer-1.2.3.tgz", + "integrity": "sha1-IaSQMQKpq6fYpzxEv1fz4oxWATY=" + }, "node_modules/asn1": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", @@ -6280,6 +6190,17 @@ "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" }, + "node_modules/catharsis": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz", + "integrity": "sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A==", + "dependencies": { + "lodash": "^4.17.15" + }, + "engines": { + "node": ">= 10" + } + }, "node_modules/caw": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/caw/-/caw-2.0.1.tgz", @@ -8771,6 +8692,27 @@ "node": ">=0.8.0" } }, + "node_modules/escodegen": { + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", + "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=4.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, "node_modules/eslint": { "version": "6.8.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", @@ -10407,6 +10349,19 @@ "node": ">=6" } }, + "node_modules/hammerjs": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/hammerjs/-/hammerjs-2.0.8.tgz", + "integrity": "sha1-BO93hiz/K7edMPdpIJWTAiK/YPE=", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/hamsterjs": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/hamsterjs/-/hamsterjs-1.1.3.tgz", + "integrity": "sha512-q4XBr7hnxx1WyZA8mpVDuZVa1YXaR0WZaFSBxnj8hUXltuqXJOt5yuWYkAbMXsj+q0REDUO990+/TuxEadXFyg==" + }, "node_modules/handle-thing": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.1.tgz", @@ -12101,11 +12056,76 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/js2xmlparser": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.2.tgz", + "integrity": "sha512-6n4D8gLlLf1n5mNLQPRfViYzu9RATblzPEtm1SthMX1Pjao0r9YI9nw7ZIfRxQMERS87mcswrg+r/OYrPRX6jA==", + "dependencies": { + "xmlcreate": "^2.0.4" + } + }, "node_modules/jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" }, + "node_modules/jsdoc": { + "version": "3.6.7", + "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.7.tgz", + "integrity": "sha512-sxKt7h0vzCd+3Y81Ey2qinupL6DpRSZJclS04ugHDNmRUXGzqicMJ6iwayhSA0S0DwwX30c5ozyUthr1QKF6uw==", + "dependencies": { + "@babel/parser": "^7.9.4", + "bluebird": "^3.7.2", + "catharsis": "^0.9.0", + "escape-string-regexp": "^2.0.0", + "js2xmlparser": "^4.0.1", + "klaw": "^3.0.0", + "markdown-it": "^10.0.0", + "markdown-it-anchor": "^5.2.7", + "marked": "^2.0.3", + "mkdirp": "^1.0.4", + "requizzle": "^0.2.3", + "strip-json-comments": "^3.1.0", + "taffydb": "2.6.2", + "underscore": "~1.13.1" + }, + "bin": { + "jsdoc": "jsdoc.js" + }, + "engines": { + "node": ">=8.15.0" + } + }, + "node_modules/jsdoc/node_modules/escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "engines": { + "node": ">=8" + } + }, + "node_modules/jsdoc/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jsdoc/node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -12303,6 +12323,14 @@ "node": ">=0.10.0" } }, + "node_modules/klaw": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz", + "integrity": "sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g==", + "dependencies": { + "graceful-fs": "^4.1.9" + } + }, "node_modules/klona": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/klona/-/klona-2.0.4.tgz", @@ -12446,6 +12474,14 @@ "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", "dev": true }, + "node_modules/linkify-it": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz", + "integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==", + "dependencies": { + "uc.micro": "^1.0.1" + } + }, "node_modules/load-json-file": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", @@ -12750,6 +12786,14 @@ "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" }, + "node_modules/lz-string": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.4.4.tgz", + "integrity": "sha1-wNjq82BZ9wV5bh40SBHPTEmNOiY=", + "bin": { + "lz-string": "bin/bin.js" + } + }, "node_modules/make-dir": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", @@ -12790,6 +12834,45 @@ "node": ">=0.10.0" } }, + "node_modules/markdown-it": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-10.0.0.tgz", + "integrity": "sha512-YWOP1j7UbDNz+TumYP1kpwnP0aEa711cJjrAQrzd0UXlbJfc5aAq0F/PZHjiioqDC1NKgvIMX+o+9Bk7yuM2dg==", + "dependencies": { + "argparse": "^1.0.7", + "entities": "~2.0.0", + "linkify-it": "^2.0.0", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + }, + "bin": { + "markdown-it": "bin/markdown-it.js" + } + }, + "node_modules/markdown-it-anchor": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-5.3.0.tgz", + "integrity": "sha512-/V1MnLL/rgJ3jkMWo84UR+K+jF1cxNG1a+KwqeXqTIJ+jtA8aWSHuigx8lTzauiIjBDbwF3NcWQMotd0Dm39jA==", + "peerDependencies": { + "markdown-it": "*" + } + }, + "node_modules/markdown-it/node_modules/entities": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.3.tgz", + "integrity": "sha512-MyoZ0jgnLvB2X3Lg5HqpFmn1kybDiIfEQmKzTb5apr51Rb+T3KdmMiqa70T+bhGnyv7bQ6WMj2QMHpGMmlrUYQ==" + }, + "node_modules/marked": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/marked/-/marked-2.1.3.tgz", + "integrity": "sha512-/Q+7MGzaETqifOMWYEA7HVMaZb4XbcRfaOzcSsHZEith83KGlvaSG33u0SKu89Mj5h+T8V2hM+8O45Qc5XTgwA==", + "bin": { + "marked": "bin/marked" + }, + "engines": { + "node": ">= 10" + } + }, "node_modules/md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -12806,6 +12889,11 @@ "integrity": "sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA==", "dev": true }, + "node_modules/mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=" + }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -15446,6 +15534,117 @@ "pbts": "bin/pbts" } }, + "node_modules/protobufjs-cli-dbx": { + "version": "7.0.7", + "resolved": "https://registry.npmjs.org/protobufjs-cli-dbx/-/protobufjs-cli-dbx-7.0.7.tgz", + "integrity": "sha512-lP9nIEfV1fw1SjRBS5qpLEbBkImHHgtrYXzqX6s6Hn7hcuTDFwCXEy6Tzz4sAh4IgCKcjDT8ZK7AluerVHaGHQ==", + "dependencies": { + "chalk": "^2.4.1", + "escodegen": "^1.9.1", + "espree": "^3.5.4", + "estraverse": "^4.2.0", + "glob": "^7.1.2", + "jsdoc": "^3.4.2", + "minimist": "^1.2.0", + "semver": "^5.5.0", + "tmp": "0.0.31", + "uglify-js": "^3.3.25" + }, + "bin": { + "pbjs": "bin/pbjs", + "pbts": "bin/pbts" + }, + "peerDependencies": { + "protobufjs-dbx": "~7.0.0" + } + }, + "node_modules/protobufjs-cli-dbx/node_modules/acorn": { + "version": "5.7.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz", + "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/protobufjs-cli-dbx/node_modules/acorn-jsx": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", + "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", + "dependencies": { + "acorn": "^3.0.4" + } + }, + "node_modules/protobufjs-cli-dbx/node_modules/acorn-jsx/node_modules/acorn": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/protobufjs-cli-dbx/node_modules/espree": { + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", + "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", + "dependencies": { + "acorn": "^5.5.0", + "acorn-jsx": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/protobufjs-cli-dbx/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/protobufjs-cli-dbx/node_modules/tmp": { + "version": "0.0.31", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.31.tgz", + "integrity": "sha1-jzirlDjhcxXl29izZX6L+yd65Kc=", + "dependencies": { + "os-tmpdir": "~1.0.1" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/protobufjs-dbx": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/protobufjs-dbx/-/protobufjs-dbx-7.0.0.tgz", + "integrity": "sha512-y4ECgn5J39e4RqlbyQhwJF72nLuyY9JhkhnfTRr03/bx0aonZ/VfDSxrXls8RxLup7Hk2rx/fandTmtYO6XGZQ==", + "hasInstallScript": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.0", + "@types/node": "^10.1.0", + "long": "^4.0.0" + } + }, + "node_modules/protobufjs-dbx/node_modules/@types/node": { + "version": "10.17.60", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", + "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==" + }, "node_modules/protobufjs/node_modules/@types/node": { "version": "13.13.52", "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.52.tgz", @@ -16125,6 +16324,14 @@ "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", "dev": true }, + "node_modules/requizzle": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.3.tgz", + "integrity": "sha512-YanoyJjykPxGHii0fZP0uUPEXpvqfBDxWV7s6GKAiiOsiqhX6vHNyW3Qzdmqp/iq/ExbhaGbVrjB4ruEVSM4GQ==", + "dependencies": { + "lodash": "^4.17.14" + } + }, "node_modules/resize-detector": { "version": "0.1.10", "resolved": "https://registry.npmjs.org/resize-detector/-/resize-detector-0.1.10.tgz", @@ -18085,6 +18292,11 @@ "node": ">=6" } }, + "node_modules/taffydb": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", + "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=" + }, "node_modules/tapable": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", @@ -18506,6 +18718,20 @@ "node": ">=0.8" } }, + "node_modules/trading-vue-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/trading-vue-js/-/trading-vue-js-1.0.2.tgz", + "integrity": "sha512-RObZR4OF5rtdgh/CyyRv0soPxlVlwHudlpAziOeQeOeId4j/2RcGUSp4/lKwzYo8b51tnAiRnMtDS+ZSmg208g==", + "dependencies": { + "@babel/runtime": "^7.13.10", + "arrayslicer": "^1.2.3", + "hammerjs": "^2.0.8", + "hamsterjs": "^1.1.3", + "lz-string": "^1.4.4", + "moment": "^2.29.1", + "vue": "^2.6.12" + } + }, "node_modules/trim-newlines": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", @@ -18559,9 +18785,9 @@ } }, "node_modules/tslib": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", - "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" }, "node_modules/tty-browserify": { "version": "0.0.0", @@ -18638,11 +18864,15 @@ "resolved": "https://registry.npmjs.org/typeforce/-/typeforce-1.18.0.tgz", "integrity": "sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g==" }, + "node_modules/uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==" + }, "node_modules/uglify-js": { "version": "3.4.10", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.10.tgz", "integrity": "sha512-Y2VsbPVs0FIshJztycsO2SfPk7/KAF/T72qzv9u5EpQ4kB2hQoHlhNQTsNyy6ul7lQtqJN/AoWeS23OzEiEFxw==", - "dev": true, "dependencies": { "commander": "~2.19.0", "source-map": "~0.6.1" @@ -18657,8 +18887,7 @@ "node_modules/uglify-js/node_modules/commander": { "version": "2.19.0", "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", - "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==", - "dev": true + "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==" }, "node_modules/unbox-primitive": { "version": "1.0.1", @@ -18685,6 +18914,11 @@ "through": "^2.3.8" } }, + "node_modules/underscore": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.1.tgz", + "integrity": "sha512-hzSoAVtJF+3ZtiFX0VgfFPHEDRm7Y/QPjGyNo4TVdnDTdft3tr8hEkD25a1jC+TjTuE7tkHGKkhwCgs9dgBB2g==" + }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", @@ -20478,6 +20712,11 @@ "node": ">=8" } }, + "node_modules/xmlcreate": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.4.tgz", + "integrity": "sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg==" + }, "node_modules/xstream": { "version": "11.14.0", "resolved": "https://registry.npmjs.org/xstream/-/xstream-11.14.0.tgz", @@ -21094,8 +21333,7 @@ "@babel/parser": { "version": "7.14.7", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.7.tgz", - "integrity": "sha512-X67Z5y+VBJuHB/RjwECp8kSl5uYi0BvRbNeWqkaJCVh+LiTPl19WBUfG627psSgp9rSf6ojuXghQM3ha6qHHdA==", - "dev": true + "integrity": "sha512-X67Z5y+VBJuHB/RjwECp8kSl5uYi0BvRbNeWqkaJCVh+LiTPl19WBUfG627psSgp9rSf6ojuXghQM3ha6qHHdA==" }, "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { "version": "7.14.5", @@ -21930,24 +22168,24 @@ } }, "@cosmjs/amino": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.26.1.tgz", - "integrity": "sha512-8jcEwsLrLW2ltJdNQzdbx+g6Ii9lgG3j7hqaSatnqJE+8OyUjjLH1beigrpz9PhRF3qzQS8WFweTNkkTgNEcSA==", + "version": "0.26.5", + "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.26.5.tgz", + "integrity": "sha512-RFf9P1eb7O60JEWaZ5jbQA0wVbwU4SiBJINEjZkhkB1vUrAxCkfSHBZdJrVg8+IIRSWxPUUVr8PMuIyWlORV3A==", "requires": { - "@cosmjs/crypto": "0.26.1", - "@cosmjs/encoding": "0.26.1", - "@cosmjs/math": "0.26.1", - "@cosmjs/utils": "0.26.1" + "@cosmjs/crypto": "0.26.5", + "@cosmjs/encoding": "0.26.5", + "@cosmjs/math": "0.26.5", + "@cosmjs/utils": "0.26.5" } }, "@cosmjs/crypto": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.26.1.tgz", - "integrity": "sha512-KzX++HMvCYjekdYr6vRRfJmAzJvdB10nRSyudzirn4/055yKh9oKk/wgjq9QGOIrMzEZNoQJNE0RndbS3nRccA==", + "version": "0.26.5", + "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.26.5.tgz", + "integrity": "sha512-ab7+qR/gdRi/DIdOLrjyimRdyD/2K/JdpRaFY1bl6Drr3ktVjDQrGsv53THvHONy33yCwD+YS+328ayQRv/pQA==", "requires": { - "@cosmjs/encoding": "0.26.1", - "@cosmjs/math": "0.26.1", - "@cosmjs/utils": "0.26.1", + "@cosmjs/encoding": "0.26.5", + "@cosmjs/math": "0.26.5", + "@cosmjs/utils": "0.26.5", "bip39": "^3.0.2", "bn.js": "^4.11.8", "elliptic": "^6.5.3", @@ -21958,9 +22196,9 @@ } }, "@cosmjs/encoding": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.26.1.tgz", - "integrity": "sha512-wDFRvSQrTVIX7k4dPPSS/NmaytTU8ludDXi06TsaqVrgL/OR1hcGEkHhoKjodhZ2NS4gLvncI8XagV3SFySGhA==", + "version": "0.26.5", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.26.5.tgz", + "integrity": "sha512-lkw2mLvDZJqVCOZCBqdMzoGUtC4CN7c4+WMCGKDej3TpC0khsv7KZ1eFcsnN6EuZwHyGH67uyyjrs5x0ah9rYg==", "requires": { "base64-js": "^1.3.0", "bech32": "^1.1.4", @@ -21968,24 +22206,24 @@ } }, "@cosmjs/json-rpc": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.26.0.tgz", - "integrity": "sha512-Jc+O0fDZjb8bxKSwH8SG9lJxV/y6lN4bYhiUqHNU6AUDUD9wzVr1mPgMudCJQ1DkQrgz8dQg2cDwgFp6eN428g==", + "version": "0.26.5", + "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.26.5.tgz", + "integrity": "sha512-SFGm5MlY54v3I26hXThwVteh91U+/DKS+KGqFL5lPLHZ2EHxggASqhKMiTJBMJVUDWvnmv1ikjFndkWNhpTPNw==", "requires": { - "@cosmjs/stream": "0.26.0", + "@cosmjs/stream": "0.26.5", "xstream": "^11.14.0" } }, "@cosmjs/launchpad": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/@cosmjs/launchpad/-/launchpad-0.26.1.tgz", - "integrity": "sha512-RCwBRbIBAJa3AsjLTjGHHUWmq1eIoAIinQLz0BJ1FF9FI1WuAjlwr/m9KRGhoNZvMeEzAtQvxNFxFzL+BOotEQ==", + "version": "0.26.5", + "resolved": "https://registry.npmjs.org/@cosmjs/launchpad/-/launchpad-0.26.5.tgz", + "integrity": "sha512-V+9bLlvlybm9TeqXAoD10KxFHK5exoUYHIoKdj03g78E2oOn82bLRMNs9ti5UtWWOzIe9suyv5/OvunTSlvA7Q==", "requires": { - "@cosmjs/amino": "0.26.1", - "@cosmjs/crypto": "0.26.1", - "@cosmjs/encoding": "0.26.1", - "@cosmjs/math": "0.26.1", - "@cosmjs/utils": "0.26.1", + "@cosmjs/amino": "0.26.5", + "@cosmjs/crypto": "0.26.5", + "@cosmjs/encoding": "0.26.5", + "@cosmjs/math": "0.26.5", + "@cosmjs/utils": "0.26.5", "axios": "^0.21.2", "fast-deep-equal": "^3.1.3" }, @@ -22001,15 +22239,15 @@ } }, "@cosmjs/ledger-amino": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/@cosmjs/ledger-amino/-/ledger-amino-0.26.1.tgz", - "integrity": "sha512-A0hnujAhezAkIAc+NCQurN8si16Ub211AVTZvO6xQXCk8/3XRkub7YAvctxyQfM9fOb/a2mGGPGk6dne51tpBA==", + "version": "0.26.5", + "resolved": "https://registry.npmjs.org/@cosmjs/ledger-amino/-/ledger-amino-0.26.5.tgz", + "integrity": "sha512-UY3OsohGamLXp1P3M7hIW/Wk7Jj04xfFipyw+n4JQ0KSFrniju5idM89kqLELTimXptdI15TaivfHb4MJqfh7g==", "requires": { - "@cosmjs/amino": "0.26.1", - "@cosmjs/crypto": "0.26.1", - "@cosmjs/encoding": "0.26.1", - "@cosmjs/math": "0.26.1", - "@cosmjs/utils": "0.26.1", + "@cosmjs/amino": "0.26.5", + "@cosmjs/crypto": "0.26.5", + "@cosmjs/encoding": "0.26.5", + "@cosmjs/math": "0.26.5", + "@cosmjs/utils": "0.26.5", "ledger-cosmos-js": "^2.1.8", "semver": "^7.3.2" }, @@ -22033,200 +22271,102 @@ } }, "@cosmjs/math": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.26.1.tgz", - "integrity": "sha512-FvCpguKswL2PYsONXHDzbcaq1gFQteFUz2w7DasVXvVlnzStDS8ePz8k36psNQ1efyX6oF62ZqMizxOZgCW33A==", + "version": "0.26.5", + "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.26.5.tgz", + "integrity": "sha512-1G7NgLJ35g4jUupvyu7Igtgu/fj2NmgpOofpNk1JqIwMXrm3Tx7lOWbxJq8Wrjj2EoH7FNytSO1dXNGeK15UJw==", "requires": { "bn.js": "^4.11.8" } }, "@cosmjs/proto-signing": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.26.1.tgz", - "integrity": "sha512-R6vHulxH5njTru9Ezr8k5+u6fBzenNRE3EbQtbVreL++TLV/jKu0Vl2CFz89X8su7BqWZImqzE9+BAesLUKVfw==", + "version": "0.26.5", + "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.26.5.tgz", + "integrity": "sha512-F94Uh+PX9nF5zGzUHMdEGgys+YCOudaWQehiHBfOjbHUIv0khufcRXs3l9/5dKzizz9ouQ5DHQAiWq/nYKZKqA==", "requires": { - "@cosmjs/amino": "0.26.1", - "@cosmjs/crypto": "0.26.1", - "@cosmjs/math": "0.26.1", + "@cosmjs/amino": "0.26.5", + "@cosmjs/crypto": "0.26.5", + "@cosmjs/math": "0.26.5", "cosmjs-types": "^0.2.0", "long": "^4.0.0", "protobufjs": "~6.10.2" } }, "@cosmjs/socket": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.26.0.tgz", - "integrity": "sha512-eLGRWDpu7ywHEAvO5B5+75pP8xT5yta4OP/nvMYa4zMtwQgLxZQsGlzQhfeIclB/G57zrupgHECtQFGIttbZPg==", + "version": "0.26.5", + "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.26.5.tgz", + "integrity": "sha512-kBpXw9wuNHkO1AGuKgDA4/DOA+jZ6Lt0GVJVJIJ6bfjGbsewsNVocktAiH+1dGb47xXg2oH7OwGJL+B/PB3qPQ==", "requires": { - "@cosmjs/stream": "0.26.0", + "@cosmjs/stream": "0.26.5", "isomorphic-ws": "^4.0.1", "ws": "^7", "xstream": "^11.14.0" }, "dependencies": { "ws": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz", - "integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==", + "version": "7.5.6", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.6.tgz", + "integrity": "sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA==", "requires": {} } } }, "@cosmjs/stargate": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.26.0.tgz", - "integrity": "sha512-+60Mbu5Y3x+vDRGfs9DgyQYx7QqKXQ7t4dH8Y0JIs+4Gn38WbrcAHaqcT58K/sQHSZPueRsBGkZTZdQkJII2zw==", + "version": "0.26.5", + "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.26.5.tgz", + "integrity": "sha512-rnRptbn01zXAa29272XZgxvH6zemPAvlE9/qGouRXpUm3ilHU+PscAq2k1pD17qtOKWRBLY2+x4feXYHwJg9VA==", "requires": { "@confio/ics23": "^0.6.3", - "@cosmjs/amino": "0.26.0", - "@cosmjs/encoding": "0.26.0", - "@cosmjs/math": "0.26.0", - "@cosmjs/proto-signing": "0.26.0", - "@cosmjs/stream": "0.26.0", - "@cosmjs/tendermint-rpc": "0.26.0", - "@cosmjs/utils": "0.26.0", + "@cosmjs/amino": "0.26.5", + "@cosmjs/encoding": "0.26.5", + "@cosmjs/math": "0.26.5", + "@cosmjs/proto-signing": "0.26.5", + "@cosmjs/stream": "0.26.5", + "@cosmjs/tendermint-rpc": "0.26.5", + "@cosmjs/utils": "0.26.5", "cosmjs-types": "^0.2.0", "long": "^4.0.0", "protobufjs": "~6.10.2", "xstream": "^11.14.0" - }, - "dependencies": { - "@cosmjs/amino": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.26.0.tgz", - "integrity": "sha512-CDGCdGYsxrJxhiI57e7no25LPuzKQOe4DdsJQyLrOzAnFnGHYJvPh0NAX4eEh3dOfwJCwMNnA1w79JNm0lzhOA==", - "requires": { - "@cosmjs/crypto": "0.26.0", - "@cosmjs/encoding": "0.26.0", - "@cosmjs/math": "0.26.0", - "@cosmjs/utils": "0.26.0" - } - }, - "@cosmjs/crypto": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.26.0.tgz", - "integrity": "sha512-/36R7BzBNag1QRA2tpOrnr7x02B/YuaCgXKmKGLNd1+62Ud6aKkORyZMDvEt65SKoLhbDUzvNpSHAUjMsUbDfg==", - "requires": { - "@cosmjs/encoding": "0.26.0", - "@cosmjs/math": "0.26.0", - "@cosmjs/utils": "0.26.0", - "bip39": "^3.0.2", - "bn.js": "^4.11.8", - "elliptic": "^6.5.3", - "js-sha3": "^0.8.0", - "libsodium-wrappers": "^0.7.6", - "ripemd160": "^2.0.2", - "sha.js": "^2.4.11" - } - }, - "@cosmjs/encoding": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.26.0.tgz", - "integrity": "sha512-ctw6cBDsQSd0OJFWEwU6fJYrAXf63JNhOS3mjawo/hRyEFpVSBSEKEHvfICPc+4dT40v9L3eYEr8LXDYxat4AA==", - "requires": { - "base64-js": "^1.3.0", - "bech32": "^1.1.4", - "readonly-date": "^1.0.0" - } - }, - "@cosmjs/math": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.26.0.tgz", - "integrity": "sha512-wfzdK/PnEnIA+CXM6VCyUr2daiEMvaF/iBaK3YCpkbXLfHUXQB+7bNh1HAHgJmp+PaYn3MhgBTnQbsmMsE3cKw==", - "requires": { - "bn.js": "^4.11.8" - } - }, - "@cosmjs/proto-signing": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.26.0.tgz", - "integrity": "sha512-hNiebrGiDCf3tq6SMHtrf4Qhd8Fn4Z868mWJrbIxamR3EsGuAPb5fKFWYEmpS8IXDfD6qRkO845oMAfnmh5Oxg==", - "requires": { - "@cosmjs/amino": "0.26.0", - "@cosmjs/crypto": "0.26.0", - "@cosmjs/math": "0.26.0", - "cosmjs-types": "^0.2.0", - "long": "^4.0.0", - "protobufjs": "~6.10.2" - } - }, - "@cosmjs/utils": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.26.0.tgz", - "integrity": "sha512-InTQ3P1noUR0U5zJs8ssqnToIGH2NKbFb+hS5wmYGLB0XRdlNk0UGcb9pjbAzaWRQPWxTd08YQvXg6IK/WE4fA==" - } } }, "@cosmjs/stream": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.26.0.tgz", - "integrity": "sha512-TaB8aXj5vskllj39fFTlsJviqm+bZjrV6JzBneJMjV0ltuXEaocKo4x+EOe68ZLjF6+lK4XUu1g2rP1iAPdmAQ==", + "version": "0.26.5", + "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.26.5.tgz", + "integrity": "sha512-CIr/8bkRlLl36LAtbapsKxA7cMVhmPPWTihAcXgBXik1FM/0XCVNETPTQ64HX47eNQuP5AhWwaMoO553Sf9T2w==", "requires": { "xstream": "^11.14.0" } }, "@cosmjs/tendermint-rpc": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.26.0.tgz", - "integrity": "sha512-PQbDLerUGAm8GwRiobVfdy7SM5nI9PzFQVDYOAnwwDME0kDsLGy83e7QNTG2DE1G+8861z9CXne5qz+54NbKwQ==", + "version": "0.26.5", + "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.26.5.tgz", + "integrity": "sha512-bBcFgpTHEP15m8n/bG3cx/LO110sScpEvYvurZDewfy7MW8WETF6sYZaPCGfVDGWde1EPjFLwKKxQ1Da/XoK0A==", "requires": { - "@cosmjs/crypto": "0.26.0", - "@cosmjs/encoding": "0.26.0", - "@cosmjs/json-rpc": "0.26.0", - "@cosmjs/math": "0.26.0", - "@cosmjs/socket": "0.26.0", - "@cosmjs/stream": "0.26.0", - "axios": "^0.21.1", + "@cosmjs/crypto": "0.26.5", + "@cosmjs/encoding": "0.26.5", + "@cosmjs/json-rpc": "0.26.5", + "@cosmjs/math": "0.26.5", + "@cosmjs/socket": "0.26.5", + "@cosmjs/stream": "0.26.5", + "axios": "^0.21.2", "readonly-date": "^1.0.0", "xstream": "^11.14.0" }, "dependencies": { - "@cosmjs/crypto": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.26.0.tgz", - "integrity": "sha512-/36R7BzBNag1QRA2tpOrnr7x02B/YuaCgXKmKGLNd1+62Ud6aKkORyZMDvEt65SKoLhbDUzvNpSHAUjMsUbDfg==", + "axios": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", "requires": { - "@cosmjs/encoding": "0.26.0", - "@cosmjs/math": "0.26.0", - "@cosmjs/utils": "0.26.0", - "bip39": "^3.0.2", - "bn.js": "^4.11.8", - "elliptic": "^6.5.3", - "js-sha3": "^0.8.0", - "libsodium-wrappers": "^0.7.6", - "ripemd160": "^2.0.2", - "sha.js": "^2.4.11" + "follow-redirects": "^1.14.0" } - }, - "@cosmjs/encoding": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.26.0.tgz", - "integrity": "sha512-ctw6cBDsQSd0OJFWEwU6fJYrAXf63JNhOS3mjawo/hRyEFpVSBSEKEHvfICPc+4dT40v9L3eYEr8LXDYxat4AA==", - "requires": { - "base64-js": "^1.3.0", - "bech32": "^1.1.4", - "readonly-date": "^1.0.0" - } - }, - "@cosmjs/math": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.26.0.tgz", - "integrity": "sha512-wfzdK/PnEnIA+CXM6VCyUr2daiEMvaF/iBaK3YCpkbXLfHUXQB+7bNh1HAHgJmp+PaYn3MhgBTnQbsmMsE3cKw==", - "requires": { - "bn.js": "^4.11.8" - } - }, - "@cosmjs/utils": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.26.0.tgz", - "integrity": "sha512-InTQ3P1noUR0U5zJs8ssqnToIGH2NKbFb+hS5wmYGLB0XRdlNk0UGcb9pjbAzaWRQPWxTd08YQvXg6IK/WE4fA==" } } }, "@cosmjs/utils": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.26.1.tgz", - "integrity": "sha512-E7sYhHfcq2V4oB504FNSt8nx6QInTea1KZT5FrtyqONmgQwccfTv5+E2PuRbQs91i56YzHORHuP57rhV7NPn3g==" + "version": "0.26.5", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.26.5.tgz", + "integrity": "sha512-VB4Z7lEIXA36q0RON15KexzEosToUtdDyMv7UXSBHSl4mLG/fIZgBIpBEYsaPZ1kh43xyINeKQJiGCp2z5rI+g==" }, "@cosmostation/cosmosjs": { "version": "0.10.8", @@ -23625,11 +23765,11 @@ } }, "@vue/composition-api": { - "version": "1.0.0-beta.22", - "resolved": "https://registry.npmjs.org/@vue/composition-api/-/composition-api-1.0.0-beta.22.tgz", - "integrity": "sha512-KkTeHVWgsJbtoA5t6pUien/ARw7JhVM7QZh05ko/UdgzALYMGwJsBf4WlcvbpMKE5eAu4ONYJypQ+r8LwBIOhA==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@vue/composition-api/-/composition-api-1.4.1.tgz", + "integrity": "sha512-ZTat9ru/rwecveRnFzlO2mduOBpGfnBdXn+WtBcFLV9UsL/D+6nX47RWuLiVdNxNDX0qphGZRC+JDjwt+YTnRA==", "requires": { - "tslib": "^2.0.1" + "tslib": "^2.3.1" } }, "@vue/eslint-config-airbnb": { @@ -24112,6 +24252,11 @@ "es-abstract": "^1.18.0-next.1" } }, + "arrayslicer": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/arrayslicer/-/arrayslicer-1.2.3.tgz", + "integrity": "sha1-IaSQMQKpq6fYpzxEv1fz4oxWATY=" + }, "asn1": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", @@ -25600,6 +25745,14 @@ "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" }, + "catharsis": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz", + "integrity": "sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A==", + "requires": { + "lodash": "^4.17.15" + } + }, "caw": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/caw/-/caw-2.0.1.tgz", @@ -27621,6 +27774,18 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, + "escodegen": { + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", + "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", + "requires": { + "esprima": "^4.0.1", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" + } + }, "eslint": { "version": "6.8.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", @@ -28901,6 +29066,16 @@ } } }, + "hammerjs": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/hammerjs/-/hammerjs-2.0.8.tgz", + "integrity": "sha1-BO93hiz/K7edMPdpIJWTAiK/YPE=" + }, + "hamsterjs": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/hamsterjs/-/hamsterjs-1.1.3.tgz", + "integrity": "sha512-q4XBr7hnxx1WyZA8mpVDuZVa1YXaR0WZaFSBxnj8hUXltuqXJOt5yuWYkAbMXsj+q0REDUO990+/TuxEadXFyg==" + }, "handle-thing": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.1.tgz", @@ -30166,11 +30341,57 @@ "esprima": "^4.0.0" } }, + "js2xmlparser": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.2.tgz", + "integrity": "sha512-6n4D8gLlLf1n5mNLQPRfViYzu9RATblzPEtm1SthMX1Pjao0r9YI9nw7ZIfRxQMERS87mcswrg+r/OYrPRX6jA==", + "requires": { + "xmlcreate": "^2.0.4" + } + }, "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" }, + "jsdoc": { + "version": "3.6.7", + "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.7.tgz", + "integrity": "sha512-sxKt7h0vzCd+3Y81Ey2qinupL6DpRSZJclS04ugHDNmRUXGzqicMJ6iwayhSA0S0DwwX30c5ozyUthr1QKF6uw==", + "requires": { + "@babel/parser": "^7.9.4", + "bluebird": "^3.7.2", + "catharsis": "^0.9.0", + "escape-string-regexp": "^2.0.0", + "js2xmlparser": "^4.0.1", + "klaw": "^3.0.0", + "markdown-it": "^10.0.0", + "markdown-it-anchor": "^5.2.7", + "marked": "^2.0.3", + "mkdirp": "^1.0.4", + "requizzle": "^0.2.3", + "strip-json-comments": "^3.1.0", + "taffydb": "2.6.2", + "underscore": "~1.13.1" + }, + "dependencies": { + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==" + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" + } + } + }, "jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -30332,6 +30553,14 @@ "is-buffer": "^1.1.5" } }, + "klaw": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz", + "integrity": "sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g==", + "requires": { + "graceful-fs": "^4.1.9" + } + }, "klona": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/klona/-/klona-2.0.4.tgz", @@ -30459,6 +30688,14 @@ "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", "dev": true }, + "linkify-it": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz", + "integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==", + "requires": { + "uc.micro": "^1.0.1" + } + }, "load-json-file": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", @@ -30710,6 +30947,11 @@ } } }, + "lz-string": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.4.4.tgz", + "integrity": "sha1-wNjq82BZ9wV5bh40SBHPTEmNOiY=" + }, "make-dir": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", @@ -30738,6 +30980,36 @@ "object-visit": "^1.0.0" } }, + "markdown-it": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-10.0.0.tgz", + "integrity": "sha512-YWOP1j7UbDNz+TumYP1kpwnP0aEa711cJjrAQrzd0UXlbJfc5aAq0F/PZHjiioqDC1NKgvIMX+o+9Bk7yuM2dg==", + "requires": { + "argparse": "^1.0.7", + "entities": "~2.0.0", + "linkify-it": "^2.0.0", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + }, + "dependencies": { + "entities": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.3.tgz", + "integrity": "sha512-MyoZ0jgnLvB2X3Lg5HqpFmn1kybDiIfEQmKzTb5apr51Rb+T3KdmMiqa70T+bhGnyv7bQ6WMj2QMHpGMmlrUYQ==" + } + } + }, + "markdown-it-anchor": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-5.3.0.tgz", + "integrity": "sha512-/V1MnLL/rgJ3jkMWo84UR+K+jF1cxNG1a+KwqeXqTIJ+jtA8aWSHuigx8lTzauiIjBDbwF3NcWQMotd0Dm39jA==", + "requires": {} + }, + "marked": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/marked/-/marked-2.1.3.tgz", + "integrity": "sha512-/Q+7MGzaETqifOMWYEA7HVMaZb4XbcRfaOzcSsHZEith83KGlvaSG33u0SKu89Mj5h+T8V2hM+8O45Qc5XTgwA==" + }, "md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -30754,6 +31026,11 @@ "integrity": "sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA==", "dev": true }, + "mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=" + }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -32850,6 +33127,94 @@ } } }, + "protobufjs-cli-dbx": { + "version": "7.0.7", + "resolved": "https://registry.npmjs.org/protobufjs-cli-dbx/-/protobufjs-cli-dbx-7.0.7.tgz", + "integrity": "sha512-lP9nIEfV1fw1SjRBS5qpLEbBkImHHgtrYXzqX6s6Hn7hcuTDFwCXEy6Tzz4sAh4IgCKcjDT8ZK7AluerVHaGHQ==", + "requires": { + "chalk": "^2.4.1", + "escodegen": "^1.9.1", + "espree": "^3.5.4", + "estraverse": "^4.2.0", + "glob": "^7.1.2", + "jsdoc": "^3.4.2", + "minimist": "^1.2.0", + "semver": "^5.5.0", + "tmp": "0.0.31", + "uglify-js": "^3.3.25" + }, + "dependencies": { + "acorn": { + "version": "5.7.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz", + "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==" + }, + "acorn-jsx": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", + "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", + "requires": { + "acorn": "^3.0.4" + }, + "dependencies": { + "acorn": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=" + } + } + }, + "espree": { + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", + "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", + "requires": { + "acorn": "^5.5.0", + "acorn-jsx": "^3.0.0" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + }, + "tmp": { + "version": "0.0.31", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.31.tgz", + "integrity": "sha1-jzirlDjhcxXl29izZX6L+yd65Kc=", + "requires": { + "os-tmpdir": "~1.0.1" + } + } + } + }, + "protobufjs-dbx": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/protobufjs-dbx/-/protobufjs-dbx-7.0.0.tgz", + "integrity": "sha512-y4ECgn5J39e4RqlbyQhwJF72nLuyY9JhkhnfTRr03/bx0aonZ/VfDSxrXls8RxLup7Hk2rx/fandTmtYO6XGZQ==", + "requires": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.0", + "@types/node": "^10.1.0", + "long": "^4.0.0" + }, + "dependencies": { + "@types/node": { + "version": "10.17.60", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", + "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==" + } + } + }, "proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -33393,6 +33758,14 @@ "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", "dev": true }, + "requizzle": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.3.tgz", + "integrity": "sha512-YanoyJjykPxGHii0fZP0uUPEXpvqfBDxWV7s6GKAiiOsiqhX6vHNyW3Qzdmqp/iq/ExbhaGbVrjB4ruEVSM4GQ==", + "requires": { + "lodash": "^4.17.14" + } + }, "resize-detector": { "version": "0.1.10", "resolved": "https://registry.npmjs.org/resize-detector/-/resize-detector-0.1.10.tgz", @@ -34922,6 +35295,11 @@ } } }, + "taffydb": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", + "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=" + }, "tapable": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", @@ -35258,6 +35636,20 @@ "punycode": "^2.1.1" } }, + "trading-vue-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/trading-vue-js/-/trading-vue-js-1.0.2.tgz", + "integrity": "sha512-RObZR4OF5rtdgh/CyyRv0soPxlVlwHudlpAziOeQeOeId4j/2RcGUSp4/lKwzYo8b51tnAiRnMtDS+ZSmg208g==", + "requires": { + "@babel/runtime": "^7.13.10", + "arrayslicer": "^1.2.3", + "hammerjs": "^2.0.8", + "hamsterjs": "^1.1.3", + "lz-string": "^1.4.4", + "moment": "^2.29.1", + "vue": "^2.6.12" + } + }, "trim-newlines": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", @@ -35297,9 +35689,9 @@ } }, "tslib": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", - "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" }, "tty-browserify": { "version": "0.0.0", @@ -35361,11 +35753,15 @@ "resolved": "https://registry.npmjs.org/typeforce/-/typeforce-1.18.0.tgz", "integrity": "sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g==" }, + "uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==" + }, "uglify-js": { "version": "3.4.10", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.10.tgz", "integrity": "sha512-Y2VsbPVs0FIshJztycsO2SfPk7/KAF/T72qzv9u5EpQ4kB2hQoHlhNQTsNyy6ul7lQtqJN/AoWeS23OzEiEFxw==", - "dev": true, "requires": { "commander": "~2.19.0", "source-map": "~0.6.1" @@ -35374,8 +35770,7 @@ "commander": { "version": "2.19.0", "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", - "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==", - "dev": true + "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==" } } }, @@ -35401,6 +35796,11 @@ "through": "^2.3.8" } }, + "underscore": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.1.tgz", + "integrity": "sha512-hzSoAVtJF+3ZtiFX0VgfFPHEDRm7Y/QPjGyNo4TVdnDTdft3tr8hEkD25a1jC+TjTuE7tkHGKkhwCgs9dgBB2g==" + }, "unicode-canonical-property-names-ecmascript": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", @@ -36785,6 +37185,11 @@ "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==", "dev": true }, + "xmlcreate": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.4.tgz", + "integrity": "sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg==" + }, "xstream": { "version": "11.14.0", "resolved": "https://registry.npmjs.org/xstream/-/xstream-11.14.0.tgz", diff --git a/package.json b/package.json index b72f4783..a3141e4f 100644 --- a/package.json +++ b/package.json @@ -12,14 +12,14 @@ "dependencies": { "@casl/ability": "4.1.6", "@casl/vue": "1.1.1", - "@cosmjs/amino": "^0.26.0", - "@cosmjs/crypto": "^0.26.0", - "@cosmjs/encoding": "^0.26.0", - "@cosmjs/launchpad": "^0.26.0", - "@cosmjs/ledger-amino": "^0.26.0", - "@cosmjs/math": "^0.26.0", - "@cosmjs/proto-signing": "^0.26.0", - "@cosmjs/stargate": "0.26.0", + "@cosmjs/amino": "^0.26.5", + "@cosmjs/crypto": "^0.26.5", + "@cosmjs/encoding": "^0.26.5", + "@cosmjs/launchpad": "^0.26.5", + "@cosmjs/ledger-amino": "^0.26.5", + "@cosmjs/math": "^0.26.5", + "@cosmjs/proto-signing": "^0.26.5", + "@cosmjs/stargate": "0.26.5", "@cosmostation/cosmosjs": "^0.10.6", "@intlify/vue-i18n-loader": "^2.1.2", "@ledgerhq/hw-app-cosmos": "^6.3.0", @@ -46,6 +46,8 @@ "portal-vue": "2.1.7", "postcss-rtl": "1.7.3", "prismjs": "1.24.0", + "protobufjs-cli-dbx": "^7.0.7", + "protobufjs-dbx": "^7.0.0", "swiper": "6.5.1", "trading-vue-js": "^1.0.2", "uuid": "8.3.2", diff --git a/src/lang/locales/en.json b/src/lang/locales/en.json index 83138473..9fb9904c 100644 --- a/src/lang/locales/en.json +++ b/src/lang/locales/en.json @@ -35,6 +35,7 @@ "blocks": "Blocks", "blockchains": "Blockchains", "uptime": "Uptime", + "trade": "Trade", "gravity": "Gravity(WIP)", "pools": "Pools(WIP)", diff --git a/src/libs/all.js b/src/libs/all.js new file mode 100644 index 00000000..241b937a --- /dev/null +++ b/src/libs/all.js @@ -0,0 +1,53878 @@ +/* eslint-disable */ +"use strict"; + +var $protobuf = require("protobufjs-dbx/minimal"); + +// Common aliases +var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); + +/** + * Namespace cosmos. + * @exports cosmos + * @namespace + */ + +$root.cosmos = (function(cosmos) { + + /** + * Namespace base. + * @memberof cosmos + * @namespace + */ + + cosmos.base = (function(base) { + + /** + * Namespace v1beta1. + * @memberof cosmos.base + * @namespace + */ + + base.v1beta1 = (function(v1beta1) { + + v1beta1.Coin = (function(Coin) { + + /** + * Properties of a Coin. + * @memberof cosmos.base.v1beta1 + * @interface ICoin + * @property {string|null} [denom] Coin denom + * @property {string|null} [amount] Coin amount + */ + + /** + * Constructs a new Coin. + * @memberof cosmos.base.v1beta1 + * @classdesc Represents a Coin. + * @implements ICoin + * @constructor + * @param {cosmos.base.v1beta1.ICoin=} [properties] Properties to set + */ + function Coin(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Coin denom. + * @member {string} denom + * @memberof cosmos.base.v1beta1.Coin + * @instance + */ + Coin.prototype.denom = ""; + + /** + * Coin amount. + * @member {string} amount + * @memberof cosmos.base.v1beta1.Coin + * @instance + */ + Coin.prototype.amount = ""; + + /** + * Creates a new Coin instance using the specified properties. + * @function create + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {cosmos.base.v1beta1.ICoin=} [properties] Properties to set + * @returns {cosmos.base.v1beta1.Coin} Coin instance + */ + Coin.create = function create(properties) { + return new Coin(properties); + }; + + /** + * Encodes the specified Coin message. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. + * @function encode + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {cosmos.base.v1beta1.ICoin} message Coin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Coin.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.amount); + return writer; + }; + + /** + * Encodes the specified Coin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {cosmos.base.v1beta1.ICoin} message Coin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Coin.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Coin message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.v1beta1.Coin} Coin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Coin.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.Coin(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Coin message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.v1beta1.Coin} Coin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Coin.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Coin message. + * @function verify + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Coin.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.denom != null && message.hasOwnProperty("denom")) + if (!$util.isString(message.denom)) + return "denom: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) + if (!$util.isString(message.amount)) + return "amount: string expected"; + return null; + }; + + /** + * Creates a Coin message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.v1beta1.Coin} Coin + */ + Coin.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.v1beta1.Coin) + return object; + var message = new $root.cosmos.base.v1beta1.Coin(); + if (object.denom != null) + message.denom = String(object.denom); + if (object.amount != null) + message.amount = String(object.amount); + return message; + }; + + /** + * Creates a plain object from a Coin message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {cosmos.base.v1beta1.Coin} message Coin + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Coin.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.denom = ""; + object.amount = ""; + } + if (message.denom != null && message.hasOwnProperty("denom")) + object.denom = message.denom; + if (message.amount != null && message.hasOwnProperty("amount")) + object.amount = message.amount; + return object; + }; + + /** + * Converts this Coin to JSON. + * @function toJSON + * @memberof cosmos.base.v1beta1.Coin + * @instance + * @returns {Object.} JSON object + */ + Coin.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Coin; + })(v1beta1.Coin || {}); + + v1beta1.DecCoin = (function(DecCoin) { + + /** + * Properties of a DecCoin. + * @memberof cosmos.base.v1beta1 + * @interface IDecCoin + * @property {string|null} [denom] DecCoin denom + * @property {string|null} [amount] DecCoin amount + */ + + /** + * Constructs a new DecCoin. + * @memberof cosmos.base.v1beta1 + * @classdesc Represents a DecCoin. + * @implements IDecCoin + * @constructor + * @param {cosmos.base.v1beta1.IDecCoin=} [properties] Properties to set + */ + function DecCoin(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DecCoin denom. + * @member {string} denom + * @memberof cosmos.base.v1beta1.DecCoin + * @instance + */ + DecCoin.prototype.denom = ""; + + /** + * DecCoin amount. + * @member {string} amount + * @memberof cosmos.base.v1beta1.DecCoin + * @instance + */ + DecCoin.prototype.amount = ""; + + /** + * Creates a new DecCoin instance using the specified properties. + * @function create + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {cosmos.base.v1beta1.IDecCoin=} [properties] Properties to set + * @returns {cosmos.base.v1beta1.DecCoin} DecCoin instance + */ + DecCoin.create = function create(properties) { + return new DecCoin(properties); + }; + + /** + * Encodes the specified DecCoin message. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. + * @function encode + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {cosmos.base.v1beta1.IDecCoin} message DecCoin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecCoin.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.amount); + return writer; + }; + + /** + * Encodes the specified DecCoin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {cosmos.base.v1beta1.IDecCoin} message DecCoin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecCoin.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DecCoin message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.v1beta1.DecCoin} DecCoin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecCoin.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.DecCoin(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DecCoin message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.v1beta1.DecCoin} DecCoin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecCoin.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DecCoin message. + * @function verify + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DecCoin.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.denom != null && message.hasOwnProperty("denom")) + if (!$util.isString(message.denom)) + return "denom: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) + if (!$util.isString(message.amount)) + return "amount: string expected"; + return null; + }; + + /** + * Creates a DecCoin message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.v1beta1.DecCoin} DecCoin + */ + DecCoin.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.v1beta1.DecCoin) + return object; + var message = new $root.cosmos.base.v1beta1.DecCoin(); + if (object.denom != null) + message.denom = String(object.denom); + if (object.amount != null) + message.amount = String(object.amount); + return message; + }; + + /** + * Creates a plain object from a DecCoin message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {cosmos.base.v1beta1.DecCoin} message DecCoin + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DecCoin.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.denom = ""; + object.amount = ""; + } + if (message.denom != null && message.hasOwnProperty("denom")) + object.denom = message.denom; + if (message.amount != null && message.hasOwnProperty("amount")) + object.amount = message.amount; + return object; + }; + + /** + * Converts this DecCoin to JSON. + * @function toJSON + * @memberof cosmos.base.v1beta1.DecCoin + * @instance + * @returns {Object.} JSON object + */ + DecCoin.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DecCoin; + })(v1beta1.DecCoin || {}); + + v1beta1.IntProto = (function(IntProto) { + + /** + * Properties of an IntProto. + * @memberof cosmos.base.v1beta1 + * @interface IIntProto + * @property {string|null} [int] IntProto int + */ + + /** + * Constructs a new IntProto. + * @memberof cosmos.base.v1beta1 + * @classdesc Represents an IntProto. + * @implements IIntProto + * @constructor + * @param {cosmos.base.v1beta1.IIntProto=} [properties] Properties to set + */ + function IntProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IntProto int. + * @member {string} int + * @memberof cosmos.base.v1beta1.IntProto + * @instance + */ + IntProto.prototype.int = ""; + + /** + * Creates a new IntProto instance using the specified properties. + * @function create + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {cosmos.base.v1beta1.IIntProto=} [properties] Properties to set + * @returns {cosmos.base.v1beta1.IntProto} IntProto instance + */ + IntProto.create = function create(properties) { + return new IntProto(properties); + }; + + /** + * Encodes the specified IntProto message. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. + * @function encode + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {cosmos.base.v1beta1.IIntProto} message IntProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.int != null && Object.hasOwnProperty.call(message, "int")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.int); + return writer; + }; + + /** + * Encodes the specified IntProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {cosmos.base.v1beta1.IIntProto} message IntProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IntProto message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.v1beta1.IntProto} IntProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.IntProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.int = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IntProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.v1beta1.IntProto} IntProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntProto message. + * @function verify + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.int != null && message.hasOwnProperty("int")) + if (!$util.isString(message.int)) + return "int: string expected"; + return null; + }; + + /** + * Creates an IntProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.v1beta1.IntProto} IntProto + */ + IntProto.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.v1beta1.IntProto) + return object; + var message = new $root.cosmos.base.v1beta1.IntProto(); + if (object.int != null) + message.int = String(object.int); + return message; + }; + + /** + * Creates a plain object from an IntProto message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {cosmos.base.v1beta1.IntProto} message IntProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.int = ""; + if (message.int != null && message.hasOwnProperty("int")) + object.int = message.int; + return object; + }; + + /** + * Converts this IntProto to JSON. + * @function toJSON + * @memberof cosmos.base.v1beta1.IntProto + * @instance + * @returns {Object.} JSON object + */ + IntProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IntProto; + })(v1beta1.IntProto || {}); + + v1beta1.DecProto = (function(DecProto) { + + /** + * Properties of a DecProto. + * @memberof cosmos.base.v1beta1 + * @interface IDecProto + * @property {string|null} [dec] DecProto dec + */ + + /** + * Constructs a new DecProto. + * @memberof cosmos.base.v1beta1 + * @classdesc Represents a DecProto. + * @implements IDecProto + * @constructor + * @param {cosmos.base.v1beta1.IDecProto=} [properties] Properties to set + */ + function DecProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DecProto dec. + * @member {string} dec + * @memberof cosmos.base.v1beta1.DecProto + * @instance + */ + DecProto.prototype.dec = ""; + + /** + * Creates a new DecProto instance using the specified properties. + * @function create + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {cosmos.base.v1beta1.IDecProto=} [properties] Properties to set + * @returns {cosmos.base.v1beta1.DecProto} DecProto instance + */ + DecProto.create = function create(properties) { + return new DecProto(properties); + }; + + /** + * Encodes the specified DecProto message. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. + * @function encode + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {cosmos.base.v1beta1.IDecProto} message DecProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dec != null && Object.hasOwnProperty.call(message, "dec")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dec); + return writer; + }; + + /** + * Encodes the specified DecProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {cosmos.base.v1beta1.IDecProto} message DecProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DecProto message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.v1beta1.DecProto} DecProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.DecProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dec = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DecProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.v1beta1.DecProto} DecProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DecProto message. + * @function verify + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DecProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dec != null && message.hasOwnProperty("dec")) + if (!$util.isString(message.dec)) + return "dec: string expected"; + return null; + }; + + /** + * Creates a DecProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.v1beta1.DecProto} DecProto + */ + DecProto.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.v1beta1.DecProto) + return object; + var message = new $root.cosmos.base.v1beta1.DecProto(); + if (object.dec != null) + message.dec = String(object.dec); + return message; + }; + + /** + * Creates a plain object from a DecProto message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {cosmos.base.v1beta1.DecProto} message DecProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DecProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.dec = ""; + if (message.dec != null && message.hasOwnProperty("dec")) + object.dec = message.dec; + return object; + }; + + /** + * Converts this DecProto to JSON. + * @function toJSON + * @memberof cosmos.base.v1beta1.DecProto + * @instance + * @returns {Object.} JSON object + */ + DecProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DecProto; + })(v1beta1.DecProto || {}); + + return v1beta1; + })(base.v1beta1 || {}); + + /** + * Namespace query. + * @memberof cosmos.base + * @namespace + */ + + base.query = (function(query) { + + /** + * Namespace v1beta1. + * @memberof cosmos.base.query + * @namespace + */ + + query.v1beta1 = (function(v1beta1) { + + v1beta1.PageRequest = (function(PageRequest) { + + /** + * Properties of a PageRequest. + * @memberof cosmos.base.query.v1beta1 + * @interface IPageRequest + * @property {Uint8Array|null} [key] PageRequest key + * @property {number|Long|null} [offset] PageRequest offset + * @property {number|Long|null} [limit] PageRequest limit + * @property {boolean|null} [countTotal] PageRequest countTotal + */ + + /** + * Constructs a new PageRequest. + * @memberof cosmos.base.query.v1beta1 + * @classdesc Represents a PageRequest. + * @implements IPageRequest + * @constructor + * @param {cosmos.base.query.v1beta1.IPageRequest=} [properties] Properties to set + */ + function PageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PageRequest key. + * @member {Uint8Array} key + * @memberof cosmos.base.query.v1beta1.PageRequest + * @instance + */ + PageRequest.prototype.key = $util.newBuffer([]); + + /** + * PageRequest offset. + * @member {number|Long} offset + * @memberof cosmos.base.query.v1beta1.PageRequest + * @instance + */ + PageRequest.prototype.offset = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * PageRequest limit. + * @member {number|Long} limit + * @memberof cosmos.base.query.v1beta1.PageRequest + * @instance + */ + PageRequest.prototype.limit = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * PageRequest countTotal. + * @member {boolean} countTotal + * @memberof cosmos.base.query.v1beta1.PageRequest + * @instance + */ + PageRequest.prototype.countTotal = false; + + /** + * Creates a new PageRequest instance using the specified properties. + * @function create + * @memberof cosmos.base.query.v1beta1.PageRequest + * @static + * @param {cosmos.base.query.v1beta1.IPageRequest=} [properties] Properties to set + * @returns {cosmos.base.query.v1beta1.PageRequest} PageRequest instance + */ + PageRequest.create = function create(properties) { + return new PageRequest(properties); + }; + + /** + * Encodes the specified PageRequest message. Does not implicitly {@link cosmos.base.query.v1beta1.PageRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.base.query.v1beta1.PageRequest + * @static + * @param {cosmos.base.query.v1beta1.IPageRequest} message PageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.offset); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.limit); + if (message.countTotal != null && Object.hasOwnProperty.call(message, "countTotal")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.countTotal); + return writer; + }; + + /** + * Encodes the specified PageRequest message, length delimited. Does not implicitly {@link cosmos.base.query.v1beta1.PageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.query.v1beta1.PageRequest + * @static + * @param {cosmos.base.query.v1beta1.IPageRequest} message PageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PageRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.query.v1beta1.PageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.query.v1beta1.PageRequest} PageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PageRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.query.v1beta1.PageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.offset = reader.uint64(); + break; + case 3: + message.limit = reader.uint64(); + break; + case 4: + message.countTotal = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.query.v1beta1.PageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.query.v1beta1.PageRequest} PageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PageRequest message. + * @function verify + * @memberof cosmos.base.query.v1beta1.PageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + if (message.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset) && !(message.offset && $util.isInteger(message.offset.low) && $util.isInteger(message.offset.high))) + return "offset: integer|Long expected"; + if (message.limit != null && message.hasOwnProperty("limit")) + if (!$util.isInteger(message.limit) && !(message.limit && $util.isInteger(message.limit.low) && $util.isInteger(message.limit.high))) + return "limit: integer|Long expected"; + if (message.countTotal != null && message.hasOwnProperty("countTotal")) + if (typeof message.countTotal !== "boolean") + return "countTotal: boolean expected"; + return null; + }; + + /** + * Creates a PageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.query.v1beta1.PageRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.query.v1beta1.PageRequest} PageRequest + */ + PageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.query.v1beta1.PageRequest) + return object; + var message = new $root.cosmos.base.query.v1beta1.PageRequest(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length) + message.key = object.key; + if (object.offset != null) + if ($util.Long) + (message.offset = $util.Long.fromValue(object.offset)).unsigned = true; + else if (typeof object.offset === "string") + message.offset = parseInt(object.offset, 10); + else if (typeof object.offset === "number") + message.offset = object.offset; + else if (typeof object.offset === "object") + message.offset = new $util.LongBits(object.offset.low >>> 0, object.offset.high >>> 0).toNumber(true); + if (object.limit != null) + if ($util.Long) + (message.limit = $util.Long.fromValue(object.limit)).unsigned = true; + else if (typeof object.limit === "string") + message.limit = parseInt(object.limit, 10); + else if (typeof object.limit === "number") + message.limit = object.limit; + else if (typeof object.limit === "object") + message.limit = new $util.LongBits(object.limit.low >>> 0, object.limit.high >>> 0).toNumber(true); + if (object.countTotal != null) + message.countTotal = Boolean(object.countTotal); + return message; + }; + + /** + * Creates a plain object from a PageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.query.v1beta1.PageRequest + * @static + * @param {cosmos.base.query.v1beta1.PageRequest} message PageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.offset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.offset = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.limit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.limit = options.longs === String ? "0" : 0; + object.countTotal = false; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.offset != null && message.hasOwnProperty("offset")) + if (typeof message.offset === "number") + object.offset = options.longs === String ? String(message.offset) : message.offset; + else + object.offset = options.longs === String ? $util.Long.prototype.toString.call(message.offset) : options.longs === Number ? new $util.LongBits(message.offset.low >>> 0, message.offset.high >>> 0).toNumber(true) : message.offset; + if (message.limit != null && message.hasOwnProperty("limit")) + if (typeof message.limit === "number") + object.limit = options.longs === String ? String(message.limit) : message.limit; + else + object.limit = options.longs === String ? $util.Long.prototype.toString.call(message.limit) : options.longs === Number ? new $util.LongBits(message.limit.low >>> 0, message.limit.high >>> 0).toNumber(true) : message.limit; + if (message.countTotal != null && message.hasOwnProperty("countTotal")) + object.countTotal = message.countTotal; + return object; + }; + + /** + * Converts this PageRequest to JSON. + * @function toJSON + * @memberof cosmos.base.query.v1beta1.PageRequest + * @instance + * @returns {Object.} JSON object + */ + PageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PageRequest; + })(v1beta1.PageRequest || {}); + + v1beta1.PageResponse = (function(PageResponse) { + + /** + * Properties of a PageResponse. + * @memberof cosmos.base.query.v1beta1 + * @interface IPageResponse + * @property {Uint8Array|null} [nextKey] PageResponse nextKey + * @property {number|Long|null} [total] PageResponse total + */ + + /** + * Constructs a new PageResponse. + * @memberof cosmos.base.query.v1beta1 + * @classdesc Represents a PageResponse. + * @implements IPageResponse + * @constructor + * @param {cosmos.base.query.v1beta1.IPageResponse=} [properties] Properties to set + */ + function PageResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PageResponse nextKey. + * @member {Uint8Array} nextKey + * @memberof cosmos.base.query.v1beta1.PageResponse + * @instance + */ + PageResponse.prototype.nextKey = $util.newBuffer([]); + + /** + * PageResponse total. + * @member {number|Long} total + * @memberof cosmos.base.query.v1beta1.PageResponse + * @instance + */ + PageResponse.prototype.total = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PageResponse instance using the specified properties. + * @function create + * @memberof cosmos.base.query.v1beta1.PageResponse + * @static + * @param {cosmos.base.query.v1beta1.IPageResponse=} [properties] Properties to set + * @returns {cosmos.base.query.v1beta1.PageResponse} PageResponse instance + */ + PageResponse.create = function create(properties) { + return new PageResponse(properties); + }; + + /** + * Encodes the specified PageResponse message. Does not implicitly {@link cosmos.base.query.v1beta1.PageResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.base.query.v1beta1.PageResponse + * @static + * @param {cosmos.base.query.v1beta1.IPageResponse} message PageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PageResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nextKey != null && Object.hasOwnProperty.call(message, "nextKey")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.nextKey); + if (message.total != null && Object.hasOwnProperty.call(message, "total")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.total); + return writer; + }; + + /** + * Encodes the specified PageResponse message, length delimited. Does not implicitly {@link cosmos.base.query.v1beta1.PageResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.query.v1beta1.PageResponse + * @static + * @param {cosmos.base.query.v1beta1.IPageResponse} message PageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PageResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PageResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.query.v1beta1.PageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.query.v1beta1.PageResponse} PageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PageResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.query.v1beta1.PageResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nextKey = reader.bytes(); + break; + case 2: + message.total = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PageResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.query.v1beta1.PageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.query.v1beta1.PageResponse} PageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PageResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PageResponse message. + * @function verify + * @memberof cosmos.base.query.v1beta1.PageResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PageResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nextKey != null && message.hasOwnProperty("nextKey")) + if (!(message.nextKey && typeof message.nextKey.length === "number" || $util.isString(message.nextKey))) + return "nextKey: buffer expected"; + if (message.total != null && message.hasOwnProperty("total")) + if (!$util.isInteger(message.total) && !(message.total && $util.isInteger(message.total.low) && $util.isInteger(message.total.high))) + return "total: integer|Long expected"; + return null; + }; + + /** + * Creates a PageResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.query.v1beta1.PageResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.query.v1beta1.PageResponse} PageResponse + */ + PageResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.query.v1beta1.PageResponse) + return object; + var message = new $root.cosmos.base.query.v1beta1.PageResponse(); + if (object.nextKey != null) + if (typeof object.nextKey === "string") + $util.base64.decode(object.nextKey, message.nextKey = $util.newBuffer($util.base64.length(object.nextKey)), 0); + else if (object.nextKey.length) + message.nextKey = object.nextKey; + if (object.total != null) + if ($util.Long) + (message.total = $util.Long.fromValue(object.total)).unsigned = true; + else if (typeof object.total === "string") + message.total = parseInt(object.total, 10); + else if (typeof object.total === "number") + message.total = object.total; + else if (typeof object.total === "object") + message.total = new $util.LongBits(object.total.low >>> 0, object.total.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a PageResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.query.v1beta1.PageResponse + * @static + * @param {cosmos.base.query.v1beta1.PageResponse} message PageResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PageResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.nextKey = ""; + else { + object.nextKey = []; + if (options.bytes !== Array) + object.nextKey = $util.newBuffer(object.nextKey); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.total = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.total = options.longs === String ? "0" : 0; + } + if (message.nextKey != null && message.hasOwnProperty("nextKey")) + object.nextKey = options.bytes === String ? $util.base64.encode(message.nextKey, 0, message.nextKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.nextKey) : message.nextKey; + if (message.total != null && message.hasOwnProperty("total")) + if (typeof message.total === "number") + object.total = options.longs === String ? String(message.total) : message.total; + else + object.total = options.longs === String ? $util.Long.prototype.toString.call(message.total) : options.longs === Number ? new $util.LongBits(message.total.low >>> 0, message.total.high >>> 0).toNumber(true) : message.total; + return object; + }; + + /** + * Converts this PageResponse to JSON. + * @function toJSON + * @memberof cosmos.base.query.v1beta1.PageResponse + * @instance + * @returns {Object.} JSON object + */ + PageResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PageResponse; + })(v1beta1.PageResponse || {}); + + return v1beta1; + })(query.v1beta1 || {}); + + return query; + })(base.query || {}); + + return base; + })(cosmos.base || {}); + + /** + * Namespace bank. + * @memberof cosmos + * @namespace + */ + + cosmos.bank = (function(bank) { + + /** + * Namespace v1beta1. + * @memberof cosmos.bank + * @namespace + */ + + bank.v1beta1 = (function(v1beta1) { + + v1beta1.Params = (function(Params) { + + /** + * Properties of a Params. + * @memberof cosmos.bank.v1beta1 + * @interface IParams + * @property {Array.|null} [sendEnabled] Params sendEnabled + * @property {boolean|null} [defaultSendEnabled] Params defaultSendEnabled + */ + + /** + * Constructs a new Params. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a Params. + * @implements IParams + * @constructor + * @param {cosmos.bank.v1beta1.IParams=} [properties] Properties to set + */ + function Params(properties) { + this.sendEnabled = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Params sendEnabled. + * @member {Array.} sendEnabled + * @memberof cosmos.bank.v1beta1.Params + * @instance + */ + Params.prototype.sendEnabled = $util.emptyArray; + + /** + * Params defaultSendEnabled. + * @member {boolean} defaultSendEnabled + * @memberof cosmos.bank.v1beta1.Params + * @instance + */ + Params.prototype.defaultSendEnabled = false; + + /** + * Creates a new Params instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.Params + * @static + * @param {cosmos.bank.v1beta1.IParams=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.Params} Params instance + */ + Params.create = function create(properties) { + return new Params(properties); + }; + + /** + * Encodes the specified Params message. Does not implicitly {@link cosmos.bank.v1beta1.Params.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.Params + * @static + * @param {cosmos.bank.v1beta1.IParams} message Params message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Params.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sendEnabled != null && message.sendEnabled.length) + for (var i = 0; i < message.sendEnabled.length; ++i) + $root.cosmos.bank.v1beta1.SendEnabled.encode(message.sendEnabled[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.defaultSendEnabled != null && Object.hasOwnProperty.call(message, "defaultSendEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.defaultSendEnabled); + return writer; + }; + + /** + * Encodes the specified Params message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.Params.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.Params + * @static + * @param {cosmos.bank.v1beta1.IParams} message Params message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Params.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Params message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.Params + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.Params} Params + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Params.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.Params(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.sendEnabled && message.sendEnabled.length)) + message.sendEnabled = []; + message.sendEnabled.push($root.cosmos.bank.v1beta1.SendEnabled.decode(reader, reader.uint32())); + break; + case 2: + message.defaultSendEnabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Params message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.Params + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.Params} Params + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Params.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Params message. + * @function verify + * @memberof cosmos.bank.v1beta1.Params + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Params.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sendEnabled != null && message.hasOwnProperty("sendEnabled")) { + if (!Array.isArray(message.sendEnabled)) + return "sendEnabled: array expected"; + for (var i = 0; i < message.sendEnabled.length; ++i) { + var error = $root.cosmos.bank.v1beta1.SendEnabled.verify(message.sendEnabled[i]); + if (error) + return "sendEnabled." + error; + } + } + if (message.defaultSendEnabled != null && message.hasOwnProperty("defaultSendEnabled")) + if (typeof message.defaultSendEnabled !== "boolean") + return "defaultSendEnabled: boolean expected"; + return null; + }; + + /** + * Creates a Params message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.Params + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.Params} Params + */ + Params.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.Params) + return object; + var message = new $root.cosmos.bank.v1beta1.Params(); + if (object.sendEnabled) { + if (!Array.isArray(object.sendEnabled)) + throw TypeError(".cosmos.bank.v1beta1.Params.sendEnabled: array expected"); + message.sendEnabled = []; + for (var i = 0; i < object.sendEnabled.length; ++i) { + if (typeof object.sendEnabled[i] !== "object") + throw TypeError(".cosmos.bank.v1beta1.Params.sendEnabled: object expected"); + message.sendEnabled[i] = $root.cosmos.bank.v1beta1.SendEnabled.fromObject(object.sendEnabled[i]); + } + } + if (object.defaultSendEnabled != null) + message.defaultSendEnabled = Boolean(object.defaultSendEnabled); + return message; + }; + + /** + * Creates a plain object from a Params message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.Params + * @static + * @param {cosmos.bank.v1beta1.Params} message Params + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Params.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sendEnabled = []; + if (options.defaults) + object.defaultSendEnabled = false; + if (message.sendEnabled && message.sendEnabled.length) { + object.sendEnabled = []; + for (var j = 0; j < message.sendEnabled.length; ++j) + object.sendEnabled[j] = $root.cosmos.bank.v1beta1.SendEnabled.toObject(message.sendEnabled[j], options); + } + if (message.defaultSendEnabled != null && message.hasOwnProperty("defaultSendEnabled")) + object.defaultSendEnabled = message.defaultSendEnabled; + return object; + }; + + /** + * Converts this Params to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.Params + * @instance + * @returns {Object.} JSON object + */ + Params.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Params; + })(v1beta1.Params || {}); + + v1beta1.SendEnabled = (function(SendEnabled) { + + /** + * Properties of a SendEnabled. + * @memberof cosmos.bank.v1beta1 + * @interface ISendEnabled + * @property {string|null} [denom] SendEnabled denom + * @property {boolean|null} [enabled] SendEnabled enabled + */ + + /** + * Constructs a new SendEnabled. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a SendEnabled. + * @implements ISendEnabled + * @constructor + * @param {cosmos.bank.v1beta1.ISendEnabled=} [properties] Properties to set + */ + function SendEnabled(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SendEnabled denom. + * @member {string} denom + * @memberof cosmos.bank.v1beta1.SendEnabled + * @instance + */ + SendEnabled.prototype.denom = ""; + + /** + * SendEnabled enabled. + * @member {boolean} enabled + * @memberof cosmos.bank.v1beta1.SendEnabled + * @instance + */ + SendEnabled.prototype.enabled = false; + + /** + * Creates a new SendEnabled instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.SendEnabled + * @static + * @param {cosmos.bank.v1beta1.ISendEnabled=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.SendEnabled} SendEnabled instance + */ + SendEnabled.create = function create(properties) { + return new SendEnabled(properties); + }; + + /** + * Encodes the specified SendEnabled message. Does not implicitly {@link cosmos.bank.v1beta1.SendEnabled.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.SendEnabled + * @static + * @param {cosmos.bank.v1beta1.ISendEnabled} message SendEnabled message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SendEnabled.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enabled); + return writer; + }; + + /** + * Encodes the specified SendEnabled message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.SendEnabled.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.SendEnabled + * @static + * @param {cosmos.bank.v1beta1.ISendEnabled} message SendEnabled message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SendEnabled.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SendEnabled message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.SendEnabled + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.SendEnabled} SendEnabled + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SendEnabled.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.SendEnabled(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.enabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SendEnabled message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.SendEnabled + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.SendEnabled} SendEnabled + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SendEnabled.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SendEnabled message. + * @function verify + * @memberof cosmos.bank.v1beta1.SendEnabled + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SendEnabled.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.denom != null && message.hasOwnProperty("denom")) + if (!$util.isString(message.denom)) + return "denom: string expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + return null; + }; + + /** + * Creates a SendEnabled message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.SendEnabled + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.SendEnabled} SendEnabled + */ + SendEnabled.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.SendEnabled) + return object; + var message = new $root.cosmos.bank.v1beta1.SendEnabled(); + if (object.denom != null) + message.denom = String(object.denom); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + return message; + }; + + /** + * Creates a plain object from a SendEnabled message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.SendEnabled + * @static + * @param {cosmos.bank.v1beta1.SendEnabled} message SendEnabled + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SendEnabled.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.denom = ""; + object.enabled = false; + } + if (message.denom != null && message.hasOwnProperty("denom")) + object.denom = message.denom; + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + return object; + }; + + /** + * Converts this SendEnabled to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.SendEnabled + * @instance + * @returns {Object.} JSON object + */ + SendEnabled.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SendEnabled; + })(v1beta1.SendEnabled || {}); + + v1beta1.Input = (function(Input) { + + /** + * Properties of an Input. + * @memberof cosmos.bank.v1beta1 + * @interface IInput + * @property {string|null} [address] Input address + * @property {Array.|null} [coins] Input coins + */ + + /** + * Constructs a new Input. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents an Input. + * @implements IInput + * @constructor + * @param {cosmos.bank.v1beta1.IInput=} [properties] Properties to set + */ + function Input(properties) { + this.coins = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Input address. + * @member {string} address + * @memberof cosmos.bank.v1beta1.Input + * @instance + */ + Input.prototype.address = ""; + + /** + * Input coins. + * @member {Array.} coins + * @memberof cosmos.bank.v1beta1.Input + * @instance + */ + Input.prototype.coins = $util.emptyArray; + + /** + * Creates a new Input instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.Input + * @static + * @param {cosmos.bank.v1beta1.IInput=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.Input} Input instance + */ + Input.create = function create(properties) { + return new Input(properties); + }; + + /** + * Encodes the specified Input message. Does not implicitly {@link cosmos.bank.v1beta1.Input.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.Input + * @static + * @param {cosmos.bank.v1beta1.IInput} message Input message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Input.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.address); + if (message.coins != null && message.coins.length) + for (var i = 0; i < message.coins.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.coins[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Input message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.Input.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.Input + * @static + * @param {cosmos.bank.v1beta1.IInput} message Input message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Input.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Input message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.Input + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.Input} Input + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Input.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.Input(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + if (!(message.coins && message.coins.length)) + message.coins = []; + message.coins.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Input message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.Input + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.Input} Input + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Input.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Input message. + * @function verify + * @memberof cosmos.bank.v1beta1.Input + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Input.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.coins != null && message.hasOwnProperty("coins")) { + if (!Array.isArray(message.coins)) + return "coins: array expected"; + for (var i = 0; i < message.coins.length; ++i) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.coins[i]); + if (error) + return "coins." + error; + } + } + return null; + }; + + /** + * Creates an Input message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.Input + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.Input} Input + */ + Input.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.Input) + return object; + var message = new $root.cosmos.bank.v1beta1.Input(); + if (object.address != null) + message.address = String(object.address); + if (object.coins) { + if (!Array.isArray(object.coins)) + throw TypeError(".cosmos.bank.v1beta1.Input.coins: array expected"); + message.coins = []; + for (var i = 0; i < object.coins.length; ++i) { + if (typeof object.coins[i] !== "object") + throw TypeError(".cosmos.bank.v1beta1.Input.coins: object expected"); + message.coins[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.coins[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Input message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.Input + * @static + * @param {cosmos.bank.v1beta1.Input} message Input + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Input.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.coins = []; + if (options.defaults) + object.address = ""; + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + if (message.coins && message.coins.length) { + object.coins = []; + for (var j = 0; j < message.coins.length; ++j) + object.coins[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.coins[j], options); + } + return object; + }; + + /** + * Converts this Input to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.Input + * @instance + * @returns {Object.} JSON object + */ + Input.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Input; + })(v1beta1.Input || {}); + + v1beta1.Output = (function(Output) { + + /** + * Properties of an Output. + * @memberof cosmos.bank.v1beta1 + * @interface IOutput + * @property {string|null} [address] Output address + * @property {Array.|null} [coins] Output coins + */ + + /** + * Constructs a new Output. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents an Output. + * @implements IOutput + * @constructor + * @param {cosmos.bank.v1beta1.IOutput=} [properties] Properties to set + */ + function Output(properties) { + this.coins = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Output address. + * @member {string} address + * @memberof cosmos.bank.v1beta1.Output + * @instance + */ + Output.prototype.address = ""; + + /** + * Output coins. + * @member {Array.} coins + * @memberof cosmos.bank.v1beta1.Output + * @instance + */ + Output.prototype.coins = $util.emptyArray; + + /** + * Creates a new Output instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.Output + * @static + * @param {cosmos.bank.v1beta1.IOutput=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.Output} Output instance + */ + Output.create = function create(properties) { + return new Output(properties); + }; + + /** + * Encodes the specified Output message. Does not implicitly {@link cosmos.bank.v1beta1.Output.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.Output + * @static + * @param {cosmos.bank.v1beta1.IOutput} message Output message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Output.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.address); + if (message.coins != null && message.coins.length) + for (var i = 0; i < message.coins.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.coins[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Output message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.Output.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.Output + * @static + * @param {cosmos.bank.v1beta1.IOutput} message Output message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Output.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Output message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.Output + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.Output} Output + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Output.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.Output(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + if (!(message.coins && message.coins.length)) + message.coins = []; + message.coins.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Output message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.Output + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.Output} Output + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Output.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Output message. + * @function verify + * @memberof cosmos.bank.v1beta1.Output + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Output.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.coins != null && message.hasOwnProperty("coins")) { + if (!Array.isArray(message.coins)) + return "coins: array expected"; + for (var i = 0; i < message.coins.length; ++i) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.coins[i]); + if (error) + return "coins." + error; + } + } + return null; + }; + + /** + * Creates an Output message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.Output + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.Output} Output + */ + Output.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.Output) + return object; + var message = new $root.cosmos.bank.v1beta1.Output(); + if (object.address != null) + message.address = String(object.address); + if (object.coins) { + if (!Array.isArray(object.coins)) + throw TypeError(".cosmos.bank.v1beta1.Output.coins: array expected"); + message.coins = []; + for (var i = 0; i < object.coins.length; ++i) { + if (typeof object.coins[i] !== "object") + throw TypeError(".cosmos.bank.v1beta1.Output.coins: object expected"); + message.coins[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.coins[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Output message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.Output + * @static + * @param {cosmos.bank.v1beta1.Output} message Output + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Output.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.coins = []; + if (options.defaults) + object.address = ""; + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + if (message.coins && message.coins.length) { + object.coins = []; + for (var j = 0; j < message.coins.length; ++j) + object.coins[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.coins[j], options); + } + return object; + }; + + /** + * Converts this Output to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.Output + * @instance + * @returns {Object.} JSON object + */ + Output.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Output; + })(v1beta1.Output || {}); + + v1beta1.Supply = (function(Supply) { + + /** + * Properties of a Supply. + * @memberof cosmos.bank.v1beta1 + * @interface ISupply + * @property {Array.|null} [total] Supply total + */ + + /** + * Constructs a new Supply. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a Supply. + * @implements ISupply + * @constructor + * @param {cosmos.bank.v1beta1.ISupply=} [properties] Properties to set + */ + function Supply(properties) { + this.total = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Supply total. + * @member {Array.} total + * @memberof cosmos.bank.v1beta1.Supply + * @instance + */ + Supply.prototype.total = $util.emptyArray; + + /** + * Creates a new Supply instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.Supply + * @static + * @param {cosmos.bank.v1beta1.ISupply=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.Supply} Supply instance + */ + Supply.create = function create(properties) { + return new Supply(properties); + }; + + /** + * Encodes the specified Supply message. Does not implicitly {@link cosmos.bank.v1beta1.Supply.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.Supply + * @static + * @param {cosmos.bank.v1beta1.ISupply} message Supply message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Supply.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.total != null && message.total.length) + for (var i = 0; i < message.total.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.total[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Supply message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.Supply.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.Supply + * @static + * @param {cosmos.bank.v1beta1.ISupply} message Supply message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Supply.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Supply message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.Supply + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.Supply} Supply + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Supply.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.Supply(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.total && message.total.length)) + message.total = []; + message.total.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Supply message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.Supply + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.Supply} Supply + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Supply.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Supply message. + * @function verify + * @memberof cosmos.bank.v1beta1.Supply + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Supply.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.total != null && message.hasOwnProperty("total")) { + if (!Array.isArray(message.total)) + return "total: array expected"; + for (var i = 0; i < message.total.length; ++i) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.total[i]); + if (error) + return "total." + error; + } + } + return null; + }; + + /** + * Creates a Supply message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.Supply + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.Supply} Supply + */ + Supply.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.Supply) + return object; + var message = new $root.cosmos.bank.v1beta1.Supply(); + if (object.total) { + if (!Array.isArray(object.total)) + throw TypeError(".cosmos.bank.v1beta1.Supply.total: array expected"); + message.total = []; + for (var i = 0; i < object.total.length; ++i) { + if (typeof object.total[i] !== "object") + throw TypeError(".cosmos.bank.v1beta1.Supply.total: object expected"); + message.total[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.total[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Supply message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.Supply + * @static + * @param {cosmos.bank.v1beta1.Supply} message Supply + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Supply.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.total = []; + if (message.total && message.total.length) { + object.total = []; + for (var j = 0; j < message.total.length; ++j) + object.total[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.total[j], options); + } + return object; + }; + + /** + * Converts this Supply to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.Supply + * @instance + * @returns {Object.} JSON object + */ + Supply.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Supply; + })(v1beta1.Supply || {}); + + v1beta1.DenomUnit = (function(DenomUnit) { + + /** + * Properties of a DenomUnit. + * @memberof cosmos.bank.v1beta1 + * @interface IDenomUnit + * @property {string|null} [denom] DenomUnit denom + * @property {number|null} [exponent] DenomUnit exponent + * @property {Array.|null} [aliases] DenomUnit aliases + */ + + /** + * Constructs a new DenomUnit. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a DenomUnit. + * @implements IDenomUnit + * @constructor + * @param {cosmos.bank.v1beta1.IDenomUnit=} [properties] Properties to set + */ + function DenomUnit(properties) { + this.aliases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DenomUnit denom. + * @member {string} denom + * @memberof cosmos.bank.v1beta1.DenomUnit + * @instance + */ + DenomUnit.prototype.denom = ""; + + /** + * DenomUnit exponent. + * @member {number} exponent + * @memberof cosmos.bank.v1beta1.DenomUnit + * @instance + */ + DenomUnit.prototype.exponent = 0; + + /** + * DenomUnit aliases. + * @member {Array.} aliases + * @memberof cosmos.bank.v1beta1.DenomUnit + * @instance + */ + DenomUnit.prototype.aliases = $util.emptyArray; + + /** + * Creates a new DenomUnit instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.DenomUnit + * @static + * @param {cosmos.bank.v1beta1.IDenomUnit=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.DenomUnit} DenomUnit instance + */ + DenomUnit.create = function create(properties) { + return new DenomUnit(properties); + }; + + /** + * Encodes the specified DenomUnit message. Does not implicitly {@link cosmos.bank.v1beta1.DenomUnit.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.DenomUnit + * @static + * @param {cosmos.bank.v1beta1.IDenomUnit} message DenomUnit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DenomUnit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); + if (message.exponent != null && Object.hasOwnProperty.call(message, "exponent")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.exponent); + if (message.aliases != null && message.aliases.length) + for (var i = 0; i < message.aliases.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.aliases[i]); + return writer; + }; + + /** + * Encodes the specified DenomUnit message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.DenomUnit.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.DenomUnit + * @static + * @param {cosmos.bank.v1beta1.IDenomUnit} message DenomUnit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DenomUnit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DenomUnit message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.DenomUnit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.DenomUnit} DenomUnit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DenomUnit.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.DenomUnit(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.exponent = reader.uint32(); + break; + case 3: + if (!(message.aliases && message.aliases.length)) + message.aliases = []; + message.aliases.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DenomUnit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.DenomUnit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.DenomUnit} DenomUnit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DenomUnit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DenomUnit message. + * @function verify + * @memberof cosmos.bank.v1beta1.DenomUnit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DenomUnit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.denom != null && message.hasOwnProperty("denom")) + if (!$util.isString(message.denom)) + return "denom: string expected"; + if (message.exponent != null && message.hasOwnProperty("exponent")) + if (!$util.isInteger(message.exponent)) + return "exponent: integer expected"; + if (message.aliases != null && message.hasOwnProperty("aliases")) { + if (!Array.isArray(message.aliases)) + return "aliases: array expected"; + for (var i = 0; i < message.aliases.length; ++i) + if (!$util.isString(message.aliases[i])) + return "aliases: string[] expected"; + } + return null; + }; + + /** + * Creates a DenomUnit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.DenomUnit + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.DenomUnit} DenomUnit + */ + DenomUnit.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.DenomUnit) + return object; + var message = new $root.cosmos.bank.v1beta1.DenomUnit(); + if (object.denom != null) + message.denom = String(object.denom); + if (object.exponent != null) + message.exponent = object.exponent >>> 0; + if (object.aliases) { + if (!Array.isArray(object.aliases)) + throw TypeError(".cosmos.bank.v1beta1.DenomUnit.aliases: array expected"); + message.aliases = []; + for (var i = 0; i < object.aliases.length; ++i) + message.aliases[i] = String(object.aliases[i]); + } + return message; + }; + + /** + * Creates a plain object from a DenomUnit message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.DenomUnit + * @static + * @param {cosmos.bank.v1beta1.DenomUnit} message DenomUnit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DenomUnit.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.aliases = []; + if (options.defaults) { + object.denom = ""; + object.exponent = 0; + } + if (message.denom != null && message.hasOwnProperty("denom")) + object.denom = message.denom; + if (message.exponent != null && message.hasOwnProperty("exponent")) + object.exponent = message.exponent; + if (message.aliases && message.aliases.length) { + object.aliases = []; + for (var j = 0; j < message.aliases.length; ++j) + object.aliases[j] = message.aliases[j]; + } + return object; + }; + + /** + * Converts this DenomUnit to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.DenomUnit + * @instance + * @returns {Object.} JSON object + */ + DenomUnit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DenomUnit; + })(v1beta1.DenomUnit || {}); + + v1beta1.Metadata = (function(Metadata) { + + /** + * Properties of a Metadata. + * @memberof cosmos.bank.v1beta1 + * @interface IMetadata + * @property {string|null} [description] Metadata description + * @property {Array.|null} [denomUnits] Metadata denomUnits + * @property {string|null} [base] Metadata base + * @property {string|null} [display] Metadata display + */ + + /** + * Constructs a new Metadata. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a Metadata. + * @implements IMetadata + * @constructor + * @param {cosmos.bank.v1beta1.IMetadata=} [properties] Properties to set + */ + function Metadata(properties) { + this.denomUnits = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Metadata description. + * @member {string} description + * @memberof cosmos.bank.v1beta1.Metadata + * @instance + */ + Metadata.prototype.description = ""; + + /** + * Metadata denomUnits. + * @member {Array.} denomUnits + * @memberof cosmos.bank.v1beta1.Metadata + * @instance + */ + Metadata.prototype.denomUnits = $util.emptyArray; + + /** + * Metadata base. + * @member {string} base + * @memberof cosmos.bank.v1beta1.Metadata + * @instance + */ + Metadata.prototype.base = ""; + + /** + * Metadata display. + * @member {string} display + * @memberof cosmos.bank.v1beta1.Metadata + * @instance + */ + Metadata.prototype.display = ""; + + /** + * Creates a new Metadata instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.Metadata + * @static + * @param {cosmos.bank.v1beta1.IMetadata=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.Metadata} Metadata instance + */ + Metadata.create = function create(properties) { + return new Metadata(properties); + }; + + /** + * Encodes the specified Metadata message. Does not implicitly {@link cosmos.bank.v1beta1.Metadata.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.Metadata + * @static + * @param {cosmos.bank.v1beta1.IMetadata} message Metadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); + if (message.denomUnits != null && message.denomUnits.length) + for (var i = 0; i < message.denomUnits.length; ++i) + $root.cosmos.bank.v1beta1.DenomUnit.encode(message.denomUnits[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.base != null && Object.hasOwnProperty.call(message, "base")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.base); + if (message.display != null && Object.hasOwnProperty.call(message, "display")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.display); + return writer; + }; + + /** + * Encodes the specified Metadata message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.Metadata.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.Metadata + * @static + * @param {cosmos.bank.v1beta1.IMetadata} message Metadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Metadata message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.Metadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.description = reader.string(); + break; + case 2: + if (!(message.denomUnits && message.denomUnits.length)) + message.denomUnits = []; + message.denomUnits.push($root.cosmos.bank.v1beta1.DenomUnit.decode(reader, reader.uint32())); + break; + case 3: + message.base = reader.string(); + break; + case 4: + message.display = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Metadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Metadata message. + * @function verify + * @memberof cosmos.bank.v1beta1.Metadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Metadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.denomUnits != null && message.hasOwnProperty("denomUnits")) { + if (!Array.isArray(message.denomUnits)) + return "denomUnits: array expected"; + for (var i = 0; i < message.denomUnits.length; ++i) { + var error = $root.cosmos.bank.v1beta1.DenomUnit.verify(message.denomUnits[i]); + if (error) + return "denomUnits." + error; + } + } + if (message.base != null && message.hasOwnProperty("base")) + if (!$util.isString(message.base)) + return "base: string expected"; + if (message.display != null && message.hasOwnProperty("display")) + if (!$util.isString(message.display)) + return "display: string expected"; + return null; + }; + + /** + * Creates a Metadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.Metadata + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.Metadata} Metadata + */ + Metadata.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.Metadata) + return object; + var message = new $root.cosmos.bank.v1beta1.Metadata(); + if (object.description != null) + message.description = String(object.description); + if (object.denomUnits) { + if (!Array.isArray(object.denomUnits)) + throw TypeError(".cosmos.bank.v1beta1.Metadata.denomUnits: array expected"); + message.denomUnits = []; + for (var i = 0; i < object.denomUnits.length; ++i) { + if (typeof object.denomUnits[i] !== "object") + throw TypeError(".cosmos.bank.v1beta1.Metadata.denomUnits: object expected"); + message.denomUnits[i] = $root.cosmos.bank.v1beta1.DenomUnit.fromObject(object.denomUnits[i]); + } + } + if (object.base != null) + message.base = String(object.base); + if (object.display != null) + message.display = String(object.display); + return message; + }; + + /** + * Creates a plain object from a Metadata message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.Metadata + * @static + * @param {cosmos.bank.v1beta1.Metadata} message Metadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Metadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.denomUnits = []; + if (options.defaults) { + object.description = ""; + object.base = ""; + object.display = ""; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.denomUnits && message.denomUnits.length) { + object.denomUnits = []; + for (var j = 0; j < message.denomUnits.length; ++j) + object.denomUnits[j] = $root.cosmos.bank.v1beta1.DenomUnit.toObject(message.denomUnits[j], options); + } + if (message.base != null && message.hasOwnProperty("base")) + object.base = message.base; + if (message.display != null && message.hasOwnProperty("display")) + object.display = message.display; + return object; + }; + + /** + * Converts this Metadata to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.Metadata + * @instance + * @returns {Object.} JSON object + */ + Metadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Metadata; + })(v1beta1.Metadata || {}); + + v1beta1.Msg = (function(Msg) { + + /** + * Constructs a new Msg service. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a Msg + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Msg(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; + + /** + * Creates new Msg service using the specified rpc implementation. + * @function create + * @memberof cosmos.bank.v1beta1.Msg + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Msg} RPC service. Useful where requests and/or responses are streamed. + */ + Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.bank.v1beta1.Msg#send}. + * @memberof cosmos.bank.v1beta1.Msg + * @typedef SendCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.bank.v1beta1.IMsgSendResponse} [response] MsgSendResponse + */ + + /** + * Calls Send. + * @function send + * @memberof cosmos.bank.v1beta1.Msg + * @instance + * @param {cosmos.bank.v1beta1.IMsgSend} request MsgSend message or plain object + * @param {cosmos.bank.v1beta1.Msg.SendCallback} callback Node-style callback called with the error, if any, and MsgSendResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.send = function send(request, callback) { + return this.rpcCall(send, $root.cosmos.bank.v1beta1.MsgSend, $root.cosmos.bank.v1beta1.MsgSendResponse, request, callback); + }, "name", { value: "Send" }); + + /** + * Calls Send. + * @function send + * @memberof cosmos.bank.v1beta1.Msg + * @instance + * @param {cosmos.bank.v1beta1.IMsgSend} request MsgSend message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.bank.v1beta1.Msg#multiSend}. + * @memberof cosmos.bank.v1beta1.Msg + * @typedef MultiSendCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.bank.v1beta1.IMsgMultiSendResponse} [response] MsgMultiSendResponse + */ + + /** + * Calls MultiSend. + * @function multiSend + * @memberof cosmos.bank.v1beta1.Msg + * @instance + * @param {cosmos.bank.v1beta1.IMsgMultiSend} request MsgMultiSend message or plain object + * @param {cosmos.bank.v1beta1.Msg.MultiSendCallback} callback Node-style callback called with the error, if any, and MsgMultiSendResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.multiSend = function multiSend(request, callback) { + return this.rpcCall(multiSend, $root.cosmos.bank.v1beta1.MsgMultiSend, $root.cosmos.bank.v1beta1.MsgMultiSendResponse, request, callback); + }, "name", { value: "MultiSend" }); + + /** + * Calls MultiSend. + * @function multiSend + * @memberof cosmos.bank.v1beta1.Msg + * @instance + * @param {cosmos.bank.v1beta1.IMsgMultiSend} request MsgMultiSend message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Msg; + })(v1beta1.Msg || {}); + + v1beta1.MsgSend = (function(MsgSend) { + + /** + * Properties of a MsgSend. + * @memberof cosmos.bank.v1beta1 + * @interface IMsgSend + * @property {string|null} [fromAddress] MsgSend fromAddress + * @property {string|null} [toAddress] MsgSend toAddress + * @property {Array.|null} [amount] MsgSend amount + */ + + /** + * Constructs a new MsgSend. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a MsgSend. + * @implements IMsgSend + * @constructor + * @param {cosmos.bank.v1beta1.IMsgSend=} [properties] Properties to set + */ + function MsgSend(properties) { + this.amount = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgSend fromAddress. + * @member {string} fromAddress + * @memberof cosmos.bank.v1beta1.MsgSend + * @instance + */ + MsgSend.prototype.fromAddress = ""; + + /** + * MsgSend toAddress. + * @member {string} toAddress + * @memberof cosmos.bank.v1beta1.MsgSend + * @instance + */ + MsgSend.prototype.toAddress = ""; + + /** + * MsgSend amount. + * @member {Array.} amount + * @memberof cosmos.bank.v1beta1.MsgSend + * @instance + */ + MsgSend.prototype.amount = $util.emptyArray; + + /** + * Creates a new MsgSend instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.MsgSend + * @static + * @param {cosmos.bank.v1beta1.IMsgSend=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.MsgSend} MsgSend instance + */ + MsgSend.create = function create(properties) { + return new MsgSend(properties); + }; + + /** + * Encodes the specified MsgSend message. Does not implicitly {@link cosmos.bank.v1beta1.MsgSend.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.MsgSend + * @static + * @param {cosmos.bank.v1beta1.IMsgSend} message MsgSend message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSend.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fromAddress != null && Object.hasOwnProperty.call(message, "fromAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fromAddress); + if (message.toAddress != null && Object.hasOwnProperty.call(message, "toAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.toAddress); + if (message.amount != null && message.amount.length) + for (var i = 0; i < message.amount.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.amount[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MsgSend message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.MsgSend.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.MsgSend + * @static + * @param {cosmos.bank.v1beta1.IMsgSend} message MsgSend message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSend.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgSend message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.MsgSend + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.MsgSend} MsgSend + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSend.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.MsgSend(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fromAddress = reader.string(); + break; + case 2: + message.toAddress = reader.string(); + break; + case 3: + if (!(message.amount && message.amount.length)) + message.amount = []; + message.amount.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgSend message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.MsgSend + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.MsgSend} MsgSend + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSend.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgSend message. + * @function verify + * @memberof cosmos.bank.v1beta1.MsgSend + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgSend.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fromAddress != null && message.hasOwnProperty("fromAddress")) + if (!$util.isString(message.fromAddress)) + return "fromAddress: string expected"; + if (message.toAddress != null && message.hasOwnProperty("toAddress")) + if (!$util.isString(message.toAddress)) + return "toAddress: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + if (!Array.isArray(message.amount)) + return "amount: array expected"; + for (var i = 0; i < message.amount.length; ++i) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.amount[i]); + if (error) + return "amount." + error; + } + } + return null; + }; + + /** + * Creates a MsgSend message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.MsgSend + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.MsgSend} MsgSend + */ + MsgSend.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.MsgSend) + return object; + var message = new $root.cosmos.bank.v1beta1.MsgSend(); + if (object.fromAddress != null) + message.fromAddress = String(object.fromAddress); + if (object.toAddress != null) + message.toAddress = String(object.toAddress); + if (object.amount) { + if (!Array.isArray(object.amount)) + throw TypeError(".cosmos.bank.v1beta1.MsgSend.amount: array expected"); + message.amount = []; + for (var i = 0; i < object.amount.length; ++i) { + if (typeof object.amount[i] !== "object") + throw TypeError(".cosmos.bank.v1beta1.MsgSend.amount: object expected"); + message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MsgSend message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.MsgSend + * @static + * @param {cosmos.bank.v1beta1.MsgSend} message MsgSend + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSend.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.amount = []; + if (options.defaults) { + object.fromAddress = ""; + object.toAddress = ""; + } + if (message.fromAddress != null && message.hasOwnProperty("fromAddress")) + object.fromAddress = message.fromAddress; + if (message.toAddress != null && message.hasOwnProperty("toAddress")) + object.toAddress = message.toAddress; + if (message.amount && message.amount.length) { + object.amount = []; + for (var j = 0; j < message.amount.length; ++j) + object.amount[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.amount[j], options); + } + return object; + }; + + /** + * Converts this MsgSend to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.MsgSend + * @instance + * @returns {Object.} JSON object + */ + MsgSend.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgSend; + })(v1beta1.MsgSend || {}); + + v1beta1.MsgSendResponse = (function(MsgSendResponse) { + + /** + * Properties of a MsgSendResponse. + * @memberof cosmos.bank.v1beta1 + * @interface IMsgSendResponse + */ + + /** + * Constructs a new MsgSendResponse. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a MsgSendResponse. + * @implements IMsgSendResponse + * @constructor + * @param {cosmos.bank.v1beta1.IMsgSendResponse=} [properties] Properties to set + */ + function MsgSendResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgSendResponse instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.MsgSendResponse + * @static + * @param {cosmos.bank.v1beta1.IMsgSendResponse=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.MsgSendResponse} MsgSendResponse instance + */ + MsgSendResponse.create = function create(properties) { + return new MsgSendResponse(properties); + }; + + /** + * Encodes the specified MsgSendResponse message. Does not implicitly {@link cosmos.bank.v1beta1.MsgSendResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.MsgSendResponse + * @static + * @param {cosmos.bank.v1beta1.IMsgSendResponse} message MsgSendResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSendResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgSendResponse message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.MsgSendResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.MsgSendResponse + * @static + * @param {cosmos.bank.v1beta1.IMsgSendResponse} message MsgSendResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSendResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgSendResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.MsgSendResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.MsgSendResponse} MsgSendResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSendResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.MsgSendResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgSendResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.MsgSendResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.MsgSendResponse} MsgSendResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSendResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgSendResponse message. + * @function verify + * @memberof cosmos.bank.v1beta1.MsgSendResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgSendResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgSendResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.MsgSendResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.MsgSendResponse} MsgSendResponse + */ + MsgSendResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.MsgSendResponse) + return object; + return new $root.cosmos.bank.v1beta1.MsgSendResponse(); + }; + + /** + * Creates a plain object from a MsgSendResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.MsgSendResponse + * @static + * @param {cosmos.bank.v1beta1.MsgSendResponse} message MsgSendResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSendResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgSendResponse to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.MsgSendResponse + * @instance + * @returns {Object.} JSON object + */ + MsgSendResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgSendResponse; + })(v1beta1.MsgSendResponse || {}); + + v1beta1.MsgMultiSend = (function(MsgMultiSend) { + + /** + * Properties of a MsgMultiSend. + * @memberof cosmos.bank.v1beta1 + * @interface IMsgMultiSend + * @property {Array.|null} [inputs] MsgMultiSend inputs + * @property {Array.|null} [outputs] MsgMultiSend outputs + */ + + /** + * Constructs a new MsgMultiSend. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a MsgMultiSend. + * @implements IMsgMultiSend + * @constructor + * @param {cosmos.bank.v1beta1.IMsgMultiSend=} [properties] Properties to set + */ + function MsgMultiSend(properties) { + this.inputs = []; + this.outputs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgMultiSend inputs. + * @member {Array.} inputs + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @instance + */ + MsgMultiSend.prototype.inputs = $util.emptyArray; + + /** + * MsgMultiSend outputs. + * @member {Array.} outputs + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @instance + */ + MsgMultiSend.prototype.outputs = $util.emptyArray; + + /** + * Creates a new MsgMultiSend instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @static + * @param {cosmos.bank.v1beta1.IMsgMultiSend=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.MsgMultiSend} MsgMultiSend instance + */ + MsgMultiSend.create = function create(properties) { + return new MsgMultiSend(properties); + }; + + /** + * Encodes the specified MsgMultiSend message. Does not implicitly {@link cosmos.bank.v1beta1.MsgMultiSend.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @static + * @param {cosmos.bank.v1beta1.IMsgMultiSend} message MsgMultiSend message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgMultiSend.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputs != null && message.inputs.length) + for (var i = 0; i < message.inputs.length; ++i) + $root.cosmos.bank.v1beta1.Input.encode(message.inputs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.outputs != null && message.outputs.length) + for (var i = 0; i < message.outputs.length; ++i) + $root.cosmos.bank.v1beta1.Output.encode(message.outputs[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MsgMultiSend message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.MsgMultiSend.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @static + * @param {cosmos.bank.v1beta1.IMsgMultiSend} message MsgMultiSend message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgMultiSend.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgMultiSend message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.MsgMultiSend} MsgMultiSend + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgMultiSend.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.MsgMultiSend(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.inputs && message.inputs.length)) + message.inputs = []; + message.inputs.push($root.cosmos.bank.v1beta1.Input.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.outputs && message.outputs.length)) + message.outputs = []; + message.outputs.push($root.cosmos.bank.v1beta1.Output.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgMultiSend message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.MsgMultiSend} MsgMultiSend + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgMultiSend.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgMultiSend message. + * @function verify + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgMultiSend.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputs != null && message.hasOwnProperty("inputs")) { + if (!Array.isArray(message.inputs)) + return "inputs: array expected"; + for (var i = 0; i < message.inputs.length; ++i) { + var error = $root.cosmos.bank.v1beta1.Input.verify(message.inputs[i]); + if (error) + return "inputs." + error; + } + } + if (message.outputs != null && message.hasOwnProperty("outputs")) { + if (!Array.isArray(message.outputs)) + return "outputs: array expected"; + for (var i = 0; i < message.outputs.length; ++i) { + var error = $root.cosmos.bank.v1beta1.Output.verify(message.outputs[i]); + if (error) + return "outputs." + error; + } + } + return null; + }; + + /** + * Creates a MsgMultiSend message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.MsgMultiSend} MsgMultiSend + */ + MsgMultiSend.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.MsgMultiSend) + return object; + var message = new $root.cosmos.bank.v1beta1.MsgMultiSend(); + if (object.inputs) { + if (!Array.isArray(object.inputs)) + throw TypeError(".cosmos.bank.v1beta1.MsgMultiSend.inputs: array expected"); + message.inputs = []; + for (var i = 0; i < object.inputs.length; ++i) { + if (typeof object.inputs[i] !== "object") + throw TypeError(".cosmos.bank.v1beta1.MsgMultiSend.inputs: object expected"); + message.inputs[i] = $root.cosmos.bank.v1beta1.Input.fromObject(object.inputs[i]); + } + } + if (object.outputs) { + if (!Array.isArray(object.outputs)) + throw TypeError(".cosmos.bank.v1beta1.MsgMultiSend.outputs: array expected"); + message.outputs = []; + for (var i = 0; i < object.outputs.length; ++i) { + if (typeof object.outputs[i] !== "object") + throw TypeError(".cosmos.bank.v1beta1.MsgMultiSend.outputs: object expected"); + message.outputs[i] = $root.cosmos.bank.v1beta1.Output.fromObject(object.outputs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MsgMultiSend message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @static + * @param {cosmos.bank.v1beta1.MsgMultiSend} message MsgMultiSend + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgMultiSend.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.inputs = []; + object.outputs = []; + } + if (message.inputs && message.inputs.length) { + object.inputs = []; + for (var j = 0; j < message.inputs.length; ++j) + object.inputs[j] = $root.cosmos.bank.v1beta1.Input.toObject(message.inputs[j], options); + } + if (message.outputs && message.outputs.length) { + object.outputs = []; + for (var j = 0; j < message.outputs.length; ++j) + object.outputs[j] = $root.cosmos.bank.v1beta1.Output.toObject(message.outputs[j], options); + } + return object; + }; + + /** + * Converts this MsgMultiSend to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @instance + * @returns {Object.} JSON object + */ + MsgMultiSend.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgMultiSend; + })(v1beta1.MsgMultiSend || {}); + + v1beta1.MsgMultiSendResponse = (function(MsgMultiSendResponse) { + + /** + * Properties of a MsgMultiSendResponse. + * @memberof cosmos.bank.v1beta1 + * @interface IMsgMultiSendResponse + */ + + /** + * Constructs a new MsgMultiSendResponse. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a MsgMultiSendResponse. + * @implements IMsgMultiSendResponse + * @constructor + * @param {cosmos.bank.v1beta1.IMsgMultiSendResponse=} [properties] Properties to set + */ + function MsgMultiSendResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgMultiSendResponse instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.MsgMultiSendResponse + * @static + * @param {cosmos.bank.v1beta1.IMsgMultiSendResponse=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.MsgMultiSendResponse} MsgMultiSendResponse instance + */ + MsgMultiSendResponse.create = function create(properties) { + return new MsgMultiSendResponse(properties); + }; + + /** + * Encodes the specified MsgMultiSendResponse message. Does not implicitly {@link cosmos.bank.v1beta1.MsgMultiSendResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.MsgMultiSendResponse + * @static + * @param {cosmos.bank.v1beta1.IMsgMultiSendResponse} message MsgMultiSendResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgMultiSendResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgMultiSendResponse message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.MsgMultiSendResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.MsgMultiSendResponse + * @static + * @param {cosmos.bank.v1beta1.IMsgMultiSendResponse} message MsgMultiSendResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgMultiSendResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgMultiSendResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.MsgMultiSendResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.MsgMultiSendResponse} MsgMultiSendResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgMultiSendResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.MsgMultiSendResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgMultiSendResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.MsgMultiSendResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.MsgMultiSendResponse} MsgMultiSendResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgMultiSendResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgMultiSendResponse message. + * @function verify + * @memberof cosmos.bank.v1beta1.MsgMultiSendResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgMultiSendResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgMultiSendResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.MsgMultiSendResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.MsgMultiSendResponse} MsgMultiSendResponse + */ + MsgMultiSendResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.MsgMultiSendResponse) + return object; + return new $root.cosmos.bank.v1beta1.MsgMultiSendResponse(); + }; + + /** + * Creates a plain object from a MsgMultiSendResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.MsgMultiSendResponse + * @static + * @param {cosmos.bank.v1beta1.MsgMultiSendResponse} message MsgMultiSendResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgMultiSendResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgMultiSendResponse to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.MsgMultiSendResponse + * @instance + * @returns {Object.} JSON object + */ + MsgMultiSendResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgMultiSendResponse; + })(v1beta1.MsgMultiSendResponse || {}); + + return v1beta1; + })(bank.v1beta1 || {}); + + return bank; + })(cosmos.bank || {}); + + /** + * Namespace gov. + * @memberof cosmos + * @namespace + */ + + cosmos.gov = (function(gov) { + + /** + * Namespace v1beta1. + * @memberof cosmos.gov + * @namespace + */ + + gov.v1beta1 = (function(v1beta1) { + + /** + * VoteOption enum. + * @name cosmos.gov.v1beta1.VoteOption + * @enum {string} + * @property {number} VOTE_OPTION_UNSPECIFIED=0 VOTE_OPTION_UNSPECIFIED value + * @property {number} VOTE_OPTION_YES=1 VOTE_OPTION_YES value + * @property {number} VOTE_OPTION_ABSTAIN=2 VOTE_OPTION_ABSTAIN value + * @property {number} VOTE_OPTION_NO=3 VOTE_OPTION_NO value + * @property {number} VOTE_OPTION_NO_WITH_VETO=4 VOTE_OPTION_NO_WITH_VETO value + */ + v1beta1.VoteOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VOTE_OPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "VOTE_OPTION_YES"] = 1; + values[valuesById[2] = "VOTE_OPTION_ABSTAIN"] = 2; + values[valuesById[3] = "VOTE_OPTION_NO"] = 3; + values[valuesById[4] = "VOTE_OPTION_NO_WITH_VETO"] = 4; + return values; + })(); + + v1beta1.TextProposal = (function(TextProposal) { + + /** + * Properties of a TextProposal. + * @memberof cosmos.gov.v1beta1 + * @interface ITextProposal + * @property {string|null} [title] TextProposal title + * @property {string|null} [description] TextProposal description + */ + + /** + * Constructs a new TextProposal. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a TextProposal. + * @implements ITextProposal + * @constructor + * @param {cosmos.gov.v1beta1.ITextProposal=} [properties] Properties to set + */ + function TextProposal(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextProposal title. + * @member {string} title + * @memberof cosmos.gov.v1beta1.TextProposal + * @instance + */ + TextProposal.prototype.title = ""; + + /** + * TextProposal description. + * @member {string} description + * @memberof cosmos.gov.v1beta1.TextProposal + * @instance + */ + TextProposal.prototype.description = ""; + + /** + * Creates a new TextProposal instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.TextProposal + * @static + * @param {cosmos.gov.v1beta1.ITextProposal=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.TextProposal} TextProposal instance + */ + TextProposal.create = function create(properties) { + return new TextProposal(properties); + }; + + /** + * Encodes the specified TextProposal message. Does not implicitly {@link cosmos.gov.v1beta1.TextProposal.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.TextProposal + * @static + * @param {cosmos.gov.v1beta1.ITextProposal} message TextProposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextProposal.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + return writer; + }; + + /** + * Encodes the specified TextProposal message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.TextProposal.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.TextProposal + * @static + * @param {cosmos.gov.v1beta1.ITextProposal} message TextProposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextProposal.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextProposal message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.TextProposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.TextProposal} TextProposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextProposal.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.TextProposal(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextProposal message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.TextProposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.TextProposal} TextProposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextProposal.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextProposal message. + * @function verify + * @memberof cosmos.gov.v1beta1.TextProposal + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextProposal.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a TextProposal message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.TextProposal + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.TextProposal} TextProposal + */ + TextProposal.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.TextProposal) + return object; + var message = new $root.cosmos.gov.v1beta1.TextProposal(); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a TextProposal message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.TextProposal + * @static + * @param {cosmos.gov.v1beta1.TextProposal} message TextProposal + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextProposal.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.title = ""; + object.description = ""; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this TextProposal to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.TextProposal + * @instance + * @returns {Object.} JSON object + */ + TextProposal.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TextProposal; + })(v1beta1.TextProposal || {}); + + v1beta1.Deposit = (function(Deposit) { + + /** + * Properties of a Deposit. + * @memberof cosmos.gov.v1beta1 + * @interface IDeposit + * @property {number|Long|null} [proposalId] Deposit proposalId + * @property {string|null} [depositor] Deposit depositor + * @property {Array.|null} [amount] Deposit amount + */ + + /** + * Constructs a new Deposit. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a Deposit. + * @implements IDeposit + * @constructor + * @param {cosmos.gov.v1beta1.IDeposit=} [properties] Properties to set + */ + function Deposit(properties) { + this.amount = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Deposit proposalId. + * @member {number|Long} proposalId + * @memberof cosmos.gov.v1beta1.Deposit + * @instance + */ + Deposit.prototype.proposalId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Deposit depositor. + * @member {string} depositor + * @memberof cosmos.gov.v1beta1.Deposit + * @instance + */ + Deposit.prototype.depositor = ""; + + /** + * Deposit amount. + * @member {Array.} amount + * @memberof cosmos.gov.v1beta1.Deposit + * @instance + */ + Deposit.prototype.amount = $util.emptyArray; + + /** + * Creates a new Deposit instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.Deposit + * @static + * @param {cosmos.gov.v1beta1.IDeposit=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.Deposit} Deposit instance + */ + Deposit.create = function create(properties) { + return new Deposit(properties); + }; + + /** + * Encodes the specified Deposit message. Does not implicitly {@link cosmos.gov.v1beta1.Deposit.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.Deposit + * @static + * @param {cosmos.gov.v1beta1.IDeposit} message Deposit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deposit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proposalId != null && Object.hasOwnProperty.call(message, "proposalId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposalId); + if (message.depositor != null && Object.hasOwnProperty.call(message, "depositor")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.depositor); + if (message.amount != null && message.amount.length) + for (var i = 0; i < message.amount.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.amount[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Deposit message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.Deposit.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.Deposit + * @static + * @param {cosmos.gov.v1beta1.IDeposit} message Deposit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deposit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Deposit message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.Deposit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.Deposit} Deposit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deposit.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.Deposit(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.depositor = reader.string(); + break; + case 3: + if (!(message.amount && message.amount.length)) + message.amount = []; + message.amount.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Deposit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.Deposit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.Deposit} Deposit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deposit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Deposit message. + * @function verify + * @memberof cosmos.gov.v1beta1.Deposit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Deposit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (!$util.isInteger(message.proposalId) && !(message.proposalId && $util.isInteger(message.proposalId.low) && $util.isInteger(message.proposalId.high))) + return "proposalId: integer|Long expected"; + if (message.depositor != null && message.hasOwnProperty("depositor")) + if (!$util.isString(message.depositor)) + return "depositor: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + if (!Array.isArray(message.amount)) + return "amount: array expected"; + for (var i = 0; i < message.amount.length; ++i) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.amount[i]); + if (error) + return "amount." + error; + } + } + return null; + }; + + /** + * Creates a Deposit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.Deposit + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.Deposit} Deposit + */ + Deposit.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.Deposit) + return object; + var message = new $root.cosmos.gov.v1beta1.Deposit(); + if (object.proposalId != null) + if ($util.Long) + (message.proposalId = $util.Long.fromValue(object.proposalId)).unsigned = true; + else if (typeof object.proposalId === "string") + message.proposalId = parseInt(object.proposalId, 10); + else if (typeof object.proposalId === "number") + message.proposalId = object.proposalId; + else if (typeof object.proposalId === "object") + message.proposalId = new $util.LongBits(object.proposalId.low >>> 0, object.proposalId.high >>> 0).toNumber(true); + if (object.depositor != null) + message.depositor = String(object.depositor); + if (object.amount) { + if (!Array.isArray(object.amount)) + throw TypeError(".cosmos.gov.v1beta1.Deposit.amount: array expected"); + message.amount = []; + for (var i = 0; i < object.amount.length; ++i) { + if (typeof object.amount[i] !== "object") + throw TypeError(".cosmos.gov.v1beta1.Deposit.amount: object expected"); + message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Deposit message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.Deposit + * @static + * @param {cosmos.gov.v1beta1.Deposit} message Deposit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Deposit.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.amount = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.proposalId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.proposalId = options.longs === String ? "0" : 0; + object.depositor = ""; + } + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (typeof message.proposalId === "number") + object.proposalId = options.longs === String ? String(message.proposalId) : message.proposalId; + else + object.proposalId = options.longs === String ? $util.Long.prototype.toString.call(message.proposalId) : options.longs === Number ? new $util.LongBits(message.proposalId.low >>> 0, message.proposalId.high >>> 0).toNumber(true) : message.proposalId; + if (message.depositor != null && message.hasOwnProperty("depositor")) + object.depositor = message.depositor; + if (message.amount && message.amount.length) { + object.amount = []; + for (var j = 0; j < message.amount.length; ++j) + object.amount[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.amount[j], options); + } + return object; + }; + + /** + * Converts this Deposit to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.Deposit + * @instance + * @returns {Object.} JSON object + */ + Deposit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Deposit; + })(v1beta1.Deposit || {}); + + v1beta1.Proposal = (function(Proposal) { + + /** + * Properties of a Proposal. + * @memberof cosmos.gov.v1beta1 + * @interface IProposal + * @property {number|Long|null} [proposalId] Proposal proposalId + * @property {google.protobuf.IAny|null} [content] Proposal content + * @property {cosmos.gov.v1beta1.ProposalStatus|null} [status] Proposal status + * @property {cosmos.gov.v1beta1.ITallyResult|null} [finalTallyResult] Proposal finalTallyResult + * @property {google.protobuf.ITimestamp|null} [submitTime] Proposal submitTime + * @property {google.protobuf.ITimestamp|null} [depositEndTime] Proposal depositEndTime + * @property {Array.|null} [totalDeposit] Proposal totalDeposit + * @property {google.protobuf.ITimestamp|null} [votingStartTime] Proposal votingStartTime + * @property {google.protobuf.ITimestamp|null} [votingEndTime] Proposal votingEndTime + */ + + /** + * Constructs a new Proposal. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a Proposal. + * @implements IProposal + * @constructor + * @param {cosmos.gov.v1beta1.IProposal=} [properties] Properties to set + */ + function Proposal(properties) { + this.totalDeposit = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Proposal proposalId. + * @member {number|Long} proposalId + * @memberof cosmos.gov.v1beta1.Proposal + * @instance + */ + Proposal.prototype.proposalId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Proposal content. + * @member {google.protobuf.IAny|null|undefined} content + * @memberof cosmos.gov.v1beta1.Proposal + * @instance + */ + Proposal.prototype.content = null; + + /** + * Proposal status. + * @member {cosmos.gov.v1beta1.ProposalStatus} status + * @memberof cosmos.gov.v1beta1.Proposal + * @instance + */ + Proposal.prototype.status = 0; + + /** + * Proposal finalTallyResult. + * @member {cosmos.gov.v1beta1.ITallyResult|null|undefined} finalTallyResult + * @memberof cosmos.gov.v1beta1.Proposal + * @instance + */ + Proposal.prototype.finalTallyResult = null; + + /** + * Proposal submitTime. + * @member {google.protobuf.ITimestamp|null|undefined} submitTime + * @memberof cosmos.gov.v1beta1.Proposal + * @instance + */ + Proposal.prototype.submitTime = null; + + /** + * Proposal depositEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} depositEndTime + * @memberof cosmos.gov.v1beta1.Proposal + * @instance + */ + Proposal.prototype.depositEndTime = null; + + /** + * Proposal totalDeposit. + * @member {Array.} totalDeposit + * @memberof cosmos.gov.v1beta1.Proposal + * @instance + */ + Proposal.prototype.totalDeposit = $util.emptyArray; + + /** + * Proposal votingStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} votingStartTime + * @memberof cosmos.gov.v1beta1.Proposal + * @instance + */ + Proposal.prototype.votingStartTime = null; + + /** + * Proposal votingEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} votingEndTime + * @memberof cosmos.gov.v1beta1.Proposal + * @instance + */ + Proposal.prototype.votingEndTime = null; + + /** + * Creates a new Proposal instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.Proposal + * @static + * @param {cosmos.gov.v1beta1.IProposal=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.Proposal} Proposal instance + */ + Proposal.create = function create(properties) { + return new Proposal(properties); + }; + + /** + * Encodes the specified Proposal message. Does not implicitly {@link cosmos.gov.v1beta1.Proposal.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.Proposal + * @static + * @param {cosmos.gov.v1beta1.IProposal} message Proposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proposal.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proposalId != null && Object.hasOwnProperty.call(message, "proposalId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposalId); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + $root.google.protobuf.Any.encode(message.content, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.status); + if (message.finalTallyResult != null && Object.hasOwnProperty.call(message, "finalTallyResult")) + $root.cosmos.gov.v1beta1.TallyResult.encode(message.finalTallyResult, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.depositEndTime != null && Object.hasOwnProperty.call(message, "depositEndTime")) + $root.google.protobuf.Timestamp.encode(message.depositEndTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.totalDeposit != null && message.totalDeposit.length) + for (var i = 0; i < message.totalDeposit.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.totalDeposit[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.votingStartTime != null && Object.hasOwnProperty.call(message, "votingStartTime")) + $root.google.protobuf.Timestamp.encode(message.votingStartTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.votingEndTime != null && Object.hasOwnProperty.call(message, "votingEndTime")) + $root.google.protobuf.Timestamp.encode(message.votingEndTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Proposal message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.Proposal.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.Proposal + * @static + * @param {cosmos.gov.v1beta1.IProposal} message Proposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proposal.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Proposal message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.Proposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.Proposal} Proposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proposal.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.Proposal(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.content = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 3: + message.status = reader.int32(); + break; + case 4: + message.finalTallyResult = $root.cosmos.gov.v1beta1.TallyResult.decode(reader, reader.uint32()); + break; + case 5: + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.depositEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 7: + if (!(message.totalDeposit && message.totalDeposit.length)) + message.totalDeposit = []; + message.totalDeposit.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + case 8: + message.votingStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 9: + message.votingEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Proposal message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.Proposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.Proposal} Proposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proposal.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Proposal message. + * @function verify + * @memberof cosmos.gov.v1beta1.Proposal + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Proposal.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (!$util.isInteger(message.proposalId) && !(message.proposalId && $util.isInteger(message.proposalId.low) && $util.isInteger(message.proposalId.high))) + return "proposalId: integer|Long expected"; + if (message.content != null && message.hasOwnProperty("content")) { + var error = $root.google.protobuf.Any.verify(message.content); + if (error) + return "content." + error; + } + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.finalTallyResult != null && message.hasOwnProperty("finalTallyResult")) { + var error = $root.cosmos.gov.v1beta1.TallyResult.verify(message.finalTallyResult); + if (error) + return "finalTallyResult." + error; + } + if (message.submitTime != null && message.hasOwnProperty("submitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.submitTime); + if (error) + return "submitTime." + error; + } + if (message.depositEndTime != null && message.hasOwnProperty("depositEndTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.depositEndTime); + if (error) + return "depositEndTime." + error; + } + if (message.totalDeposit != null && message.hasOwnProperty("totalDeposit")) { + if (!Array.isArray(message.totalDeposit)) + return "totalDeposit: array expected"; + for (var i = 0; i < message.totalDeposit.length; ++i) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.totalDeposit[i]); + if (error) + return "totalDeposit." + error; + } + } + if (message.votingStartTime != null && message.hasOwnProperty("votingStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.votingStartTime); + if (error) + return "votingStartTime." + error; + } + if (message.votingEndTime != null && message.hasOwnProperty("votingEndTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.votingEndTime); + if (error) + return "votingEndTime." + error; + } + return null; + }; + + /** + * Creates a Proposal message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.Proposal + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.Proposal} Proposal + */ + Proposal.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.Proposal) + return object; + var message = new $root.cosmos.gov.v1beta1.Proposal(); + if (object.proposalId != null) + if ($util.Long) + (message.proposalId = $util.Long.fromValue(object.proposalId)).unsigned = true; + else if (typeof object.proposalId === "string") + message.proposalId = parseInt(object.proposalId, 10); + else if (typeof object.proposalId === "number") + message.proposalId = object.proposalId; + else if (typeof object.proposalId === "object") + message.proposalId = new $util.LongBits(object.proposalId.low >>> 0, object.proposalId.high >>> 0).toNumber(true); + if (object.content != null) { + if (typeof object.content !== "object") + throw TypeError(".cosmos.gov.v1beta1.Proposal.content: object expected"); + message.content = $root.google.protobuf.Any.fromObject(object.content); + } + switch (object.status) { + case "PROPOSAL_STATUS_UNSPECIFIED": + case 0: + message.status = 0; + break; + case "PROPOSAL_STATUS_DEPOSIT_PERIOD": + case 1: + message.status = 1; + break; + case "PROPOSAL_STATUS_VOTING_PERIOD": + case 2: + message.status = 2; + break; + case "PROPOSAL_STATUS_PASSED": + case 3: + message.status = 3; + break; + case "PROPOSAL_STATUS_REJECTED": + case 4: + message.status = 4; + break; + case "PROPOSAL_STATUS_FAILED": + case 5: + message.status = 5; + break; + } + if (object.finalTallyResult != null) { + if (typeof object.finalTallyResult !== "object") + throw TypeError(".cosmos.gov.v1beta1.Proposal.finalTallyResult: object expected"); + message.finalTallyResult = $root.cosmos.gov.v1beta1.TallyResult.fromObject(object.finalTallyResult); + } + if (object.submitTime != null) { + if (typeof object.submitTime !== "object") + throw TypeError(".cosmos.gov.v1beta1.Proposal.submitTime: object expected"); + message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + } + if (object.depositEndTime != null) { + if (typeof object.depositEndTime !== "object") + throw TypeError(".cosmos.gov.v1beta1.Proposal.depositEndTime: object expected"); + message.depositEndTime = $root.google.protobuf.Timestamp.fromObject(object.depositEndTime); + } + if (object.totalDeposit) { + if (!Array.isArray(object.totalDeposit)) + throw TypeError(".cosmos.gov.v1beta1.Proposal.totalDeposit: array expected"); + message.totalDeposit = []; + for (var i = 0; i < object.totalDeposit.length; ++i) { + if (typeof object.totalDeposit[i] !== "object") + throw TypeError(".cosmos.gov.v1beta1.Proposal.totalDeposit: object expected"); + message.totalDeposit[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.totalDeposit[i]); + } + } + if (object.votingStartTime != null) { + if (typeof object.votingStartTime !== "object") + throw TypeError(".cosmos.gov.v1beta1.Proposal.votingStartTime: object expected"); + message.votingStartTime = $root.google.protobuf.Timestamp.fromObject(object.votingStartTime); + } + if (object.votingEndTime != null) { + if (typeof object.votingEndTime !== "object") + throw TypeError(".cosmos.gov.v1beta1.Proposal.votingEndTime: object expected"); + message.votingEndTime = $root.google.protobuf.Timestamp.fromObject(object.votingEndTime); + } + return message; + }; + + /** + * Creates a plain object from a Proposal message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.Proposal + * @static + * @param {cosmos.gov.v1beta1.Proposal} message Proposal + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Proposal.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.totalDeposit = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.proposalId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.proposalId = options.longs === String ? "0" : 0; + object.content = null; + object.status = options.enums === String ? "PROPOSAL_STATUS_UNSPECIFIED" : 0; + object.finalTallyResult = null; + object.submitTime = null; + object.depositEndTime = null; + object.votingStartTime = null; + object.votingEndTime = null; + } + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (typeof message.proposalId === "number") + object.proposalId = options.longs === String ? String(message.proposalId) : message.proposalId; + else + object.proposalId = options.longs === String ? $util.Long.prototype.toString.call(message.proposalId) : options.longs === Number ? new $util.LongBits(message.proposalId.low >>> 0, message.proposalId.high >>> 0).toNumber(true) : message.proposalId; + if (message.content != null && message.hasOwnProperty("content")) + object.content = $root.google.protobuf.Any.toObject(message.content, options); + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.cosmos.gov.v1beta1.ProposalStatus[message.status] : message.status; + if (message.finalTallyResult != null && message.hasOwnProperty("finalTallyResult")) + object.finalTallyResult = $root.cosmos.gov.v1beta1.TallyResult.toObject(message.finalTallyResult, options); + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); + if (message.depositEndTime != null && message.hasOwnProperty("depositEndTime")) + object.depositEndTime = $root.google.protobuf.Timestamp.toObject(message.depositEndTime, options); + if (message.totalDeposit && message.totalDeposit.length) { + object.totalDeposit = []; + for (var j = 0; j < message.totalDeposit.length; ++j) + object.totalDeposit[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.totalDeposit[j], options); + } + if (message.votingStartTime != null && message.hasOwnProperty("votingStartTime")) + object.votingStartTime = $root.google.protobuf.Timestamp.toObject(message.votingStartTime, options); + if (message.votingEndTime != null && message.hasOwnProperty("votingEndTime")) + object.votingEndTime = $root.google.protobuf.Timestamp.toObject(message.votingEndTime, options); + return object; + }; + + /** + * Converts this Proposal to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.Proposal + * @instance + * @returns {Object.} JSON object + */ + Proposal.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Proposal; + })(v1beta1.Proposal || {}); + + /** + * ProposalStatus enum. + * @name cosmos.gov.v1beta1.ProposalStatus + * @enum {string} + * @property {number} PROPOSAL_STATUS_UNSPECIFIED=0 PROPOSAL_STATUS_UNSPECIFIED value + * @property {number} PROPOSAL_STATUS_DEPOSIT_PERIOD=1 PROPOSAL_STATUS_DEPOSIT_PERIOD value + * @property {number} PROPOSAL_STATUS_VOTING_PERIOD=2 PROPOSAL_STATUS_VOTING_PERIOD value + * @property {number} PROPOSAL_STATUS_PASSED=3 PROPOSAL_STATUS_PASSED value + * @property {number} PROPOSAL_STATUS_REJECTED=4 PROPOSAL_STATUS_REJECTED value + * @property {number} PROPOSAL_STATUS_FAILED=5 PROPOSAL_STATUS_FAILED value + */ + v1beta1.ProposalStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROPOSAL_STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "PROPOSAL_STATUS_DEPOSIT_PERIOD"] = 1; + values[valuesById[2] = "PROPOSAL_STATUS_VOTING_PERIOD"] = 2; + values[valuesById[3] = "PROPOSAL_STATUS_PASSED"] = 3; + values[valuesById[4] = "PROPOSAL_STATUS_REJECTED"] = 4; + values[valuesById[5] = "PROPOSAL_STATUS_FAILED"] = 5; + return values; + })(); + + v1beta1.TallyResult = (function(TallyResult) { + + /** + * Properties of a TallyResult. + * @memberof cosmos.gov.v1beta1 + * @interface ITallyResult + * @property {string|null} [yes] TallyResult yes + * @property {string|null} [abstain] TallyResult abstain + * @property {string|null} [no] TallyResult no + * @property {string|null} [noWithVeto] TallyResult noWithVeto + */ + + /** + * Constructs a new TallyResult. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a TallyResult. + * @implements ITallyResult + * @constructor + * @param {cosmos.gov.v1beta1.ITallyResult=} [properties] Properties to set + */ + function TallyResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TallyResult yes. + * @member {string} yes + * @memberof cosmos.gov.v1beta1.TallyResult + * @instance + */ + TallyResult.prototype.yes = ""; + + /** + * TallyResult abstain. + * @member {string} abstain + * @memberof cosmos.gov.v1beta1.TallyResult + * @instance + */ + TallyResult.prototype.abstain = ""; + + /** + * TallyResult no. + * @member {string} no + * @memberof cosmos.gov.v1beta1.TallyResult + * @instance + */ + TallyResult.prototype.no = ""; + + /** + * TallyResult noWithVeto. + * @member {string} noWithVeto + * @memberof cosmos.gov.v1beta1.TallyResult + * @instance + */ + TallyResult.prototype.noWithVeto = ""; + + /** + * Creates a new TallyResult instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.TallyResult + * @static + * @param {cosmos.gov.v1beta1.ITallyResult=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.TallyResult} TallyResult instance + */ + TallyResult.create = function create(properties) { + return new TallyResult(properties); + }; + + /** + * Encodes the specified TallyResult message. Does not implicitly {@link cosmos.gov.v1beta1.TallyResult.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.TallyResult + * @static + * @param {cosmos.gov.v1beta1.ITallyResult} message TallyResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TallyResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.yes != null && Object.hasOwnProperty.call(message, "yes")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.yes); + if (message.abstain != null && Object.hasOwnProperty.call(message, "abstain")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.abstain); + if (message.no != null && Object.hasOwnProperty.call(message, "no")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.no); + if (message.noWithVeto != null && Object.hasOwnProperty.call(message, "noWithVeto")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.noWithVeto); + return writer; + }; + + /** + * Encodes the specified TallyResult message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.TallyResult.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.TallyResult + * @static + * @param {cosmos.gov.v1beta1.ITallyResult} message TallyResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TallyResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TallyResult message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.TallyResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.TallyResult} TallyResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TallyResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.TallyResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.yes = reader.string(); + break; + case 2: + message.abstain = reader.string(); + break; + case 3: + message.no = reader.string(); + break; + case 4: + message.noWithVeto = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TallyResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.TallyResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.TallyResult} TallyResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TallyResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TallyResult message. + * @function verify + * @memberof cosmos.gov.v1beta1.TallyResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TallyResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.yes != null && message.hasOwnProperty("yes")) + if (!$util.isString(message.yes)) + return "yes: string expected"; + if (message.abstain != null && message.hasOwnProperty("abstain")) + if (!$util.isString(message.abstain)) + return "abstain: string expected"; + if (message.no != null && message.hasOwnProperty("no")) + if (!$util.isString(message.no)) + return "no: string expected"; + if (message.noWithVeto != null && message.hasOwnProperty("noWithVeto")) + if (!$util.isString(message.noWithVeto)) + return "noWithVeto: string expected"; + return null; + }; + + /** + * Creates a TallyResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.TallyResult + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.TallyResult} TallyResult + */ + TallyResult.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.TallyResult) + return object; + var message = new $root.cosmos.gov.v1beta1.TallyResult(); + if (object.yes != null) + message.yes = String(object.yes); + if (object.abstain != null) + message.abstain = String(object.abstain); + if (object.no != null) + message.no = String(object.no); + if (object.noWithVeto != null) + message.noWithVeto = String(object.noWithVeto); + return message; + }; + + /** + * Creates a plain object from a TallyResult message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.TallyResult + * @static + * @param {cosmos.gov.v1beta1.TallyResult} message TallyResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TallyResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.yes = ""; + object.abstain = ""; + object.no = ""; + object.noWithVeto = ""; + } + if (message.yes != null && message.hasOwnProperty("yes")) + object.yes = message.yes; + if (message.abstain != null && message.hasOwnProperty("abstain")) + object.abstain = message.abstain; + if (message.no != null && message.hasOwnProperty("no")) + object.no = message.no; + if (message.noWithVeto != null && message.hasOwnProperty("noWithVeto")) + object.noWithVeto = message.noWithVeto; + return object; + }; + + /** + * Converts this TallyResult to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.TallyResult + * @instance + * @returns {Object.} JSON object + */ + TallyResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TallyResult; + })(v1beta1.TallyResult || {}); + + v1beta1.Vote = (function(Vote) { + + /** + * Properties of a Vote. + * @memberof cosmos.gov.v1beta1 + * @interface IVote + * @property {number|Long|null} [proposalId] Vote proposalId + * @property {string|null} [voter] Vote voter + * @property {cosmos.gov.v1beta1.VoteOption|null} [option] Vote option + */ + + /** + * Constructs a new Vote. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a Vote. + * @implements IVote + * @constructor + * @param {cosmos.gov.v1beta1.IVote=} [properties] Properties to set + */ + function Vote(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Vote proposalId. + * @member {number|Long} proposalId + * @memberof cosmos.gov.v1beta1.Vote + * @instance + */ + Vote.prototype.proposalId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Vote voter. + * @member {string} voter + * @memberof cosmos.gov.v1beta1.Vote + * @instance + */ + Vote.prototype.voter = ""; + + /** + * Vote option. + * @member {cosmos.gov.v1beta1.VoteOption} option + * @memberof cosmos.gov.v1beta1.Vote + * @instance + */ + Vote.prototype.option = 0; + + /** + * Creates a new Vote instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.Vote + * @static + * @param {cosmos.gov.v1beta1.IVote=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.Vote} Vote instance + */ + Vote.create = function create(properties) { + return new Vote(properties); + }; + + /** + * Encodes the specified Vote message. Does not implicitly {@link cosmos.gov.v1beta1.Vote.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.Vote + * @static + * @param {cosmos.gov.v1beta1.IVote} message Vote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vote.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proposalId != null && Object.hasOwnProperty.call(message, "proposalId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposalId); + if (message.voter != null && Object.hasOwnProperty.call(message, "voter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.voter); + if (message.option != null && Object.hasOwnProperty.call(message, "option")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.option); + return writer; + }; + + /** + * Encodes the specified Vote message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.Vote.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.Vote + * @static + * @param {cosmos.gov.v1beta1.IVote} message Vote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vote.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Vote message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.Vote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.Vote} Vote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vote.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.Vote(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.voter = reader.string(); + break; + case 3: + message.option = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Vote message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.Vote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.Vote} Vote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vote.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Vote message. + * @function verify + * @memberof cosmos.gov.v1beta1.Vote + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Vote.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (!$util.isInteger(message.proposalId) && !(message.proposalId && $util.isInteger(message.proposalId.low) && $util.isInteger(message.proposalId.high))) + return "proposalId: integer|Long expected"; + if (message.voter != null && message.hasOwnProperty("voter")) + if (!$util.isString(message.voter)) + return "voter: string expected"; + if (message.option != null && message.hasOwnProperty("option")) + switch (message.option) { + default: + return "option: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a Vote message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.Vote + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.Vote} Vote + */ + Vote.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.Vote) + return object; + var message = new $root.cosmos.gov.v1beta1.Vote(); + if (object.proposalId != null) + if ($util.Long) + (message.proposalId = $util.Long.fromValue(object.proposalId)).unsigned = true; + else if (typeof object.proposalId === "string") + message.proposalId = parseInt(object.proposalId, 10); + else if (typeof object.proposalId === "number") + message.proposalId = object.proposalId; + else if (typeof object.proposalId === "object") + message.proposalId = new $util.LongBits(object.proposalId.low >>> 0, object.proposalId.high >>> 0).toNumber(true); + if (object.voter != null) + message.voter = String(object.voter); + switch (object.option) { + case "VOTE_OPTION_UNSPECIFIED": + case 0: + message.option = 0; + break; + case "VOTE_OPTION_YES": + case 1: + message.option = 1; + break; + case "VOTE_OPTION_ABSTAIN": + case 2: + message.option = 2; + break; + case "VOTE_OPTION_NO": + case 3: + message.option = 3; + break; + case "VOTE_OPTION_NO_WITH_VETO": + case 4: + message.option = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a Vote message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.Vote + * @static + * @param {cosmos.gov.v1beta1.Vote} message Vote + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Vote.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.proposalId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.proposalId = options.longs === String ? "0" : 0; + object.voter = ""; + object.option = options.enums === String ? "VOTE_OPTION_UNSPECIFIED" : 0; + } + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (typeof message.proposalId === "number") + object.proposalId = options.longs === String ? String(message.proposalId) : message.proposalId; + else + object.proposalId = options.longs === String ? $util.Long.prototype.toString.call(message.proposalId) : options.longs === Number ? new $util.LongBits(message.proposalId.low >>> 0, message.proposalId.high >>> 0).toNumber(true) : message.proposalId; + if (message.voter != null && message.hasOwnProperty("voter")) + object.voter = message.voter; + if (message.option != null && message.hasOwnProperty("option")) + object.option = options.enums === String ? $root.cosmos.gov.v1beta1.VoteOption[message.option] : message.option; + return object; + }; + + /** + * Converts this Vote to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.Vote + * @instance + * @returns {Object.} JSON object + */ + Vote.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Vote; + })(v1beta1.Vote || {}); + + v1beta1.DepositParams = (function(DepositParams) { + + /** + * Properties of a DepositParams. + * @memberof cosmos.gov.v1beta1 + * @interface IDepositParams + * @property {Array.|null} [minDeposit] DepositParams minDeposit + * @property {google.protobuf.IDuration|null} [maxDepositPeriod] DepositParams maxDepositPeriod + */ + + /** + * Constructs a new DepositParams. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a DepositParams. + * @implements IDepositParams + * @constructor + * @param {cosmos.gov.v1beta1.IDepositParams=} [properties] Properties to set + */ + function DepositParams(properties) { + this.minDeposit = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DepositParams minDeposit. + * @member {Array.} minDeposit + * @memberof cosmos.gov.v1beta1.DepositParams + * @instance + */ + DepositParams.prototype.minDeposit = $util.emptyArray; + + /** + * DepositParams maxDepositPeriod. + * @member {google.protobuf.IDuration|null|undefined} maxDepositPeriod + * @memberof cosmos.gov.v1beta1.DepositParams + * @instance + */ + DepositParams.prototype.maxDepositPeriod = null; + + /** + * Creates a new DepositParams instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.DepositParams + * @static + * @param {cosmos.gov.v1beta1.IDepositParams=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.DepositParams} DepositParams instance + */ + DepositParams.create = function create(properties) { + return new DepositParams(properties); + }; + + /** + * Encodes the specified DepositParams message. Does not implicitly {@link cosmos.gov.v1beta1.DepositParams.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.DepositParams + * @static + * @param {cosmos.gov.v1beta1.IDepositParams} message DepositParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DepositParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minDeposit != null && message.minDeposit.length) + for (var i = 0; i < message.minDeposit.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.minDeposit[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.maxDepositPeriod != null && Object.hasOwnProperty.call(message, "maxDepositPeriod")) + $root.google.protobuf.Duration.encode(message.maxDepositPeriod, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DepositParams message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.DepositParams.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.DepositParams + * @static + * @param {cosmos.gov.v1beta1.IDepositParams} message DepositParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DepositParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DepositParams message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.DepositParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.DepositParams} DepositParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DepositParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.DepositParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.minDeposit && message.minDeposit.length)) + message.minDeposit = []; + message.minDeposit.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + case 2: + message.maxDepositPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DepositParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.DepositParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.DepositParams} DepositParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DepositParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DepositParams message. + * @function verify + * @memberof cosmos.gov.v1beta1.DepositParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DepositParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.minDeposit != null && message.hasOwnProperty("minDeposit")) { + if (!Array.isArray(message.minDeposit)) + return "minDeposit: array expected"; + for (var i = 0; i < message.minDeposit.length; ++i) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.minDeposit[i]); + if (error) + return "minDeposit." + error; + } + } + if (message.maxDepositPeriod != null && message.hasOwnProperty("maxDepositPeriod")) { + var error = $root.google.protobuf.Duration.verify(message.maxDepositPeriod); + if (error) + return "maxDepositPeriod." + error; + } + return null; + }; + + /** + * Creates a DepositParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.DepositParams + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.DepositParams} DepositParams + */ + DepositParams.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.DepositParams) + return object; + var message = new $root.cosmos.gov.v1beta1.DepositParams(); + if (object.minDeposit) { + if (!Array.isArray(object.minDeposit)) + throw TypeError(".cosmos.gov.v1beta1.DepositParams.minDeposit: array expected"); + message.minDeposit = []; + for (var i = 0; i < object.minDeposit.length; ++i) { + if (typeof object.minDeposit[i] !== "object") + throw TypeError(".cosmos.gov.v1beta1.DepositParams.minDeposit: object expected"); + message.minDeposit[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.minDeposit[i]); + } + } + if (object.maxDepositPeriod != null) { + if (typeof object.maxDepositPeriod !== "object") + throw TypeError(".cosmos.gov.v1beta1.DepositParams.maxDepositPeriod: object expected"); + message.maxDepositPeriod = $root.google.protobuf.Duration.fromObject(object.maxDepositPeriod); + } + return message; + }; + + /** + * Creates a plain object from a DepositParams message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.DepositParams + * @static + * @param {cosmos.gov.v1beta1.DepositParams} message DepositParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DepositParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.minDeposit = []; + if (options.defaults) + object.maxDepositPeriod = null; + if (message.minDeposit && message.minDeposit.length) { + object.minDeposit = []; + for (var j = 0; j < message.minDeposit.length; ++j) + object.minDeposit[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.minDeposit[j], options); + } + if (message.maxDepositPeriod != null && message.hasOwnProperty("maxDepositPeriod")) + object.maxDepositPeriod = $root.google.protobuf.Duration.toObject(message.maxDepositPeriod, options); + return object; + }; + + /** + * Converts this DepositParams to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.DepositParams + * @instance + * @returns {Object.} JSON object + */ + DepositParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DepositParams; + })(v1beta1.DepositParams || {}); + + v1beta1.VotingParams = (function(VotingParams) { + + /** + * Properties of a VotingParams. + * @memberof cosmos.gov.v1beta1 + * @interface IVotingParams + * @property {google.protobuf.IDuration|null} [votingPeriod] VotingParams votingPeriod + */ + + /** + * Constructs a new VotingParams. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a VotingParams. + * @implements IVotingParams + * @constructor + * @param {cosmos.gov.v1beta1.IVotingParams=} [properties] Properties to set + */ + function VotingParams(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VotingParams votingPeriod. + * @member {google.protobuf.IDuration|null|undefined} votingPeriod + * @memberof cosmos.gov.v1beta1.VotingParams + * @instance + */ + VotingParams.prototype.votingPeriod = null; + + /** + * Creates a new VotingParams instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.VotingParams + * @static + * @param {cosmos.gov.v1beta1.IVotingParams=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.VotingParams} VotingParams instance + */ + VotingParams.create = function create(properties) { + return new VotingParams(properties); + }; + + /** + * Encodes the specified VotingParams message. Does not implicitly {@link cosmos.gov.v1beta1.VotingParams.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.VotingParams + * @static + * @param {cosmos.gov.v1beta1.IVotingParams} message VotingParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VotingParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.votingPeriod != null && Object.hasOwnProperty.call(message, "votingPeriod")) + $root.google.protobuf.Duration.encode(message.votingPeriod, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VotingParams message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.VotingParams.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.VotingParams + * @static + * @param {cosmos.gov.v1beta1.IVotingParams} message VotingParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VotingParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VotingParams message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.VotingParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.VotingParams} VotingParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VotingParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.VotingParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votingPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VotingParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.VotingParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.VotingParams} VotingParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VotingParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VotingParams message. + * @function verify + * @memberof cosmos.gov.v1beta1.VotingParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VotingParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.votingPeriod != null && message.hasOwnProperty("votingPeriod")) { + var error = $root.google.protobuf.Duration.verify(message.votingPeriod); + if (error) + return "votingPeriod." + error; + } + return null; + }; + + /** + * Creates a VotingParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.VotingParams + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.VotingParams} VotingParams + */ + VotingParams.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.VotingParams) + return object; + var message = new $root.cosmos.gov.v1beta1.VotingParams(); + if (object.votingPeriod != null) { + if (typeof object.votingPeriod !== "object") + throw TypeError(".cosmos.gov.v1beta1.VotingParams.votingPeriod: object expected"); + message.votingPeriod = $root.google.protobuf.Duration.fromObject(object.votingPeriod); + } + return message; + }; + + /** + * Creates a plain object from a VotingParams message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.VotingParams + * @static + * @param {cosmos.gov.v1beta1.VotingParams} message VotingParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VotingParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.votingPeriod = null; + if (message.votingPeriod != null && message.hasOwnProperty("votingPeriod")) + object.votingPeriod = $root.google.protobuf.Duration.toObject(message.votingPeriod, options); + return object; + }; + + /** + * Converts this VotingParams to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.VotingParams + * @instance + * @returns {Object.} JSON object + */ + VotingParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VotingParams; + })(v1beta1.VotingParams || {}); + + v1beta1.TallyParams = (function(TallyParams) { + + /** + * Properties of a TallyParams. + * @memberof cosmos.gov.v1beta1 + * @interface ITallyParams + * @property {Uint8Array|null} [quorum] TallyParams quorum + * @property {Uint8Array|null} [threshold] TallyParams threshold + * @property {Uint8Array|null} [vetoThreshold] TallyParams vetoThreshold + */ + + /** + * Constructs a new TallyParams. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a TallyParams. + * @implements ITallyParams + * @constructor + * @param {cosmos.gov.v1beta1.ITallyParams=} [properties] Properties to set + */ + function TallyParams(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TallyParams quorum. + * @member {Uint8Array} quorum + * @memberof cosmos.gov.v1beta1.TallyParams + * @instance + */ + TallyParams.prototype.quorum = $util.newBuffer([]); + + /** + * TallyParams threshold. + * @member {Uint8Array} threshold + * @memberof cosmos.gov.v1beta1.TallyParams + * @instance + */ + TallyParams.prototype.threshold = $util.newBuffer([]); + + /** + * TallyParams vetoThreshold. + * @member {Uint8Array} vetoThreshold + * @memberof cosmos.gov.v1beta1.TallyParams + * @instance + */ + TallyParams.prototype.vetoThreshold = $util.newBuffer([]); + + /** + * Creates a new TallyParams instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.TallyParams + * @static + * @param {cosmos.gov.v1beta1.ITallyParams=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.TallyParams} TallyParams instance + */ + TallyParams.create = function create(properties) { + return new TallyParams(properties); + }; + + /** + * Encodes the specified TallyParams message. Does not implicitly {@link cosmos.gov.v1beta1.TallyParams.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.TallyParams + * @static + * @param {cosmos.gov.v1beta1.ITallyParams} message TallyParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TallyParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quorum != null && Object.hasOwnProperty.call(message, "quorum")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.quorum); + if (message.threshold != null && Object.hasOwnProperty.call(message, "threshold")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.threshold); + if (message.vetoThreshold != null && Object.hasOwnProperty.call(message, "vetoThreshold")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.vetoThreshold); + return writer; + }; + + /** + * Encodes the specified TallyParams message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.TallyParams.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.TallyParams + * @static + * @param {cosmos.gov.v1beta1.ITallyParams} message TallyParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TallyParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TallyParams message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.TallyParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.TallyParams} TallyParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TallyParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.TallyParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.quorum = reader.bytes(); + break; + case 2: + message.threshold = reader.bytes(); + break; + case 3: + message.vetoThreshold = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TallyParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.TallyParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.TallyParams} TallyParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TallyParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TallyParams message. + * @function verify + * @memberof cosmos.gov.v1beta1.TallyParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TallyParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quorum != null && message.hasOwnProperty("quorum")) + if (!(message.quorum && typeof message.quorum.length === "number" || $util.isString(message.quorum))) + return "quorum: buffer expected"; + if (message.threshold != null && message.hasOwnProperty("threshold")) + if (!(message.threshold && typeof message.threshold.length === "number" || $util.isString(message.threshold))) + return "threshold: buffer expected"; + if (message.vetoThreshold != null && message.hasOwnProperty("vetoThreshold")) + if (!(message.vetoThreshold && typeof message.vetoThreshold.length === "number" || $util.isString(message.vetoThreshold))) + return "vetoThreshold: buffer expected"; + return null; + }; + + /** + * Creates a TallyParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.TallyParams + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.TallyParams} TallyParams + */ + TallyParams.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.TallyParams) + return object; + var message = new $root.cosmos.gov.v1beta1.TallyParams(); + if (object.quorum != null) + if (typeof object.quorum === "string") + $util.base64.decode(object.quorum, message.quorum = $util.newBuffer($util.base64.length(object.quorum)), 0); + else if (object.quorum.length) + message.quorum = object.quorum; + if (object.threshold != null) + if (typeof object.threshold === "string") + $util.base64.decode(object.threshold, message.threshold = $util.newBuffer($util.base64.length(object.threshold)), 0); + else if (object.threshold.length) + message.threshold = object.threshold; + if (object.vetoThreshold != null) + if (typeof object.vetoThreshold === "string") + $util.base64.decode(object.vetoThreshold, message.vetoThreshold = $util.newBuffer($util.base64.length(object.vetoThreshold)), 0); + else if (object.vetoThreshold.length) + message.vetoThreshold = object.vetoThreshold; + return message; + }; + + /** + * Creates a plain object from a TallyParams message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.TallyParams + * @static + * @param {cosmos.gov.v1beta1.TallyParams} message TallyParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TallyParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.quorum = ""; + else { + object.quorum = []; + if (options.bytes !== Array) + object.quorum = $util.newBuffer(object.quorum); + } + if (options.bytes === String) + object.threshold = ""; + else { + object.threshold = []; + if (options.bytes !== Array) + object.threshold = $util.newBuffer(object.threshold); + } + if (options.bytes === String) + object.vetoThreshold = ""; + else { + object.vetoThreshold = []; + if (options.bytes !== Array) + object.vetoThreshold = $util.newBuffer(object.vetoThreshold); + } + } + if (message.quorum != null && message.hasOwnProperty("quorum")) + object.quorum = options.bytes === String ? $util.base64.encode(message.quorum, 0, message.quorum.length) : options.bytes === Array ? Array.prototype.slice.call(message.quorum) : message.quorum; + if (message.threshold != null && message.hasOwnProperty("threshold")) + object.threshold = options.bytes === String ? $util.base64.encode(message.threshold, 0, message.threshold.length) : options.bytes === Array ? Array.prototype.slice.call(message.threshold) : message.threshold; + if (message.vetoThreshold != null && message.hasOwnProperty("vetoThreshold")) + object.vetoThreshold = options.bytes === String ? $util.base64.encode(message.vetoThreshold, 0, message.vetoThreshold.length) : options.bytes === Array ? Array.prototype.slice.call(message.vetoThreshold) : message.vetoThreshold; + return object; + }; + + /** + * Converts this TallyParams to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.TallyParams + * @instance + * @returns {Object.} JSON object + */ + TallyParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TallyParams; + })(v1beta1.TallyParams || {}); + + v1beta1.Msg = (function(Msg) { + + /** + * Constructs a new Msg service. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a Msg + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Msg(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; + + /** + * Creates new Msg service using the specified rpc implementation. + * @function create + * @memberof cosmos.gov.v1beta1.Msg + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Msg} RPC service. Useful where requests and/or responses are streamed. + */ + Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.gov.v1beta1.Msg#submitProposal}. + * @memberof cosmos.gov.v1beta1.Msg + * @typedef SubmitProposalCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.gov.v1beta1.IMsgSubmitProposalResponse} [response] MsgSubmitProposalResponse + */ + + /** + * Calls SubmitProposal. + * @function submitProposal + * @memberof cosmos.gov.v1beta1.Msg + * @instance + * @param {cosmos.gov.v1beta1.IMsgSubmitProposal} request MsgSubmitProposal message or plain object + * @param {cosmos.gov.v1beta1.Msg.SubmitProposalCallback} callback Node-style callback called with the error, if any, and MsgSubmitProposalResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.submitProposal = function submitProposal(request, callback) { + return this.rpcCall(submitProposal, $root.cosmos.gov.v1beta1.MsgSubmitProposal, $root.cosmos.gov.v1beta1.MsgSubmitProposalResponse, request, callback); + }, "name", { value: "SubmitProposal" }); + + /** + * Calls SubmitProposal. + * @function submitProposal + * @memberof cosmos.gov.v1beta1.Msg + * @instance + * @param {cosmos.gov.v1beta1.IMsgSubmitProposal} request MsgSubmitProposal message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.gov.v1beta1.Msg#vote}. + * @memberof cosmos.gov.v1beta1.Msg + * @typedef VoteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.gov.v1beta1.IMsgVoteResponse} [response] MsgVoteResponse + */ + + /** + * Calls Vote. + * @function vote + * @memberof cosmos.gov.v1beta1.Msg + * @instance + * @param {cosmos.gov.v1beta1.IMsgVote} request MsgVote message or plain object + * @param {cosmos.gov.v1beta1.Msg.VoteCallback} callback Node-style callback called with the error, if any, and MsgVoteResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.vote = function vote(request, callback) { + return this.rpcCall(vote, $root.cosmos.gov.v1beta1.MsgVote, $root.cosmos.gov.v1beta1.MsgVoteResponse, request, callback); + }, "name", { value: "Vote" }); + + /** + * Calls Vote. + * @function vote + * @memberof cosmos.gov.v1beta1.Msg + * @instance + * @param {cosmos.gov.v1beta1.IMsgVote} request MsgVote message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.gov.v1beta1.Msg#deposit}. + * @memberof cosmos.gov.v1beta1.Msg + * @typedef DepositCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.gov.v1beta1.IMsgDepositResponse} [response] MsgDepositResponse + */ + + /** + * Calls Deposit. + * @function deposit + * @memberof cosmos.gov.v1beta1.Msg + * @instance + * @param {cosmos.gov.v1beta1.IMsgDeposit} request MsgDeposit message or plain object + * @param {cosmos.gov.v1beta1.Msg.DepositCallback} callback Node-style callback called with the error, if any, and MsgDepositResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.deposit = function deposit(request, callback) { + return this.rpcCall(deposit, $root.cosmos.gov.v1beta1.MsgDeposit, $root.cosmos.gov.v1beta1.MsgDepositResponse, request, callback); + }, "name", { value: "Deposit" }); + + /** + * Calls Deposit. + * @function deposit + * @memberof cosmos.gov.v1beta1.Msg + * @instance + * @param {cosmos.gov.v1beta1.IMsgDeposit} request MsgDeposit message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Msg; + })(v1beta1.Msg || {}); + + v1beta1.MsgSubmitProposal = (function(MsgSubmitProposal) { + + /** + * Properties of a MsgSubmitProposal. + * @memberof cosmos.gov.v1beta1 + * @interface IMsgSubmitProposal + * @property {google.protobuf.IAny|null} [content] MsgSubmitProposal content + * @property {Array.|null} [initialDeposit] MsgSubmitProposal initialDeposit + * @property {string|null} [proposer] MsgSubmitProposal proposer + */ + + /** + * Constructs a new MsgSubmitProposal. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a MsgSubmitProposal. + * @implements IMsgSubmitProposal + * @constructor + * @param {cosmos.gov.v1beta1.IMsgSubmitProposal=} [properties] Properties to set + */ + function MsgSubmitProposal(properties) { + this.initialDeposit = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgSubmitProposal content. + * @member {google.protobuf.IAny|null|undefined} content + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @instance + */ + MsgSubmitProposal.prototype.content = null; + + /** + * MsgSubmitProposal initialDeposit. + * @member {Array.} initialDeposit + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @instance + */ + MsgSubmitProposal.prototype.initialDeposit = $util.emptyArray; + + /** + * MsgSubmitProposal proposer. + * @member {string} proposer + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @instance + */ + MsgSubmitProposal.prototype.proposer = ""; + + /** + * Creates a new MsgSubmitProposal instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @static + * @param {cosmos.gov.v1beta1.IMsgSubmitProposal=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.MsgSubmitProposal} MsgSubmitProposal instance + */ + MsgSubmitProposal.create = function create(properties) { + return new MsgSubmitProposal(properties); + }; + + /** + * Encodes the specified MsgSubmitProposal message. Does not implicitly {@link cosmos.gov.v1beta1.MsgSubmitProposal.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @static + * @param {cosmos.gov.v1beta1.IMsgSubmitProposal} message MsgSubmitProposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitProposal.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + $root.google.protobuf.Any.encode(message.content, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.initialDeposit != null && message.initialDeposit.length) + for (var i = 0; i < message.initialDeposit.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.initialDeposit[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.proposer != null && Object.hasOwnProperty.call(message, "proposer")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.proposer); + return writer; + }; + + /** + * Encodes the specified MsgSubmitProposal message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.MsgSubmitProposal.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @static + * @param {cosmos.gov.v1beta1.IMsgSubmitProposal} message MsgSubmitProposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitProposal.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgSubmitProposal message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.MsgSubmitProposal} MsgSubmitProposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitProposal.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.MsgSubmitProposal(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.content = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.initialDeposit && message.initialDeposit.length)) + message.initialDeposit = []; + message.initialDeposit.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + case 3: + message.proposer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgSubmitProposal message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.MsgSubmitProposal} MsgSubmitProposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitProposal.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgSubmitProposal message. + * @function verify + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgSubmitProposal.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) { + var error = $root.google.protobuf.Any.verify(message.content); + if (error) + return "content." + error; + } + if (message.initialDeposit != null && message.hasOwnProperty("initialDeposit")) { + if (!Array.isArray(message.initialDeposit)) + return "initialDeposit: array expected"; + for (var i = 0; i < message.initialDeposit.length; ++i) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.initialDeposit[i]); + if (error) + return "initialDeposit." + error; + } + } + if (message.proposer != null && message.hasOwnProperty("proposer")) + if (!$util.isString(message.proposer)) + return "proposer: string expected"; + return null; + }; + + /** + * Creates a MsgSubmitProposal message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.MsgSubmitProposal} MsgSubmitProposal + */ + MsgSubmitProposal.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.MsgSubmitProposal) + return object; + var message = new $root.cosmos.gov.v1beta1.MsgSubmitProposal(); + if (object.content != null) { + if (typeof object.content !== "object") + throw TypeError(".cosmos.gov.v1beta1.MsgSubmitProposal.content: object expected"); + message.content = $root.google.protobuf.Any.fromObject(object.content); + } + if (object.initialDeposit) { + if (!Array.isArray(object.initialDeposit)) + throw TypeError(".cosmos.gov.v1beta1.MsgSubmitProposal.initialDeposit: array expected"); + message.initialDeposit = []; + for (var i = 0; i < object.initialDeposit.length; ++i) { + if (typeof object.initialDeposit[i] !== "object") + throw TypeError(".cosmos.gov.v1beta1.MsgSubmitProposal.initialDeposit: object expected"); + message.initialDeposit[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.initialDeposit[i]); + } + } + if (object.proposer != null) + message.proposer = String(object.proposer); + return message; + }; + + /** + * Creates a plain object from a MsgSubmitProposal message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @static + * @param {cosmos.gov.v1beta1.MsgSubmitProposal} message MsgSubmitProposal + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSubmitProposal.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.initialDeposit = []; + if (options.defaults) { + object.content = null; + object.proposer = ""; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = $root.google.protobuf.Any.toObject(message.content, options); + if (message.initialDeposit && message.initialDeposit.length) { + object.initialDeposit = []; + for (var j = 0; j < message.initialDeposit.length; ++j) + object.initialDeposit[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.initialDeposit[j], options); + } + if (message.proposer != null && message.hasOwnProperty("proposer")) + object.proposer = message.proposer; + return object; + }; + + /** + * Converts this MsgSubmitProposal to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @instance + * @returns {Object.} JSON object + */ + MsgSubmitProposal.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgSubmitProposal; + })(v1beta1.MsgSubmitProposal || {}); + + v1beta1.MsgSubmitProposalResponse = (function(MsgSubmitProposalResponse) { + + /** + * Properties of a MsgSubmitProposalResponse. + * @memberof cosmos.gov.v1beta1 + * @interface IMsgSubmitProposalResponse + * @property {number|Long|null} [proposalId] MsgSubmitProposalResponse proposalId + */ + + /** + * Constructs a new MsgSubmitProposalResponse. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a MsgSubmitProposalResponse. + * @implements IMsgSubmitProposalResponse + * @constructor + * @param {cosmos.gov.v1beta1.IMsgSubmitProposalResponse=} [properties] Properties to set + */ + function MsgSubmitProposalResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgSubmitProposalResponse proposalId. + * @member {number|Long} proposalId + * @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse + * @instance + */ + MsgSubmitProposalResponse.prototype.proposalId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new MsgSubmitProposalResponse instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse + * @static + * @param {cosmos.gov.v1beta1.IMsgSubmitProposalResponse=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.MsgSubmitProposalResponse} MsgSubmitProposalResponse instance + */ + MsgSubmitProposalResponse.create = function create(properties) { + return new MsgSubmitProposalResponse(properties); + }; + + /** + * Encodes the specified MsgSubmitProposalResponse message. Does not implicitly {@link cosmos.gov.v1beta1.MsgSubmitProposalResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse + * @static + * @param {cosmos.gov.v1beta1.IMsgSubmitProposalResponse} message MsgSubmitProposalResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitProposalResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proposalId != null && Object.hasOwnProperty.call(message, "proposalId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposalId); + return writer; + }; + + /** + * Encodes the specified MsgSubmitProposalResponse message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.MsgSubmitProposalResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse + * @static + * @param {cosmos.gov.v1beta1.IMsgSubmitProposalResponse} message MsgSubmitProposalResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitProposalResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgSubmitProposalResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.MsgSubmitProposalResponse} MsgSubmitProposalResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitProposalResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.MsgSubmitProposalResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgSubmitProposalResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.MsgSubmitProposalResponse} MsgSubmitProposalResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitProposalResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgSubmitProposalResponse message. + * @function verify + * @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgSubmitProposalResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (!$util.isInteger(message.proposalId) && !(message.proposalId && $util.isInteger(message.proposalId.low) && $util.isInteger(message.proposalId.high))) + return "proposalId: integer|Long expected"; + return null; + }; + + /** + * Creates a MsgSubmitProposalResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.MsgSubmitProposalResponse} MsgSubmitProposalResponse + */ + MsgSubmitProposalResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.MsgSubmitProposalResponse) + return object; + var message = new $root.cosmos.gov.v1beta1.MsgSubmitProposalResponse(); + if (object.proposalId != null) + if ($util.Long) + (message.proposalId = $util.Long.fromValue(object.proposalId)).unsigned = true; + else if (typeof object.proposalId === "string") + message.proposalId = parseInt(object.proposalId, 10); + else if (typeof object.proposalId === "number") + message.proposalId = object.proposalId; + else if (typeof object.proposalId === "object") + message.proposalId = new $util.LongBits(object.proposalId.low >>> 0, object.proposalId.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a MsgSubmitProposalResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse + * @static + * @param {cosmos.gov.v1beta1.MsgSubmitProposalResponse} message MsgSubmitProposalResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSubmitProposalResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.proposalId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.proposalId = options.longs === String ? "0" : 0; + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (typeof message.proposalId === "number") + object.proposalId = options.longs === String ? String(message.proposalId) : message.proposalId; + else + object.proposalId = options.longs === String ? $util.Long.prototype.toString.call(message.proposalId) : options.longs === Number ? new $util.LongBits(message.proposalId.low >>> 0, message.proposalId.high >>> 0).toNumber(true) : message.proposalId; + return object; + }; + + /** + * Converts this MsgSubmitProposalResponse to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse + * @instance + * @returns {Object.} JSON object + */ + MsgSubmitProposalResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgSubmitProposalResponse; + })(v1beta1.MsgSubmitProposalResponse || {}); + + v1beta1.MsgVote = (function(MsgVote) { + + /** + * Properties of a MsgVote. + * @memberof cosmos.gov.v1beta1 + * @interface IMsgVote + * @property {number|Long|null} [proposalId] MsgVote proposalId + * @property {string|null} [voter] MsgVote voter + * @property {cosmos.gov.v1beta1.VoteOption|null} [option] MsgVote option + */ + + /** + * Constructs a new MsgVote. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a MsgVote. + * @implements IMsgVote + * @constructor + * @param {cosmos.gov.v1beta1.IMsgVote=} [properties] Properties to set + */ + function MsgVote(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgVote proposalId. + * @member {number|Long} proposalId + * @memberof cosmos.gov.v1beta1.MsgVote + * @instance + */ + MsgVote.prototype.proposalId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * MsgVote voter. + * @member {string} voter + * @memberof cosmos.gov.v1beta1.MsgVote + * @instance + */ + MsgVote.prototype.voter = ""; + + /** + * MsgVote option. + * @member {cosmos.gov.v1beta1.VoteOption} option + * @memberof cosmos.gov.v1beta1.MsgVote + * @instance + */ + MsgVote.prototype.option = 0; + + /** + * Creates a new MsgVote instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.MsgVote + * @static + * @param {cosmos.gov.v1beta1.IMsgVote=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.MsgVote} MsgVote instance + */ + MsgVote.create = function create(properties) { + return new MsgVote(properties); + }; + + /** + * Encodes the specified MsgVote message. Does not implicitly {@link cosmos.gov.v1beta1.MsgVote.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.MsgVote + * @static + * @param {cosmos.gov.v1beta1.IMsgVote} message MsgVote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgVote.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proposalId != null && Object.hasOwnProperty.call(message, "proposalId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposalId); + if (message.voter != null && Object.hasOwnProperty.call(message, "voter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.voter); + if (message.option != null && Object.hasOwnProperty.call(message, "option")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.option); + return writer; + }; + + /** + * Encodes the specified MsgVote message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.MsgVote.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.MsgVote + * @static + * @param {cosmos.gov.v1beta1.IMsgVote} message MsgVote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgVote.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgVote message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.MsgVote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.MsgVote} MsgVote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgVote.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.MsgVote(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.voter = reader.string(); + break; + case 3: + message.option = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgVote message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.MsgVote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.MsgVote} MsgVote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgVote.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgVote message. + * @function verify + * @memberof cosmos.gov.v1beta1.MsgVote + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgVote.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (!$util.isInteger(message.proposalId) && !(message.proposalId && $util.isInteger(message.proposalId.low) && $util.isInteger(message.proposalId.high))) + return "proposalId: integer|Long expected"; + if (message.voter != null && message.hasOwnProperty("voter")) + if (!$util.isString(message.voter)) + return "voter: string expected"; + if (message.option != null && message.hasOwnProperty("option")) + switch (message.option) { + default: + return "option: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a MsgVote message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.MsgVote + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.MsgVote} MsgVote + */ + MsgVote.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.MsgVote) + return object; + var message = new $root.cosmos.gov.v1beta1.MsgVote(); + if (object.proposalId != null) + if ($util.Long) + (message.proposalId = $util.Long.fromValue(object.proposalId)).unsigned = true; + else if (typeof object.proposalId === "string") + message.proposalId = parseInt(object.proposalId, 10); + else if (typeof object.proposalId === "number") + message.proposalId = object.proposalId; + else if (typeof object.proposalId === "object") + message.proposalId = new $util.LongBits(object.proposalId.low >>> 0, object.proposalId.high >>> 0).toNumber(true); + if (object.voter != null) + message.voter = String(object.voter); + switch (object.option) { + case "VOTE_OPTION_UNSPECIFIED": + case 0: + message.option = 0; + break; + case "VOTE_OPTION_YES": + case 1: + message.option = 1; + break; + case "VOTE_OPTION_ABSTAIN": + case 2: + message.option = 2; + break; + case "VOTE_OPTION_NO": + case 3: + message.option = 3; + break; + case "VOTE_OPTION_NO_WITH_VETO": + case 4: + message.option = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a MsgVote message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.MsgVote + * @static + * @param {cosmos.gov.v1beta1.MsgVote} message MsgVote + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgVote.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.proposalId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.proposalId = options.longs === String ? "0" : 0; + object.voter = ""; + object.option = options.enums === String ? "VOTE_OPTION_UNSPECIFIED" : 0; + } + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (typeof message.proposalId === "number") + object.proposalId = options.longs === String ? String(message.proposalId) : message.proposalId; + else + object.proposalId = options.longs === String ? $util.Long.prototype.toString.call(message.proposalId) : options.longs === Number ? new $util.LongBits(message.proposalId.low >>> 0, message.proposalId.high >>> 0).toNumber(true) : message.proposalId; + if (message.voter != null && message.hasOwnProperty("voter")) + object.voter = message.voter; + if (message.option != null && message.hasOwnProperty("option")) + object.option = options.enums === String ? $root.cosmos.gov.v1beta1.VoteOption[message.option] : message.option; + return object; + }; + + /** + * Converts this MsgVote to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.MsgVote + * @instance + * @returns {Object.} JSON object + */ + MsgVote.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgVote; + })(v1beta1.MsgVote || {}); + + v1beta1.MsgVoteResponse = (function(MsgVoteResponse) { + + /** + * Properties of a MsgVoteResponse. + * @memberof cosmos.gov.v1beta1 + * @interface IMsgVoteResponse + */ + + /** + * Constructs a new MsgVoteResponse. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a MsgVoteResponse. + * @implements IMsgVoteResponse + * @constructor + * @param {cosmos.gov.v1beta1.IMsgVoteResponse=} [properties] Properties to set + */ + function MsgVoteResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgVoteResponse instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.MsgVoteResponse + * @static + * @param {cosmos.gov.v1beta1.IMsgVoteResponse=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.MsgVoteResponse} MsgVoteResponse instance + */ + MsgVoteResponse.create = function create(properties) { + return new MsgVoteResponse(properties); + }; + + /** + * Encodes the specified MsgVoteResponse message. Does not implicitly {@link cosmos.gov.v1beta1.MsgVoteResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.MsgVoteResponse + * @static + * @param {cosmos.gov.v1beta1.IMsgVoteResponse} message MsgVoteResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgVoteResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgVoteResponse message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.MsgVoteResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.MsgVoteResponse + * @static + * @param {cosmos.gov.v1beta1.IMsgVoteResponse} message MsgVoteResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgVoteResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgVoteResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.MsgVoteResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.MsgVoteResponse} MsgVoteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgVoteResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.MsgVoteResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgVoteResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.MsgVoteResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.MsgVoteResponse} MsgVoteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgVoteResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgVoteResponse message. + * @function verify + * @memberof cosmos.gov.v1beta1.MsgVoteResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgVoteResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgVoteResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.MsgVoteResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.MsgVoteResponse} MsgVoteResponse + */ + MsgVoteResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.MsgVoteResponse) + return object; + return new $root.cosmos.gov.v1beta1.MsgVoteResponse(); + }; + + /** + * Creates a plain object from a MsgVoteResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.MsgVoteResponse + * @static + * @param {cosmos.gov.v1beta1.MsgVoteResponse} message MsgVoteResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgVoteResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgVoteResponse to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.MsgVoteResponse + * @instance + * @returns {Object.} JSON object + */ + MsgVoteResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgVoteResponse; + })(v1beta1.MsgVoteResponse || {}); + + v1beta1.MsgDeposit = (function(MsgDeposit) { + + /** + * Properties of a MsgDeposit. + * @memberof cosmos.gov.v1beta1 + * @interface IMsgDeposit + * @property {number|Long|null} [proposalId] MsgDeposit proposalId + * @property {string|null} [depositor] MsgDeposit depositor + * @property {Array.|null} [amount] MsgDeposit amount + */ + + /** + * Constructs a new MsgDeposit. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a MsgDeposit. + * @implements IMsgDeposit + * @constructor + * @param {cosmos.gov.v1beta1.IMsgDeposit=} [properties] Properties to set + */ + function MsgDeposit(properties) { + this.amount = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgDeposit proposalId. + * @member {number|Long} proposalId + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @instance + */ + MsgDeposit.prototype.proposalId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * MsgDeposit depositor. + * @member {string} depositor + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @instance + */ + MsgDeposit.prototype.depositor = ""; + + /** + * MsgDeposit amount. + * @member {Array.} amount + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @instance + */ + MsgDeposit.prototype.amount = $util.emptyArray; + + /** + * Creates a new MsgDeposit instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @static + * @param {cosmos.gov.v1beta1.IMsgDeposit=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.MsgDeposit} MsgDeposit instance + */ + MsgDeposit.create = function create(properties) { + return new MsgDeposit(properties); + }; + + /** + * Encodes the specified MsgDeposit message. Does not implicitly {@link cosmos.gov.v1beta1.MsgDeposit.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @static + * @param {cosmos.gov.v1beta1.IMsgDeposit} message MsgDeposit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgDeposit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proposalId != null && Object.hasOwnProperty.call(message, "proposalId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposalId); + if (message.depositor != null && Object.hasOwnProperty.call(message, "depositor")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.depositor); + if (message.amount != null && message.amount.length) + for (var i = 0; i < message.amount.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.amount[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MsgDeposit message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.MsgDeposit.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @static + * @param {cosmos.gov.v1beta1.IMsgDeposit} message MsgDeposit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgDeposit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgDeposit message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.MsgDeposit} MsgDeposit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgDeposit.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.MsgDeposit(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.depositor = reader.string(); + break; + case 3: + if (!(message.amount && message.amount.length)) + message.amount = []; + message.amount.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgDeposit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.MsgDeposit} MsgDeposit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgDeposit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgDeposit message. + * @function verify + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgDeposit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (!$util.isInteger(message.proposalId) && !(message.proposalId && $util.isInteger(message.proposalId.low) && $util.isInteger(message.proposalId.high))) + return "proposalId: integer|Long expected"; + if (message.depositor != null && message.hasOwnProperty("depositor")) + if (!$util.isString(message.depositor)) + return "depositor: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + if (!Array.isArray(message.amount)) + return "amount: array expected"; + for (var i = 0; i < message.amount.length; ++i) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.amount[i]); + if (error) + return "amount." + error; + } + } + return null; + }; + + /** + * Creates a MsgDeposit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.MsgDeposit} MsgDeposit + */ + MsgDeposit.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.MsgDeposit) + return object; + var message = new $root.cosmos.gov.v1beta1.MsgDeposit(); + if (object.proposalId != null) + if ($util.Long) + (message.proposalId = $util.Long.fromValue(object.proposalId)).unsigned = true; + else if (typeof object.proposalId === "string") + message.proposalId = parseInt(object.proposalId, 10); + else if (typeof object.proposalId === "number") + message.proposalId = object.proposalId; + else if (typeof object.proposalId === "object") + message.proposalId = new $util.LongBits(object.proposalId.low >>> 0, object.proposalId.high >>> 0).toNumber(true); + if (object.depositor != null) + message.depositor = String(object.depositor); + if (object.amount) { + if (!Array.isArray(object.amount)) + throw TypeError(".cosmos.gov.v1beta1.MsgDeposit.amount: array expected"); + message.amount = []; + for (var i = 0; i < object.amount.length; ++i) { + if (typeof object.amount[i] !== "object") + throw TypeError(".cosmos.gov.v1beta1.MsgDeposit.amount: object expected"); + message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MsgDeposit message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @static + * @param {cosmos.gov.v1beta1.MsgDeposit} message MsgDeposit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgDeposit.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.amount = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.proposalId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.proposalId = options.longs === String ? "0" : 0; + object.depositor = ""; + } + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (typeof message.proposalId === "number") + object.proposalId = options.longs === String ? String(message.proposalId) : message.proposalId; + else + object.proposalId = options.longs === String ? $util.Long.prototype.toString.call(message.proposalId) : options.longs === Number ? new $util.LongBits(message.proposalId.low >>> 0, message.proposalId.high >>> 0).toNumber(true) : message.proposalId; + if (message.depositor != null && message.hasOwnProperty("depositor")) + object.depositor = message.depositor; + if (message.amount && message.amount.length) { + object.amount = []; + for (var j = 0; j < message.amount.length; ++j) + object.amount[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.amount[j], options); + } + return object; + }; + + /** + * Converts this MsgDeposit to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @instance + * @returns {Object.} JSON object + */ + MsgDeposit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgDeposit; + })(v1beta1.MsgDeposit || {}); + + v1beta1.MsgDepositResponse = (function(MsgDepositResponse) { + + /** + * Properties of a MsgDepositResponse. + * @memberof cosmos.gov.v1beta1 + * @interface IMsgDepositResponse + */ + + /** + * Constructs a new MsgDepositResponse. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a MsgDepositResponse. + * @implements IMsgDepositResponse + * @constructor + * @param {cosmos.gov.v1beta1.IMsgDepositResponse=} [properties] Properties to set + */ + function MsgDepositResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgDepositResponse instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.MsgDepositResponse + * @static + * @param {cosmos.gov.v1beta1.IMsgDepositResponse=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.MsgDepositResponse} MsgDepositResponse instance + */ + MsgDepositResponse.create = function create(properties) { + return new MsgDepositResponse(properties); + }; + + /** + * Encodes the specified MsgDepositResponse message. Does not implicitly {@link cosmos.gov.v1beta1.MsgDepositResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.MsgDepositResponse + * @static + * @param {cosmos.gov.v1beta1.IMsgDepositResponse} message MsgDepositResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgDepositResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgDepositResponse message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.MsgDepositResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.MsgDepositResponse + * @static + * @param {cosmos.gov.v1beta1.IMsgDepositResponse} message MsgDepositResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgDepositResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgDepositResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.MsgDepositResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.MsgDepositResponse} MsgDepositResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgDepositResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.MsgDepositResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgDepositResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.MsgDepositResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.MsgDepositResponse} MsgDepositResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgDepositResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgDepositResponse message. + * @function verify + * @memberof cosmos.gov.v1beta1.MsgDepositResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgDepositResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgDepositResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.MsgDepositResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.MsgDepositResponse} MsgDepositResponse + */ + MsgDepositResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.MsgDepositResponse) + return object; + return new $root.cosmos.gov.v1beta1.MsgDepositResponse(); + }; + + /** + * Creates a plain object from a MsgDepositResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.MsgDepositResponse + * @static + * @param {cosmos.gov.v1beta1.MsgDepositResponse} message MsgDepositResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgDepositResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgDepositResponse to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.MsgDepositResponse + * @instance + * @returns {Object.} JSON object + */ + MsgDepositResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgDepositResponse; + })(v1beta1.MsgDepositResponse || {}); + + return v1beta1; + })(gov.v1beta1 || {}); + + return gov; + })(cosmos.gov || {}); + + /** + * Namespace staking. + * @memberof cosmos + * @namespace + */ + + cosmos.staking = (function(staking) { + + /** + * Namespace v1beta1. + * @memberof cosmos.staking + * @namespace + */ + + staking.v1beta1 = (function(v1beta1) { + + v1beta1.HistoricalInfo = (function(HistoricalInfo) { + + /** + * Properties of a HistoricalInfo. + * @memberof cosmos.staking.v1beta1 + * @interface IHistoricalInfo + * @property {tendermint.types.IHeader|null} [header] HistoricalInfo header + * @property {Array.|null} [valset] HistoricalInfo valset + */ + + /** + * Constructs a new HistoricalInfo. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a HistoricalInfo. + * @implements IHistoricalInfo + * @constructor + * @param {cosmos.staking.v1beta1.IHistoricalInfo=} [properties] Properties to set + */ + function HistoricalInfo(properties) { + this.valset = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HistoricalInfo header. + * @member {tendermint.types.IHeader|null|undefined} header + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @instance + */ + HistoricalInfo.prototype.header = null; + + /** + * HistoricalInfo valset. + * @member {Array.} valset + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @instance + */ + HistoricalInfo.prototype.valset = $util.emptyArray; + + /** + * Creates a new HistoricalInfo instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @static + * @param {cosmos.staking.v1beta1.IHistoricalInfo=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.HistoricalInfo} HistoricalInfo instance + */ + HistoricalInfo.create = function create(properties) { + return new HistoricalInfo(properties); + }; + + /** + * Encodes the specified HistoricalInfo message. Does not implicitly {@link cosmos.staking.v1beta1.HistoricalInfo.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @static + * @param {cosmos.staking.v1beta1.IHistoricalInfo} message HistoricalInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HistoricalInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + $root.tendermint.types.Header.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.valset != null && message.valset.length) + for (var i = 0; i < message.valset.length; ++i) + $root.cosmos.staking.v1beta1.Validator.encode(message.valset[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HistoricalInfo message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.HistoricalInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @static + * @param {cosmos.staking.v1beta1.IHistoricalInfo} message HistoricalInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HistoricalInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HistoricalInfo message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.HistoricalInfo} HistoricalInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HistoricalInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.HistoricalInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.header = $root.tendermint.types.Header.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.valset && message.valset.length)) + message.valset = []; + message.valset.push($root.cosmos.staking.v1beta1.Validator.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HistoricalInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.HistoricalInfo} HistoricalInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HistoricalInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HistoricalInfo message. + * @function verify + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HistoricalInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.header != null && message.hasOwnProperty("header")) { + var error = $root.tendermint.types.Header.verify(message.header); + if (error) + return "header." + error; + } + if (message.valset != null && message.hasOwnProperty("valset")) { + if (!Array.isArray(message.valset)) + return "valset: array expected"; + for (var i = 0; i < message.valset.length; ++i) { + var error = $root.cosmos.staking.v1beta1.Validator.verify(message.valset[i]); + if (error) + return "valset." + error; + } + } + return null; + }; + + /** + * Creates a HistoricalInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.HistoricalInfo} HistoricalInfo + */ + HistoricalInfo.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.HistoricalInfo) + return object; + var message = new $root.cosmos.staking.v1beta1.HistoricalInfo(); + if (object.header != null) { + if (typeof object.header !== "object") + throw TypeError(".cosmos.staking.v1beta1.HistoricalInfo.header: object expected"); + message.header = $root.tendermint.types.Header.fromObject(object.header); + } + if (object.valset) { + if (!Array.isArray(object.valset)) + throw TypeError(".cosmos.staking.v1beta1.HistoricalInfo.valset: array expected"); + message.valset = []; + for (var i = 0; i < object.valset.length; ++i) { + if (typeof object.valset[i] !== "object") + throw TypeError(".cosmos.staking.v1beta1.HistoricalInfo.valset: object expected"); + message.valset[i] = $root.cosmos.staking.v1beta1.Validator.fromObject(object.valset[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HistoricalInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @static + * @param {cosmos.staking.v1beta1.HistoricalInfo} message HistoricalInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HistoricalInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.valset = []; + if (options.defaults) + object.header = null; + if (message.header != null && message.hasOwnProperty("header")) + object.header = $root.tendermint.types.Header.toObject(message.header, options); + if (message.valset && message.valset.length) { + object.valset = []; + for (var j = 0; j < message.valset.length; ++j) + object.valset[j] = $root.cosmos.staking.v1beta1.Validator.toObject(message.valset[j], options); + } + return object; + }; + + /** + * Converts this HistoricalInfo to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @instance + * @returns {Object.} JSON object + */ + HistoricalInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HistoricalInfo; + })(v1beta1.HistoricalInfo || {}); + + v1beta1.CommissionRates = (function(CommissionRates) { + + /** + * Properties of a CommissionRates. + * @memberof cosmos.staking.v1beta1 + * @interface ICommissionRates + * @property {string|null} [rate] CommissionRates rate + * @property {string|null} [maxRate] CommissionRates maxRate + * @property {string|null} [maxChangeRate] CommissionRates maxChangeRate + */ + + /** + * Constructs a new CommissionRates. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a CommissionRates. + * @implements ICommissionRates + * @constructor + * @param {cosmos.staking.v1beta1.ICommissionRates=} [properties] Properties to set + */ + function CommissionRates(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommissionRates rate. + * @member {string} rate + * @memberof cosmos.staking.v1beta1.CommissionRates + * @instance + */ + CommissionRates.prototype.rate = ""; + + /** + * CommissionRates maxRate. + * @member {string} maxRate + * @memberof cosmos.staking.v1beta1.CommissionRates + * @instance + */ + CommissionRates.prototype.maxRate = ""; + + /** + * CommissionRates maxChangeRate. + * @member {string} maxChangeRate + * @memberof cosmos.staking.v1beta1.CommissionRates + * @instance + */ + CommissionRates.prototype.maxChangeRate = ""; + + /** + * Creates a new CommissionRates instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.CommissionRates + * @static + * @param {cosmos.staking.v1beta1.ICommissionRates=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.CommissionRates} CommissionRates instance + */ + CommissionRates.create = function create(properties) { + return new CommissionRates(properties); + }; + + /** + * Encodes the specified CommissionRates message. Does not implicitly {@link cosmos.staking.v1beta1.CommissionRates.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.CommissionRates + * @static + * @param {cosmos.staking.v1beta1.ICommissionRates} message CommissionRates message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommissionRates.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rate != null && Object.hasOwnProperty.call(message, "rate")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.rate); + if (message.maxRate != null && Object.hasOwnProperty.call(message, "maxRate")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.maxRate); + if (message.maxChangeRate != null && Object.hasOwnProperty.call(message, "maxChangeRate")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.maxChangeRate); + return writer; + }; + + /** + * Encodes the specified CommissionRates message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.CommissionRates.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.CommissionRates + * @static + * @param {cosmos.staking.v1beta1.ICommissionRates} message CommissionRates message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommissionRates.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommissionRates message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.CommissionRates + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.CommissionRates} CommissionRates + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommissionRates.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.CommissionRates(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rate = reader.string(); + break; + case 2: + message.maxRate = reader.string(); + break; + case 3: + message.maxChangeRate = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommissionRates message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.CommissionRates + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.CommissionRates} CommissionRates + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommissionRates.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommissionRates message. + * @function verify + * @memberof cosmos.staking.v1beta1.CommissionRates + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommissionRates.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rate != null && message.hasOwnProperty("rate")) + if (!$util.isString(message.rate)) + return "rate: string expected"; + if (message.maxRate != null && message.hasOwnProperty("maxRate")) + if (!$util.isString(message.maxRate)) + return "maxRate: string expected"; + if (message.maxChangeRate != null && message.hasOwnProperty("maxChangeRate")) + if (!$util.isString(message.maxChangeRate)) + return "maxChangeRate: string expected"; + return null; + }; + + /** + * Creates a CommissionRates message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.CommissionRates + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.CommissionRates} CommissionRates + */ + CommissionRates.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.CommissionRates) + return object; + var message = new $root.cosmos.staking.v1beta1.CommissionRates(); + if (object.rate != null) + message.rate = String(object.rate); + if (object.maxRate != null) + message.maxRate = String(object.maxRate); + if (object.maxChangeRate != null) + message.maxChangeRate = String(object.maxChangeRate); + return message; + }; + + /** + * Creates a plain object from a CommissionRates message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.CommissionRates + * @static + * @param {cosmos.staking.v1beta1.CommissionRates} message CommissionRates + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommissionRates.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rate = ""; + object.maxRate = ""; + object.maxChangeRate = ""; + } + if (message.rate != null && message.hasOwnProperty("rate")) + object.rate = message.rate; + if (message.maxRate != null && message.hasOwnProperty("maxRate")) + object.maxRate = message.maxRate; + if (message.maxChangeRate != null && message.hasOwnProperty("maxChangeRate")) + object.maxChangeRate = message.maxChangeRate; + return object; + }; + + /** + * Converts this CommissionRates to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.CommissionRates + * @instance + * @returns {Object.} JSON object + */ + CommissionRates.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CommissionRates; + })(v1beta1.CommissionRates || {}); + + v1beta1.Commission = (function(Commission) { + + /** + * Properties of a Commission. + * @memberof cosmos.staking.v1beta1 + * @interface ICommission + * @property {cosmos.staking.v1beta1.ICommissionRates|null} [commissionRates] Commission commissionRates + * @property {google.protobuf.ITimestamp|null} [updateTime] Commission updateTime + */ + + /** + * Constructs a new Commission. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a Commission. + * @implements ICommission + * @constructor + * @param {cosmos.staking.v1beta1.ICommission=} [properties] Properties to set + */ + function Commission(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Commission commissionRates. + * @member {cosmos.staking.v1beta1.ICommissionRates|null|undefined} commissionRates + * @memberof cosmos.staking.v1beta1.Commission + * @instance + */ + Commission.prototype.commissionRates = null; + + /** + * Commission updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof cosmos.staking.v1beta1.Commission + * @instance + */ + Commission.prototype.updateTime = null; + + /** + * Creates a new Commission instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.Commission + * @static + * @param {cosmos.staking.v1beta1.ICommission=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.Commission} Commission instance + */ + Commission.create = function create(properties) { + return new Commission(properties); + }; + + /** + * Encodes the specified Commission message. Does not implicitly {@link cosmos.staking.v1beta1.Commission.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.Commission + * @static + * @param {cosmos.staking.v1beta1.ICommission} message Commission message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Commission.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commissionRates != null && Object.hasOwnProperty.call(message, "commissionRates")) + $root.cosmos.staking.v1beta1.CommissionRates.encode(message.commissionRates, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Commission message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.Commission.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.Commission + * @static + * @param {cosmos.staking.v1beta1.ICommission} message Commission message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Commission.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Commission message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.Commission + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.Commission} Commission + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Commission.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.Commission(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.commissionRates = $root.cosmos.staking.v1beta1.CommissionRates.decode(reader, reader.uint32()); + break; + case 2: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Commission message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.Commission + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.Commission} Commission + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Commission.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Commission message. + * @function verify + * @memberof cosmos.staking.v1beta1.Commission + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Commission.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commissionRates != null && message.hasOwnProperty("commissionRates")) { + var error = $root.cosmos.staking.v1beta1.CommissionRates.verify(message.commissionRates); + if (error) + return "commissionRates." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a Commission message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.Commission + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.Commission} Commission + */ + Commission.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.Commission) + return object; + var message = new $root.cosmos.staking.v1beta1.Commission(); + if (object.commissionRates != null) { + if (typeof object.commissionRates !== "object") + throw TypeError(".cosmos.staking.v1beta1.Commission.commissionRates: object expected"); + message.commissionRates = $root.cosmos.staking.v1beta1.CommissionRates.fromObject(object.commissionRates); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".cosmos.staking.v1beta1.Commission.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a Commission message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.Commission + * @static + * @param {cosmos.staking.v1beta1.Commission} message Commission + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Commission.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.commissionRates = null; + object.updateTime = null; + } + if (message.commissionRates != null && message.hasOwnProperty("commissionRates")) + object.commissionRates = $root.cosmos.staking.v1beta1.CommissionRates.toObject(message.commissionRates, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this Commission to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.Commission + * @instance + * @returns {Object.} JSON object + */ + Commission.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Commission; + })(v1beta1.Commission || {}); + + v1beta1.Description = (function(Description) { + + /** + * Properties of a Description. + * @memberof cosmos.staking.v1beta1 + * @interface IDescription + * @property {string|null} [moniker] Description moniker + * @property {string|null} [identity] Description identity + * @property {string|null} [website] Description website + * @property {string|null} [securityContact] Description securityContact + * @property {string|null} [details] Description details + */ + + /** + * Constructs a new Description. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a Description. + * @implements IDescription + * @constructor + * @param {cosmos.staking.v1beta1.IDescription=} [properties] Properties to set + */ + function Description(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Description moniker. + * @member {string} moniker + * @memberof cosmos.staking.v1beta1.Description + * @instance + */ + Description.prototype.moniker = ""; + + /** + * Description identity. + * @member {string} identity + * @memberof cosmos.staking.v1beta1.Description + * @instance + */ + Description.prototype.identity = ""; + + /** + * Description website. + * @member {string} website + * @memberof cosmos.staking.v1beta1.Description + * @instance + */ + Description.prototype.website = ""; + + /** + * Description securityContact. + * @member {string} securityContact + * @memberof cosmos.staking.v1beta1.Description + * @instance + */ + Description.prototype.securityContact = ""; + + /** + * Description details. + * @member {string} details + * @memberof cosmos.staking.v1beta1.Description + * @instance + */ + Description.prototype.details = ""; + + /** + * Creates a new Description instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.Description + * @static + * @param {cosmos.staking.v1beta1.IDescription=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.Description} Description instance + */ + Description.create = function create(properties) { + return new Description(properties); + }; + + /** + * Encodes the specified Description message. Does not implicitly {@link cosmos.staking.v1beta1.Description.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.Description + * @static + * @param {cosmos.staking.v1beta1.IDescription} message Description message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Description.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.moniker != null && Object.hasOwnProperty.call(message, "moniker")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.moniker); + if (message.identity != null && Object.hasOwnProperty.call(message, "identity")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.identity); + if (message.website != null && Object.hasOwnProperty.call(message, "website")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.website); + if (message.securityContact != null && Object.hasOwnProperty.call(message, "securityContact")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.securityContact); + if (message.details != null && Object.hasOwnProperty.call(message, "details")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.details); + return writer; + }; + + /** + * Encodes the specified Description message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.Description.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.Description + * @static + * @param {cosmos.staking.v1beta1.IDescription} message Description message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Description.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Description message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.Description + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.Description} Description + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Description.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.Description(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.moniker = reader.string(); + break; + case 2: + message.identity = reader.string(); + break; + case 3: + message.website = reader.string(); + break; + case 4: + message.securityContact = reader.string(); + break; + case 5: + message.details = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Description message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.Description + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.Description} Description + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Description.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Description message. + * @function verify + * @memberof cosmos.staking.v1beta1.Description + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Description.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.moniker != null && message.hasOwnProperty("moniker")) + if (!$util.isString(message.moniker)) + return "moniker: string expected"; + if (message.identity != null && message.hasOwnProperty("identity")) + if (!$util.isString(message.identity)) + return "identity: string expected"; + if (message.website != null && message.hasOwnProperty("website")) + if (!$util.isString(message.website)) + return "website: string expected"; + if (message.securityContact != null && message.hasOwnProperty("securityContact")) + if (!$util.isString(message.securityContact)) + return "securityContact: string expected"; + if (message.details != null && message.hasOwnProperty("details")) + if (!$util.isString(message.details)) + return "details: string expected"; + return null; + }; + + /** + * Creates a Description message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.Description + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.Description} Description + */ + Description.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.Description) + return object; + var message = new $root.cosmos.staking.v1beta1.Description(); + if (object.moniker != null) + message.moniker = String(object.moniker); + if (object.identity != null) + message.identity = String(object.identity); + if (object.website != null) + message.website = String(object.website); + if (object.securityContact != null) + message.securityContact = String(object.securityContact); + if (object.details != null) + message.details = String(object.details); + return message; + }; + + /** + * Creates a plain object from a Description message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.Description + * @static + * @param {cosmos.staking.v1beta1.Description} message Description + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Description.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.moniker = ""; + object.identity = ""; + object.website = ""; + object.securityContact = ""; + object.details = ""; + } + if (message.moniker != null && message.hasOwnProperty("moniker")) + object.moniker = message.moniker; + if (message.identity != null && message.hasOwnProperty("identity")) + object.identity = message.identity; + if (message.website != null && message.hasOwnProperty("website")) + object.website = message.website; + if (message.securityContact != null && message.hasOwnProperty("securityContact")) + object.securityContact = message.securityContact; + if (message.details != null && message.hasOwnProperty("details")) + object.details = message.details; + return object; + }; + + /** + * Converts this Description to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.Description + * @instance + * @returns {Object.} JSON object + */ + Description.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Description; + })(v1beta1.Description || {}); + + v1beta1.Validator = (function(Validator) { + + /** + * Properties of a Validator. + * @memberof cosmos.staking.v1beta1 + * @interface IValidator + * @property {string|null} [operatorAddress] Validator operatorAddress + * @property {google.protobuf.IAny|null} [consensusPubkey] Validator consensusPubkey + * @property {boolean|null} [jailed] Validator jailed + * @property {cosmos.staking.v1beta1.BondStatus|null} [status] Validator status + * @property {string|null} [tokens] Validator tokens + * @property {string|null} [delegatorShares] Validator delegatorShares + * @property {cosmos.staking.v1beta1.IDescription|null} [description] Validator description + * @property {number|Long|null} [unbondingHeight] Validator unbondingHeight + * @property {google.protobuf.ITimestamp|null} [unbondingTime] Validator unbondingTime + * @property {cosmos.staking.v1beta1.ICommission|null} [commission] Validator commission + * @property {string|null} [minSelfDelegation] Validator minSelfDelegation + */ + + /** + * Constructs a new Validator. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a Validator. + * @implements IValidator + * @constructor + * @param {cosmos.staking.v1beta1.IValidator=} [properties] Properties to set + */ + function Validator(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Validator operatorAddress. + * @member {string} operatorAddress + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.operatorAddress = ""; + + /** + * Validator consensusPubkey. + * @member {google.protobuf.IAny|null|undefined} consensusPubkey + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.consensusPubkey = null; + + /** + * Validator jailed. + * @member {boolean} jailed + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.jailed = false; + + /** + * Validator status. + * @member {cosmos.staking.v1beta1.BondStatus} status + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.status = 0; + + /** + * Validator tokens. + * @member {string} tokens + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.tokens = ""; + + /** + * Validator delegatorShares. + * @member {string} delegatorShares + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.delegatorShares = ""; + + /** + * Validator description. + * @member {cosmos.staking.v1beta1.IDescription|null|undefined} description + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.description = null; + + /** + * Validator unbondingHeight. + * @member {number|Long} unbondingHeight + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.unbondingHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Validator unbondingTime. + * @member {google.protobuf.ITimestamp|null|undefined} unbondingTime + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.unbondingTime = null; + + /** + * Validator commission. + * @member {cosmos.staking.v1beta1.ICommission|null|undefined} commission + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.commission = null; + + /** + * Validator minSelfDelegation. + * @member {string} minSelfDelegation + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.minSelfDelegation = ""; + + /** + * Creates a new Validator instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.Validator + * @static + * @param {cosmos.staking.v1beta1.IValidator=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.Validator} Validator instance + */ + Validator.create = function create(properties) { + return new Validator(properties); + }; + + /** + * Encodes the specified Validator message. Does not implicitly {@link cosmos.staking.v1beta1.Validator.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.Validator + * @static + * @param {cosmos.staking.v1beta1.IValidator} message Validator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Validator.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operatorAddress != null && Object.hasOwnProperty.call(message, "operatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.operatorAddress); + if (message.consensusPubkey != null && Object.hasOwnProperty.call(message, "consensusPubkey")) + $root.google.protobuf.Any.encode(message.consensusPubkey, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.jailed != null && Object.hasOwnProperty.call(message, "jailed")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.jailed); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.status); + if (message.tokens != null && Object.hasOwnProperty.call(message, "tokens")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.tokens); + if (message.delegatorShares != null && Object.hasOwnProperty.call(message, "delegatorShares")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.delegatorShares); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + $root.cosmos.staking.v1beta1.Description.encode(message.description, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.unbondingHeight != null && Object.hasOwnProperty.call(message, "unbondingHeight")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.unbondingHeight); + if (message.unbondingTime != null && Object.hasOwnProperty.call(message, "unbondingTime")) + $root.google.protobuf.Timestamp.encode(message.unbondingTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.commission != null && Object.hasOwnProperty.call(message, "commission")) + $root.cosmos.staking.v1beta1.Commission.encode(message.commission, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.minSelfDelegation != null && Object.hasOwnProperty.call(message, "minSelfDelegation")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.minSelfDelegation); + return writer; + }; + + /** + * Encodes the specified Validator message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.Validator.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.Validator + * @static + * @param {cosmos.staking.v1beta1.IValidator} message Validator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Validator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Validator message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.Validator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.Validator} Validator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Validator.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.Validator(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operatorAddress = reader.string(); + break; + case 2: + message.consensusPubkey = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 3: + message.jailed = reader.bool(); + break; + case 4: + message.status = reader.int32(); + break; + case 5: + message.tokens = reader.string(); + break; + case 6: + message.delegatorShares = reader.string(); + break; + case 7: + message.description = $root.cosmos.staking.v1beta1.Description.decode(reader, reader.uint32()); + break; + case 8: + message.unbondingHeight = reader.int64(); + break; + case 9: + message.unbondingTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 10: + message.commission = $root.cosmos.staking.v1beta1.Commission.decode(reader, reader.uint32()); + break; + case 11: + message.minSelfDelegation = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Validator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.Validator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.Validator} Validator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Validator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Validator message. + * @function verify + * @memberof cosmos.staking.v1beta1.Validator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Validator.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operatorAddress != null && message.hasOwnProperty("operatorAddress")) + if (!$util.isString(message.operatorAddress)) + return "operatorAddress: string expected"; + if (message.consensusPubkey != null && message.hasOwnProperty("consensusPubkey")) { + var error = $root.google.protobuf.Any.verify(message.consensusPubkey); + if (error) + return "consensusPubkey." + error; + } + if (message.jailed != null && message.hasOwnProperty("jailed")) + if (typeof message.jailed !== "boolean") + return "jailed: boolean expected"; + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.tokens != null && message.hasOwnProperty("tokens")) + if (!$util.isString(message.tokens)) + return "tokens: string expected"; + if (message.delegatorShares != null && message.hasOwnProperty("delegatorShares")) + if (!$util.isString(message.delegatorShares)) + return "delegatorShares: string expected"; + if (message.description != null && message.hasOwnProperty("description")) { + var error = $root.cosmos.staking.v1beta1.Description.verify(message.description); + if (error) + return "description." + error; + } + if (message.unbondingHeight != null && message.hasOwnProperty("unbondingHeight")) + if (!$util.isInteger(message.unbondingHeight) && !(message.unbondingHeight && $util.isInteger(message.unbondingHeight.low) && $util.isInteger(message.unbondingHeight.high))) + return "unbondingHeight: integer|Long expected"; + if (message.unbondingTime != null && message.hasOwnProperty("unbondingTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.unbondingTime); + if (error) + return "unbondingTime." + error; + } + if (message.commission != null && message.hasOwnProperty("commission")) { + var error = $root.cosmos.staking.v1beta1.Commission.verify(message.commission); + if (error) + return "commission." + error; + } + if (message.minSelfDelegation != null && message.hasOwnProperty("minSelfDelegation")) + if (!$util.isString(message.minSelfDelegation)) + return "minSelfDelegation: string expected"; + return null; + }; + + /** + * Creates a Validator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.Validator + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.Validator} Validator + */ + Validator.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.Validator) + return object; + var message = new $root.cosmos.staking.v1beta1.Validator(); + if (object.operatorAddress != null) + message.operatorAddress = String(object.operatorAddress); + if (object.consensusPubkey != null) { + if (typeof object.consensusPubkey !== "object") + throw TypeError(".cosmos.staking.v1beta1.Validator.consensusPubkey: object expected"); + message.consensusPubkey = $root.google.protobuf.Any.fromObject(object.consensusPubkey); + } + if (object.jailed != null) + message.jailed = Boolean(object.jailed); + switch (object.status) { + case "BOND_STATUS_UNSPECIFIED": + case 0: + message.status = 0; + break; + case "BOND_STATUS_UNBONDED": + case 1: + message.status = 1; + break; + case "BOND_STATUS_UNBONDING": + case 2: + message.status = 2; + break; + case "BOND_STATUS_BONDED": + case 3: + message.status = 3; + break; + } + if (object.tokens != null) + message.tokens = String(object.tokens); + if (object.delegatorShares != null) + message.delegatorShares = String(object.delegatorShares); + if (object.description != null) { + if (typeof object.description !== "object") + throw TypeError(".cosmos.staking.v1beta1.Validator.description: object expected"); + message.description = $root.cosmos.staking.v1beta1.Description.fromObject(object.description); + } + if (object.unbondingHeight != null) + if ($util.Long) + (message.unbondingHeight = $util.Long.fromValue(object.unbondingHeight)).unsigned = false; + else if (typeof object.unbondingHeight === "string") + message.unbondingHeight = parseInt(object.unbondingHeight, 10); + else if (typeof object.unbondingHeight === "number") + message.unbondingHeight = object.unbondingHeight; + else if (typeof object.unbondingHeight === "object") + message.unbondingHeight = new $util.LongBits(object.unbondingHeight.low >>> 0, object.unbondingHeight.high >>> 0).toNumber(); + if (object.unbondingTime != null) { + if (typeof object.unbondingTime !== "object") + throw TypeError(".cosmos.staking.v1beta1.Validator.unbondingTime: object expected"); + message.unbondingTime = $root.google.protobuf.Timestamp.fromObject(object.unbondingTime); + } + if (object.commission != null) { + if (typeof object.commission !== "object") + throw TypeError(".cosmos.staking.v1beta1.Validator.commission: object expected"); + message.commission = $root.cosmos.staking.v1beta1.Commission.fromObject(object.commission); + } + if (object.minSelfDelegation != null) + message.minSelfDelegation = String(object.minSelfDelegation); + return message; + }; + + /** + * Creates a plain object from a Validator message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.Validator + * @static + * @param {cosmos.staking.v1beta1.Validator} message Validator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Validator.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.operatorAddress = ""; + object.consensusPubkey = null; + object.jailed = false; + object.status = options.enums === String ? "BOND_STATUS_UNSPECIFIED" : 0; + object.tokens = ""; + object.delegatorShares = ""; + object.description = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.unbondingHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.unbondingHeight = options.longs === String ? "0" : 0; + object.unbondingTime = null; + object.commission = null; + object.minSelfDelegation = ""; + } + if (message.operatorAddress != null && message.hasOwnProperty("operatorAddress")) + object.operatorAddress = message.operatorAddress; + if (message.consensusPubkey != null && message.hasOwnProperty("consensusPubkey")) + object.consensusPubkey = $root.google.protobuf.Any.toObject(message.consensusPubkey, options); + if (message.jailed != null && message.hasOwnProperty("jailed")) + object.jailed = message.jailed; + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.cosmos.staking.v1beta1.BondStatus[message.status] : message.status; + if (message.tokens != null && message.hasOwnProperty("tokens")) + object.tokens = message.tokens; + if (message.delegatorShares != null && message.hasOwnProperty("delegatorShares")) + object.delegatorShares = message.delegatorShares; + if (message.description != null && message.hasOwnProperty("description")) + object.description = $root.cosmos.staking.v1beta1.Description.toObject(message.description, options); + if (message.unbondingHeight != null && message.hasOwnProperty("unbondingHeight")) + if (typeof message.unbondingHeight === "number") + object.unbondingHeight = options.longs === String ? String(message.unbondingHeight) : message.unbondingHeight; + else + object.unbondingHeight = options.longs === String ? $util.Long.prototype.toString.call(message.unbondingHeight) : options.longs === Number ? new $util.LongBits(message.unbondingHeight.low >>> 0, message.unbondingHeight.high >>> 0).toNumber() : message.unbondingHeight; + if (message.unbondingTime != null && message.hasOwnProperty("unbondingTime")) + object.unbondingTime = $root.google.protobuf.Timestamp.toObject(message.unbondingTime, options); + if (message.commission != null && message.hasOwnProperty("commission")) + object.commission = $root.cosmos.staking.v1beta1.Commission.toObject(message.commission, options); + if (message.minSelfDelegation != null && message.hasOwnProperty("minSelfDelegation")) + object.minSelfDelegation = message.minSelfDelegation; + return object; + }; + + /** + * Converts this Validator to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.Validator + * @instance + * @returns {Object.} JSON object + */ + Validator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Validator; + })(v1beta1.Validator || {}); + + /** + * BondStatus enum. + * @name cosmos.staking.v1beta1.BondStatus + * @enum {string} + * @property {number} BOND_STATUS_UNSPECIFIED=0 BOND_STATUS_UNSPECIFIED value + * @property {number} BOND_STATUS_UNBONDED=1 BOND_STATUS_UNBONDED value + * @property {number} BOND_STATUS_UNBONDING=2 BOND_STATUS_UNBONDING value + * @property {number} BOND_STATUS_BONDED=3 BOND_STATUS_BONDED value + */ + v1beta1.BondStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BOND_STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "BOND_STATUS_UNBONDED"] = 1; + values[valuesById[2] = "BOND_STATUS_UNBONDING"] = 2; + values[valuesById[3] = "BOND_STATUS_BONDED"] = 3; + return values; + })(); + + v1beta1.ValAddresses = (function(ValAddresses) { + + /** + * Properties of a ValAddresses. + * @memberof cosmos.staking.v1beta1 + * @interface IValAddresses + * @property {Array.|null} [addresses] ValAddresses addresses + */ + + /** + * Constructs a new ValAddresses. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a ValAddresses. + * @implements IValAddresses + * @constructor + * @param {cosmos.staking.v1beta1.IValAddresses=} [properties] Properties to set + */ + function ValAddresses(properties) { + this.addresses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValAddresses addresses. + * @member {Array.} addresses + * @memberof cosmos.staking.v1beta1.ValAddresses + * @instance + */ + ValAddresses.prototype.addresses = $util.emptyArray; + + /** + * Creates a new ValAddresses instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.ValAddresses + * @static + * @param {cosmos.staking.v1beta1.IValAddresses=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.ValAddresses} ValAddresses instance + */ + ValAddresses.create = function create(properties) { + return new ValAddresses(properties); + }; + + /** + * Encodes the specified ValAddresses message. Does not implicitly {@link cosmos.staking.v1beta1.ValAddresses.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.ValAddresses + * @static + * @param {cosmos.staking.v1beta1.IValAddresses} message ValAddresses message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValAddresses.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.addresses != null && message.addresses.length) + for (var i = 0; i < message.addresses.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.addresses[i]); + return writer; + }; + + /** + * Encodes the specified ValAddresses message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.ValAddresses.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.ValAddresses + * @static + * @param {cosmos.staking.v1beta1.IValAddresses} message ValAddresses message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValAddresses.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValAddresses message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.ValAddresses + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.ValAddresses} ValAddresses + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValAddresses.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.ValAddresses(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.addresses && message.addresses.length)) + message.addresses = []; + message.addresses.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValAddresses message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.ValAddresses + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.ValAddresses} ValAddresses + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValAddresses.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValAddresses message. + * @function verify + * @memberof cosmos.staking.v1beta1.ValAddresses + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValAddresses.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.addresses != null && message.hasOwnProperty("addresses")) { + if (!Array.isArray(message.addresses)) + return "addresses: array expected"; + for (var i = 0; i < message.addresses.length; ++i) + if (!$util.isString(message.addresses[i])) + return "addresses: string[] expected"; + } + return null; + }; + + /** + * Creates a ValAddresses message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.ValAddresses + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.ValAddresses} ValAddresses + */ + ValAddresses.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.ValAddresses) + return object; + var message = new $root.cosmos.staking.v1beta1.ValAddresses(); + if (object.addresses) { + if (!Array.isArray(object.addresses)) + throw TypeError(".cosmos.staking.v1beta1.ValAddresses.addresses: array expected"); + message.addresses = []; + for (var i = 0; i < object.addresses.length; ++i) + message.addresses[i] = String(object.addresses[i]); + } + return message; + }; + + /** + * Creates a plain object from a ValAddresses message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.ValAddresses + * @static + * @param {cosmos.staking.v1beta1.ValAddresses} message ValAddresses + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValAddresses.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.addresses = []; + if (message.addresses && message.addresses.length) { + object.addresses = []; + for (var j = 0; j < message.addresses.length; ++j) + object.addresses[j] = message.addresses[j]; + } + return object; + }; + + /** + * Converts this ValAddresses to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.ValAddresses + * @instance + * @returns {Object.} JSON object + */ + ValAddresses.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValAddresses; + })(v1beta1.ValAddresses || {}); + + v1beta1.DVPair = (function(DVPair) { + + /** + * Properties of a DVPair. + * @memberof cosmos.staking.v1beta1 + * @interface IDVPair + * @property {string|null} [delegatorAddress] DVPair delegatorAddress + * @property {string|null} [validatorAddress] DVPair validatorAddress + */ + + /** + * Constructs a new DVPair. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a DVPair. + * @implements IDVPair + * @constructor + * @param {cosmos.staking.v1beta1.IDVPair=} [properties] Properties to set + */ + function DVPair(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DVPair delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.staking.v1beta1.DVPair + * @instance + */ + DVPair.prototype.delegatorAddress = ""; + + /** + * DVPair validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.staking.v1beta1.DVPair + * @instance + */ + DVPair.prototype.validatorAddress = ""; + + /** + * Creates a new DVPair instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.DVPair + * @static + * @param {cosmos.staking.v1beta1.IDVPair=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.DVPair} DVPair instance + */ + DVPair.create = function create(properties) { + return new DVPair(properties); + }; + + /** + * Encodes the specified DVPair message. Does not implicitly {@link cosmos.staking.v1beta1.DVPair.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.DVPair + * @static + * @param {cosmos.staking.v1beta1.IDVPair} message DVPair message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DVPair.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddress); + return writer; + }; + + /** + * Encodes the specified DVPair message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.DVPair.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.DVPair + * @static + * @param {cosmos.staking.v1beta1.IDVPair} message DVPair message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DVPair.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DVPair message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.DVPair + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.DVPair} DVPair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DVPair.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.DVPair(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DVPair message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.DVPair + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.DVPair} DVPair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DVPair.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DVPair message. + * @function verify + * @memberof cosmos.staking.v1beta1.DVPair + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DVPair.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + return null; + }; + + /** + * Creates a DVPair message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.DVPair + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.DVPair} DVPair + */ + DVPair.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.DVPair) + return object; + var message = new $root.cosmos.staking.v1beta1.DVPair(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + return message; + }; + + /** + * Creates a plain object from a DVPair message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.DVPair + * @static + * @param {cosmos.staking.v1beta1.DVPair} message DVPair + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DVPair.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.delegatorAddress = ""; + object.validatorAddress = ""; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + return object; + }; + + /** + * Converts this DVPair to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.DVPair + * @instance + * @returns {Object.} JSON object + */ + DVPair.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DVPair; + })(v1beta1.DVPair || {}); + + v1beta1.DVPairs = (function(DVPairs) { + + /** + * Properties of a DVPairs. + * @memberof cosmos.staking.v1beta1 + * @interface IDVPairs + * @property {Array.|null} [pairs] DVPairs pairs + */ + + /** + * Constructs a new DVPairs. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a DVPairs. + * @implements IDVPairs + * @constructor + * @param {cosmos.staking.v1beta1.IDVPairs=} [properties] Properties to set + */ + function DVPairs(properties) { + this.pairs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DVPairs pairs. + * @member {Array.} pairs + * @memberof cosmos.staking.v1beta1.DVPairs + * @instance + */ + DVPairs.prototype.pairs = $util.emptyArray; + + /** + * Creates a new DVPairs instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.DVPairs + * @static + * @param {cosmos.staking.v1beta1.IDVPairs=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.DVPairs} DVPairs instance + */ + DVPairs.create = function create(properties) { + return new DVPairs(properties); + }; + + /** + * Encodes the specified DVPairs message. Does not implicitly {@link cosmos.staking.v1beta1.DVPairs.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.DVPairs + * @static + * @param {cosmos.staking.v1beta1.IDVPairs} message DVPairs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DVPairs.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pairs != null && message.pairs.length) + for (var i = 0; i < message.pairs.length; ++i) + $root.cosmos.staking.v1beta1.DVPair.encode(message.pairs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DVPairs message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.DVPairs.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.DVPairs + * @static + * @param {cosmos.staking.v1beta1.IDVPairs} message DVPairs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DVPairs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DVPairs message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.DVPairs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.DVPairs} DVPairs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DVPairs.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.DVPairs(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.pairs && message.pairs.length)) + message.pairs = []; + message.pairs.push($root.cosmos.staking.v1beta1.DVPair.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DVPairs message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.DVPairs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.DVPairs} DVPairs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DVPairs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DVPairs message. + * @function verify + * @memberof cosmos.staking.v1beta1.DVPairs + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DVPairs.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pairs != null && message.hasOwnProperty("pairs")) { + if (!Array.isArray(message.pairs)) + return "pairs: array expected"; + for (var i = 0; i < message.pairs.length; ++i) { + var error = $root.cosmos.staking.v1beta1.DVPair.verify(message.pairs[i]); + if (error) + return "pairs." + error; + } + } + return null; + }; + + /** + * Creates a DVPairs message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.DVPairs + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.DVPairs} DVPairs + */ + DVPairs.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.DVPairs) + return object; + var message = new $root.cosmos.staking.v1beta1.DVPairs(); + if (object.pairs) { + if (!Array.isArray(object.pairs)) + throw TypeError(".cosmos.staking.v1beta1.DVPairs.pairs: array expected"); + message.pairs = []; + for (var i = 0; i < object.pairs.length; ++i) { + if (typeof object.pairs[i] !== "object") + throw TypeError(".cosmos.staking.v1beta1.DVPairs.pairs: object expected"); + message.pairs[i] = $root.cosmos.staking.v1beta1.DVPair.fromObject(object.pairs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DVPairs message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.DVPairs + * @static + * @param {cosmos.staking.v1beta1.DVPairs} message DVPairs + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DVPairs.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pairs = []; + if (message.pairs && message.pairs.length) { + object.pairs = []; + for (var j = 0; j < message.pairs.length; ++j) + object.pairs[j] = $root.cosmos.staking.v1beta1.DVPair.toObject(message.pairs[j], options); + } + return object; + }; + + /** + * Converts this DVPairs to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.DVPairs + * @instance + * @returns {Object.} JSON object + */ + DVPairs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DVPairs; + })(v1beta1.DVPairs || {}); + + v1beta1.DVVTriplet = (function(DVVTriplet) { + + /** + * Properties of a DVVTriplet. + * @memberof cosmos.staking.v1beta1 + * @interface IDVVTriplet + * @property {string|null} [delegatorAddress] DVVTriplet delegatorAddress + * @property {string|null} [validatorSrcAddress] DVVTriplet validatorSrcAddress + * @property {string|null} [validatorDstAddress] DVVTriplet validatorDstAddress + */ + + /** + * Constructs a new DVVTriplet. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a DVVTriplet. + * @implements IDVVTriplet + * @constructor + * @param {cosmos.staking.v1beta1.IDVVTriplet=} [properties] Properties to set + */ + function DVVTriplet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DVVTriplet delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @instance + */ + DVVTriplet.prototype.delegatorAddress = ""; + + /** + * DVVTriplet validatorSrcAddress. + * @member {string} validatorSrcAddress + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @instance + */ + DVVTriplet.prototype.validatorSrcAddress = ""; + + /** + * DVVTriplet validatorDstAddress. + * @member {string} validatorDstAddress + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @instance + */ + DVVTriplet.prototype.validatorDstAddress = ""; + + /** + * Creates a new DVVTriplet instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @static + * @param {cosmos.staking.v1beta1.IDVVTriplet=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.DVVTriplet} DVVTriplet instance + */ + DVVTriplet.create = function create(properties) { + return new DVVTriplet(properties); + }; + + /** + * Encodes the specified DVVTriplet message. Does not implicitly {@link cosmos.staking.v1beta1.DVVTriplet.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @static + * @param {cosmos.staking.v1beta1.IDVVTriplet} message DVVTriplet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DVVTriplet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.validatorSrcAddress != null && Object.hasOwnProperty.call(message, "validatorSrcAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorSrcAddress); + if (message.validatorDstAddress != null && Object.hasOwnProperty.call(message, "validatorDstAddress")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.validatorDstAddress); + return writer; + }; + + /** + * Encodes the specified DVVTriplet message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.DVVTriplet.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @static + * @param {cosmos.staking.v1beta1.IDVVTriplet} message DVVTriplet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DVVTriplet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DVVTriplet message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.DVVTriplet} DVVTriplet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DVVTriplet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.DVVTriplet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorSrcAddress = reader.string(); + break; + case 3: + message.validatorDstAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DVVTriplet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.DVVTriplet} DVVTriplet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DVVTriplet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DVVTriplet message. + * @function verify + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DVVTriplet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.validatorSrcAddress != null && message.hasOwnProperty("validatorSrcAddress")) + if (!$util.isString(message.validatorSrcAddress)) + return "validatorSrcAddress: string expected"; + if (message.validatorDstAddress != null && message.hasOwnProperty("validatorDstAddress")) + if (!$util.isString(message.validatorDstAddress)) + return "validatorDstAddress: string expected"; + return null; + }; + + /** + * Creates a DVVTriplet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.DVVTriplet} DVVTriplet + */ + DVVTriplet.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.DVVTriplet) + return object; + var message = new $root.cosmos.staking.v1beta1.DVVTriplet(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.validatorSrcAddress != null) + message.validatorSrcAddress = String(object.validatorSrcAddress); + if (object.validatorDstAddress != null) + message.validatorDstAddress = String(object.validatorDstAddress); + return message; + }; + + /** + * Creates a plain object from a DVVTriplet message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @static + * @param {cosmos.staking.v1beta1.DVVTriplet} message DVVTriplet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DVVTriplet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.delegatorAddress = ""; + object.validatorSrcAddress = ""; + object.validatorDstAddress = ""; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.validatorSrcAddress != null && message.hasOwnProperty("validatorSrcAddress")) + object.validatorSrcAddress = message.validatorSrcAddress; + if (message.validatorDstAddress != null && message.hasOwnProperty("validatorDstAddress")) + object.validatorDstAddress = message.validatorDstAddress; + return object; + }; + + /** + * Converts this DVVTriplet to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @instance + * @returns {Object.} JSON object + */ + DVVTriplet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DVVTriplet; + })(v1beta1.DVVTriplet || {}); + + v1beta1.DVVTriplets = (function(DVVTriplets) { + + /** + * Properties of a DVVTriplets. + * @memberof cosmos.staking.v1beta1 + * @interface IDVVTriplets + * @property {Array.|null} [triplets] DVVTriplets triplets + */ + + /** + * Constructs a new DVVTriplets. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a DVVTriplets. + * @implements IDVVTriplets + * @constructor + * @param {cosmos.staking.v1beta1.IDVVTriplets=} [properties] Properties to set + */ + function DVVTriplets(properties) { + this.triplets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DVVTriplets triplets. + * @member {Array.} triplets + * @memberof cosmos.staking.v1beta1.DVVTriplets + * @instance + */ + DVVTriplets.prototype.triplets = $util.emptyArray; + + /** + * Creates a new DVVTriplets instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.DVVTriplets + * @static + * @param {cosmos.staking.v1beta1.IDVVTriplets=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.DVVTriplets} DVVTriplets instance + */ + DVVTriplets.create = function create(properties) { + return new DVVTriplets(properties); + }; + + /** + * Encodes the specified DVVTriplets message. Does not implicitly {@link cosmos.staking.v1beta1.DVVTriplets.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.DVVTriplets + * @static + * @param {cosmos.staking.v1beta1.IDVVTriplets} message DVVTriplets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DVVTriplets.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.triplets != null && message.triplets.length) + for (var i = 0; i < message.triplets.length; ++i) + $root.cosmos.staking.v1beta1.DVVTriplet.encode(message.triplets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DVVTriplets message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.DVVTriplets.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.DVVTriplets + * @static + * @param {cosmos.staking.v1beta1.IDVVTriplets} message DVVTriplets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DVVTriplets.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DVVTriplets message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.DVVTriplets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.DVVTriplets} DVVTriplets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DVVTriplets.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.DVVTriplets(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.triplets && message.triplets.length)) + message.triplets = []; + message.triplets.push($root.cosmos.staking.v1beta1.DVVTriplet.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DVVTriplets message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.DVVTriplets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.DVVTriplets} DVVTriplets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DVVTriplets.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DVVTriplets message. + * @function verify + * @memberof cosmos.staking.v1beta1.DVVTriplets + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DVVTriplets.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.triplets != null && message.hasOwnProperty("triplets")) { + if (!Array.isArray(message.triplets)) + return "triplets: array expected"; + for (var i = 0; i < message.triplets.length; ++i) { + var error = $root.cosmos.staking.v1beta1.DVVTriplet.verify(message.triplets[i]); + if (error) + return "triplets." + error; + } + } + return null; + }; + + /** + * Creates a DVVTriplets message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.DVVTriplets + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.DVVTriplets} DVVTriplets + */ + DVVTriplets.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.DVVTriplets) + return object; + var message = new $root.cosmos.staking.v1beta1.DVVTriplets(); + if (object.triplets) { + if (!Array.isArray(object.triplets)) + throw TypeError(".cosmos.staking.v1beta1.DVVTriplets.triplets: array expected"); + message.triplets = []; + for (var i = 0; i < object.triplets.length; ++i) { + if (typeof object.triplets[i] !== "object") + throw TypeError(".cosmos.staking.v1beta1.DVVTriplets.triplets: object expected"); + message.triplets[i] = $root.cosmos.staking.v1beta1.DVVTriplet.fromObject(object.triplets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DVVTriplets message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.DVVTriplets + * @static + * @param {cosmos.staking.v1beta1.DVVTriplets} message DVVTriplets + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DVVTriplets.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.triplets = []; + if (message.triplets && message.triplets.length) { + object.triplets = []; + for (var j = 0; j < message.triplets.length; ++j) + object.triplets[j] = $root.cosmos.staking.v1beta1.DVVTriplet.toObject(message.triplets[j], options); + } + return object; + }; + + /** + * Converts this DVVTriplets to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.DVVTriplets + * @instance + * @returns {Object.} JSON object + */ + DVVTriplets.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DVVTriplets; + })(v1beta1.DVVTriplets || {}); + + v1beta1.Delegation = (function(Delegation) { + + /** + * Properties of a Delegation. + * @memberof cosmos.staking.v1beta1 + * @interface IDelegation + * @property {string|null} [delegatorAddress] Delegation delegatorAddress + * @property {string|null} [validatorAddress] Delegation validatorAddress + * @property {string|null} [shares] Delegation shares + */ + + /** + * Constructs a new Delegation. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a Delegation. + * @implements IDelegation + * @constructor + * @param {cosmos.staking.v1beta1.IDelegation=} [properties] Properties to set + */ + function Delegation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Delegation delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.staking.v1beta1.Delegation + * @instance + */ + Delegation.prototype.delegatorAddress = ""; + + /** + * Delegation validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.staking.v1beta1.Delegation + * @instance + */ + Delegation.prototype.validatorAddress = ""; + + /** + * Delegation shares. + * @member {string} shares + * @memberof cosmos.staking.v1beta1.Delegation + * @instance + */ + Delegation.prototype.shares = ""; + + /** + * Creates a new Delegation instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.Delegation + * @static + * @param {cosmos.staking.v1beta1.IDelegation=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.Delegation} Delegation instance + */ + Delegation.create = function create(properties) { + return new Delegation(properties); + }; + + /** + * Encodes the specified Delegation message. Does not implicitly {@link cosmos.staking.v1beta1.Delegation.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.Delegation + * @static + * @param {cosmos.staking.v1beta1.IDelegation} message Delegation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Delegation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddress); + if (message.shares != null && Object.hasOwnProperty.call(message, "shares")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.shares); + return writer; + }; + + /** + * Encodes the specified Delegation message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.Delegation.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.Delegation + * @static + * @param {cosmos.staking.v1beta1.IDelegation} message Delegation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Delegation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Delegation message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.Delegation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.Delegation} Delegation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Delegation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.Delegation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.shares = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Delegation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.Delegation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.Delegation} Delegation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Delegation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Delegation message. + * @function verify + * @memberof cosmos.staking.v1beta1.Delegation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Delegation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + if (message.shares != null && message.hasOwnProperty("shares")) + if (!$util.isString(message.shares)) + return "shares: string expected"; + return null; + }; + + /** + * Creates a Delegation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.Delegation + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.Delegation} Delegation + */ + Delegation.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.Delegation) + return object; + var message = new $root.cosmos.staking.v1beta1.Delegation(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + if (object.shares != null) + message.shares = String(object.shares); + return message; + }; + + /** + * Creates a plain object from a Delegation message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.Delegation + * @static + * @param {cosmos.staking.v1beta1.Delegation} message Delegation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Delegation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.delegatorAddress = ""; + object.validatorAddress = ""; + object.shares = ""; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + if (message.shares != null && message.hasOwnProperty("shares")) + object.shares = message.shares; + return object; + }; + + /** + * Converts this Delegation to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.Delegation + * @instance + * @returns {Object.} JSON object + */ + Delegation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Delegation; + })(v1beta1.Delegation || {}); + + v1beta1.UnbondingDelegation = (function(UnbondingDelegation) { + + /** + * Properties of an UnbondingDelegation. + * @memberof cosmos.staking.v1beta1 + * @interface IUnbondingDelegation + * @property {string|null} [delegatorAddress] UnbondingDelegation delegatorAddress + * @property {string|null} [validatorAddress] UnbondingDelegation validatorAddress + * @property {Array.|null} [entries] UnbondingDelegation entries + */ + + /** + * Constructs a new UnbondingDelegation. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents an UnbondingDelegation. + * @implements IUnbondingDelegation + * @constructor + * @param {cosmos.staking.v1beta1.IUnbondingDelegation=} [properties] Properties to set + */ + function UnbondingDelegation(properties) { + this.entries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UnbondingDelegation delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @instance + */ + UnbondingDelegation.prototype.delegatorAddress = ""; + + /** + * UnbondingDelegation validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @instance + */ + UnbondingDelegation.prototype.validatorAddress = ""; + + /** + * UnbondingDelegation entries. + * @member {Array.} entries + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @instance + */ + UnbondingDelegation.prototype.entries = $util.emptyArray; + + /** + * Creates a new UnbondingDelegation instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @static + * @param {cosmos.staking.v1beta1.IUnbondingDelegation=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.UnbondingDelegation} UnbondingDelegation instance + */ + UnbondingDelegation.create = function create(properties) { + return new UnbondingDelegation(properties); + }; + + /** + * Encodes the specified UnbondingDelegation message. Does not implicitly {@link cosmos.staking.v1beta1.UnbondingDelegation.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @static + * @param {cosmos.staking.v1beta1.IUnbondingDelegation} message UnbondingDelegation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnbondingDelegation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddress); + if (message.entries != null && message.entries.length) + for (var i = 0; i < message.entries.length; ++i) + $root.cosmos.staking.v1beta1.UnbondingDelegationEntry.encode(message.entries[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UnbondingDelegation message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.UnbondingDelegation.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @static + * @param {cosmos.staking.v1beta1.IUnbondingDelegation} message UnbondingDelegation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnbondingDelegation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UnbondingDelegation message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.UnbondingDelegation} UnbondingDelegation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnbondingDelegation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.UnbondingDelegation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.cosmos.staking.v1beta1.UnbondingDelegationEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UnbondingDelegation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.UnbondingDelegation} UnbondingDelegation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnbondingDelegation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UnbondingDelegation message. + * @function verify + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UnbondingDelegation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (var i = 0; i < message.entries.length; ++i) { + var error = $root.cosmos.staking.v1beta1.UnbondingDelegationEntry.verify(message.entries[i]); + if (error) + return "entries." + error; + } + } + return null; + }; + + /** + * Creates an UnbondingDelegation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.UnbondingDelegation} UnbondingDelegation + */ + UnbondingDelegation.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.UnbondingDelegation) + return object; + var message = new $root.cosmos.staking.v1beta1.UnbondingDelegation(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".cosmos.staking.v1beta1.UnbondingDelegation.entries: array expected"); + message.entries = []; + for (var i = 0; i < object.entries.length; ++i) { + if (typeof object.entries[i] !== "object") + throw TypeError(".cosmos.staking.v1beta1.UnbondingDelegation.entries: object expected"); + message.entries[i] = $root.cosmos.staking.v1beta1.UnbondingDelegationEntry.fromObject(object.entries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an UnbondingDelegation message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @static + * @param {cosmos.staking.v1beta1.UnbondingDelegation} message UnbondingDelegation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UnbondingDelegation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (options.defaults) { + object.delegatorAddress = ""; + object.validatorAddress = ""; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + if (message.entries && message.entries.length) { + object.entries = []; + for (var j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.cosmos.staking.v1beta1.UnbondingDelegationEntry.toObject(message.entries[j], options); + } + return object; + }; + + /** + * Converts this UnbondingDelegation to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @instance + * @returns {Object.} JSON object + */ + UnbondingDelegation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UnbondingDelegation; + })(v1beta1.UnbondingDelegation || {}); + + v1beta1.UnbondingDelegationEntry = (function(UnbondingDelegationEntry) { + + /** + * Properties of an UnbondingDelegationEntry. + * @memberof cosmos.staking.v1beta1 + * @interface IUnbondingDelegationEntry + * @property {number|Long|null} [creationHeight] UnbondingDelegationEntry creationHeight + * @property {google.protobuf.ITimestamp|null} [completionTime] UnbondingDelegationEntry completionTime + * @property {string|null} [initialBalance] UnbondingDelegationEntry initialBalance + * @property {string|null} [balance] UnbondingDelegationEntry balance + */ + + /** + * Constructs a new UnbondingDelegationEntry. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents an UnbondingDelegationEntry. + * @implements IUnbondingDelegationEntry + * @constructor + * @param {cosmos.staking.v1beta1.IUnbondingDelegationEntry=} [properties] Properties to set + */ + function UnbondingDelegationEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UnbondingDelegationEntry creationHeight. + * @member {number|Long} creationHeight + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @instance + */ + UnbondingDelegationEntry.prototype.creationHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UnbondingDelegationEntry completionTime. + * @member {google.protobuf.ITimestamp|null|undefined} completionTime + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @instance + */ + UnbondingDelegationEntry.prototype.completionTime = null; + + /** + * UnbondingDelegationEntry initialBalance. + * @member {string} initialBalance + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @instance + */ + UnbondingDelegationEntry.prototype.initialBalance = ""; + + /** + * UnbondingDelegationEntry balance. + * @member {string} balance + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @instance + */ + UnbondingDelegationEntry.prototype.balance = ""; + + /** + * Creates a new UnbondingDelegationEntry instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @static + * @param {cosmos.staking.v1beta1.IUnbondingDelegationEntry=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.UnbondingDelegationEntry} UnbondingDelegationEntry instance + */ + UnbondingDelegationEntry.create = function create(properties) { + return new UnbondingDelegationEntry(properties); + }; + + /** + * Encodes the specified UnbondingDelegationEntry message. Does not implicitly {@link cosmos.staking.v1beta1.UnbondingDelegationEntry.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @static + * @param {cosmos.staking.v1beta1.IUnbondingDelegationEntry} message UnbondingDelegationEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnbondingDelegationEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.creationHeight != null && Object.hasOwnProperty.call(message, "creationHeight")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.creationHeight); + if (message.completionTime != null && Object.hasOwnProperty.call(message, "completionTime")) + $root.google.protobuf.Timestamp.encode(message.completionTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.initialBalance != null && Object.hasOwnProperty.call(message, "initialBalance")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.initialBalance); + if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.balance); + return writer; + }; + + /** + * Encodes the specified UnbondingDelegationEntry message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.UnbondingDelegationEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @static + * @param {cosmos.staking.v1beta1.IUnbondingDelegationEntry} message UnbondingDelegationEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnbondingDelegationEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UnbondingDelegationEntry message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.UnbondingDelegationEntry} UnbondingDelegationEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnbondingDelegationEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.UnbondingDelegationEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creationHeight = reader.int64(); + break; + case 2: + message.completionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.initialBalance = reader.string(); + break; + case 4: + message.balance = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UnbondingDelegationEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.UnbondingDelegationEntry} UnbondingDelegationEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnbondingDelegationEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UnbondingDelegationEntry message. + * @function verify + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UnbondingDelegationEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.creationHeight != null && message.hasOwnProperty("creationHeight")) + if (!$util.isInteger(message.creationHeight) && !(message.creationHeight && $util.isInteger(message.creationHeight.low) && $util.isInteger(message.creationHeight.high))) + return "creationHeight: integer|Long expected"; + if (message.completionTime != null && message.hasOwnProperty("completionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.completionTime); + if (error) + return "completionTime." + error; + } + if (message.initialBalance != null && message.hasOwnProperty("initialBalance")) + if (!$util.isString(message.initialBalance)) + return "initialBalance: string expected"; + if (message.balance != null && message.hasOwnProperty("balance")) + if (!$util.isString(message.balance)) + return "balance: string expected"; + return null; + }; + + /** + * Creates an UnbondingDelegationEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.UnbondingDelegationEntry} UnbondingDelegationEntry + */ + UnbondingDelegationEntry.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.UnbondingDelegationEntry) + return object; + var message = new $root.cosmos.staking.v1beta1.UnbondingDelegationEntry(); + if (object.creationHeight != null) + if ($util.Long) + (message.creationHeight = $util.Long.fromValue(object.creationHeight)).unsigned = false; + else if (typeof object.creationHeight === "string") + message.creationHeight = parseInt(object.creationHeight, 10); + else if (typeof object.creationHeight === "number") + message.creationHeight = object.creationHeight; + else if (typeof object.creationHeight === "object") + message.creationHeight = new $util.LongBits(object.creationHeight.low >>> 0, object.creationHeight.high >>> 0).toNumber(); + if (object.completionTime != null) { + if (typeof object.completionTime !== "object") + throw TypeError(".cosmos.staking.v1beta1.UnbondingDelegationEntry.completionTime: object expected"); + message.completionTime = $root.google.protobuf.Timestamp.fromObject(object.completionTime); + } + if (object.initialBalance != null) + message.initialBalance = String(object.initialBalance); + if (object.balance != null) + message.balance = String(object.balance); + return message; + }; + + /** + * Creates a plain object from an UnbondingDelegationEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @static + * @param {cosmos.staking.v1beta1.UnbondingDelegationEntry} message UnbondingDelegationEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UnbondingDelegationEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.creationHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.creationHeight = options.longs === String ? "0" : 0; + object.completionTime = null; + object.initialBalance = ""; + object.balance = ""; + } + if (message.creationHeight != null && message.hasOwnProperty("creationHeight")) + if (typeof message.creationHeight === "number") + object.creationHeight = options.longs === String ? String(message.creationHeight) : message.creationHeight; + else + object.creationHeight = options.longs === String ? $util.Long.prototype.toString.call(message.creationHeight) : options.longs === Number ? new $util.LongBits(message.creationHeight.low >>> 0, message.creationHeight.high >>> 0).toNumber() : message.creationHeight; + if (message.completionTime != null && message.hasOwnProperty("completionTime")) + object.completionTime = $root.google.protobuf.Timestamp.toObject(message.completionTime, options); + if (message.initialBalance != null && message.hasOwnProperty("initialBalance")) + object.initialBalance = message.initialBalance; + if (message.balance != null && message.hasOwnProperty("balance")) + object.balance = message.balance; + return object; + }; + + /** + * Converts this UnbondingDelegationEntry to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @instance + * @returns {Object.} JSON object + */ + UnbondingDelegationEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UnbondingDelegationEntry; + })(v1beta1.UnbondingDelegationEntry || {}); + + v1beta1.RedelegationEntry = (function(RedelegationEntry) { + + /** + * Properties of a RedelegationEntry. + * @memberof cosmos.staking.v1beta1 + * @interface IRedelegationEntry + * @property {number|Long|null} [creationHeight] RedelegationEntry creationHeight + * @property {google.protobuf.ITimestamp|null} [completionTime] RedelegationEntry completionTime + * @property {string|null} [initialBalance] RedelegationEntry initialBalance + * @property {string|null} [sharesDst] RedelegationEntry sharesDst + */ + + /** + * Constructs a new RedelegationEntry. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a RedelegationEntry. + * @implements IRedelegationEntry + * @constructor + * @param {cosmos.staking.v1beta1.IRedelegationEntry=} [properties] Properties to set + */ + function RedelegationEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RedelegationEntry creationHeight. + * @member {number|Long} creationHeight + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @instance + */ + RedelegationEntry.prototype.creationHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * RedelegationEntry completionTime. + * @member {google.protobuf.ITimestamp|null|undefined} completionTime + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @instance + */ + RedelegationEntry.prototype.completionTime = null; + + /** + * RedelegationEntry initialBalance. + * @member {string} initialBalance + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @instance + */ + RedelegationEntry.prototype.initialBalance = ""; + + /** + * RedelegationEntry sharesDst. + * @member {string} sharesDst + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @instance + */ + RedelegationEntry.prototype.sharesDst = ""; + + /** + * Creates a new RedelegationEntry instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @static + * @param {cosmos.staking.v1beta1.IRedelegationEntry=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.RedelegationEntry} RedelegationEntry instance + */ + RedelegationEntry.create = function create(properties) { + return new RedelegationEntry(properties); + }; + + /** + * Encodes the specified RedelegationEntry message. Does not implicitly {@link cosmos.staking.v1beta1.RedelegationEntry.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @static + * @param {cosmos.staking.v1beta1.IRedelegationEntry} message RedelegationEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedelegationEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.creationHeight != null && Object.hasOwnProperty.call(message, "creationHeight")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.creationHeight); + if (message.completionTime != null && Object.hasOwnProperty.call(message, "completionTime")) + $root.google.protobuf.Timestamp.encode(message.completionTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.initialBalance != null && Object.hasOwnProperty.call(message, "initialBalance")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.initialBalance); + if (message.sharesDst != null && Object.hasOwnProperty.call(message, "sharesDst")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.sharesDst); + return writer; + }; + + /** + * Encodes the specified RedelegationEntry message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.RedelegationEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @static + * @param {cosmos.staking.v1beta1.IRedelegationEntry} message RedelegationEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedelegationEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RedelegationEntry message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.RedelegationEntry} RedelegationEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedelegationEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.RedelegationEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creationHeight = reader.int64(); + break; + case 2: + message.completionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.initialBalance = reader.string(); + break; + case 4: + message.sharesDst = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RedelegationEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.RedelegationEntry} RedelegationEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedelegationEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RedelegationEntry message. + * @function verify + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RedelegationEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.creationHeight != null && message.hasOwnProperty("creationHeight")) + if (!$util.isInteger(message.creationHeight) && !(message.creationHeight && $util.isInteger(message.creationHeight.low) && $util.isInteger(message.creationHeight.high))) + return "creationHeight: integer|Long expected"; + if (message.completionTime != null && message.hasOwnProperty("completionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.completionTime); + if (error) + return "completionTime." + error; + } + if (message.initialBalance != null && message.hasOwnProperty("initialBalance")) + if (!$util.isString(message.initialBalance)) + return "initialBalance: string expected"; + if (message.sharesDst != null && message.hasOwnProperty("sharesDst")) + if (!$util.isString(message.sharesDst)) + return "sharesDst: string expected"; + return null; + }; + + /** + * Creates a RedelegationEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.RedelegationEntry} RedelegationEntry + */ + RedelegationEntry.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.RedelegationEntry) + return object; + var message = new $root.cosmos.staking.v1beta1.RedelegationEntry(); + if (object.creationHeight != null) + if ($util.Long) + (message.creationHeight = $util.Long.fromValue(object.creationHeight)).unsigned = false; + else if (typeof object.creationHeight === "string") + message.creationHeight = parseInt(object.creationHeight, 10); + else if (typeof object.creationHeight === "number") + message.creationHeight = object.creationHeight; + else if (typeof object.creationHeight === "object") + message.creationHeight = new $util.LongBits(object.creationHeight.low >>> 0, object.creationHeight.high >>> 0).toNumber(); + if (object.completionTime != null) { + if (typeof object.completionTime !== "object") + throw TypeError(".cosmos.staking.v1beta1.RedelegationEntry.completionTime: object expected"); + message.completionTime = $root.google.protobuf.Timestamp.fromObject(object.completionTime); + } + if (object.initialBalance != null) + message.initialBalance = String(object.initialBalance); + if (object.sharesDst != null) + message.sharesDst = String(object.sharesDst); + return message; + }; + + /** + * Creates a plain object from a RedelegationEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @static + * @param {cosmos.staking.v1beta1.RedelegationEntry} message RedelegationEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RedelegationEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.creationHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.creationHeight = options.longs === String ? "0" : 0; + object.completionTime = null; + object.initialBalance = ""; + object.sharesDst = ""; + } + if (message.creationHeight != null && message.hasOwnProperty("creationHeight")) + if (typeof message.creationHeight === "number") + object.creationHeight = options.longs === String ? String(message.creationHeight) : message.creationHeight; + else + object.creationHeight = options.longs === String ? $util.Long.prototype.toString.call(message.creationHeight) : options.longs === Number ? new $util.LongBits(message.creationHeight.low >>> 0, message.creationHeight.high >>> 0).toNumber() : message.creationHeight; + if (message.completionTime != null && message.hasOwnProperty("completionTime")) + object.completionTime = $root.google.protobuf.Timestamp.toObject(message.completionTime, options); + if (message.initialBalance != null && message.hasOwnProperty("initialBalance")) + object.initialBalance = message.initialBalance; + if (message.sharesDst != null && message.hasOwnProperty("sharesDst")) + object.sharesDst = message.sharesDst; + return object; + }; + + /** + * Converts this RedelegationEntry to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @instance + * @returns {Object.} JSON object + */ + RedelegationEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RedelegationEntry; + })(v1beta1.RedelegationEntry || {}); + + v1beta1.Redelegation = (function(Redelegation) { + + /** + * Properties of a Redelegation. + * @memberof cosmos.staking.v1beta1 + * @interface IRedelegation + * @property {string|null} [delegatorAddress] Redelegation delegatorAddress + * @property {string|null} [validatorSrcAddress] Redelegation validatorSrcAddress + * @property {string|null} [validatorDstAddress] Redelegation validatorDstAddress + * @property {Array.|null} [entries] Redelegation entries + */ + + /** + * Constructs a new Redelegation. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a Redelegation. + * @implements IRedelegation + * @constructor + * @param {cosmos.staking.v1beta1.IRedelegation=} [properties] Properties to set + */ + function Redelegation(properties) { + this.entries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Redelegation delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.staking.v1beta1.Redelegation + * @instance + */ + Redelegation.prototype.delegatorAddress = ""; + + /** + * Redelegation validatorSrcAddress. + * @member {string} validatorSrcAddress + * @memberof cosmos.staking.v1beta1.Redelegation + * @instance + */ + Redelegation.prototype.validatorSrcAddress = ""; + + /** + * Redelegation validatorDstAddress. + * @member {string} validatorDstAddress + * @memberof cosmos.staking.v1beta1.Redelegation + * @instance + */ + Redelegation.prototype.validatorDstAddress = ""; + + /** + * Redelegation entries. + * @member {Array.} entries + * @memberof cosmos.staking.v1beta1.Redelegation + * @instance + */ + Redelegation.prototype.entries = $util.emptyArray; + + /** + * Creates a new Redelegation instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.Redelegation + * @static + * @param {cosmos.staking.v1beta1.IRedelegation=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.Redelegation} Redelegation instance + */ + Redelegation.create = function create(properties) { + return new Redelegation(properties); + }; + + /** + * Encodes the specified Redelegation message. Does not implicitly {@link cosmos.staking.v1beta1.Redelegation.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.Redelegation + * @static + * @param {cosmos.staking.v1beta1.IRedelegation} message Redelegation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Redelegation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.validatorSrcAddress != null && Object.hasOwnProperty.call(message, "validatorSrcAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorSrcAddress); + if (message.validatorDstAddress != null && Object.hasOwnProperty.call(message, "validatorDstAddress")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.validatorDstAddress); + if (message.entries != null && message.entries.length) + for (var i = 0; i < message.entries.length; ++i) + $root.cosmos.staking.v1beta1.RedelegationEntry.encode(message.entries[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Redelegation message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.Redelegation.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.Redelegation + * @static + * @param {cosmos.staking.v1beta1.IRedelegation} message Redelegation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Redelegation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Redelegation message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.Redelegation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.Redelegation} Redelegation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Redelegation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.Redelegation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorSrcAddress = reader.string(); + break; + case 3: + message.validatorDstAddress = reader.string(); + break; + case 4: + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.cosmos.staking.v1beta1.RedelegationEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Redelegation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.Redelegation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.Redelegation} Redelegation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Redelegation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Redelegation message. + * @function verify + * @memberof cosmos.staking.v1beta1.Redelegation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Redelegation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.validatorSrcAddress != null && message.hasOwnProperty("validatorSrcAddress")) + if (!$util.isString(message.validatorSrcAddress)) + return "validatorSrcAddress: string expected"; + if (message.validatorDstAddress != null && message.hasOwnProperty("validatorDstAddress")) + if (!$util.isString(message.validatorDstAddress)) + return "validatorDstAddress: string expected"; + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (var i = 0; i < message.entries.length; ++i) { + var error = $root.cosmos.staking.v1beta1.RedelegationEntry.verify(message.entries[i]); + if (error) + return "entries." + error; + } + } + return null; + }; + + /** + * Creates a Redelegation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.Redelegation + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.Redelegation} Redelegation + */ + Redelegation.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.Redelegation) + return object; + var message = new $root.cosmos.staking.v1beta1.Redelegation(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.validatorSrcAddress != null) + message.validatorSrcAddress = String(object.validatorSrcAddress); + if (object.validatorDstAddress != null) + message.validatorDstAddress = String(object.validatorDstAddress); + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".cosmos.staking.v1beta1.Redelegation.entries: array expected"); + message.entries = []; + for (var i = 0; i < object.entries.length; ++i) { + if (typeof object.entries[i] !== "object") + throw TypeError(".cosmos.staking.v1beta1.Redelegation.entries: object expected"); + message.entries[i] = $root.cosmos.staking.v1beta1.RedelegationEntry.fromObject(object.entries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Redelegation message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.Redelegation + * @static + * @param {cosmos.staking.v1beta1.Redelegation} message Redelegation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Redelegation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (options.defaults) { + object.delegatorAddress = ""; + object.validatorSrcAddress = ""; + object.validatorDstAddress = ""; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.validatorSrcAddress != null && message.hasOwnProperty("validatorSrcAddress")) + object.validatorSrcAddress = message.validatorSrcAddress; + if (message.validatorDstAddress != null && message.hasOwnProperty("validatorDstAddress")) + object.validatorDstAddress = message.validatorDstAddress; + if (message.entries && message.entries.length) { + object.entries = []; + for (var j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.cosmos.staking.v1beta1.RedelegationEntry.toObject(message.entries[j], options); + } + return object; + }; + + /** + * Converts this Redelegation to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.Redelegation + * @instance + * @returns {Object.} JSON object + */ + Redelegation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Redelegation; + })(v1beta1.Redelegation || {}); + + v1beta1.Params = (function(Params) { + + /** + * Properties of a Params. + * @memberof cosmos.staking.v1beta1 + * @interface IParams + * @property {google.protobuf.IDuration|null} [unbondingTime] Params unbondingTime + * @property {number|null} [maxValidators] Params maxValidators + * @property {number|null} [maxEntries] Params maxEntries + * @property {number|null} [historicalEntries] Params historicalEntries + * @property {string|null} [bondDenom] Params bondDenom + */ + + /** + * Constructs a new Params. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a Params. + * @implements IParams + * @constructor + * @param {cosmos.staking.v1beta1.IParams=} [properties] Properties to set + */ + function Params(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Params unbondingTime. + * @member {google.protobuf.IDuration|null|undefined} unbondingTime + * @memberof cosmos.staking.v1beta1.Params + * @instance + */ + Params.prototype.unbondingTime = null; + + /** + * Params maxValidators. + * @member {number} maxValidators + * @memberof cosmos.staking.v1beta1.Params + * @instance + */ + Params.prototype.maxValidators = 0; + + /** + * Params maxEntries. + * @member {number} maxEntries + * @memberof cosmos.staking.v1beta1.Params + * @instance + */ + Params.prototype.maxEntries = 0; + + /** + * Params historicalEntries. + * @member {number} historicalEntries + * @memberof cosmos.staking.v1beta1.Params + * @instance + */ + Params.prototype.historicalEntries = 0; + + /** + * Params bondDenom. + * @member {string} bondDenom + * @memberof cosmos.staking.v1beta1.Params + * @instance + */ + Params.prototype.bondDenom = ""; + + /** + * Creates a new Params instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.Params + * @static + * @param {cosmos.staking.v1beta1.IParams=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.Params} Params instance + */ + Params.create = function create(properties) { + return new Params(properties); + }; + + /** + * Encodes the specified Params message. Does not implicitly {@link cosmos.staking.v1beta1.Params.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.Params + * @static + * @param {cosmos.staking.v1beta1.IParams} message Params message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Params.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.unbondingTime != null && Object.hasOwnProperty.call(message, "unbondingTime")) + $root.google.protobuf.Duration.encode(message.unbondingTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.maxValidators != null && Object.hasOwnProperty.call(message, "maxValidators")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.maxValidators); + if (message.maxEntries != null && Object.hasOwnProperty.call(message, "maxEntries")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.maxEntries); + if (message.historicalEntries != null && Object.hasOwnProperty.call(message, "historicalEntries")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.historicalEntries); + if (message.bondDenom != null && Object.hasOwnProperty.call(message, "bondDenom")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.bondDenom); + return writer; + }; + + /** + * Encodes the specified Params message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.Params.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.Params + * @static + * @param {cosmos.staking.v1beta1.IParams} message Params message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Params.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Params message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.Params + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.Params} Params + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Params.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.Params(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.unbondingTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 2: + message.maxValidators = reader.uint32(); + break; + case 3: + message.maxEntries = reader.uint32(); + break; + case 4: + message.historicalEntries = reader.uint32(); + break; + case 5: + message.bondDenom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Params message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.Params + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.Params} Params + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Params.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Params message. + * @function verify + * @memberof cosmos.staking.v1beta1.Params + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Params.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.unbondingTime != null && message.hasOwnProperty("unbondingTime")) { + var error = $root.google.protobuf.Duration.verify(message.unbondingTime); + if (error) + return "unbondingTime." + error; + } + if (message.maxValidators != null && message.hasOwnProperty("maxValidators")) + if (!$util.isInteger(message.maxValidators)) + return "maxValidators: integer expected"; + if (message.maxEntries != null && message.hasOwnProperty("maxEntries")) + if (!$util.isInteger(message.maxEntries)) + return "maxEntries: integer expected"; + if (message.historicalEntries != null && message.hasOwnProperty("historicalEntries")) + if (!$util.isInteger(message.historicalEntries)) + return "historicalEntries: integer expected"; + if (message.bondDenom != null && message.hasOwnProperty("bondDenom")) + if (!$util.isString(message.bondDenom)) + return "bondDenom: string expected"; + return null; + }; + + /** + * Creates a Params message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.Params + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.Params} Params + */ + Params.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.Params) + return object; + var message = new $root.cosmos.staking.v1beta1.Params(); + if (object.unbondingTime != null) { + if (typeof object.unbondingTime !== "object") + throw TypeError(".cosmos.staking.v1beta1.Params.unbondingTime: object expected"); + message.unbondingTime = $root.google.protobuf.Duration.fromObject(object.unbondingTime); + } + if (object.maxValidators != null) + message.maxValidators = object.maxValidators >>> 0; + if (object.maxEntries != null) + message.maxEntries = object.maxEntries >>> 0; + if (object.historicalEntries != null) + message.historicalEntries = object.historicalEntries >>> 0; + if (object.bondDenom != null) + message.bondDenom = String(object.bondDenom); + return message; + }; + + /** + * Creates a plain object from a Params message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.Params + * @static + * @param {cosmos.staking.v1beta1.Params} message Params + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Params.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.unbondingTime = null; + object.maxValidators = 0; + object.maxEntries = 0; + object.historicalEntries = 0; + object.bondDenom = ""; + } + if (message.unbondingTime != null && message.hasOwnProperty("unbondingTime")) + object.unbondingTime = $root.google.protobuf.Duration.toObject(message.unbondingTime, options); + if (message.maxValidators != null && message.hasOwnProperty("maxValidators")) + object.maxValidators = message.maxValidators; + if (message.maxEntries != null && message.hasOwnProperty("maxEntries")) + object.maxEntries = message.maxEntries; + if (message.historicalEntries != null && message.hasOwnProperty("historicalEntries")) + object.historicalEntries = message.historicalEntries; + if (message.bondDenom != null && message.hasOwnProperty("bondDenom")) + object.bondDenom = message.bondDenom; + return object; + }; + + /** + * Converts this Params to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.Params + * @instance + * @returns {Object.} JSON object + */ + Params.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Params; + })(v1beta1.Params || {}); + + v1beta1.DelegationResponse = (function(DelegationResponse) { + + /** + * Properties of a DelegationResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IDelegationResponse + * @property {cosmos.staking.v1beta1.IDelegation|null} [delegation] DelegationResponse delegation + * @property {cosmos.base.v1beta1.ICoin|null} [balance] DelegationResponse balance + */ + + /** + * Constructs a new DelegationResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a DelegationResponse. + * @implements IDelegationResponse + * @constructor + * @param {cosmos.staking.v1beta1.IDelegationResponse=} [properties] Properties to set + */ + function DelegationResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DelegationResponse delegation. + * @member {cosmos.staking.v1beta1.IDelegation|null|undefined} delegation + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @instance + */ + DelegationResponse.prototype.delegation = null; + + /** + * DelegationResponse balance. + * @member {cosmos.base.v1beta1.ICoin|null|undefined} balance + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @instance + */ + DelegationResponse.prototype.balance = null; + + /** + * Creates a new DelegationResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @static + * @param {cosmos.staking.v1beta1.IDelegationResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.DelegationResponse} DelegationResponse instance + */ + DelegationResponse.create = function create(properties) { + return new DelegationResponse(properties); + }; + + /** + * Encodes the specified DelegationResponse message. Does not implicitly {@link cosmos.staking.v1beta1.DelegationResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @static + * @param {cosmos.staking.v1beta1.IDelegationResponse} message DelegationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DelegationResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegation != null && Object.hasOwnProperty.call(message, "delegation")) + $root.cosmos.staking.v1beta1.Delegation.encode(message.delegation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) + $root.cosmos.base.v1beta1.Coin.encode(message.balance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DelegationResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.DelegationResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @static + * @param {cosmos.staking.v1beta1.IDelegationResponse} message DelegationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DelegationResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DelegationResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.DelegationResponse} DelegationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DelegationResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.DelegationResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegation = $root.cosmos.staking.v1beta1.Delegation.decode(reader, reader.uint32()); + break; + case 2: + message.balance = $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DelegationResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.DelegationResponse} DelegationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DelegationResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DelegationResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DelegationResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegation != null && message.hasOwnProperty("delegation")) { + var error = $root.cosmos.staking.v1beta1.Delegation.verify(message.delegation); + if (error) + return "delegation." + error; + } + if (message.balance != null && message.hasOwnProperty("balance")) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.balance); + if (error) + return "balance." + error; + } + return null; + }; + + /** + * Creates a DelegationResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.DelegationResponse} DelegationResponse + */ + DelegationResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.DelegationResponse) + return object; + var message = new $root.cosmos.staking.v1beta1.DelegationResponse(); + if (object.delegation != null) { + if (typeof object.delegation !== "object") + throw TypeError(".cosmos.staking.v1beta1.DelegationResponse.delegation: object expected"); + message.delegation = $root.cosmos.staking.v1beta1.Delegation.fromObject(object.delegation); + } + if (object.balance != null) { + if (typeof object.balance !== "object") + throw TypeError(".cosmos.staking.v1beta1.DelegationResponse.balance: object expected"); + message.balance = $root.cosmos.base.v1beta1.Coin.fromObject(object.balance); + } + return message; + }; + + /** + * Creates a plain object from a DelegationResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @static + * @param {cosmos.staking.v1beta1.DelegationResponse} message DelegationResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DelegationResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.delegation = null; + object.balance = null; + } + if (message.delegation != null && message.hasOwnProperty("delegation")) + object.delegation = $root.cosmos.staking.v1beta1.Delegation.toObject(message.delegation, options); + if (message.balance != null && message.hasOwnProperty("balance")) + object.balance = $root.cosmos.base.v1beta1.Coin.toObject(message.balance, options); + return object; + }; + + /** + * Converts this DelegationResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @instance + * @returns {Object.} JSON object + */ + DelegationResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DelegationResponse; + })(v1beta1.DelegationResponse || {}); + + v1beta1.RedelegationEntryResponse = (function(RedelegationEntryResponse) { + + /** + * Properties of a RedelegationEntryResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IRedelegationEntryResponse + * @property {cosmos.staking.v1beta1.IRedelegationEntry|null} [redelegationEntry] RedelegationEntryResponse redelegationEntry + * @property {string|null} [balance] RedelegationEntryResponse balance + */ + + /** + * Constructs a new RedelegationEntryResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a RedelegationEntryResponse. + * @implements IRedelegationEntryResponse + * @constructor + * @param {cosmos.staking.v1beta1.IRedelegationEntryResponse=} [properties] Properties to set + */ + function RedelegationEntryResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RedelegationEntryResponse redelegationEntry. + * @member {cosmos.staking.v1beta1.IRedelegationEntry|null|undefined} redelegationEntry + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @instance + */ + RedelegationEntryResponse.prototype.redelegationEntry = null; + + /** + * RedelegationEntryResponse balance. + * @member {string} balance + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @instance + */ + RedelegationEntryResponse.prototype.balance = ""; + + /** + * Creates a new RedelegationEntryResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @static + * @param {cosmos.staking.v1beta1.IRedelegationEntryResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.RedelegationEntryResponse} RedelegationEntryResponse instance + */ + RedelegationEntryResponse.create = function create(properties) { + return new RedelegationEntryResponse(properties); + }; + + /** + * Encodes the specified RedelegationEntryResponse message. Does not implicitly {@link cosmos.staking.v1beta1.RedelegationEntryResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @static + * @param {cosmos.staking.v1beta1.IRedelegationEntryResponse} message RedelegationEntryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedelegationEntryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.redelegationEntry != null && Object.hasOwnProperty.call(message, "redelegationEntry")) + $root.cosmos.staking.v1beta1.RedelegationEntry.encode(message.redelegationEntry, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.balance); + return writer; + }; + + /** + * Encodes the specified RedelegationEntryResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.RedelegationEntryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @static + * @param {cosmos.staking.v1beta1.IRedelegationEntryResponse} message RedelegationEntryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedelegationEntryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RedelegationEntryResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.RedelegationEntryResponse} RedelegationEntryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedelegationEntryResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.RedelegationEntryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.redelegationEntry = $root.cosmos.staking.v1beta1.RedelegationEntry.decode(reader, reader.uint32()); + break; + case 4: + message.balance = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RedelegationEntryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.RedelegationEntryResponse} RedelegationEntryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedelegationEntryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RedelegationEntryResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RedelegationEntryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.redelegationEntry != null && message.hasOwnProperty("redelegationEntry")) { + var error = $root.cosmos.staking.v1beta1.RedelegationEntry.verify(message.redelegationEntry); + if (error) + return "redelegationEntry." + error; + } + if (message.balance != null && message.hasOwnProperty("balance")) + if (!$util.isString(message.balance)) + return "balance: string expected"; + return null; + }; + + /** + * Creates a RedelegationEntryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.RedelegationEntryResponse} RedelegationEntryResponse + */ + RedelegationEntryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.RedelegationEntryResponse) + return object; + var message = new $root.cosmos.staking.v1beta1.RedelegationEntryResponse(); + if (object.redelegationEntry != null) { + if (typeof object.redelegationEntry !== "object") + throw TypeError(".cosmos.staking.v1beta1.RedelegationEntryResponse.redelegationEntry: object expected"); + message.redelegationEntry = $root.cosmos.staking.v1beta1.RedelegationEntry.fromObject(object.redelegationEntry); + } + if (object.balance != null) + message.balance = String(object.balance); + return message; + }; + + /** + * Creates a plain object from a RedelegationEntryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @static + * @param {cosmos.staking.v1beta1.RedelegationEntryResponse} message RedelegationEntryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RedelegationEntryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.redelegationEntry = null; + object.balance = ""; + } + if (message.redelegationEntry != null && message.hasOwnProperty("redelegationEntry")) + object.redelegationEntry = $root.cosmos.staking.v1beta1.RedelegationEntry.toObject(message.redelegationEntry, options); + if (message.balance != null && message.hasOwnProperty("balance")) + object.balance = message.balance; + return object; + }; + + /** + * Converts this RedelegationEntryResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @instance + * @returns {Object.} JSON object + */ + RedelegationEntryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RedelegationEntryResponse; + })(v1beta1.RedelegationEntryResponse || {}); + + v1beta1.RedelegationResponse = (function(RedelegationResponse) { + + /** + * Properties of a RedelegationResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IRedelegationResponse + * @property {cosmos.staking.v1beta1.IRedelegation|null} [redelegation] RedelegationResponse redelegation + * @property {Array.|null} [entries] RedelegationResponse entries + */ + + /** + * Constructs a new RedelegationResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a RedelegationResponse. + * @implements IRedelegationResponse + * @constructor + * @param {cosmos.staking.v1beta1.IRedelegationResponse=} [properties] Properties to set + */ + function RedelegationResponse(properties) { + this.entries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RedelegationResponse redelegation. + * @member {cosmos.staking.v1beta1.IRedelegation|null|undefined} redelegation + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @instance + */ + RedelegationResponse.prototype.redelegation = null; + + /** + * RedelegationResponse entries. + * @member {Array.} entries + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @instance + */ + RedelegationResponse.prototype.entries = $util.emptyArray; + + /** + * Creates a new RedelegationResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @static + * @param {cosmos.staking.v1beta1.IRedelegationResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.RedelegationResponse} RedelegationResponse instance + */ + RedelegationResponse.create = function create(properties) { + return new RedelegationResponse(properties); + }; + + /** + * Encodes the specified RedelegationResponse message. Does not implicitly {@link cosmos.staking.v1beta1.RedelegationResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @static + * @param {cosmos.staking.v1beta1.IRedelegationResponse} message RedelegationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedelegationResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.redelegation != null && Object.hasOwnProperty.call(message, "redelegation")) + $root.cosmos.staking.v1beta1.Redelegation.encode(message.redelegation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.entries != null && message.entries.length) + for (var i = 0; i < message.entries.length; ++i) + $root.cosmos.staking.v1beta1.RedelegationEntryResponse.encode(message.entries[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RedelegationResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.RedelegationResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @static + * @param {cosmos.staking.v1beta1.IRedelegationResponse} message RedelegationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedelegationResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RedelegationResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.RedelegationResponse} RedelegationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedelegationResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.RedelegationResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.redelegation = $root.cosmos.staking.v1beta1.Redelegation.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.cosmos.staking.v1beta1.RedelegationEntryResponse.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RedelegationResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.RedelegationResponse} RedelegationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedelegationResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RedelegationResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RedelegationResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.redelegation != null && message.hasOwnProperty("redelegation")) { + var error = $root.cosmos.staking.v1beta1.Redelegation.verify(message.redelegation); + if (error) + return "redelegation." + error; + } + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (var i = 0; i < message.entries.length; ++i) { + var error = $root.cosmos.staking.v1beta1.RedelegationEntryResponse.verify(message.entries[i]); + if (error) + return "entries." + error; + } + } + return null; + }; + + /** + * Creates a RedelegationResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.RedelegationResponse} RedelegationResponse + */ + RedelegationResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.RedelegationResponse) + return object; + var message = new $root.cosmos.staking.v1beta1.RedelegationResponse(); + if (object.redelegation != null) { + if (typeof object.redelegation !== "object") + throw TypeError(".cosmos.staking.v1beta1.RedelegationResponse.redelegation: object expected"); + message.redelegation = $root.cosmos.staking.v1beta1.Redelegation.fromObject(object.redelegation); + } + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".cosmos.staking.v1beta1.RedelegationResponse.entries: array expected"); + message.entries = []; + for (var i = 0; i < object.entries.length; ++i) { + if (typeof object.entries[i] !== "object") + throw TypeError(".cosmos.staking.v1beta1.RedelegationResponse.entries: object expected"); + message.entries[i] = $root.cosmos.staking.v1beta1.RedelegationEntryResponse.fromObject(object.entries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RedelegationResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @static + * @param {cosmos.staking.v1beta1.RedelegationResponse} message RedelegationResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RedelegationResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (options.defaults) + object.redelegation = null; + if (message.redelegation != null && message.hasOwnProperty("redelegation")) + object.redelegation = $root.cosmos.staking.v1beta1.Redelegation.toObject(message.redelegation, options); + if (message.entries && message.entries.length) { + object.entries = []; + for (var j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.cosmos.staking.v1beta1.RedelegationEntryResponse.toObject(message.entries[j], options); + } + return object; + }; + + /** + * Converts this RedelegationResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @instance + * @returns {Object.} JSON object + */ + RedelegationResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RedelegationResponse; + })(v1beta1.RedelegationResponse || {}); + + v1beta1.Pool = (function(Pool) { + + /** + * Properties of a Pool. + * @memberof cosmos.staking.v1beta1 + * @interface IPool + * @property {string|null} [notBondedTokens] Pool notBondedTokens + * @property {string|null} [bondedTokens] Pool bondedTokens + */ + + /** + * Constructs a new Pool. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a Pool. + * @implements IPool + * @constructor + * @param {cosmos.staking.v1beta1.IPool=} [properties] Properties to set + */ + function Pool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Pool notBondedTokens. + * @member {string} notBondedTokens + * @memberof cosmos.staking.v1beta1.Pool + * @instance + */ + Pool.prototype.notBondedTokens = ""; + + /** + * Pool bondedTokens. + * @member {string} bondedTokens + * @memberof cosmos.staking.v1beta1.Pool + * @instance + */ + Pool.prototype.bondedTokens = ""; + + /** + * Creates a new Pool instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.Pool + * @static + * @param {cosmos.staking.v1beta1.IPool=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.Pool} Pool instance + */ + Pool.create = function create(properties) { + return new Pool(properties); + }; + + /** + * Encodes the specified Pool message. Does not implicitly {@link cosmos.staking.v1beta1.Pool.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.Pool + * @static + * @param {cosmos.staking.v1beta1.IPool} message Pool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Pool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.notBondedTokens != null && Object.hasOwnProperty.call(message, "notBondedTokens")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.notBondedTokens); + if (message.bondedTokens != null && Object.hasOwnProperty.call(message, "bondedTokens")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.bondedTokens); + return writer; + }; + + /** + * Encodes the specified Pool message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.Pool.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.Pool + * @static + * @param {cosmos.staking.v1beta1.IPool} message Pool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Pool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Pool message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.Pool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.Pool} Pool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Pool.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.Pool(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.notBondedTokens = reader.string(); + break; + case 2: + message.bondedTokens = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Pool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.Pool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.Pool} Pool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Pool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Pool message. + * @function verify + * @memberof cosmos.staking.v1beta1.Pool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Pool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.notBondedTokens != null && message.hasOwnProperty("notBondedTokens")) + if (!$util.isString(message.notBondedTokens)) + return "notBondedTokens: string expected"; + if (message.bondedTokens != null && message.hasOwnProperty("bondedTokens")) + if (!$util.isString(message.bondedTokens)) + return "bondedTokens: string expected"; + return null; + }; + + /** + * Creates a Pool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.Pool + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.Pool} Pool + */ + Pool.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.Pool) + return object; + var message = new $root.cosmos.staking.v1beta1.Pool(); + if (object.notBondedTokens != null) + message.notBondedTokens = String(object.notBondedTokens); + if (object.bondedTokens != null) + message.bondedTokens = String(object.bondedTokens); + return message; + }; + + /** + * Creates a plain object from a Pool message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.Pool + * @static + * @param {cosmos.staking.v1beta1.Pool} message Pool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Pool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.notBondedTokens = ""; + object.bondedTokens = ""; + } + if (message.notBondedTokens != null && message.hasOwnProperty("notBondedTokens")) + object.notBondedTokens = message.notBondedTokens; + if (message.bondedTokens != null && message.hasOwnProperty("bondedTokens")) + object.bondedTokens = message.bondedTokens; + return object; + }; + + /** + * Converts this Pool to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.Pool + * @instance + * @returns {Object.} JSON object + */ + Pool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Pool; + })(v1beta1.Pool || {}); + + v1beta1.Msg = (function(Msg) { + + /** + * Constructs a new Msg service. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a Msg + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Msg(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; + + /** + * Creates new Msg service using the specified rpc implementation. + * @function create + * @memberof cosmos.staking.v1beta1.Msg + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Msg} RPC service. Useful where requests and/or responses are streamed. + */ + Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.staking.v1beta1.Msg#createValidator}. + * @memberof cosmos.staking.v1beta1.Msg + * @typedef CreateValidatorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.staking.v1beta1.IMsgCreateValidatorResponse} [response] MsgCreateValidatorResponse + */ + + /** + * Calls CreateValidator. + * @function createValidator + * @memberof cosmos.staking.v1beta1.Msg + * @instance + * @param {cosmos.staking.v1beta1.IMsgCreateValidator} request MsgCreateValidator message or plain object + * @param {cosmos.staking.v1beta1.Msg.CreateValidatorCallback} callback Node-style callback called with the error, if any, and MsgCreateValidatorResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.createValidator = function createValidator(request, callback) { + return this.rpcCall(createValidator, $root.cosmos.staking.v1beta1.MsgCreateValidator, $root.cosmos.staking.v1beta1.MsgCreateValidatorResponse, request, callback); + }, "name", { value: "CreateValidator" }); + + /** + * Calls CreateValidator. + * @function createValidator + * @memberof cosmos.staking.v1beta1.Msg + * @instance + * @param {cosmos.staking.v1beta1.IMsgCreateValidator} request MsgCreateValidator message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.staking.v1beta1.Msg#editValidator}. + * @memberof cosmos.staking.v1beta1.Msg + * @typedef EditValidatorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.staking.v1beta1.IMsgEditValidatorResponse} [response] MsgEditValidatorResponse + */ + + /** + * Calls EditValidator. + * @function editValidator + * @memberof cosmos.staking.v1beta1.Msg + * @instance + * @param {cosmos.staking.v1beta1.IMsgEditValidator} request MsgEditValidator message or plain object + * @param {cosmos.staking.v1beta1.Msg.EditValidatorCallback} callback Node-style callback called with the error, if any, and MsgEditValidatorResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.editValidator = function editValidator(request, callback) { + return this.rpcCall(editValidator, $root.cosmos.staking.v1beta1.MsgEditValidator, $root.cosmos.staking.v1beta1.MsgEditValidatorResponse, request, callback); + }, "name", { value: "EditValidator" }); + + /** + * Calls EditValidator. + * @function editValidator + * @memberof cosmos.staking.v1beta1.Msg + * @instance + * @param {cosmos.staking.v1beta1.IMsgEditValidator} request MsgEditValidator message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.staking.v1beta1.Msg#delegate}. + * @memberof cosmos.staking.v1beta1.Msg + * @typedef DelegateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.staking.v1beta1.IMsgDelegateResponse} [response] MsgDelegateResponse + */ + + /** + * Calls Delegate. + * @function delegate + * @memberof cosmos.staking.v1beta1.Msg + * @instance + * @param {cosmos.staking.v1beta1.IMsgDelegate} request MsgDelegate message or plain object + * @param {cosmos.staking.v1beta1.Msg.DelegateCallback} callback Node-style callback called with the error, if any, and MsgDelegateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.delegate = function delegate(request, callback) { + return this.rpcCall(delegate, $root.cosmos.staking.v1beta1.MsgDelegate, $root.cosmos.staking.v1beta1.MsgDelegateResponse, request, callback); + }, "name", { value: "Delegate" }); + + /** + * Calls Delegate. + * @function delegate + * @memberof cosmos.staking.v1beta1.Msg + * @instance + * @param {cosmos.staking.v1beta1.IMsgDelegate} request MsgDelegate message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.staking.v1beta1.Msg#beginRedelegate}. + * @memberof cosmos.staking.v1beta1.Msg + * @typedef BeginRedelegateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegateResponse} [response] MsgBeginRedelegateResponse + */ + + /** + * Calls BeginRedelegate. + * @function beginRedelegate + * @memberof cosmos.staking.v1beta1.Msg + * @instance + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegate} request MsgBeginRedelegate message or plain object + * @param {cosmos.staking.v1beta1.Msg.BeginRedelegateCallback} callback Node-style callback called with the error, if any, and MsgBeginRedelegateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.beginRedelegate = function beginRedelegate(request, callback) { + return this.rpcCall(beginRedelegate, $root.cosmos.staking.v1beta1.MsgBeginRedelegate, $root.cosmos.staking.v1beta1.MsgBeginRedelegateResponse, request, callback); + }, "name", { value: "BeginRedelegate" }); + + /** + * Calls BeginRedelegate. + * @function beginRedelegate + * @memberof cosmos.staking.v1beta1.Msg + * @instance + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegate} request MsgBeginRedelegate message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.staking.v1beta1.Msg#undelegate}. + * @memberof cosmos.staking.v1beta1.Msg + * @typedef UndelegateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.staking.v1beta1.IMsgUndelegateResponse} [response] MsgUndelegateResponse + */ + + /** + * Calls Undelegate. + * @function undelegate + * @memberof cosmos.staking.v1beta1.Msg + * @instance + * @param {cosmos.staking.v1beta1.IMsgUndelegate} request MsgUndelegate message or plain object + * @param {cosmos.staking.v1beta1.Msg.UndelegateCallback} callback Node-style callback called with the error, if any, and MsgUndelegateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.undelegate = function undelegate(request, callback) { + return this.rpcCall(undelegate, $root.cosmos.staking.v1beta1.MsgUndelegate, $root.cosmos.staking.v1beta1.MsgUndelegateResponse, request, callback); + }, "name", { value: "Undelegate" }); + + /** + * Calls Undelegate. + * @function undelegate + * @memberof cosmos.staking.v1beta1.Msg + * @instance + * @param {cosmos.staking.v1beta1.IMsgUndelegate} request MsgUndelegate message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Msg; + })(v1beta1.Msg || {}); + + v1beta1.MsgCreateValidator = (function(MsgCreateValidator) { + + /** + * Properties of a MsgCreateValidator. + * @memberof cosmos.staking.v1beta1 + * @interface IMsgCreateValidator + * @property {cosmos.staking.v1beta1.IDescription|null} [description] MsgCreateValidator description + * @property {cosmos.staking.v1beta1.ICommissionRates|null} [commission] MsgCreateValidator commission + * @property {string|null} [minSelfDelegation] MsgCreateValidator minSelfDelegation + * @property {string|null} [delegatorAddress] MsgCreateValidator delegatorAddress + * @property {string|null} [validatorAddress] MsgCreateValidator validatorAddress + * @property {google.protobuf.IAny|null} [pubkey] MsgCreateValidator pubkey + * @property {cosmos.base.v1beta1.ICoin|null} [value] MsgCreateValidator value + */ + + /** + * Constructs a new MsgCreateValidator. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a MsgCreateValidator. + * @implements IMsgCreateValidator + * @constructor + * @param {cosmos.staking.v1beta1.IMsgCreateValidator=} [properties] Properties to set + */ + function MsgCreateValidator(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgCreateValidator description. + * @member {cosmos.staking.v1beta1.IDescription|null|undefined} description + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @instance + */ + MsgCreateValidator.prototype.description = null; + + /** + * MsgCreateValidator commission. + * @member {cosmos.staking.v1beta1.ICommissionRates|null|undefined} commission + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @instance + */ + MsgCreateValidator.prototype.commission = null; + + /** + * MsgCreateValidator minSelfDelegation. + * @member {string} minSelfDelegation + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @instance + */ + MsgCreateValidator.prototype.minSelfDelegation = ""; + + /** + * MsgCreateValidator delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @instance + */ + MsgCreateValidator.prototype.delegatorAddress = ""; + + /** + * MsgCreateValidator validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @instance + */ + MsgCreateValidator.prototype.validatorAddress = ""; + + /** + * MsgCreateValidator pubkey. + * @member {google.protobuf.IAny|null|undefined} pubkey + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @instance + */ + MsgCreateValidator.prototype.pubkey = null; + + /** + * MsgCreateValidator value. + * @member {cosmos.base.v1beta1.ICoin|null|undefined} value + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @instance + */ + MsgCreateValidator.prototype.value = null; + + /** + * Creates a new MsgCreateValidator instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @static + * @param {cosmos.staking.v1beta1.IMsgCreateValidator=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.MsgCreateValidator} MsgCreateValidator instance + */ + MsgCreateValidator.create = function create(properties) { + return new MsgCreateValidator(properties); + }; + + /** + * Encodes the specified MsgCreateValidator message. Does not implicitly {@link cosmos.staking.v1beta1.MsgCreateValidator.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @static + * @param {cosmos.staking.v1beta1.IMsgCreateValidator} message MsgCreateValidator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateValidator.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + $root.cosmos.staking.v1beta1.Description.encode(message.description, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.commission != null && Object.hasOwnProperty.call(message, "commission")) + $root.cosmos.staking.v1beta1.CommissionRates.encode(message.commission, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.minSelfDelegation != null && Object.hasOwnProperty.call(message, "minSelfDelegation")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.minSelfDelegation); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.delegatorAddress); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.validatorAddress); + if (message.pubkey != null && Object.hasOwnProperty.call(message, "pubkey")) + $root.google.protobuf.Any.encode(message.pubkey, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.cosmos.base.v1beta1.Coin.encode(message.value, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MsgCreateValidator message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgCreateValidator.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @static + * @param {cosmos.staking.v1beta1.IMsgCreateValidator} message MsgCreateValidator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateValidator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgCreateValidator message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.MsgCreateValidator} MsgCreateValidator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateValidator.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.MsgCreateValidator(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.description = $root.cosmos.staking.v1beta1.Description.decode(reader, reader.uint32()); + break; + case 2: + message.commission = $root.cosmos.staking.v1beta1.CommissionRates.decode(reader, reader.uint32()); + break; + case 3: + message.minSelfDelegation = reader.string(); + break; + case 4: + message.delegatorAddress = reader.string(); + break; + case 5: + message.validatorAddress = reader.string(); + break; + case 6: + message.pubkey = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 7: + message.value = $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgCreateValidator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.MsgCreateValidator} MsgCreateValidator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateValidator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgCreateValidator message. + * @function verify + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgCreateValidator.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.description != null && message.hasOwnProperty("description")) { + var error = $root.cosmos.staking.v1beta1.Description.verify(message.description); + if (error) + return "description." + error; + } + if (message.commission != null && message.hasOwnProperty("commission")) { + var error = $root.cosmos.staking.v1beta1.CommissionRates.verify(message.commission); + if (error) + return "commission." + error; + } + if (message.minSelfDelegation != null && message.hasOwnProperty("minSelfDelegation")) + if (!$util.isString(message.minSelfDelegation)) + return "minSelfDelegation: string expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + if (message.pubkey != null && message.hasOwnProperty("pubkey")) { + var error = $root.google.protobuf.Any.verify(message.pubkey); + if (error) + return "pubkey." + error; + } + if (message.value != null && message.hasOwnProperty("value")) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.value); + if (error) + return "value." + error; + } + return null; + }; + + /** + * Creates a MsgCreateValidator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.MsgCreateValidator} MsgCreateValidator + */ + MsgCreateValidator.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.MsgCreateValidator) + return object; + var message = new $root.cosmos.staking.v1beta1.MsgCreateValidator(); + if (object.description != null) { + if (typeof object.description !== "object") + throw TypeError(".cosmos.staking.v1beta1.MsgCreateValidator.description: object expected"); + message.description = $root.cosmos.staking.v1beta1.Description.fromObject(object.description); + } + if (object.commission != null) { + if (typeof object.commission !== "object") + throw TypeError(".cosmos.staking.v1beta1.MsgCreateValidator.commission: object expected"); + message.commission = $root.cosmos.staking.v1beta1.CommissionRates.fromObject(object.commission); + } + if (object.minSelfDelegation != null) + message.minSelfDelegation = String(object.minSelfDelegation); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + if (object.pubkey != null) { + if (typeof object.pubkey !== "object") + throw TypeError(".cosmos.staking.v1beta1.MsgCreateValidator.pubkey: object expected"); + message.pubkey = $root.google.protobuf.Any.fromObject(object.pubkey); + } + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".cosmos.staking.v1beta1.MsgCreateValidator.value: object expected"); + message.value = $root.cosmos.base.v1beta1.Coin.fromObject(object.value); + } + return message; + }; + + /** + * Creates a plain object from a MsgCreateValidator message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @static + * @param {cosmos.staking.v1beta1.MsgCreateValidator} message MsgCreateValidator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgCreateValidator.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.description = null; + object.commission = null; + object.minSelfDelegation = ""; + object.delegatorAddress = ""; + object.validatorAddress = ""; + object.pubkey = null; + object.value = null; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = $root.cosmos.staking.v1beta1.Description.toObject(message.description, options); + if (message.commission != null && message.hasOwnProperty("commission")) + object.commission = $root.cosmos.staking.v1beta1.CommissionRates.toObject(message.commission, options); + if (message.minSelfDelegation != null && message.hasOwnProperty("minSelfDelegation")) + object.minSelfDelegation = message.minSelfDelegation; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + if (message.pubkey != null && message.hasOwnProperty("pubkey")) + object.pubkey = $root.google.protobuf.Any.toObject(message.pubkey, options); + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.cosmos.base.v1beta1.Coin.toObject(message.value, options); + return object; + }; + + /** + * Converts this MsgCreateValidator to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @instance + * @returns {Object.} JSON object + */ + MsgCreateValidator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgCreateValidator; + })(v1beta1.MsgCreateValidator || {}); + + v1beta1.MsgCreateValidatorResponse = (function(MsgCreateValidatorResponse) { + + /** + * Properties of a MsgCreateValidatorResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IMsgCreateValidatorResponse + */ + + /** + * Constructs a new MsgCreateValidatorResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a MsgCreateValidatorResponse. + * @implements IMsgCreateValidatorResponse + * @constructor + * @param {cosmos.staking.v1beta1.IMsgCreateValidatorResponse=} [properties] Properties to set + */ + function MsgCreateValidatorResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgCreateValidatorResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgCreateValidatorResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.MsgCreateValidatorResponse} MsgCreateValidatorResponse instance + */ + MsgCreateValidatorResponse.create = function create(properties) { + return new MsgCreateValidatorResponse(properties); + }; + + /** + * Encodes the specified MsgCreateValidatorResponse message. Does not implicitly {@link cosmos.staking.v1beta1.MsgCreateValidatorResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgCreateValidatorResponse} message MsgCreateValidatorResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateValidatorResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgCreateValidatorResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgCreateValidatorResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgCreateValidatorResponse} message MsgCreateValidatorResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateValidatorResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgCreateValidatorResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.MsgCreateValidatorResponse} MsgCreateValidatorResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateValidatorResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.MsgCreateValidatorResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgCreateValidatorResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.MsgCreateValidatorResponse} MsgCreateValidatorResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateValidatorResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgCreateValidatorResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgCreateValidatorResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgCreateValidatorResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.MsgCreateValidatorResponse} MsgCreateValidatorResponse + */ + MsgCreateValidatorResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.MsgCreateValidatorResponse) + return object; + return new $root.cosmos.staking.v1beta1.MsgCreateValidatorResponse(); + }; + + /** + * Creates a plain object from a MsgCreateValidatorResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse + * @static + * @param {cosmos.staking.v1beta1.MsgCreateValidatorResponse} message MsgCreateValidatorResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgCreateValidatorResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgCreateValidatorResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse + * @instance + * @returns {Object.} JSON object + */ + MsgCreateValidatorResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgCreateValidatorResponse; + })(v1beta1.MsgCreateValidatorResponse || {}); + + v1beta1.MsgEditValidator = (function(MsgEditValidator) { + + /** + * Properties of a MsgEditValidator. + * @memberof cosmos.staking.v1beta1 + * @interface IMsgEditValidator + * @property {cosmos.staking.v1beta1.IDescription|null} [description] MsgEditValidator description + * @property {string|null} [validatorAddress] MsgEditValidator validatorAddress + * @property {string|null} [commissionRate] MsgEditValidator commissionRate + * @property {string|null} [minSelfDelegation] MsgEditValidator minSelfDelegation + */ + + /** + * Constructs a new MsgEditValidator. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a MsgEditValidator. + * @implements IMsgEditValidator + * @constructor + * @param {cosmos.staking.v1beta1.IMsgEditValidator=} [properties] Properties to set + */ + function MsgEditValidator(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgEditValidator description. + * @member {cosmos.staking.v1beta1.IDescription|null|undefined} description + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @instance + */ + MsgEditValidator.prototype.description = null; + + /** + * MsgEditValidator validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @instance + */ + MsgEditValidator.prototype.validatorAddress = ""; + + /** + * MsgEditValidator commissionRate. + * @member {string} commissionRate + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @instance + */ + MsgEditValidator.prototype.commissionRate = ""; + + /** + * MsgEditValidator minSelfDelegation. + * @member {string} minSelfDelegation + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @instance + */ + MsgEditValidator.prototype.minSelfDelegation = ""; + + /** + * Creates a new MsgEditValidator instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @static + * @param {cosmos.staking.v1beta1.IMsgEditValidator=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.MsgEditValidator} MsgEditValidator instance + */ + MsgEditValidator.create = function create(properties) { + return new MsgEditValidator(properties); + }; + + /** + * Encodes the specified MsgEditValidator message. Does not implicitly {@link cosmos.staking.v1beta1.MsgEditValidator.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @static + * @param {cosmos.staking.v1beta1.IMsgEditValidator} message MsgEditValidator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgEditValidator.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + $root.cosmos.staking.v1beta1.Description.encode(message.description, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddress); + if (message.commissionRate != null && Object.hasOwnProperty.call(message, "commissionRate")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.commissionRate); + if (message.minSelfDelegation != null && Object.hasOwnProperty.call(message, "minSelfDelegation")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.minSelfDelegation); + return writer; + }; + + /** + * Encodes the specified MsgEditValidator message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgEditValidator.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @static + * @param {cosmos.staking.v1beta1.IMsgEditValidator} message MsgEditValidator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgEditValidator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgEditValidator message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.MsgEditValidator} MsgEditValidator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgEditValidator.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.MsgEditValidator(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.description = $root.cosmos.staking.v1beta1.Description.decode(reader, reader.uint32()); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.commissionRate = reader.string(); + break; + case 4: + message.minSelfDelegation = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgEditValidator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.MsgEditValidator} MsgEditValidator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgEditValidator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgEditValidator message. + * @function verify + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgEditValidator.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.description != null && message.hasOwnProperty("description")) { + var error = $root.cosmos.staking.v1beta1.Description.verify(message.description); + if (error) + return "description." + error; + } + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + if (message.commissionRate != null && message.hasOwnProperty("commissionRate")) + if (!$util.isString(message.commissionRate)) + return "commissionRate: string expected"; + if (message.minSelfDelegation != null && message.hasOwnProperty("minSelfDelegation")) + if (!$util.isString(message.minSelfDelegation)) + return "minSelfDelegation: string expected"; + return null; + }; + + /** + * Creates a MsgEditValidator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.MsgEditValidator} MsgEditValidator + */ + MsgEditValidator.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.MsgEditValidator) + return object; + var message = new $root.cosmos.staking.v1beta1.MsgEditValidator(); + if (object.description != null) { + if (typeof object.description !== "object") + throw TypeError(".cosmos.staking.v1beta1.MsgEditValidator.description: object expected"); + message.description = $root.cosmos.staking.v1beta1.Description.fromObject(object.description); + } + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + if (object.commissionRate != null) + message.commissionRate = String(object.commissionRate); + if (object.minSelfDelegation != null) + message.minSelfDelegation = String(object.minSelfDelegation); + return message; + }; + + /** + * Creates a plain object from a MsgEditValidator message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @static + * @param {cosmos.staking.v1beta1.MsgEditValidator} message MsgEditValidator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgEditValidator.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.description = null; + object.validatorAddress = ""; + object.commissionRate = ""; + object.minSelfDelegation = ""; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = $root.cosmos.staking.v1beta1.Description.toObject(message.description, options); + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + if (message.commissionRate != null && message.hasOwnProperty("commissionRate")) + object.commissionRate = message.commissionRate; + if (message.minSelfDelegation != null && message.hasOwnProperty("minSelfDelegation")) + object.minSelfDelegation = message.minSelfDelegation; + return object; + }; + + /** + * Converts this MsgEditValidator to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @instance + * @returns {Object.} JSON object + */ + MsgEditValidator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgEditValidator; + })(v1beta1.MsgEditValidator || {}); + + v1beta1.MsgEditValidatorResponse = (function(MsgEditValidatorResponse) { + + /** + * Properties of a MsgEditValidatorResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IMsgEditValidatorResponse + */ + + /** + * Constructs a new MsgEditValidatorResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a MsgEditValidatorResponse. + * @implements IMsgEditValidatorResponse + * @constructor + * @param {cosmos.staking.v1beta1.IMsgEditValidatorResponse=} [properties] Properties to set + */ + function MsgEditValidatorResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgEditValidatorResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgEditValidatorResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.MsgEditValidatorResponse} MsgEditValidatorResponse instance + */ + MsgEditValidatorResponse.create = function create(properties) { + return new MsgEditValidatorResponse(properties); + }; + + /** + * Encodes the specified MsgEditValidatorResponse message. Does not implicitly {@link cosmos.staking.v1beta1.MsgEditValidatorResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgEditValidatorResponse} message MsgEditValidatorResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgEditValidatorResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgEditValidatorResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgEditValidatorResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgEditValidatorResponse} message MsgEditValidatorResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgEditValidatorResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgEditValidatorResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.MsgEditValidatorResponse} MsgEditValidatorResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgEditValidatorResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.MsgEditValidatorResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgEditValidatorResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.MsgEditValidatorResponse} MsgEditValidatorResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgEditValidatorResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgEditValidatorResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgEditValidatorResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgEditValidatorResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.MsgEditValidatorResponse} MsgEditValidatorResponse + */ + MsgEditValidatorResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.MsgEditValidatorResponse) + return object; + return new $root.cosmos.staking.v1beta1.MsgEditValidatorResponse(); + }; + + /** + * Creates a plain object from a MsgEditValidatorResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse + * @static + * @param {cosmos.staking.v1beta1.MsgEditValidatorResponse} message MsgEditValidatorResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgEditValidatorResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgEditValidatorResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse + * @instance + * @returns {Object.} JSON object + */ + MsgEditValidatorResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgEditValidatorResponse; + })(v1beta1.MsgEditValidatorResponse || {}); + + v1beta1.MsgDelegate = (function(MsgDelegate) { + + /** + * Properties of a MsgDelegate. + * @memberof cosmos.staking.v1beta1 + * @interface IMsgDelegate + * @property {string|null} [delegatorAddress] MsgDelegate delegatorAddress + * @property {string|null} [validatorAddress] MsgDelegate validatorAddress + * @property {cosmos.base.v1beta1.ICoin|null} [amount] MsgDelegate amount + */ + + /** + * Constructs a new MsgDelegate. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a MsgDelegate. + * @implements IMsgDelegate + * @constructor + * @param {cosmos.staking.v1beta1.IMsgDelegate=} [properties] Properties to set + */ + function MsgDelegate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgDelegate delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @instance + */ + MsgDelegate.prototype.delegatorAddress = ""; + + /** + * MsgDelegate validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @instance + */ + MsgDelegate.prototype.validatorAddress = ""; + + /** + * MsgDelegate amount. + * @member {cosmos.base.v1beta1.ICoin|null|undefined} amount + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @instance + */ + MsgDelegate.prototype.amount = null; + + /** + * Creates a new MsgDelegate instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @static + * @param {cosmos.staking.v1beta1.IMsgDelegate=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.MsgDelegate} MsgDelegate instance + */ + MsgDelegate.create = function create(properties) { + return new MsgDelegate(properties); + }; + + /** + * Encodes the specified MsgDelegate message. Does not implicitly {@link cosmos.staking.v1beta1.MsgDelegate.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @static + * @param {cosmos.staking.v1beta1.IMsgDelegate} message MsgDelegate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgDelegate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddress); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + $root.cosmos.base.v1beta1.Coin.encode(message.amount, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MsgDelegate message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgDelegate.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @static + * @param {cosmos.staking.v1beta1.IMsgDelegate} message MsgDelegate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgDelegate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgDelegate message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.MsgDelegate} MsgDelegate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgDelegate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.MsgDelegate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.amount = $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgDelegate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.MsgDelegate} MsgDelegate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgDelegate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgDelegate message. + * @function verify + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgDelegate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.amount); + if (error) + return "amount." + error; + } + return null; + }; + + /** + * Creates a MsgDelegate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.MsgDelegate} MsgDelegate + */ + MsgDelegate.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.MsgDelegate) + return object; + var message = new $root.cosmos.staking.v1beta1.MsgDelegate(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + if (object.amount != null) { + if (typeof object.amount !== "object") + throw TypeError(".cosmos.staking.v1beta1.MsgDelegate.amount: object expected"); + message.amount = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount); + } + return message; + }; + + /** + * Creates a plain object from a MsgDelegate message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @static + * @param {cosmos.staking.v1beta1.MsgDelegate} message MsgDelegate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgDelegate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.delegatorAddress = ""; + object.validatorAddress = ""; + object.amount = null; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + if (message.amount != null && message.hasOwnProperty("amount")) + object.amount = $root.cosmos.base.v1beta1.Coin.toObject(message.amount, options); + return object; + }; + + /** + * Converts this MsgDelegate to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @instance + * @returns {Object.} JSON object + */ + MsgDelegate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgDelegate; + })(v1beta1.MsgDelegate || {}); + + v1beta1.MsgDelegateResponse = (function(MsgDelegateResponse) { + + /** + * Properties of a MsgDelegateResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IMsgDelegateResponse + */ + + /** + * Constructs a new MsgDelegateResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a MsgDelegateResponse. + * @implements IMsgDelegateResponse + * @constructor + * @param {cosmos.staking.v1beta1.IMsgDelegateResponse=} [properties] Properties to set + */ + function MsgDelegateResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgDelegateResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.MsgDelegateResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgDelegateResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.MsgDelegateResponse} MsgDelegateResponse instance + */ + MsgDelegateResponse.create = function create(properties) { + return new MsgDelegateResponse(properties); + }; + + /** + * Encodes the specified MsgDelegateResponse message. Does not implicitly {@link cosmos.staking.v1beta1.MsgDelegateResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.MsgDelegateResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgDelegateResponse} message MsgDelegateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgDelegateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgDelegateResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgDelegateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.MsgDelegateResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgDelegateResponse} message MsgDelegateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgDelegateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgDelegateResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.MsgDelegateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.MsgDelegateResponse} MsgDelegateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgDelegateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.MsgDelegateResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgDelegateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.MsgDelegateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.MsgDelegateResponse} MsgDelegateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgDelegateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgDelegateResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.MsgDelegateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgDelegateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgDelegateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.MsgDelegateResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.MsgDelegateResponse} MsgDelegateResponse + */ + MsgDelegateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.MsgDelegateResponse) + return object; + return new $root.cosmos.staking.v1beta1.MsgDelegateResponse(); + }; + + /** + * Creates a plain object from a MsgDelegateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.MsgDelegateResponse + * @static + * @param {cosmos.staking.v1beta1.MsgDelegateResponse} message MsgDelegateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgDelegateResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgDelegateResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.MsgDelegateResponse + * @instance + * @returns {Object.} JSON object + */ + MsgDelegateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgDelegateResponse; + })(v1beta1.MsgDelegateResponse || {}); + + v1beta1.MsgBeginRedelegate = (function(MsgBeginRedelegate) { + + /** + * Properties of a MsgBeginRedelegate. + * @memberof cosmos.staking.v1beta1 + * @interface IMsgBeginRedelegate + * @property {string|null} [delegatorAddress] MsgBeginRedelegate delegatorAddress + * @property {string|null} [validatorSrcAddress] MsgBeginRedelegate validatorSrcAddress + * @property {string|null} [validatorDstAddress] MsgBeginRedelegate validatorDstAddress + * @property {cosmos.base.v1beta1.ICoin|null} [amount] MsgBeginRedelegate amount + */ + + /** + * Constructs a new MsgBeginRedelegate. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a MsgBeginRedelegate. + * @implements IMsgBeginRedelegate + * @constructor + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegate=} [properties] Properties to set + */ + function MsgBeginRedelegate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgBeginRedelegate delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @instance + */ + MsgBeginRedelegate.prototype.delegatorAddress = ""; + + /** + * MsgBeginRedelegate validatorSrcAddress. + * @member {string} validatorSrcAddress + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @instance + */ + MsgBeginRedelegate.prototype.validatorSrcAddress = ""; + + /** + * MsgBeginRedelegate validatorDstAddress. + * @member {string} validatorDstAddress + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @instance + */ + MsgBeginRedelegate.prototype.validatorDstAddress = ""; + + /** + * MsgBeginRedelegate amount. + * @member {cosmos.base.v1beta1.ICoin|null|undefined} amount + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @instance + */ + MsgBeginRedelegate.prototype.amount = null; + + /** + * Creates a new MsgBeginRedelegate instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @static + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegate=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.MsgBeginRedelegate} MsgBeginRedelegate instance + */ + MsgBeginRedelegate.create = function create(properties) { + return new MsgBeginRedelegate(properties); + }; + + /** + * Encodes the specified MsgBeginRedelegate message. Does not implicitly {@link cosmos.staking.v1beta1.MsgBeginRedelegate.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @static + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegate} message MsgBeginRedelegate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgBeginRedelegate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.validatorSrcAddress != null && Object.hasOwnProperty.call(message, "validatorSrcAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorSrcAddress); + if (message.validatorDstAddress != null && Object.hasOwnProperty.call(message, "validatorDstAddress")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.validatorDstAddress); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + $root.cosmos.base.v1beta1.Coin.encode(message.amount, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MsgBeginRedelegate message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgBeginRedelegate.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @static + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegate} message MsgBeginRedelegate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgBeginRedelegate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgBeginRedelegate message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.MsgBeginRedelegate} MsgBeginRedelegate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgBeginRedelegate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.MsgBeginRedelegate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorSrcAddress = reader.string(); + break; + case 3: + message.validatorDstAddress = reader.string(); + break; + case 4: + message.amount = $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgBeginRedelegate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.MsgBeginRedelegate} MsgBeginRedelegate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgBeginRedelegate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgBeginRedelegate message. + * @function verify + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgBeginRedelegate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.validatorSrcAddress != null && message.hasOwnProperty("validatorSrcAddress")) + if (!$util.isString(message.validatorSrcAddress)) + return "validatorSrcAddress: string expected"; + if (message.validatorDstAddress != null && message.hasOwnProperty("validatorDstAddress")) + if (!$util.isString(message.validatorDstAddress)) + return "validatorDstAddress: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.amount); + if (error) + return "amount." + error; + } + return null; + }; + + /** + * Creates a MsgBeginRedelegate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.MsgBeginRedelegate} MsgBeginRedelegate + */ + MsgBeginRedelegate.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.MsgBeginRedelegate) + return object; + var message = new $root.cosmos.staking.v1beta1.MsgBeginRedelegate(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.validatorSrcAddress != null) + message.validatorSrcAddress = String(object.validatorSrcAddress); + if (object.validatorDstAddress != null) + message.validatorDstAddress = String(object.validatorDstAddress); + if (object.amount != null) { + if (typeof object.amount !== "object") + throw TypeError(".cosmos.staking.v1beta1.MsgBeginRedelegate.amount: object expected"); + message.amount = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount); + } + return message; + }; + + /** + * Creates a plain object from a MsgBeginRedelegate message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @static + * @param {cosmos.staking.v1beta1.MsgBeginRedelegate} message MsgBeginRedelegate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgBeginRedelegate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.delegatorAddress = ""; + object.validatorSrcAddress = ""; + object.validatorDstAddress = ""; + object.amount = null; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.validatorSrcAddress != null && message.hasOwnProperty("validatorSrcAddress")) + object.validatorSrcAddress = message.validatorSrcAddress; + if (message.validatorDstAddress != null && message.hasOwnProperty("validatorDstAddress")) + object.validatorDstAddress = message.validatorDstAddress; + if (message.amount != null && message.hasOwnProperty("amount")) + object.amount = $root.cosmos.base.v1beta1.Coin.toObject(message.amount, options); + return object; + }; + + /** + * Converts this MsgBeginRedelegate to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @instance + * @returns {Object.} JSON object + */ + MsgBeginRedelegate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgBeginRedelegate; + })(v1beta1.MsgBeginRedelegate || {}); + + v1beta1.MsgBeginRedelegateResponse = (function(MsgBeginRedelegateResponse) { + + /** + * Properties of a MsgBeginRedelegateResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IMsgBeginRedelegateResponse + * @property {google.protobuf.ITimestamp|null} [completionTime] MsgBeginRedelegateResponse completionTime + */ + + /** + * Constructs a new MsgBeginRedelegateResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a MsgBeginRedelegateResponse. + * @implements IMsgBeginRedelegateResponse + * @constructor + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegateResponse=} [properties] Properties to set + */ + function MsgBeginRedelegateResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgBeginRedelegateResponse completionTime. + * @member {google.protobuf.ITimestamp|null|undefined} completionTime + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse + * @instance + */ + MsgBeginRedelegateResponse.prototype.completionTime = null; + + /** + * Creates a new MsgBeginRedelegateResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegateResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.MsgBeginRedelegateResponse} MsgBeginRedelegateResponse instance + */ + MsgBeginRedelegateResponse.create = function create(properties) { + return new MsgBeginRedelegateResponse(properties); + }; + + /** + * Encodes the specified MsgBeginRedelegateResponse message. Does not implicitly {@link cosmos.staking.v1beta1.MsgBeginRedelegateResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegateResponse} message MsgBeginRedelegateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgBeginRedelegateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.completionTime != null && Object.hasOwnProperty.call(message, "completionTime")) + $root.google.protobuf.Timestamp.encode(message.completionTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MsgBeginRedelegateResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgBeginRedelegateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegateResponse} message MsgBeginRedelegateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgBeginRedelegateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgBeginRedelegateResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.MsgBeginRedelegateResponse} MsgBeginRedelegateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgBeginRedelegateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.MsgBeginRedelegateResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.completionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgBeginRedelegateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.MsgBeginRedelegateResponse} MsgBeginRedelegateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgBeginRedelegateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgBeginRedelegateResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgBeginRedelegateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.completionTime != null && message.hasOwnProperty("completionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.completionTime); + if (error) + return "completionTime." + error; + } + return null; + }; + + /** + * Creates a MsgBeginRedelegateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.MsgBeginRedelegateResponse} MsgBeginRedelegateResponse + */ + MsgBeginRedelegateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.MsgBeginRedelegateResponse) + return object; + var message = new $root.cosmos.staking.v1beta1.MsgBeginRedelegateResponse(); + if (object.completionTime != null) { + if (typeof object.completionTime !== "object") + throw TypeError(".cosmos.staking.v1beta1.MsgBeginRedelegateResponse.completionTime: object expected"); + message.completionTime = $root.google.protobuf.Timestamp.fromObject(object.completionTime); + } + return message; + }; + + /** + * Creates a plain object from a MsgBeginRedelegateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse + * @static + * @param {cosmos.staking.v1beta1.MsgBeginRedelegateResponse} message MsgBeginRedelegateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgBeginRedelegateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.completionTime = null; + if (message.completionTime != null && message.hasOwnProperty("completionTime")) + object.completionTime = $root.google.protobuf.Timestamp.toObject(message.completionTime, options); + return object; + }; + + /** + * Converts this MsgBeginRedelegateResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse + * @instance + * @returns {Object.} JSON object + */ + MsgBeginRedelegateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgBeginRedelegateResponse; + })(v1beta1.MsgBeginRedelegateResponse || {}); + + v1beta1.MsgUndelegate = (function(MsgUndelegate) { + + /** + * Properties of a MsgUndelegate. + * @memberof cosmos.staking.v1beta1 + * @interface IMsgUndelegate + * @property {string|null} [delegatorAddress] MsgUndelegate delegatorAddress + * @property {string|null} [validatorAddress] MsgUndelegate validatorAddress + * @property {cosmos.base.v1beta1.ICoin|null} [amount] MsgUndelegate amount + */ + + /** + * Constructs a new MsgUndelegate. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a MsgUndelegate. + * @implements IMsgUndelegate + * @constructor + * @param {cosmos.staking.v1beta1.IMsgUndelegate=} [properties] Properties to set + */ + function MsgUndelegate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgUndelegate delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @instance + */ + MsgUndelegate.prototype.delegatorAddress = ""; + + /** + * MsgUndelegate validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @instance + */ + MsgUndelegate.prototype.validatorAddress = ""; + + /** + * MsgUndelegate amount. + * @member {cosmos.base.v1beta1.ICoin|null|undefined} amount + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @instance + */ + MsgUndelegate.prototype.amount = null; + + /** + * Creates a new MsgUndelegate instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @static + * @param {cosmos.staking.v1beta1.IMsgUndelegate=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.MsgUndelegate} MsgUndelegate instance + */ + MsgUndelegate.create = function create(properties) { + return new MsgUndelegate(properties); + }; + + /** + * Encodes the specified MsgUndelegate message. Does not implicitly {@link cosmos.staking.v1beta1.MsgUndelegate.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @static + * @param {cosmos.staking.v1beta1.IMsgUndelegate} message MsgUndelegate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUndelegate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddress); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + $root.cosmos.base.v1beta1.Coin.encode(message.amount, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MsgUndelegate message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgUndelegate.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @static + * @param {cosmos.staking.v1beta1.IMsgUndelegate} message MsgUndelegate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUndelegate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgUndelegate message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.MsgUndelegate} MsgUndelegate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUndelegate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.MsgUndelegate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.amount = $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgUndelegate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.MsgUndelegate} MsgUndelegate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUndelegate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgUndelegate message. + * @function verify + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgUndelegate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.amount); + if (error) + return "amount." + error; + } + return null; + }; + + /** + * Creates a MsgUndelegate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.MsgUndelegate} MsgUndelegate + */ + MsgUndelegate.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.MsgUndelegate) + return object; + var message = new $root.cosmos.staking.v1beta1.MsgUndelegate(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + if (object.amount != null) { + if (typeof object.amount !== "object") + throw TypeError(".cosmos.staking.v1beta1.MsgUndelegate.amount: object expected"); + message.amount = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount); + } + return message; + }; + + /** + * Creates a plain object from a MsgUndelegate message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @static + * @param {cosmos.staking.v1beta1.MsgUndelegate} message MsgUndelegate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgUndelegate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.delegatorAddress = ""; + object.validatorAddress = ""; + object.amount = null; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + if (message.amount != null && message.hasOwnProperty("amount")) + object.amount = $root.cosmos.base.v1beta1.Coin.toObject(message.amount, options); + return object; + }; + + /** + * Converts this MsgUndelegate to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @instance + * @returns {Object.} JSON object + */ + MsgUndelegate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgUndelegate; + })(v1beta1.MsgUndelegate || {}); + + v1beta1.MsgUndelegateResponse = (function(MsgUndelegateResponse) { + + /** + * Properties of a MsgUndelegateResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IMsgUndelegateResponse + * @property {google.protobuf.ITimestamp|null} [completionTime] MsgUndelegateResponse completionTime + */ + + /** + * Constructs a new MsgUndelegateResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a MsgUndelegateResponse. + * @implements IMsgUndelegateResponse + * @constructor + * @param {cosmos.staking.v1beta1.IMsgUndelegateResponse=} [properties] Properties to set + */ + function MsgUndelegateResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgUndelegateResponse completionTime. + * @member {google.protobuf.ITimestamp|null|undefined} completionTime + * @memberof cosmos.staking.v1beta1.MsgUndelegateResponse + * @instance + */ + MsgUndelegateResponse.prototype.completionTime = null; + + /** + * Creates a new MsgUndelegateResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.MsgUndelegateResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgUndelegateResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.MsgUndelegateResponse} MsgUndelegateResponse instance + */ + MsgUndelegateResponse.create = function create(properties) { + return new MsgUndelegateResponse(properties); + }; + + /** + * Encodes the specified MsgUndelegateResponse message. Does not implicitly {@link cosmos.staking.v1beta1.MsgUndelegateResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.MsgUndelegateResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgUndelegateResponse} message MsgUndelegateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUndelegateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.completionTime != null && Object.hasOwnProperty.call(message, "completionTime")) + $root.google.protobuf.Timestamp.encode(message.completionTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MsgUndelegateResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgUndelegateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.MsgUndelegateResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgUndelegateResponse} message MsgUndelegateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUndelegateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgUndelegateResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.MsgUndelegateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.MsgUndelegateResponse} MsgUndelegateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUndelegateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.MsgUndelegateResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.completionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgUndelegateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.MsgUndelegateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.MsgUndelegateResponse} MsgUndelegateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUndelegateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgUndelegateResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.MsgUndelegateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgUndelegateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.completionTime != null && message.hasOwnProperty("completionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.completionTime); + if (error) + return "completionTime." + error; + } + return null; + }; + + /** + * Creates a MsgUndelegateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.MsgUndelegateResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.MsgUndelegateResponse} MsgUndelegateResponse + */ + MsgUndelegateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.MsgUndelegateResponse) + return object; + var message = new $root.cosmos.staking.v1beta1.MsgUndelegateResponse(); + if (object.completionTime != null) { + if (typeof object.completionTime !== "object") + throw TypeError(".cosmos.staking.v1beta1.MsgUndelegateResponse.completionTime: object expected"); + message.completionTime = $root.google.protobuf.Timestamp.fromObject(object.completionTime); + } + return message; + }; + + /** + * Creates a plain object from a MsgUndelegateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.MsgUndelegateResponse + * @static + * @param {cosmos.staking.v1beta1.MsgUndelegateResponse} message MsgUndelegateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgUndelegateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.completionTime = null; + if (message.completionTime != null && message.hasOwnProperty("completionTime")) + object.completionTime = $root.google.protobuf.Timestamp.toObject(message.completionTime, options); + return object; + }; + + /** + * Converts this MsgUndelegateResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.MsgUndelegateResponse + * @instance + * @returns {Object.} JSON object + */ + MsgUndelegateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgUndelegateResponse; + })(v1beta1.MsgUndelegateResponse || {}); + + return v1beta1; + })(staking.v1beta1 || {}); + + return staking; + })(cosmos.staking || {}); + + /** + * Namespace crypto. + * @memberof cosmos + * @namespace + */ + + cosmos.crypto = (function(crypto) { + + /** + * Namespace multisig. + * @memberof cosmos.crypto + * @namespace + */ + + crypto.multisig = (function(multisig) { + + /** + * Namespace v1beta1. + * @memberof cosmos.crypto.multisig + * @namespace + */ + + multisig.v1beta1 = (function(v1beta1) { + + v1beta1.MultiSignature = (function(MultiSignature) { + + /** + * Properties of a MultiSignature. + * @memberof cosmos.crypto.multisig.v1beta1 + * @interface IMultiSignature + * @property {Array.|null} [signatures] MultiSignature signatures + */ + + /** + * Constructs a new MultiSignature. + * @memberof cosmos.crypto.multisig.v1beta1 + * @classdesc Represents a MultiSignature. + * @implements IMultiSignature + * @constructor + * @param {cosmos.crypto.multisig.v1beta1.IMultiSignature=} [properties] Properties to set + */ + function MultiSignature(properties) { + this.signatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MultiSignature signatures. + * @member {Array.} signatures + * @memberof cosmos.crypto.multisig.v1beta1.MultiSignature + * @instance + */ + MultiSignature.prototype.signatures = $util.emptyArray; + + /** + * Creates a new MultiSignature instance using the specified properties. + * @function create + * @memberof cosmos.crypto.multisig.v1beta1.MultiSignature + * @static + * @param {cosmos.crypto.multisig.v1beta1.IMultiSignature=} [properties] Properties to set + * @returns {cosmos.crypto.multisig.v1beta1.MultiSignature} MultiSignature instance + */ + MultiSignature.create = function create(properties) { + return new MultiSignature(properties); + }; + + /** + * Encodes the specified MultiSignature message. Does not implicitly {@link cosmos.crypto.multisig.v1beta1.MultiSignature.verify|verify} messages. + * @function encode + * @memberof cosmos.crypto.multisig.v1beta1.MultiSignature + * @static + * @param {cosmos.crypto.multisig.v1beta1.IMultiSignature} message MultiSignature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiSignature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.signatures != null && message.signatures.length) + for (var i = 0; i < message.signatures.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.signatures[i]); + return writer; + }; + + /** + * Encodes the specified MultiSignature message, length delimited. Does not implicitly {@link cosmos.crypto.multisig.v1beta1.MultiSignature.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.crypto.multisig.v1beta1.MultiSignature + * @static + * @param {cosmos.crypto.multisig.v1beta1.IMultiSignature} message MultiSignature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiSignature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MultiSignature message from the specified reader or buffer. + * @function decode + * @memberof cosmos.crypto.multisig.v1beta1.MultiSignature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.crypto.multisig.v1beta1.MultiSignature} MultiSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiSignature.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.crypto.multisig.v1beta1.MultiSignature(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.signatures && message.signatures.length)) + message.signatures = []; + message.signatures.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MultiSignature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.crypto.multisig.v1beta1.MultiSignature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.crypto.multisig.v1beta1.MultiSignature} MultiSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiSignature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MultiSignature message. + * @function verify + * @memberof cosmos.crypto.multisig.v1beta1.MultiSignature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MultiSignature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.signatures != null && message.hasOwnProperty("signatures")) { + if (!Array.isArray(message.signatures)) + return "signatures: array expected"; + for (var i = 0; i < message.signatures.length; ++i) + if (!(message.signatures[i] && typeof message.signatures[i].length === "number" || $util.isString(message.signatures[i]))) + return "signatures: buffer[] expected"; + } + return null; + }; + + /** + * Creates a MultiSignature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.crypto.multisig.v1beta1.MultiSignature + * @static + * @param {Object.} object Plain object + * @returns {cosmos.crypto.multisig.v1beta1.MultiSignature} MultiSignature + */ + MultiSignature.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.crypto.multisig.v1beta1.MultiSignature) + return object; + var message = new $root.cosmos.crypto.multisig.v1beta1.MultiSignature(); + if (object.signatures) { + if (!Array.isArray(object.signatures)) + throw TypeError(".cosmos.crypto.multisig.v1beta1.MultiSignature.signatures: array expected"); + message.signatures = []; + for (var i = 0; i < object.signatures.length; ++i) + if (typeof object.signatures[i] === "string") + $util.base64.decode(object.signatures[i], message.signatures[i] = $util.newBuffer($util.base64.length(object.signatures[i])), 0); + else if (object.signatures[i].length) + message.signatures[i] = object.signatures[i]; + } + return message; + }; + + /** + * Creates a plain object from a MultiSignature message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.crypto.multisig.v1beta1.MultiSignature + * @static + * @param {cosmos.crypto.multisig.v1beta1.MultiSignature} message MultiSignature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MultiSignature.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.signatures = []; + if (message.signatures && message.signatures.length) { + object.signatures = []; + for (var j = 0; j < message.signatures.length; ++j) + object.signatures[j] = options.bytes === String ? $util.base64.encode(message.signatures[j], 0, message.signatures[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.signatures[j]) : message.signatures[j]; + } + return object; + }; + + /** + * Converts this MultiSignature to JSON. + * @function toJSON + * @memberof cosmos.crypto.multisig.v1beta1.MultiSignature + * @instance + * @returns {Object.} JSON object + */ + MultiSignature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MultiSignature; + })(v1beta1.MultiSignature || {}); + + v1beta1.CompactBitArray = (function(CompactBitArray) { + + /** + * Properties of a CompactBitArray. + * @memberof cosmos.crypto.multisig.v1beta1 + * @interface ICompactBitArray + * @property {number|null} [extraBitsStored] CompactBitArray extraBitsStored + * @property {Uint8Array|null} [elems] CompactBitArray elems + */ + + /** + * Constructs a new CompactBitArray. + * @memberof cosmos.crypto.multisig.v1beta1 + * @classdesc Represents a CompactBitArray. + * @implements ICompactBitArray + * @constructor + * @param {cosmos.crypto.multisig.v1beta1.ICompactBitArray=} [properties] Properties to set + */ + function CompactBitArray(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompactBitArray extraBitsStored. + * @member {number} extraBitsStored + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @instance + */ + CompactBitArray.prototype.extraBitsStored = 0; + + /** + * CompactBitArray elems. + * @member {Uint8Array} elems + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @instance + */ + CompactBitArray.prototype.elems = $util.newBuffer([]); + + /** + * Creates a new CompactBitArray instance using the specified properties. + * @function create + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @static + * @param {cosmos.crypto.multisig.v1beta1.ICompactBitArray=} [properties] Properties to set + * @returns {cosmos.crypto.multisig.v1beta1.CompactBitArray} CompactBitArray instance + */ + CompactBitArray.create = function create(properties) { + return new CompactBitArray(properties); + }; + + /** + * Encodes the specified CompactBitArray message. Does not implicitly {@link cosmos.crypto.multisig.v1beta1.CompactBitArray.verify|verify} messages. + * @function encode + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @static + * @param {cosmos.crypto.multisig.v1beta1.ICompactBitArray} message CompactBitArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompactBitArray.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.extraBitsStored != null && Object.hasOwnProperty.call(message, "extraBitsStored")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.extraBitsStored); + if (message.elems != null && Object.hasOwnProperty.call(message, "elems")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.elems); + return writer; + }; + + /** + * Encodes the specified CompactBitArray message, length delimited. Does not implicitly {@link cosmos.crypto.multisig.v1beta1.CompactBitArray.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @static + * @param {cosmos.crypto.multisig.v1beta1.ICompactBitArray} message CompactBitArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompactBitArray.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompactBitArray message from the specified reader or buffer. + * @function decode + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.crypto.multisig.v1beta1.CompactBitArray} CompactBitArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompactBitArray.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.crypto.multisig.v1beta1.CompactBitArray(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.extraBitsStored = reader.uint32(); + break; + case 2: + message.elems = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompactBitArray message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.crypto.multisig.v1beta1.CompactBitArray} CompactBitArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompactBitArray.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompactBitArray message. + * @function verify + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompactBitArray.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.extraBitsStored != null && message.hasOwnProperty("extraBitsStored")) + if (!$util.isInteger(message.extraBitsStored)) + return "extraBitsStored: integer expected"; + if (message.elems != null && message.hasOwnProperty("elems")) + if (!(message.elems && typeof message.elems.length === "number" || $util.isString(message.elems))) + return "elems: buffer expected"; + return null; + }; + + /** + * Creates a CompactBitArray message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @static + * @param {Object.} object Plain object + * @returns {cosmos.crypto.multisig.v1beta1.CompactBitArray} CompactBitArray + */ + CompactBitArray.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.crypto.multisig.v1beta1.CompactBitArray) + return object; + var message = new $root.cosmos.crypto.multisig.v1beta1.CompactBitArray(); + if (object.extraBitsStored != null) + message.extraBitsStored = object.extraBitsStored >>> 0; + if (object.elems != null) + if (typeof object.elems === "string") + $util.base64.decode(object.elems, message.elems = $util.newBuffer($util.base64.length(object.elems)), 0); + else if (object.elems.length) + message.elems = object.elems; + return message; + }; + + /** + * Creates a plain object from a CompactBitArray message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @static + * @param {cosmos.crypto.multisig.v1beta1.CompactBitArray} message CompactBitArray + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompactBitArray.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.extraBitsStored = 0; + if (options.bytes === String) + object.elems = ""; + else { + object.elems = []; + if (options.bytes !== Array) + object.elems = $util.newBuffer(object.elems); + } + } + if (message.extraBitsStored != null && message.hasOwnProperty("extraBitsStored")) + object.extraBitsStored = message.extraBitsStored; + if (message.elems != null && message.hasOwnProperty("elems")) + object.elems = options.bytes === String ? $util.base64.encode(message.elems, 0, message.elems.length) : options.bytes === Array ? Array.prototype.slice.call(message.elems) : message.elems; + return object; + }; + + /** + * Converts this CompactBitArray to JSON. + * @function toJSON + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @instance + * @returns {Object.} JSON object + */ + CompactBitArray.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CompactBitArray; + })(v1beta1.CompactBitArray || {}); + + return v1beta1; + })(multisig.v1beta1 || {}); + + return multisig; + })(crypto.multisig || {}); + + return crypto; + })(cosmos.crypto || {}); + + /** + * Namespace tx. + * @memberof cosmos + * @namespace + */ + + cosmos.tx = (function(tx) { + + /** + * Namespace signing. + * @memberof cosmos.tx + * @namespace + */ + + tx.signing = (function(signing) { + + /** + * Namespace v1beta1. + * @memberof cosmos.tx.signing + * @namespace + */ + + signing.v1beta1 = (function(v1beta1) { + + /** + * SignMode enum. + * @name cosmos.tx.signing.v1beta1.SignMode + * @enum {string} + * @property {number} SIGN_MODE_UNSPECIFIED=0 SIGN_MODE_UNSPECIFIED value + * @property {number} SIGN_MODE_DIRECT=1 SIGN_MODE_DIRECT value + * @property {number} SIGN_MODE_TEXTUAL=2 SIGN_MODE_TEXTUAL value + * @property {number} SIGN_MODE_LEGACY_AMINO_JSON=127 SIGN_MODE_LEGACY_AMINO_JSON value + */ + v1beta1.SignMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SIGN_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SIGN_MODE_DIRECT"] = 1; + values[valuesById[2] = "SIGN_MODE_TEXTUAL"] = 2; + values[valuesById[127] = "SIGN_MODE_LEGACY_AMINO_JSON"] = 127; + return values; + })(); + + v1beta1.SignatureDescriptors = (function(SignatureDescriptors) { + + /** + * Properties of a SignatureDescriptors. + * @memberof cosmos.tx.signing.v1beta1 + * @interface ISignatureDescriptors + * @property {Array.|null} [signatures] SignatureDescriptors signatures + */ + + /** + * Constructs a new SignatureDescriptors. + * @memberof cosmos.tx.signing.v1beta1 + * @classdesc Represents a SignatureDescriptors. + * @implements ISignatureDescriptors + * @constructor + * @param {cosmos.tx.signing.v1beta1.ISignatureDescriptors=} [properties] Properties to set + */ + function SignatureDescriptors(properties) { + this.signatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SignatureDescriptors signatures. + * @member {Array.} signatures + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors + * @instance + */ + SignatureDescriptors.prototype.signatures = $util.emptyArray; + + /** + * Creates a new SignatureDescriptors instance using the specified properties. + * @function create + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors + * @static + * @param {cosmos.tx.signing.v1beta1.ISignatureDescriptors=} [properties] Properties to set + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptors} SignatureDescriptors instance + */ + SignatureDescriptors.create = function create(properties) { + return new SignatureDescriptors(properties); + }; + + /** + * Encodes the specified SignatureDescriptors message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptors.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors + * @static + * @param {cosmos.tx.signing.v1beta1.ISignatureDescriptors} message SignatureDescriptors message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureDescriptors.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.signatures != null && message.signatures.length) + for (var i = 0; i < message.signatures.length; ++i) + $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.encode(message.signatures[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SignatureDescriptors message, length delimited. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptors.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors + * @static + * @param {cosmos.tx.signing.v1beta1.ISignatureDescriptors} message SignatureDescriptors message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureDescriptors.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SignatureDescriptors message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptors} SignatureDescriptors + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureDescriptors.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptors(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.signatures && message.signatures.length)) + message.signatures = []; + message.signatures.push($root.cosmos.tx.signing.v1beta1.SignatureDescriptor.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SignatureDescriptors message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptors} SignatureDescriptors + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureDescriptors.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SignatureDescriptors message. + * @function verify + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SignatureDescriptors.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.signatures != null && message.hasOwnProperty("signatures")) { + if (!Array.isArray(message.signatures)) + return "signatures: array expected"; + for (var i = 0; i < message.signatures.length; ++i) { + var error = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.verify(message.signatures[i]); + if (error) + return "signatures." + error; + } + } + return null; + }; + + /** + * Creates a SignatureDescriptors message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptors} SignatureDescriptors + */ + SignatureDescriptors.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.signing.v1beta1.SignatureDescriptors) + return object; + var message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptors(); + if (object.signatures) { + if (!Array.isArray(object.signatures)) + throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptors.signatures: array expected"); + message.signatures = []; + for (var i = 0; i < object.signatures.length; ++i) { + if (typeof object.signatures[i] !== "object") + throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptors.signatures: object expected"); + message.signatures[i] = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.fromObject(object.signatures[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SignatureDescriptors message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptors} message SignatureDescriptors + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SignatureDescriptors.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.signatures = []; + if (message.signatures && message.signatures.length) { + object.signatures = []; + for (var j = 0; j < message.signatures.length; ++j) + object.signatures[j] = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.toObject(message.signatures[j], options); + } + return object; + }; + + /** + * Converts this SignatureDescriptors to JSON. + * @function toJSON + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors + * @instance + * @returns {Object.} JSON object + */ + SignatureDescriptors.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SignatureDescriptors; + })(v1beta1.SignatureDescriptors || {}); + + v1beta1.SignatureDescriptor = (function(SignatureDescriptor) { + + /** + * Properties of a SignatureDescriptor. + * @memberof cosmos.tx.signing.v1beta1 + * @interface ISignatureDescriptor + * @property {google.protobuf.IAny|null} [publicKey] SignatureDescriptor publicKey + * @property {cosmos.tx.signing.v1beta1.SignatureDescriptor.IData|null} [data] SignatureDescriptor data + * @property {number|Long|null} [sequence] SignatureDescriptor sequence + */ + + /** + * Constructs a new SignatureDescriptor. + * @memberof cosmos.tx.signing.v1beta1 + * @classdesc Represents a SignatureDescriptor. + * @implements ISignatureDescriptor + * @constructor + * @param {cosmos.tx.signing.v1beta1.ISignatureDescriptor=} [properties] Properties to set + */ + function SignatureDescriptor(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SignatureDescriptor publicKey. + * @member {google.protobuf.IAny|null|undefined} publicKey + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @instance + */ + SignatureDescriptor.prototype.publicKey = null; + + /** + * SignatureDescriptor data. + * @member {cosmos.tx.signing.v1beta1.SignatureDescriptor.IData|null|undefined} data + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @instance + */ + SignatureDescriptor.prototype.data = null; + + /** + * SignatureDescriptor sequence. + * @member {number|Long} sequence + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @instance + */ + SignatureDescriptor.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new SignatureDescriptor instance using the specified properties. + * @function create + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @static + * @param {cosmos.tx.signing.v1beta1.ISignatureDescriptor=} [properties] Properties to set + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor} SignatureDescriptor instance + */ + SignatureDescriptor.create = function create(properties) { + return new SignatureDescriptor(properties); + }; + + /** + * Encodes the specified SignatureDescriptor message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @static + * @param {cosmos.tx.signing.v1beta1.ISignatureDescriptor} message SignatureDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) + $root.google.protobuf.Any.encode(message.publicKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.encode(message.data, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.sequence); + return writer; + }; + + /** + * Encodes the specified SignatureDescriptor message, length delimited. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @static + * @param {cosmos.tx.signing.v1beta1.ISignatureDescriptor} message SignatureDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SignatureDescriptor message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor} SignatureDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publicKey = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 2: + message.data = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.decode(reader, reader.uint32()); + break; + case 3: + message.sequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SignatureDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor} SignatureDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SignatureDescriptor message. + * @function verify + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SignatureDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.publicKey != null && message.hasOwnProperty("publicKey")) { + var error = $root.google.protobuf.Any.verify(message.publicKey); + if (error) + return "publicKey." + error; + } + if (message.data != null && message.hasOwnProperty("data")) { + var error = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.verify(message.data); + if (error) + return "data." + error; + } + if (message.sequence != null && message.hasOwnProperty("sequence")) + if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) + return "sequence: integer|Long expected"; + return null; + }; + + /** + * Creates a SignatureDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor} SignatureDescriptor + */ + SignatureDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.signing.v1beta1.SignatureDescriptor) + return object; + var message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor(); + if (object.publicKey != null) { + if (typeof object.publicKey !== "object") + throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.publicKey: object expected"); + message.publicKey = $root.google.protobuf.Any.fromObject(object.publicKey); + } + if (object.data != null) { + if (typeof object.data !== "object") + throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.data: object expected"); + message.data = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.fromObject(object.data); + } + if (object.sequence != null) + if ($util.Long) + (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; + else if (typeof object.sequence === "string") + message.sequence = parseInt(object.sequence, 10); + else if (typeof object.sequence === "number") + message.sequence = object.sequence; + else if (typeof object.sequence === "object") + message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a SignatureDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor} message SignatureDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SignatureDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.publicKey = null; + object.data = null; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sequence = options.longs === String ? "0" : 0; + } + if (message.publicKey != null && message.hasOwnProperty("publicKey")) + object.publicKey = $root.google.protobuf.Any.toObject(message.publicKey, options); + if (message.data != null && message.hasOwnProperty("data")) + object.data = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.toObject(message.data, options); + if (message.sequence != null && message.hasOwnProperty("sequence")) + if (typeof message.sequence === "number") + object.sequence = options.longs === String ? String(message.sequence) : message.sequence; + else + object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; + return object; + }; + + /** + * Converts this SignatureDescriptor to JSON. + * @function toJSON + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @instance + * @returns {Object.} JSON object + */ + SignatureDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + SignatureDescriptor.Data = (function(Data) { + + /** + * Properties of a Data. + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @interface IData + * @property {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle|null} [single] Data single + * @property {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti|null} [multi] Data multi + */ + + /** + * Constructs a new Data. + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @classdesc Represents a Data. + * @implements IData + * @constructor + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.IData=} [properties] Properties to set + */ + function Data(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Data single. + * @member {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle|null|undefined} single + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @instance + */ + Data.prototype.single = null; + + /** + * Data multi. + * @member {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti|null|undefined} multi + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @instance + */ + Data.prototype.multi = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Data sum. + * @member {"single"|"multi"|undefined} sum + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @instance + */ + Object.defineProperty(Data.prototype, "sum", { + get: $util.oneOfGetter($oneOfFields = ["single", "multi"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Data instance using the specified properties. + * @function create + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.IData=} [properties] Properties to set + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data} Data instance + */ + Data.create = function create(properties) { + return new Data(properties); + }; + + /** + * Encodes the specified Data message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.IData} message Data message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Data.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.single != null && Object.hasOwnProperty.call(message, "single")) + $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.encode(message.single, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.multi != null && Object.hasOwnProperty.call(message, "multi")) + $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.encode(message.multi, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Data message, length delimited. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.IData} message Data message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Data.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Data message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data} Data + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Data.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.single = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.decode(reader, reader.uint32()); + break; + case 2: + message.multi = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Data message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data} Data + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Data.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Data message. + * @function verify + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Data.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.single != null && message.hasOwnProperty("single")) { + properties.sum = 1; + { + var error = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.verify(message.single); + if (error) + return "single." + error; + } + } + if (message.multi != null && message.hasOwnProperty("multi")) { + if (properties.sum === 1) + return "sum: multiple values"; + properties.sum = 1; + { + var error = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.verify(message.multi); + if (error) + return "multi." + error; + } + } + return null; + }; + + /** + * Creates a Data message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data} Data + */ + Data.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data) + return object; + var message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data(); + if (object.single != null) { + if (typeof object.single !== "object") + throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.single: object expected"); + message.single = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.fromObject(object.single); + } + if (object.multi != null) { + if (typeof object.multi !== "object") + throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.multi: object expected"); + message.multi = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.fromObject(object.multi); + } + return message; + }; + + /** + * Creates a plain object from a Data message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data} message Data + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Data.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.single != null && message.hasOwnProperty("single")) { + object.single = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.toObject(message.single, options); + if (options.oneofs) + object.sum = "single"; + } + if (message.multi != null && message.hasOwnProperty("multi")) { + object.multi = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.toObject(message.multi, options); + if (options.oneofs) + object.sum = "multi"; + } + return object; + }; + + /** + * Converts this Data to JSON. + * @function toJSON + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @instance + * @returns {Object.} JSON object + */ + Data.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Data.Single = (function(Single) { + + /** + * Properties of a Single. + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @interface ISingle + * @property {cosmos.tx.signing.v1beta1.SignMode|null} [mode] Single mode + * @property {Uint8Array|null} [signature] Single signature + */ + + /** + * Constructs a new Single. + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @classdesc Represents a Single. + * @implements ISingle + * @constructor + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle=} [properties] Properties to set + */ + function Single(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Single mode. + * @member {cosmos.tx.signing.v1beta1.SignMode} mode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @instance + */ + Single.prototype.mode = 0; + + /** + * Single signature. + * @member {Uint8Array} signature + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @instance + */ + Single.prototype.signature = $util.newBuffer([]); + + /** + * Creates a new Single instance using the specified properties. + * @function create + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle=} [properties] Properties to set + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single} Single instance + */ + Single.create = function create(properties) { + return new Single(properties); + }; + + /** + * Encodes the specified Single message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle} message Single message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Single.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); + if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.signature); + return writer; + }; + + /** + * Encodes the specified Single message, length delimited. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle} message Single message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Single.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Single message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single} Single + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Single.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mode = reader.int32(); + break; + case 2: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Single message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single} Single + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Single.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Single message. + * @function verify + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Single.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + case 127: + break; + } + if (message.signature != null && message.hasOwnProperty("signature")) + if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) + return "signature: buffer expected"; + return null; + }; + + /** + * Creates a Single message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single} Single + */ + Single.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single) + return object; + var message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single(); + switch (object.mode) { + case "SIGN_MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "SIGN_MODE_DIRECT": + case 1: + message.mode = 1; + break; + case "SIGN_MODE_TEXTUAL": + case 2: + message.mode = 2; + break; + case "SIGN_MODE_LEGACY_AMINO_JSON": + case 127: + message.mode = 127; + break; + } + if (object.signature != null) + if (typeof object.signature === "string") + $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); + else if (object.signature.length) + message.signature = object.signature; + return message; + }; + + /** + * Creates a plain object from a Single message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single} message Single + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Single.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.mode = options.enums === String ? "SIGN_MODE_UNSPECIFIED" : 0; + if (options.bytes === String) + object.signature = ""; + else { + object.signature = []; + if (options.bytes !== Array) + object.signature = $util.newBuffer(object.signature); + } + } + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.cosmos.tx.signing.v1beta1.SignMode[message.mode] : message.mode; + if (message.signature != null && message.hasOwnProperty("signature")) + object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; + return object; + }; + + /** + * Converts this Single to JSON. + * @function toJSON + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @instance + * @returns {Object.} JSON object + */ + Single.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Single; + })(Data.Single || {}); + + Data.Multi = (function(Multi) { + + /** + * Properties of a Multi. + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @interface IMulti + * @property {cosmos.crypto.multisig.v1beta1.ICompactBitArray|null} [bitarray] Multi bitarray + * @property {Array.|null} [signatures] Multi signatures + */ + + /** + * Constructs a new Multi. + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @classdesc Represents a Multi. + * @implements IMulti + * @constructor + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti=} [properties] Properties to set + */ + function Multi(properties) { + this.signatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Multi bitarray. + * @member {cosmos.crypto.multisig.v1beta1.ICompactBitArray|null|undefined} bitarray + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @instance + */ + Multi.prototype.bitarray = null; + + /** + * Multi signatures. + * @member {Array.} signatures + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @instance + */ + Multi.prototype.signatures = $util.emptyArray; + + /** + * Creates a new Multi instance using the specified properties. + * @function create + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti=} [properties] Properties to set + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi} Multi instance + */ + Multi.create = function create(properties) { + return new Multi(properties); + }; + + /** + * Encodes the specified Multi message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti} message Multi message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Multi.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bitarray != null && Object.hasOwnProperty.call(message, "bitarray")) + $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.encode(message.bitarray, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.signatures != null && message.signatures.length) + for (var i = 0; i < message.signatures.length; ++i) + $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.encode(message.signatures[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Multi message, length delimited. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti} message Multi message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Multi.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Multi message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi} Multi + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Multi.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bitarray = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.signatures && message.signatures.length)) + message.signatures = []; + message.signatures.push($root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Multi message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi} Multi + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Multi.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Multi message. + * @function verify + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Multi.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bitarray != null && message.hasOwnProperty("bitarray")) { + var error = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.verify(message.bitarray); + if (error) + return "bitarray." + error; + } + if (message.signatures != null && message.hasOwnProperty("signatures")) { + if (!Array.isArray(message.signatures)) + return "signatures: array expected"; + for (var i = 0; i < message.signatures.length; ++i) { + var error = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.verify(message.signatures[i]); + if (error) + return "signatures." + error; + } + } + return null; + }; + + /** + * Creates a Multi message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi} Multi + */ + Multi.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi) + return object; + var message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi(); + if (object.bitarray != null) { + if (typeof object.bitarray !== "object") + throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.bitarray: object expected"); + message.bitarray = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.fromObject(object.bitarray); + } + if (object.signatures) { + if (!Array.isArray(object.signatures)) + throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.signatures: array expected"); + message.signatures = []; + for (var i = 0; i < object.signatures.length; ++i) { + if (typeof object.signatures[i] !== "object") + throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.signatures: object expected"); + message.signatures[i] = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.fromObject(object.signatures[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Multi message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi} message Multi + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Multi.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.signatures = []; + if (options.defaults) + object.bitarray = null; + if (message.bitarray != null && message.hasOwnProperty("bitarray")) + object.bitarray = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.toObject(message.bitarray, options); + if (message.signatures && message.signatures.length) { + object.signatures = []; + for (var j = 0; j < message.signatures.length; ++j) + object.signatures[j] = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.toObject(message.signatures[j], options); + } + return object; + }; + + /** + * Converts this Multi to JSON. + * @function toJSON + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @instance + * @returns {Object.} JSON object + */ + Multi.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Multi; + })(Data.Multi || {}); + + return Data; + })(SignatureDescriptor.Data || {}); + + return SignatureDescriptor; + })(v1beta1.SignatureDescriptor || {}); + + return v1beta1; + })(signing.v1beta1 || {}); + + return signing; + })(tx.signing || {}); + + /** + * Namespace v1beta1. + * @memberof cosmos.tx + * @namespace + */ + + tx.v1beta1 = (function(v1beta1) { + + v1beta1.Tx = (function(Tx) { + + /** + * Properties of a Tx. + * @memberof cosmos.tx.v1beta1 + * @interface ITx + * @property {cosmos.tx.v1beta1.ITxBody|null} [body] Tx body + * @property {cosmos.tx.v1beta1.IAuthInfo|null} [authInfo] Tx authInfo + * @property {Array.|null} [signatures] Tx signatures + */ + + /** + * Constructs a new Tx. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents a Tx. + * @implements ITx + * @constructor + * @param {cosmos.tx.v1beta1.ITx=} [properties] Properties to set + */ + function Tx(properties) { + this.signatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Tx body. + * @member {cosmos.tx.v1beta1.ITxBody|null|undefined} body + * @memberof cosmos.tx.v1beta1.Tx + * @instance + */ + Tx.prototype.body = null; + + /** + * Tx authInfo. + * @member {cosmos.tx.v1beta1.IAuthInfo|null|undefined} authInfo + * @memberof cosmos.tx.v1beta1.Tx + * @instance + */ + Tx.prototype.authInfo = null; + + /** + * Tx signatures. + * @member {Array.} signatures + * @memberof cosmos.tx.v1beta1.Tx + * @instance + */ + Tx.prototype.signatures = $util.emptyArray; + + /** + * Creates a new Tx instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.Tx + * @static + * @param {cosmos.tx.v1beta1.ITx=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.Tx} Tx instance + */ + Tx.create = function create(properties) { + return new Tx(properties); + }; + + /** + * Encodes the specified Tx message. Does not implicitly {@link cosmos.tx.v1beta1.Tx.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.Tx + * @static + * @param {cosmos.tx.v1beta1.ITx} message Tx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tx.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + $root.cosmos.tx.v1beta1.TxBody.encode(message.body, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.authInfo != null && Object.hasOwnProperty.call(message, "authInfo")) + $root.cosmos.tx.v1beta1.AuthInfo.encode(message.authInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.signatures != null && message.signatures.length) + for (var i = 0; i < message.signatures.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.signatures[i]); + return writer; + }; + + /** + * Encodes the specified Tx message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.Tx.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.Tx + * @static + * @param {cosmos.tx.v1beta1.ITx} message Tx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tx.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Tx message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.Tx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.Tx} Tx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tx.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.Tx(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.body = $root.cosmos.tx.v1beta1.TxBody.decode(reader, reader.uint32()); + break; + case 2: + message.authInfo = $root.cosmos.tx.v1beta1.AuthInfo.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.signatures && message.signatures.length)) + message.signatures = []; + message.signatures.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Tx message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.Tx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.Tx} Tx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tx.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Tx message. + * @function verify + * @memberof cosmos.tx.v1beta1.Tx + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Tx.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.body != null && message.hasOwnProperty("body")) { + var error = $root.cosmos.tx.v1beta1.TxBody.verify(message.body); + if (error) + return "body." + error; + } + if (message.authInfo != null && message.hasOwnProperty("authInfo")) { + var error = $root.cosmos.tx.v1beta1.AuthInfo.verify(message.authInfo); + if (error) + return "authInfo." + error; + } + if (message.signatures != null && message.hasOwnProperty("signatures")) { + if (!Array.isArray(message.signatures)) + return "signatures: array expected"; + for (var i = 0; i < message.signatures.length; ++i) + if (!(message.signatures[i] && typeof message.signatures[i].length === "number" || $util.isString(message.signatures[i]))) + return "signatures: buffer[] expected"; + } + return null; + }; + + /** + * Creates a Tx message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.Tx + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.Tx} Tx + */ + Tx.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.Tx) + return object; + var message = new $root.cosmos.tx.v1beta1.Tx(); + if (object.body != null) { + if (typeof object.body !== "object") + throw TypeError(".cosmos.tx.v1beta1.Tx.body: object expected"); + message.body = $root.cosmos.tx.v1beta1.TxBody.fromObject(object.body); + } + if (object.authInfo != null) { + if (typeof object.authInfo !== "object") + throw TypeError(".cosmos.tx.v1beta1.Tx.authInfo: object expected"); + message.authInfo = $root.cosmos.tx.v1beta1.AuthInfo.fromObject(object.authInfo); + } + if (object.signatures) { + if (!Array.isArray(object.signatures)) + throw TypeError(".cosmos.tx.v1beta1.Tx.signatures: array expected"); + message.signatures = []; + for (var i = 0; i < object.signatures.length; ++i) + if (typeof object.signatures[i] === "string") + $util.base64.decode(object.signatures[i], message.signatures[i] = $util.newBuffer($util.base64.length(object.signatures[i])), 0); + else if (object.signatures[i].length) + message.signatures[i] = object.signatures[i]; + } + return message; + }; + + /** + * Creates a plain object from a Tx message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.Tx + * @static + * @param {cosmos.tx.v1beta1.Tx} message Tx + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Tx.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.signatures = []; + if (options.defaults) { + object.body = null; + object.authInfo = null; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = $root.cosmos.tx.v1beta1.TxBody.toObject(message.body, options); + if (message.authInfo != null && message.hasOwnProperty("authInfo")) + object.authInfo = $root.cosmos.tx.v1beta1.AuthInfo.toObject(message.authInfo, options); + if (message.signatures && message.signatures.length) { + object.signatures = []; + for (var j = 0; j < message.signatures.length; ++j) + object.signatures[j] = options.bytes === String ? $util.base64.encode(message.signatures[j], 0, message.signatures[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.signatures[j]) : message.signatures[j]; + } + return object; + }; + + /** + * Converts this Tx to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.Tx + * @instance + * @returns {Object.} JSON object + */ + Tx.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Tx; + })(v1beta1.Tx || {}); + + v1beta1.TxRaw = (function(TxRaw) { + + /** + * Properties of a TxRaw. + * @memberof cosmos.tx.v1beta1 + * @interface ITxRaw + * @property {Uint8Array|null} [bodyBytes] TxRaw bodyBytes + * @property {Uint8Array|null} [authInfoBytes] TxRaw authInfoBytes + * @property {Array.|null} [signatures] TxRaw signatures + */ + + /** + * Constructs a new TxRaw. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents a TxRaw. + * @implements ITxRaw + * @constructor + * @param {cosmos.tx.v1beta1.ITxRaw=} [properties] Properties to set + */ + function TxRaw(properties) { + this.signatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TxRaw bodyBytes. + * @member {Uint8Array} bodyBytes + * @memberof cosmos.tx.v1beta1.TxRaw + * @instance + */ + TxRaw.prototype.bodyBytes = $util.newBuffer([]); + + /** + * TxRaw authInfoBytes. + * @member {Uint8Array} authInfoBytes + * @memberof cosmos.tx.v1beta1.TxRaw + * @instance + */ + TxRaw.prototype.authInfoBytes = $util.newBuffer([]); + + /** + * TxRaw signatures. + * @member {Array.} signatures + * @memberof cosmos.tx.v1beta1.TxRaw + * @instance + */ + TxRaw.prototype.signatures = $util.emptyArray; + + /** + * Creates a new TxRaw instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.TxRaw + * @static + * @param {cosmos.tx.v1beta1.ITxRaw=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.TxRaw} TxRaw instance + */ + TxRaw.create = function create(properties) { + return new TxRaw(properties); + }; + + /** + * Encodes the specified TxRaw message. Does not implicitly {@link cosmos.tx.v1beta1.TxRaw.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.TxRaw + * @static + * @param {cosmos.tx.v1beta1.ITxRaw} message TxRaw message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TxRaw.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bodyBytes != null && Object.hasOwnProperty.call(message, "bodyBytes")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.bodyBytes); + if (message.authInfoBytes != null && Object.hasOwnProperty.call(message, "authInfoBytes")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.authInfoBytes); + if (message.signatures != null && message.signatures.length) + for (var i = 0; i < message.signatures.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.signatures[i]); + return writer; + }; + + /** + * Encodes the specified TxRaw message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.TxRaw.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.TxRaw + * @static + * @param {cosmos.tx.v1beta1.ITxRaw} message TxRaw message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TxRaw.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TxRaw message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.TxRaw + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.TxRaw} TxRaw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TxRaw.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.TxRaw(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bodyBytes = reader.bytes(); + break; + case 2: + message.authInfoBytes = reader.bytes(); + break; + case 3: + if (!(message.signatures && message.signatures.length)) + message.signatures = []; + message.signatures.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TxRaw message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.TxRaw + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.TxRaw} TxRaw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TxRaw.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TxRaw message. + * @function verify + * @memberof cosmos.tx.v1beta1.TxRaw + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TxRaw.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bodyBytes != null && message.hasOwnProperty("bodyBytes")) + if (!(message.bodyBytes && typeof message.bodyBytes.length === "number" || $util.isString(message.bodyBytes))) + return "bodyBytes: buffer expected"; + if (message.authInfoBytes != null && message.hasOwnProperty("authInfoBytes")) + if (!(message.authInfoBytes && typeof message.authInfoBytes.length === "number" || $util.isString(message.authInfoBytes))) + return "authInfoBytes: buffer expected"; + if (message.signatures != null && message.hasOwnProperty("signatures")) { + if (!Array.isArray(message.signatures)) + return "signatures: array expected"; + for (var i = 0; i < message.signatures.length; ++i) + if (!(message.signatures[i] && typeof message.signatures[i].length === "number" || $util.isString(message.signatures[i]))) + return "signatures: buffer[] expected"; + } + return null; + }; + + /** + * Creates a TxRaw message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.TxRaw + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.TxRaw} TxRaw + */ + TxRaw.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.TxRaw) + return object; + var message = new $root.cosmos.tx.v1beta1.TxRaw(); + if (object.bodyBytes != null) + if (typeof object.bodyBytes === "string") + $util.base64.decode(object.bodyBytes, message.bodyBytes = $util.newBuffer($util.base64.length(object.bodyBytes)), 0); + else if (object.bodyBytes.length) + message.bodyBytes = object.bodyBytes; + if (object.authInfoBytes != null) + if (typeof object.authInfoBytes === "string") + $util.base64.decode(object.authInfoBytes, message.authInfoBytes = $util.newBuffer($util.base64.length(object.authInfoBytes)), 0); + else if (object.authInfoBytes.length) + message.authInfoBytes = object.authInfoBytes; + if (object.signatures) { + if (!Array.isArray(object.signatures)) + throw TypeError(".cosmos.tx.v1beta1.TxRaw.signatures: array expected"); + message.signatures = []; + for (var i = 0; i < object.signatures.length; ++i) + if (typeof object.signatures[i] === "string") + $util.base64.decode(object.signatures[i], message.signatures[i] = $util.newBuffer($util.base64.length(object.signatures[i])), 0); + else if (object.signatures[i].length) + message.signatures[i] = object.signatures[i]; + } + return message; + }; + + /** + * Creates a plain object from a TxRaw message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.TxRaw + * @static + * @param {cosmos.tx.v1beta1.TxRaw} message TxRaw + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TxRaw.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.signatures = []; + if (options.defaults) { + if (options.bytes === String) + object.bodyBytes = ""; + else { + object.bodyBytes = []; + if (options.bytes !== Array) + object.bodyBytes = $util.newBuffer(object.bodyBytes); + } + if (options.bytes === String) + object.authInfoBytes = ""; + else { + object.authInfoBytes = []; + if (options.bytes !== Array) + object.authInfoBytes = $util.newBuffer(object.authInfoBytes); + } + } + if (message.bodyBytes != null && message.hasOwnProperty("bodyBytes")) + object.bodyBytes = options.bytes === String ? $util.base64.encode(message.bodyBytes, 0, message.bodyBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.bodyBytes) : message.bodyBytes; + if (message.authInfoBytes != null && message.hasOwnProperty("authInfoBytes")) + object.authInfoBytes = options.bytes === String ? $util.base64.encode(message.authInfoBytes, 0, message.authInfoBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.authInfoBytes) : message.authInfoBytes; + if (message.signatures && message.signatures.length) { + object.signatures = []; + for (var j = 0; j < message.signatures.length; ++j) + object.signatures[j] = options.bytes === String ? $util.base64.encode(message.signatures[j], 0, message.signatures[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.signatures[j]) : message.signatures[j]; + } + return object; + }; + + /** + * Converts this TxRaw to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.TxRaw + * @instance + * @returns {Object.} JSON object + */ + TxRaw.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TxRaw; + })(v1beta1.TxRaw || {}); + + v1beta1.SignDoc = (function(SignDoc) { + + /** + * Properties of a SignDoc. + * @memberof cosmos.tx.v1beta1 + * @interface ISignDoc + * @property {Uint8Array|null} [bodyBytes] SignDoc bodyBytes + * @property {Uint8Array|null} [authInfoBytes] SignDoc authInfoBytes + * @property {string|null} [chainId] SignDoc chainId + * @property {number|Long|null} [accountNumber] SignDoc accountNumber + */ + + /** + * Constructs a new SignDoc. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents a SignDoc. + * @implements ISignDoc + * @constructor + * @param {cosmos.tx.v1beta1.ISignDoc=} [properties] Properties to set + */ + function SignDoc(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SignDoc bodyBytes. + * @member {Uint8Array} bodyBytes + * @memberof cosmos.tx.v1beta1.SignDoc + * @instance + */ + SignDoc.prototype.bodyBytes = $util.newBuffer([]); + + /** + * SignDoc authInfoBytes. + * @member {Uint8Array} authInfoBytes + * @memberof cosmos.tx.v1beta1.SignDoc + * @instance + */ + SignDoc.prototype.authInfoBytes = $util.newBuffer([]); + + /** + * SignDoc chainId. + * @member {string} chainId + * @memberof cosmos.tx.v1beta1.SignDoc + * @instance + */ + SignDoc.prototype.chainId = ""; + + /** + * SignDoc accountNumber. + * @member {number|Long} accountNumber + * @memberof cosmos.tx.v1beta1.SignDoc + * @instance + */ + SignDoc.prototype.accountNumber = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new SignDoc instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.SignDoc + * @static + * @param {cosmos.tx.v1beta1.ISignDoc=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.SignDoc} SignDoc instance + */ + SignDoc.create = function create(properties) { + return new SignDoc(properties); + }; + + /** + * Encodes the specified SignDoc message. Does not implicitly {@link cosmos.tx.v1beta1.SignDoc.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.SignDoc + * @static + * @param {cosmos.tx.v1beta1.ISignDoc} message SignDoc message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignDoc.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bodyBytes != null && Object.hasOwnProperty.call(message, "bodyBytes")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.bodyBytes); + if (message.authInfoBytes != null && Object.hasOwnProperty.call(message, "authInfoBytes")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.authInfoBytes); + if (message.chainId != null && Object.hasOwnProperty.call(message, "chainId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.chainId); + if (message.accountNumber != null && Object.hasOwnProperty.call(message, "accountNumber")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.accountNumber); + return writer; + }; + + /** + * Encodes the specified SignDoc message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.SignDoc.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.SignDoc + * @static + * @param {cosmos.tx.v1beta1.ISignDoc} message SignDoc message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignDoc.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SignDoc message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.SignDoc + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.SignDoc} SignDoc + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignDoc.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.SignDoc(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bodyBytes = reader.bytes(); + break; + case 2: + message.authInfoBytes = reader.bytes(); + break; + case 3: + message.chainId = reader.string(); + break; + case 4: + message.accountNumber = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SignDoc message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.SignDoc + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.SignDoc} SignDoc + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignDoc.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SignDoc message. + * @function verify + * @memberof cosmos.tx.v1beta1.SignDoc + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SignDoc.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bodyBytes != null && message.hasOwnProperty("bodyBytes")) + if (!(message.bodyBytes && typeof message.bodyBytes.length === "number" || $util.isString(message.bodyBytes))) + return "bodyBytes: buffer expected"; + if (message.authInfoBytes != null && message.hasOwnProperty("authInfoBytes")) + if (!(message.authInfoBytes && typeof message.authInfoBytes.length === "number" || $util.isString(message.authInfoBytes))) + return "authInfoBytes: buffer expected"; + if (message.chainId != null && message.hasOwnProperty("chainId")) + if (!$util.isString(message.chainId)) + return "chainId: string expected"; + if (message.accountNumber != null && message.hasOwnProperty("accountNumber")) + if (!$util.isInteger(message.accountNumber) && !(message.accountNumber && $util.isInteger(message.accountNumber.low) && $util.isInteger(message.accountNumber.high))) + return "accountNumber: integer|Long expected"; + return null; + }; + + /** + * Creates a SignDoc message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.SignDoc + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.SignDoc} SignDoc + */ + SignDoc.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.SignDoc) + return object; + var message = new $root.cosmos.tx.v1beta1.SignDoc(); + if (object.bodyBytes != null) + if (typeof object.bodyBytes === "string") + $util.base64.decode(object.bodyBytes, message.bodyBytes = $util.newBuffer($util.base64.length(object.bodyBytes)), 0); + else if (object.bodyBytes.length) + message.bodyBytes = object.bodyBytes; + if (object.authInfoBytes != null) + if (typeof object.authInfoBytes === "string") + $util.base64.decode(object.authInfoBytes, message.authInfoBytes = $util.newBuffer($util.base64.length(object.authInfoBytes)), 0); + else if (object.authInfoBytes.length) + message.authInfoBytes = object.authInfoBytes; + if (object.chainId != null) + message.chainId = String(object.chainId); + if (object.accountNumber != null) + if ($util.Long) + (message.accountNumber = $util.Long.fromValue(object.accountNumber)).unsigned = true; + else if (typeof object.accountNumber === "string") + message.accountNumber = parseInt(object.accountNumber, 10); + else if (typeof object.accountNumber === "number") + message.accountNumber = object.accountNumber; + else if (typeof object.accountNumber === "object") + message.accountNumber = new $util.LongBits(object.accountNumber.low >>> 0, object.accountNumber.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a SignDoc message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.SignDoc + * @static + * @param {cosmos.tx.v1beta1.SignDoc} message SignDoc + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SignDoc.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.bodyBytes = ""; + else { + object.bodyBytes = []; + if (options.bytes !== Array) + object.bodyBytes = $util.newBuffer(object.bodyBytes); + } + if (options.bytes === String) + object.authInfoBytes = ""; + else { + object.authInfoBytes = []; + if (options.bytes !== Array) + object.authInfoBytes = $util.newBuffer(object.authInfoBytes); + } + object.chainId = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.accountNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.accountNumber = options.longs === String ? "0" : 0; + } + if (message.bodyBytes != null && message.hasOwnProperty("bodyBytes")) + object.bodyBytes = options.bytes === String ? $util.base64.encode(message.bodyBytes, 0, message.bodyBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.bodyBytes) : message.bodyBytes; + if (message.authInfoBytes != null && message.hasOwnProperty("authInfoBytes")) + object.authInfoBytes = options.bytes === String ? $util.base64.encode(message.authInfoBytes, 0, message.authInfoBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.authInfoBytes) : message.authInfoBytes; + if (message.chainId != null && message.hasOwnProperty("chainId")) + object.chainId = message.chainId; + if (message.accountNumber != null && message.hasOwnProperty("accountNumber")) + if (typeof message.accountNumber === "number") + object.accountNumber = options.longs === String ? String(message.accountNumber) : message.accountNumber; + else + object.accountNumber = options.longs === String ? $util.Long.prototype.toString.call(message.accountNumber) : options.longs === Number ? new $util.LongBits(message.accountNumber.low >>> 0, message.accountNumber.high >>> 0).toNumber(true) : message.accountNumber; + return object; + }; + + /** + * Converts this SignDoc to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.SignDoc + * @instance + * @returns {Object.} JSON object + */ + SignDoc.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SignDoc; + })(v1beta1.SignDoc || {}); + + v1beta1.TxBody = (function(TxBody) { + + /** + * Properties of a TxBody. + * @memberof cosmos.tx.v1beta1 + * @interface ITxBody + * @property {Array.|null} [messages] TxBody messages + * @property {string|null} [memo] TxBody memo + * @property {number|Long|null} [timeoutHeight] TxBody timeoutHeight + * @property {Array.|null} [extensionOptions] TxBody extensionOptions + * @property {Array.|null} [nonCriticalExtensionOptions] TxBody nonCriticalExtensionOptions + */ + + /** + * Constructs a new TxBody. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents a TxBody. + * @implements ITxBody + * @constructor + * @param {cosmos.tx.v1beta1.ITxBody=} [properties] Properties to set + */ + function TxBody(properties) { + this.messages = []; + this.extensionOptions = []; + this.nonCriticalExtensionOptions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TxBody messages. + * @member {Array.} messages + * @memberof cosmos.tx.v1beta1.TxBody + * @instance + */ + TxBody.prototype.messages = $util.emptyArray; + + /** + * TxBody memo. + * @member {string} memo + * @memberof cosmos.tx.v1beta1.TxBody + * @instance + */ + TxBody.prototype.memo = ""; + + /** + * TxBody timeoutHeight. + * @member {number|Long} timeoutHeight + * @memberof cosmos.tx.v1beta1.TxBody + * @instance + */ + TxBody.prototype.timeoutHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * TxBody extensionOptions. + * @member {Array.} extensionOptions + * @memberof cosmos.tx.v1beta1.TxBody + * @instance + */ + TxBody.prototype.extensionOptions = $util.emptyArray; + + /** + * TxBody nonCriticalExtensionOptions. + * @member {Array.} nonCriticalExtensionOptions + * @memberof cosmos.tx.v1beta1.TxBody + * @instance + */ + TxBody.prototype.nonCriticalExtensionOptions = $util.emptyArray; + + /** + * Creates a new TxBody instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.TxBody + * @static + * @param {cosmos.tx.v1beta1.ITxBody=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.TxBody} TxBody instance + */ + TxBody.create = function create(properties) { + return new TxBody(properties); + }; + + /** + * Encodes the specified TxBody message. Does not implicitly {@link cosmos.tx.v1beta1.TxBody.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.TxBody + * @static + * @param {cosmos.tx.v1beta1.ITxBody} message TxBody message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TxBody.encode = function encode(message, writer) { + console.log('encoding: ', message) + if (!writer) + writer = $Writer.create(); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + message.messages[i].constructor.encode(message.messages[i].value, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim() + // $root.google.protobuf.Any.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.memo != null && Object.hasOwnProperty.call(message, "memo")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.memo); + if (message.timeoutHeight != null && Object.hasOwnProperty.call(message, "timeoutHeight")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.timeoutHeight); + if (message.extensionOptions != null && message.extensionOptions.length) + for (var i = 0; i < message.extensionOptions.length; ++i) + $root.google.protobuf.Any.encode(message.extensionOptions[i], writer.uint32(/* id 1023, wireType 2 =*/8186).fork()).ldelim(); + if (message.nonCriticalExtensionOptions != null && message.nonCriticalExtensionOptions.length) + for (var i = 0; i < message.nonCriticalExtensionOptions.length; ++i) + $root.google.protobuf.Any.encode(message.nonCriticalExtensionOptions[i], writer.uint32(/* id 2047, wireType 2 =*/16378).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TxBody message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.TxBody.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.TxBody + * @static + * @param {cosmos.tx.v1beta1.ITxBody} message TxBody message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TxBody.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TxBody message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.TxBody + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.TxBody} TxBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TxBody.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.TxBody(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + case 2: + message.memo = reader.string(); + break; + case 3: + message.timeoutHeight = reader.uint64(); + break; + case 1023: + if (!(message.extensionOptions && message.extensionOptions.length)) + message.extensionOptions = []; + message.extensionOptions.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + case 2047: + if (!(message.nonCriticalExtensionOptions && message.nonCriticalExtensionOptions.length)) + message.nonCriticalExtensionOptions = []; + message.nonCriticalExtensionOptions.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TxBody message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.TxBody + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.TxBody} TxBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TxBody.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TxBody message. + * @function verify + * @memberof cosmos.tx.v1beta1.TxBody + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TxBody.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.messages[i]); + if (error) + return "messages." + error; + } + } + if (message.memo != null && message.hasOwnProperty("memo")) + if (!$util.isString(message.memo)) + return "memo: string expected"; + if (message.timeoutHeight != null && message.hasOwnProperty("timeoutHeight")) + if (!$util.isInteger(message.timeoutHeight) && !(message.timeoutHeight && $util.isInteger(message.timeoutHeight.low) && $util.isInteger(message.timeoutHeight.high))) + return "timeoutHeight: integer|Long expected"; + if (message.extensionOptions != null && message.hasOwnProperty("extensionOptions")) { + if (!Array.isArray(message.extensionOptions)) + return "extensionOptions: array expected"; + for (var i = 0; i < message.extensionOptions.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.extensionOptions[i]); + if (error) + return "extensionOptions." + error; + } + } + if (message.nonCriticalExtensionOptions != null && message.hasOwnProperty("nonCriticalExtensionOptions")) { + if (!Array.isArray(message.nonCriticalExtensionOptions)) + return "nonCriticalExtensionOptions: array expected"; + for (var i = 0; i < message.nonCriticalExtensionOptions.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.nonCriticalExtensionOptions[i]); + if (error) + return "nonCriticalExtensionOptions." + error; + } + } + return null; + }; + + /** + * Creates a TxBody message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.TxBody + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.TxBody} TxBody + */ + TxBody.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.TxBody) + return object; + var message = new $root.cosmos.tx.v1beta1.TxBody(); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".cosmos.tx.v1beta1.TxBody.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".cosmos.tx.v1beta1.TxBody.messages: object expected"); + message.messages[i] = $root.google.protobuf.Any.fromObject(object.messages[i]); + } + } + if (object.memo != null) + message.memo = String(object.memo); + if (object.timeoutHeight != null) + if ($util.Long) + (message.timeoutHeight = $util.Long.fromValue(object.timeoutHeight)).unsigned = true; + else if (typeof object.timeoutHeight === "string") + message.timeoutHeight = parseInt(object.timeoutHeight, 10); + else if (typeof object.timeoutHeight === "number") + message.timeoutHeight = object.timeoutHeight; + else if (typeof object.timeoutHeight === "object") + message.timeoutHeight = new $util.LongBits(object.timeoutHeight.low >>> 0, object.timeoutHeight.high >>> 0).toNumber(true); + if (object.extensionOptions) { + if (!Array.isArray(object.extensionOptions)) + throw TypeError(".cosmos.tx.v1beta1.TxBody.extensionOptions: array expected"); + message.extensionOptions = []; + for (var i = 0; i < object.extensionOptions.length; ++i) { + if (typeof object.extensionOptions[i] !== "object") + throw TypeError(".cosmos.tx.v1beta1.TxBody.extensionOptions: object expected"); + message.extensionOptions[i] = $root.google.protobuf.Any.fromObject(object.extensionOptions[i]); + } + } + if (object.nonCriticalExtensionOptions) { + if (!Array.isArray(object.nonCriticalExtensionOptions)) + throw TypeError(".cosmos.tx.v1beta1.TxBody.nonCriticalExtensionOptions: array expected"); + message.nonCriticalExtensionOptions = []; + for (var i = 0; i < object.nonCriticalExtensionOptions.length; ++i) { + if (typeof object.nonCriticalExtensionOptions[i] !== "object") + throw TypeError(".cosmos.tx.v1beta1.TxBody.nonCriticalExtensionOptions: object expected"); + message.nonCriticalExtensionOptions[i] = $root.google.protobuf.Any.fromObject(object.nonCriticalExtensionOptions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TxBody message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.TxBody + * @static + * @param {cosmos.tx.v1beta1.TxBody} message TxBody + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TxBody.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.messages = []; + object.extensionOptions = []; + object.nonCriticalExtensionOptions = []; + } + if (options.defaults) { + object.memo = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.timeoutHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timeoutHeight = options.longs === String ? "0" : 0; + } + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.protobuf.Any.toObject(message.messages[j], options); + } + if (message.memo != null && message.hasOwnProperty("memo")) + object.memo = message.memo; + if (message.timeoutHeight != null && message.hasOwnProperty("timeoutHeight")) + if (typeof message.timeoutHeight === "number") + object.timeoutHeight = options.longs === String ? String(message.timeoutHeight) : message.timeoutHeight; + else + object.timeoutHeight = options.longs === String ? $util.Long.prototype.toString.call(message.timeoutHeight) : options.longs === Number ? new $util.LongBits(message.timeoutHeight.low >>> 0, message.timeoutHeight.high >>> 0).toNumber(true) : message.timeoutHeight; + if (message.extensionOptions && message.extensionOptions.length) { + object.extensionOptions = []; + for (var j = 0; j < message.extensionOptions.length; ++j) + object.extensionOptions[j] = $root.google.protobuf.Any.toObject(message.extensionOptions[j], options); + } + if (message.nonCriticalExtensionOptions && message.nonCriticalExtensionOptions.length) { + object.nonCriticalExtensionOptions = []; + for (var j = 0; j < message.nonCriticalExtensionOptions.length; ++j) + object.nonCriticalExtensionOptions[j] = $root.google.protobuf.Any.toObject(message.nonCriticalExtensionOptions[j], options); + } + return object; + }; + + /** + * Converts this TxBody to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.TxBody + * @instance + * @returns {Object.} JSON object + */ + TxBody.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TxBody; + })(v1beta1.TxBody || {}); + + v1beta1.AuthInfo = (function(AuthInfo) { + + /** + * Properties of an AuthInfo. + * @memberof cosmos.tx.v1beta1 + * @interface IAuthInfo + * @property {Array.|null} [signerInfos] AuthInfo signerInfos + * @property {cosmos.tx.v1beta1.IFee|null} [fee] AuthInfo fee + */ + + /** + * Constructs a new AuthInfo. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents an AuthInfo. + * @implements IAuthInfo + * @constructor + * @param {cosmos.tx.v1beta1.IAuthInfo=} [properties] Properties to set + */ + function AuthInfo(properties) { + this.signerInfos = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuthInfo signerInfos. + * @member {Array.} signerInfos + * @memberof cosmos.tx.v1beta1.AuthInfo + * @instance + */ + AuthInfo.prototype.signerInfos = $util.emptyArray; + + /** + * AuthInfo fee. + * @member {cosmos.tx.v1beta1.IFee|null|undefined} fee + * @memberof cosmos.tx.v1beta1.AuthInfo + * @instance + */ + AuthInfo.prototype.fee = null; + + /** + * Creates a new AuthInfo instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.AuthInfo + * @static + * @param {cosmos.tx.v1beta1.IAuthInfo=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.AuthInfo} AuthInfo instance + */ + AuthInfo.create = function create(properties) { + return new AuthInfo(properties); + }; + + /** + * Encodes the specified AuthInfo message. Does not implicitly {@link cosmos.tx.v1beta1.AuthInfo.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.AuthInfo + * @static + * @param {cosmos.tx.v1beta1.IAuthInfo} message AuthInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.signerInfos != null && message.signerInfos.length) + for (var i = 0; i < message.signerInfos.length; ++i) + $root.cosmos.tx.v1beta1.SignerInfo.encode(message.signerInfos[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fee != null && Object.hasOwnProperty.call(message, "fee")) + $root.cosmos.tx.v1beta1.Fee.encode(message.fee, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuthInfo message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.AuthInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.AuthInfo + * @static + * @param {cosmos.tx.v1beta1.IAuthInfo} message AuthInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuthInfo message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.AuthInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.AuthInfo} AuthInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.AuthInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.signerInfos && message.signerInfos.length)) + message.signerInfos = []; + message.signerInfos.push($root.cosmos.tx.v1beta1.SignerInfo.decode(reader, reader.uint32())); + break; + case 2: + message.fee = $root.cosmos.tx.v1beta1.Fee.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuthInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.AuthInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.AuthInfo} AuthInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuthInfo message. + * @function verify + * @memberof cosmos.tx.v1beta1.AuthInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuthInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.signerInfos != null && message.hasOwnProperty("signerInfos")) { + if (!Array.isArray(message.signerInfos)) + return "signerInfos: array expected"; + for (var i = 0; i < message.signerInfos.length; ++i) { + var error = $root.cosmos.tx.v1beta1.SignerInfo.verify(message.signerInfos[i]); + if (error) + return "signerInfos." + error; + } + } + if (message.fee != null && message.hasOwnProperty("fee")) { + var error = $root.cosmos.tx.v1beta1.Fee.verify(message.fee); + if (error) + return "fee." + error; + } + return null; + }; + + /** + * Creates an AuthInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.AuthInfo + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.AuthInfo} AuthInfo + */ + AuthInfo.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.AuthInfo) + return object; + var message = new $root.cosmos.tx.v1beta1.AuthInfo(); + if (object.signerInfos) { + if (!Array.isArray(object.signerInfos)) + throw TypeError(".cosmos.tx.v1beta1.AuthInfo.signerInfos: array expected"); + message.signerInfos = []; + for (var i = 0; i < object.signerInfos.length; ++i) { + if (typeof object.signerInfos[i] !== "object") + throw TypeError(".cosmos.tx.v1beta1.AuthInfo.signerInfos: object expected"); + message.signerInfos[i] = $root.cosmos.tx.v1beta1.SignerInfo.fromObject(object.signerInfos[i]); + } + } + if (object.fee != null) { + if (typeof object.fee !== "object") + throw TypeError(".cosmos.tx.v1beta1.AuthInfo.fee: object expected"); + message.fee = $root.cosmos.tx.v1beta1.Fee.fromObject(object.fee); + } + return message; + }; + + /** + * Creates a plain object from an AuthInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.AuthInfo + * @static + * @param {cosmos.tx.v1beta1.AuthInfo} message AuthInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuthInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.signerInfos = []; + if (options.defaults) + object.fee = null; + if (message.signerInfos && message.signerInfos.length) { + object.signerInfos = []; + for (var j = 0; j < message.signerInfos.length; ++j) + object.signerInfos[j] = $root.cosmos.tx.v1beta1.SignerInfo.toObject(message.signerInfos[j], options); + } + if (message.fee != null && message.hasOwnProperty("fee")) + object.fee = $root.cosmos.tx.v1beta1.Fee.toObject(message.fee, options); + return object; + }; + + /** + * Converts this AuthInfo to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.AuthInfo + * @instance + * @returns {Object.} JSON object + */ + AuthInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AuthInfo; + })(v1beta1.AuthInfo || {}); + + v1beta1.SignerInfo = (function(SignerInfo) { + + /** + * Properties of a SignerInfo. + * @memberof cosmos.tx.v1beta1 + * @interface ISignerInfo + * @property {google.protobuf.IAny|null} [publicKey] SignerInfo publicKey + * @property {cosmos.tx.v1beta1.IModeInfo|null} [modeInfo] SignerInfo modeInfo + * @property {number|Long|null} [sequence] SignerInfo sequence + */ + + /** + * Constructs a new SignerInfo. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents a SignerInfo. + * @implements ISignerInfo + * @constructor + * @param {cosmos.tx.v1beta1.ISignerInfo=} [properties] Properties to set + */ + function SignerInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SignerInfo publicKey. + * @member {google.protobuf.IAny|null|undefined} publicKey + * @memberof cosmos.tx.v1beta1.SignerInfo + * @instance + */ + SignerInfo.prototype.publicKey = null; + + /** + * SignerInfo modeInfo. + * @member {cosmos.tx.v1beta1.IModeInfo|null|undefined} modeInfo + * @memberof cosmos.tx.v1beta1.SignerInfo + * @instance + */ + SignerInfo.prototype.modeInfo = null; + + /** + * SignerInfo sequence. + * @member {number|Long} sequence + * @memberof cosmos.tx.v1beta1.SignerInfo + * @instance + */ + SignerInfo.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new SignerInfo instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.SignerInfo + * @static + * @param {cosmos.tx.v1beta1.ISignerInfo=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.SignerInfo} SignerInfo instance + */ + SignerInfo.create = function create(properties) { + return new SignerInfo(properties); + }; + + /** + * Encodes the specified SignerInfo message. Does not implicitly {@link cosmos.tx.v1beta1.SignerInfo.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.SignerInfo + * @static + * @param {cosmos.tx.v1beta1.ISignerInfo} message SignerInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignerInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) + $root.google.protobuf.Any.encode(message.publicKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.modeInfo != null && Object.hasOwnProperty.call(message, "modeInfo")) + $root.cosmos.tx.v1beta1.ModeInfo.encode(message.modeInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.sequence); + return writer; + }; + + /** + * Encodes the specified SignerInfo message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.SignerInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.SignerInfo + * @static + * @param {cosmos.tx.v1beta1.ISignerInfo} message SignerInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignerInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SignerInfo message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.SignerInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.SignerInfo} SignerInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignerInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.SignerInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publicKey = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 2: + message.modeInfo = $root.cosmos.tx.v1beta1.ModeInfo.decode(reader, reader.uint32()); + break; + case 3: + message.sequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SignerInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.SignerInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.SignerInfo} SignerInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignerInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SignerInfo message. + * @function verify + * @memberof cosmos.tx.v1beta1.SignerInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SignerInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.publicKey != null && message.hasOwnProperty("publicKey")) { + var error = $root.google.protobuf.Any.verify(message.publicKey); + if (error) + return "publicKey." + error; + } + if (message.modeInfo != null && message.hasOwnProperty("modeInfo")) { + var error = $root.cosmos.tx.v1beta1.ModeInfo.verify(message.modeInfo); + if (error) + return "modeInfo." + error; + } + if (message.sequence != null && message.hasOwnProperty("sequence")) + if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) + return "sequence: integer|Long expected"; + return null; + }; + + /** + * Creates a SignerInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.SignerInfo + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.SignerInfo} SignerInfo + */ + SignerInfo.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.SignerInfo) + return object; + var message = new $root.cosmos.tx.v1beta1.SignerInfo(); + if (object.publicKey != null) { + if (typeof object.publicKey !== "object") + throw TypeError(".cosmos.tx.v1beta1.SignerInfo.publicKey: object expected"); + message.publicKey = $root.google.protobuf.Any.fromObject(object.publicKey); + } + if (object.modeInfo != null) { + if (typeof object.modeInfo !== "object") + throw TypeError(".cosmos.tx.v1beta1.SignerInfo.modeInfo: object expected"); + message.modeInfo = $root.cosmos.tx.v1beta1.ModeInfo.fromObject(object.modeInfo); + } + if (object.sequence != null) + if ($util.Long) + (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; + else if (typeof object.sequence === "string") + message.sequence = parseInt(object.sequence, 10); + else if (typeof object.sequence === "number") + message.sequence = object.sequence; + else if (typeof object.sequence === "object") + message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a SignerInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.SignerInfo + * @static + * @param {cosmos.tx.v1beta1.SignerInfo} message SignerInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SignerInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.publicKey = null; + object.modeInfo = null; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sequence = options.longs === String ? "0" : 0; + } + if (message.publicKey != null && message.hasOwnProperty("publicKey")) + object.publicKey = $root.google.protobuf.Any.toObject(message.publicKey, options); + if (message.modeInfo != null && message.hasOwnProperty("modeInfo")) + object.modeInfo = $root.cosmos.tx.v1beta1.ModeInfo.toObject(message.modeInfo, options); + if (message.sequence != null && message.hasOwnProperty("sequence")) + if (typeof message.sequence === "number") + object.sequence = options.longs === String ? String(message.sequence) : message.sequence; + else + object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; + return object; + }; + + /** + * Converts this SignerInfo to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.SignerInfo + * @instance + * @returns {Object.} JSON object + */ + SignerInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SignerInfo; + })(v1beta1.SignerInfo || {}); + + v1beta1.ModeInfo = (function(ModeInfo) { + + /** + * Properties of a ModeInfo. + * @memberof cosmos.tx.v1beta1 + * @interface IModeInfo + * @property {cosmos.tx.v1beta1.ModeInfo.ISingle|null} [single] ModeInfo single + * @property {cosmos.tx.v1beta1.ModeInfo.IMulti|null} [multi] ModeInfo multi + */ + + /** + * Constructs a new ModeInfo. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents a ModeInfo. + * @implements IModeInfo + * @constructor + * @param {cosmos.tx.v1beta1.IModeInfo=} [properties] Properties to set + */ + function ModeInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModeInfo single. + * @member {cosmos.tx.v1beta1.ModeInfo.ISingle|null|undefined} single + * @memberof cosmos.tx.v1beta1.ModeInfo + * @instance + */ + ModeInfo.prototype.single = null; + + /** + * ModeInfo multi. + * @member {cosmos.tx.v1beta1.ModeInfo.IMulti|null|undefined} multi + * @memberof cosmos.tx.v1beta1.ModeInfo + * @instance + */ + ModeInfo.prototype.multi = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ModeInfo sum. + * @member {"single"|"multi"|undefined} sum + * @memberof cosmos.tx.v1beta1.ModeInfo + * @instance + */ + Object.defineProperty(ModeInfo.prototype, "sum", { + get: $util.oneOfGetter($oneOfFields = ["single", "multi"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ModeInfo instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.ModeInfo + * @static + * @param {cosmos.tx.v1beta1.IModeInfo=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.ModeInfo} ModeInfo instance + */ + ModeInfo.create = function create(properties) { + return new ModeInfo(properties); + }; + + /** + * Encodes the specified ModeInfo message. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.ModeInfo + * @static + * @param {cosmos.tx.v1beta1.IModeInfo} message ModeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.single != null && Object.hasOwnProperty.call(message, "single")) + $root.cosmos.tx.v1beta1.ModeInfo.Single.encode(message.single, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.multi != null && Object.hasOwnProperty.call(message, "multi")) + $root.cosmos.tx.v1beta1.ModeInfo.Multi.encode(message.multi, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ModeInfo message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.ModeInfo + * @static + * @param {cosmos.tx.v1beta1.IModeInfo} message ModeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModeInfo message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.ModeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.ModeInfo} ModeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.ModeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.single = $root.cosmos.tx.v1beta1.ModeInfo.Single.decode(reader, reader.uint32()); + break; + case 2: + message.multi = $root.cosmos.tx.v1beta1.ModeInfo.Multi.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.ModeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.ModeInfo} ModeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModeInfo message. + * @function verify + * @memberof cosmos.tx.v1beta1.ModeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.single != null && message.hasOwnProperty("single")) { + properties.sum = 1; + { + var error = $root.cosmos.tx.v1beta1.ModeInfo.Single.verify(message.single); + if (error) + return "single." + error; + } + } + if (message.multi != null && message.hasOwnProperty("multi")) { + if (properties.sum === 1) + return "sum: multiple values"; + properties.sum = 1; + { + var error = $root.cosmos.tx.v1beta1.ModeInfo.Multi.verify(message.multi); + if (error) + return "multi." + error; + } + } + return null; + }; + + /** + * Creates a ModeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.ModeInfo + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.ModeInfo} ModeInfo + */ + ModeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.ModeInfo) + return object; + var message = new $root.cosmos.tx.v1beta1.ModeInfo(); + if (object.single != null) { + if (typeof object.single !== "object") + throw TypeError(".cosmos.tx.v1beta1.ModeInfo.single: object expected"); + message.single = $root.cosmos.tx.v1beta1.ModeInfo.Single.fromObject(object.single); + } + if (object.multi != null) { + if (typeof object.multi !== "object") + throw TypeError(".cosmos.tx.v1beta1.ModeInfo.multi: object expected"); + message.multi = $root.cosmos.tx.v1beta1.ModeInfo.Multi.fromObject(object.multi); + } + return message; + }; + + /** + * Creates a plain object from a ModeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.ModeInfo + * @static + * @param {cosmos.tx.v1beta1.ModeInfo} message ModeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.single != null && message.hasOwnProperty("single")) { + object.single = $root.cosmos.tx.v1beta1.ModeInfo.Single.toObject(message.single, options); + if (options.oneofs) + object.sum = "single"; + } + if (message.multi != null && message.hasOwnProperty("multi")) { + object.multi = $root.cosmos.tx.v1beta1.ModeInfo.Multi.toObject(message.multi, options); + if (options.oneofs) + object.sum = "multi"; + } + return object; + }; + + /** + * Converts this ModeInfo to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.ModeInfo + * @instance + * @returns {Object.} JSON object + */ + ModeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + ModeInfo.Single = (function(Single) { + + /** + * Properties of a Single. + * @memberof cosmos.tx.v1beta1.ModeInfo + * @interface ISingle + * @property {cosmos.tx.signing.v1beta1.SignMode|null} [mode] Single mode + */ + + /** + * Constructs a new Single. + * @memberof cosmos.tx.v1beta1.ModeInfo + * @classdesc Represents a Single. + * @implements ISingle + * @constructor + * @param {cosmos.tx.v1beta1.ModeInfo.ISingle=} [properties] Properties to set + */ + function Single(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Single mode. + * @member {cosmos.tx.signing.v1beta1.SignMode} mode + * @memberof cosmos.tx.v1beta1.ModeInfo.Single + * @instance + */ + Single.prototype.mode = 0; + + /** + * Creates a new Single instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.ModeInfo.Single + * @static + * @param {cosmos.tx.v1beta1.ModeInfo.ISingle=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.ModeInfo.Single} Single instance + */ + Single.create = function create(properties) { + return new Single(properties); + }; + + /** + * Encodes the specified Single message. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.Single.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.ModeInfo.Single + * @static + * @param {cosmos.tx.v1beta1.ModeInfo.ISingle} message Single message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Single.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); + return writer; + }; + + /** + * Encodes the specified Single message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.Single.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.ModeInfo.Single + * @static + * @param {cosmos.tx.v1beta1.ModeInfo.ISingle} message Single message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Single.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Single message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.ModeInfo.Single + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.ModeInfo.Single} Single + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Single.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.ModeInfo.Single(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mode = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Single message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.ModeInfo.Single + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.ModeInfo.Single} Single + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Single.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Single message. + * @function verify + * @memberof cosmos.tx.v1beta1.ModeInfo.Single + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Single.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + case 127: + break; + } + return null; + }; + + /** + * Creates a Single message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.ModeInfo.Single + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.ModeInfo.Single} Single + */ + Single.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.ModeInfo.Single) + return object; + var message = new $root.cosmos.tx.v1beta1.ModeInfo.Single(); + switch (object.mode) { + case "SIGN_MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "SIGN_MODE_DIRECT": + case 1: + message.mode = 1; + break; + case "SIGN_MODE_TEXTUAL": + case 2: + message.mode = 2; + break; + case "SIGN_MODE_LEGACY_AMINO_JSON": + case 127: + message.mode = 127; + break; + } + return message; + }; + + /** + * Creates a plain object from a Single message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.ModeInfo.Single + * @static + * @param {cosmos.tx.v1beta1.ModeInfo.Single} message Single + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Single.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.mode = options.enums === String ? "SIGN_MODE_UNSPECIFIED" : 0; + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.cosmos.tx.signing.v1beta1.SignMode[message.mode] : message.mode; + return object; + }; + + /** + * Converts this Single to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.ModeInfo.Single + * @instance + * @returns {Object.} JSON object + */ + Single.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Single; + })(ModeInfo.Single || {}); + + ModeInfo.Multi = (function(Multi) { + + /** + * Properties of a Multi. + * @memberof cosmos.tx.v1beta1.ModeInfo + * @interface IMulti + * @property {cosmos.crypto.multisig.v1beta1.ICompactBitArray|null} [bitarray] Multi bitarray + * @property {Array.|null} [modeInfos] Multi modeInfos + */ + + /** + * Constructs a new Multi. + * @memberof cosmos.tx.v1beta1.ModeInfo + * @classdesc Represents a Multi. + * @implements IMulti + * @constructor + * @param {cosmos.tx.v1beta1.ModeInfo.IMulti=} [properties] Properties to set + */ + function Multi(properties) { + this.modeInfos = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Multi bitarray. + * @member {cosmos.crypto.multisig.v1beta1.ICompactBitArray|null|undefined} bitarray + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @instance + */ + Multi.prototype.bitarray = null; + + /** + * Multi modeInfos. + * @member {Array.} modeInfos + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @instance + */ + Multi.prototype.modeInfos = $util.emptyArray; + + /** + * Creates a new Multi instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @static + * @param {cosmos.tx.v1beta1.ModeInfo.IMulti=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.ModeInfo.Multi} Multi instance + */ + Multi.create = function create(properties) { + return new Multi(properties); + }; + + /** + * Encodes the specified Multi message. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.Multi.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @static + * @param {cosmos.tx.v1beta1.ModeInfo.IMulti} message Multi message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Multi.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bitarray != null && Object.hasOwnProperty.call(message, "bitarray")) + $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.encode(message.bitarray, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.modeInfos != null && message.modeInfos.length) + for (var i = 0; i < message.modeInfos.length; ++i) + $root.cosmos.tx.v1beta1.ModeInfo.encode(message.modeInfos[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Multi message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.Multi.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @static + * @param {cosmos.tx.v1beta1.ModeInfo.IMulti} message Multi message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Multi.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Multi message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.ModeInfo.Multi} Multi + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Multi.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.ModeInfo.Multi(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bitarray = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.modeInfos && message.modeInfos.length)) + message.modeInfos = []; + message.modeInfos.push($root.cosmos.tx.v1beta1.ModeInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Multi message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.ModeInfo.Multi} Multi + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Multi.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Multi message. + * @function verify + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Multi.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bitarray != null && message.hasOwnProperty("bitarray")) { + var error = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.verify(message.bitarray); + if (error) + return "bitarray." + error; + } + if (message.modeInfos != null && message.hasOwnProperty("modeInfos")) { + if (!Array.isArray(message.modeInfos)) + return "modeInfos: array expected"; + for (var i = 0; i < message.modeInfos.length; ++i) { + var error = $root.cosmos.tx.v1beta1.ModeInfo.verify(message.modeInfos[i]); + if (error) + return "modeInfos." + error; + } + } + return null; + }; + + /** + * Creates a Multi message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.ModeInfo.Multi} Multi + */ + Multi.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.ModeInfo.Multi) + return object; + var message = new $root.cosmos.tx.v1beta1.ModeInfo.Multi(); + if (object.bitarray != null) { + if (typeof object.bitarray !== "object") + throw TypeError(".cosmos.tx.v1beta1.ModeInfo.Multi.bitarray: object expected"); + message.bitarray = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.fromObject(object.bitarray); + } + if (object.modeInfos) { + if (!Array.isArray(object.modeInfos)) + throw TypeError(".cosmos.tx.v1beta1.ModeInfo.Multi.modeInfos: array expected"); + message.modeInfos = []; + for (var i = 0; i < object.modeInfos.length; ++i) { + if (typeof object.modeInfos[i] !== "object") + throw TypeError(".cosmos.tx.v1beta1.ModeInfo.Multi.modeInfos: object expected"); + message.modeInfos[i] = $root.cosmos.tx.v1beta1.ModeInfo.fromObject(object.modeInfos[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Multi message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @static + * @param {cosmos.tx.v1beta1.ModeInfo.Multi} message Multi + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Multi.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.modeInfos = []; + if (options.defaults) + object.bitarray = null; + if (message.bitarray != null && message.hasOwnProperty("bitarray")) + object.bitarray = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.toObject(message.bitarray, options); + if (message.modeInfos && message.modeInfos.length) { + object.modeInfos = []; + for (var j = 0; j < message.modeInfos.length; ++j) + object.modeInfos[j] = $root.cosmos.tx.v1beta1.ModeInfo.toObject(message.modeInfos[j], options); + } + return object; + }; + + /** + * Converts this Multi to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @instance + * @returns {Object.} JSON object + */ + Multi.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Multi; + })(ModeInfo.Multi || {}); + + return ModeInfo; + })(v1beta1.ModeInfo || {}); + + v1beta1.Fee = (function(Fee) { + + /** + * Properties of a Fee. + * @memberof cosmos.tx.v1beta1 + * @interface IFee + * @property {Array.|null} [amount] Fee amount + * @property {number|Long|null} [gasLimit] Fee gasLimit + * @property {string|null} [payer] Fee payer + * @property {string|null} [granter] Fee granter + */ + + /** + * Constructs a new Fee. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents a Fee. + * @implements IFee + * @constructor + * @param {cosmos.tx.v1beta1.IFee=} [properties] Properties to set + */ + function Fee(properties) { + this.amount = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Fee amount. + * @member {Array.} amount + * @memberof cosmos.tx.v1beta1.Fee + * @instance + */ + Fee.prototype.amount = $util.emptyArray; + + /** + * Fee gasLimit. + * @member {number|Long} gasLimit + * @memberof cosmos.tx.v1beta1.Fee + * @instance + */ + Fee.prototype.gasLimit = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Fee payer. + * @member {string} payer + * @memberof cosmos.tx.v1beta1.Fee + * @instance + */ + Fee.prototype.payer = ""; + + /** + * Fee granter. + * @member {string} granter + * @memberof cosmos.tx.v1beta1.Fee + * @instance + */ + Fee.prototype.granter = ""; + + /** + * Creates a new Fee instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.Fee + * @static + * @param {cosmos.tx.v1beta1.IFee=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.Fee} Fee instance + */ + Fee.create = function create(properties) { + return new Fee(properties); + }; + + /** + * Encodes the specified Fee message. Does not implicitly {@link cosmos.tx.v1beta1.Fee.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.Fee + * @static + * @param {cosmos.tx.v1beta1.IFee} message Fee message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fee.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.amount != null && message.amount.length) + for (var i = 0; i < message.amount.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.amount[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.gasLimit != null && Object.hasOwnProperty.call(message, "gasLimit")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.gasLimit); + if (message.payer != null && Object.hasOwnProperty.call(message, "payer")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.payer); + if (message.granter != null && Object.hasOwnProperty.call(message, "granter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.granter); + return writer; + }; + + /** + * Encodes the specified Fee message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.Fee.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.Fee + * @static + * @param {cosmos.tx.v1beta1.IFee} message Fee message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fee.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Fee message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.Fee + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.Fee} Fee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fee.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.Fee(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.amount && message.amount.length)) + message.amount = []; + message.amount.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + case 2: + message.gasLimit = reader.uint64(); + break; + case 3: + message.payer = reader.string(); + break; + case 4: + message.granter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Fee message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.Fee + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.Fee} Fee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fee.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Fee message. + * @function verify + * @memberof cosmos.tx.v1beta1.Fee + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Fee.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + if (!Array.isArray(message.amount)) + return "amount: array expected"; + for (var i = 0; i < message.amount.length; ++i) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.amount[i]); + if (error) + return "amount." + error; + } + } + if (message.gasLimit != null && message.hasOwnProperty("gasLimit")) + if (!$util.isInteger(message.gasLimit) && !(message.gasLimit && $util.isInteger(message.gasLimit.low) && $util.isInteger(message.gasLimit.high))) + return "gasLimit: integer|Long expected"; + if (message.payer != null && message.hasOwnProperty("payer")) + if (!$util.isString(message.payer)) + return "payer: string expected"; + if (message.granter != null && message.hasOwnProperty("granter")) + if (!$util.isString(message.granter)) + return "granter: string expected"; + return null; + }; + + /** + * Creates a Fee message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.Fee + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.Fee} Fee + */ + Fee.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.Fee) + return object; + var message = new $root.cosmos.tx.v1beta1.Fee(); + if (object.amount) { + if (!Array.isArray(object.amount)) + throw TypeError(".cosmos.tx.v1beta1.Fee.amount: array expected"); + message.amount = []; + for (var i = 0; i < object.amount.length; ++i) { + if (typeof object.amount[i] !== "object") + throw TypeError(".cosmos.tx.v1beta1.Fee.amount: object expected"); + message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]); + } + } + if (object.gasLimit != null) + if ($util.Long) + (message.gasLimit = $util.Long.fromValue(object.gasLimit)).unsigned = true; + else if (typeof object.gasLimit === "string") + message.gasLimit = parseInt(object.gasLimit, 10); + else if (typeof object.gasLimit === "number") + message.gasLimit = object.gasLimit; + else if (typeof object.gasLimit === "object") + message.gasLimit = new $util.LongBits(object.gasLimit.low >>> 0, object.gasLimit.high >>> 0).toNumber(true); + if (object.payer != null) + message.payer = String(object.payer); + if (object.granter != null) + message.granter = String(object.granter); + return message; + }; + + /** + * Creates a plain object from a Fee message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.Fee + * @static + * @param {cosmos.tx.v1beta1.Fee} message Fee + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Fee.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.amount = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.gasLimit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.gasLimit = options.longs === String ? "0" : 0; + object.payer = ""; + object.granter = ""; + } + if (message.amount && message.amount.length) { + object.amount = []; + for (var j = 0; j < message.amount.length; ++j) + object.amount[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.amount[j], options); + } + if (message.gasLimit != null && message.hasOwnProperty("gasLimit")) + if (typeof message.gasLimit === "number") + object.gasLimit = options.longs === String ? String(message.gasLimit) : message.gasLimit; + else + object.gasLimit = options.longs === String ? $util.Long.prototype.toString.call(message.gasLimit) : options.longs === Number ? new $util.LongBits(message.gasLimit.low >>> 0, message.gasLimit.high >>> 0).toNumber(true) : message.gasLimit; + if (message.payer != null && message.hasOwnProperty("payer")) + object.payer = message.payer; + if (message.granter != null && message.hasOwnProperty("granter")) + object.granter = message.granter; + return object; + }; + + /** + * Converts this Fee to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.Fee + * @instance + * @returns {Object.} JSON object + */ + Fee.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Fee; + })(v1beta1.Fee || {}); + + return v1beta1; + })(tx.v1beta1 || {}); + + return tx; + })(cosmos.tx || {}); + + /** + * Namespace crisis. + * @memberof cosmos + * @namespace + */ + + cosmos.crisis = (function(crisis) { + + /** + * Namespace v1beta1. + * @memberof cosmos.crisis + * @namespace + */ + + crisis.v1beta1 = (function(v1beta1) { + + v1beta1.Msg = (function(Msg) { + + /** + * Constructs a new Msg service. + * @memberof cosmos.crisis.v1beta1 + * @classdesc Represents a Msg + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Msg(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; + + /** + * Creates new Msg service using the specified rpc implementation. + * @function create + * @memberof cosmos.crisis.v1beta1.Msg + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Msg} RPC service. Useful where requests and/or responses are streamed. + */ + Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.crisis.v1beta1.Msg#verifyInvariant}. + * @memberof cosmos.crisis.v1beta1.Msg + * @typedef VerifyInvariantCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariantResponse} [response] MsgVerifyInvariantResponse + */ + + /** + * Calls VerifyInvariant. + * @function verifyInvariant + * @memberof cosmos.crisis.v1beta1.Msg + * @instance + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariant} request MsgVerifyInvariant message or plain object + * @param {cosmos.crisis.v1beta1.Msg.VerifyInvariantCallback} callback Node-style callback called with the error, if any, and MsgVerifyInvariantResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.verifyInvariant = function verifyInvariant(request, callback) { + return this.rpcCall(verifyInvariant, $root.cosmos.crisis.v1beta1.MsgVerifyInvariant, $root.cosmos.crisis.v1beta1.MsgVerifyInvariantResponse, request, callback); + }, "name", { value: "VerifyInvariant" }); + + /** + * Calls VerifyInvariant. + * @function verifyInvariant + * @memberof cosmos.crisis.v1beta1.Msg + * @instance + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariant} request MsgVerifyInvariant message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Msg; + })(v1beta1.Msg || {}); + + v1beta1.MsgVerifyInvariant = (function(MsgVerifyInvariant) { + + /** + * Properties of a MsgVerifyInvariant. + * @memberof cosmos.crisis.v1beta1 + * @interface IMsgVerifyInvariant + * @property {string|null} [sender] MsgVerifyInvariant sender + * @property {string|null} [invariantModuleName] MsgVerifyInvariant invariantModuleName + * @property {string|null} [invariantRoute] MsgVerifyInvariant invariantRoute + */ + + /** + * Constructs a new MsgVerifyInvariant. + * @memberof cosmos.crisis.v1beta1 + * @classdesc Represents a MsgVerifyInvariant. + * @implements IMsgVerifyInvariant + * @constructor + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariant=} [properties] Properties to set + */ + function MsgVerifyInvariant(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgVerifyInvariant sender. + * @member {string} sender + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @instance + */ + MsgVerifyInvariant.prototype.sender = ""; + + /** + * MsgVerifyInvariant invariantModuleName. + * @member {string} invariantModuleName + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @instance + */ + MsgVerifyInvariant.prototype.invariantModuleName = ""; + + /** + * MsgVerifyInvariant invariantRoute. + * @member {string} invariantRoute + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @instance + */ + MsgVerifyInvariant.prototype.invariantRoute = ""; + + /** + * Creates a new MsgVerifyInvariant instance using the specified properties. + * @function create + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @static + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariant=} [properties] Properties to set + * @returns {cosmos.crisis.v1beta1.MsgVerifyInvariant} MsgVerifyInvariant instance + */ + MsgVerifyInvariant.create = function create(properties) { + return new MsgVerifyInvariant(properties); + }; + + /** + * Encodes the specified MsgVerifyInvariant message. Does not implicitly {@link cosmos.crisis.v1beta1.MsgVerifyInvariant.verify|verify} messages. + * @function encode + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @static + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariant} message MsgVerifyInvariant message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgVerifyInvariant.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sender != null && Object.hasOwnProperty.call(message, "sender")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sender); + if (message.invariantModuleName != null && Object.hasOwnProperty.call(message, "invariantModuleName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.invariantModuleName); + if (message.invariantRoute != null && Object.hasOwnProperty.call(message, "invariantRoute")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.invariantRoute); + return writer; + }; + + /** + * Encodes the specified MsgVerifyInvariant message, length delimited. Does not implicitly {@link cosmos.crisis.v1beta1.MsgVerifyInvariant.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @static + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariant} message MsgVerifyInvariant message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgVerifyInvariant.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgVerifyInvariant message from the specified reader or buffer. + * @function decode + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.crisis.v1beta1.MsgVerifyInvariant} MsgVerifyInvariant + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgVerifyInvariant.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.crisis.v1beta1.MsgVerifyInvariant(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.invariantModuleName = reader.string(); + break; + case 3: + message.invariantRoute = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgVerifyInvariant message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.crisis.v1beta1.MsgVerifyInvariant} MsgVerifyInvariant + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgVerifyInvariant.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgVerifyInvariant message. + * @function verify + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgVerifyInvariant.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sender != null && message.hasOwnProperty("sender")) + if (!$util.isString(message.sender)) + return "sender: string expected"; + if (message.invariantModuleName != null && message.hasOwnProperty("invariantModuleName")) + if (!$util.isString(message.invariantModuleName)) + return "invariantModuleName: string expected"; + if (message.invariantRoute != null && message.hasOwnProperty("invariantRoute")) + if (!$util.isString(message.invariantRoute)) + return "invariantRoute: string expected"; + return null; + }; + + /** + * Creates a MsgVerifyInvariant message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @static + * @param {Object.} object Plain object + * @returns {cosmos.crisis.v1beta1.MsgVerifyInvariant} MsgVerifyInvariant + */ + MsgVerifyInvariant.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.crisis.v1beta1.MsgVerifyInvariant) + return object; + var message = new $root.cosmos.crisis.v1beta1.MsgVerifyInvariant(); + if (object.sender != null) + message.sender = String(object.sender); + if (object.invariantModuleName != null) + message.invariantModuleName = String(object.invariantModuleName); + if (object.invariantRoute != null) + message.invariantRoute = String(object.invariantRoute); + return message; + }; + + /** + * Creates a plain object from a MsgVerifyInvariant message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @static + * @param {cosmos.crisis.v1beta1.MsgVerifyInvariant} message MsgVerifyInvariant + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgVerifyInvariant.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sender = ""; + object.invariantModuleName = ""; + object.invariantRoute = ""; + } + if (message.sender != null && message.hasOwnProperty("sender")) + object.sender = message.sender; + if (message.invariantModuleName != null && message.hasOwnProperty("invariantModuleName")) + object.invariantModuleName = message.invariantModuleName; + if (message.invariantRoute != null && message.hasOwnProperty("invariantRoute")) + object.invariantRoute = message.invariantRoute; + return object; + }; + + /** + * Converts this MsgVerifyInvariant to JSON. + * @function toJSON + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @instance + * @returns {Object.} JSON object + */ + MsgVerifyInvariant.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgVerifyInvariant; + })(v1beta1.MsgVerifyInvariant || {}); + + v1beta1.MsgVerifyInvariantResponse = (function(MsgVerifyInvariantResponse) { + + /** + * Properties of a MsgVerifyInvariantResponse. + * @memberof cosmos.crisis.v1beta1 + * @interface IMsgVerifyInvariantResponse + */ + + /** + * Constructs a new MsgVerifyInvariantResponse. + * @memberof cosmos.crisis.v1beta1 + * @classdesc Represents a MsgVerifyInvariantResponse. + * @implements IMsgVerifyInvariantResponse + * @constructor + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariantResponse=} [properties] Properties to set + */ + function MsgVerifyInvariantResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgVerifyInvariantResponse instance using the specified properties. + * @function create + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse + * @static + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariantResponse=} [properties] Properties to set + * @returns {cosmos.crisis.v1beta1.MsgVerifyInvariantResponse} MsgVerifyInvariantResponse instance + */ + MsgVerifyInvariantResponse.create = function create(properties) { + return new MsgVerifyInvariantResponse(properties); + }; + + /** + * Encodes the specified MsgVerifyInvariantResponse message. Does not implicitly {@link cosmos.crisis.v1beta1.MsgVerifyInvariantResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse + * @static + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariantResponse} message MsgVerifyInvariantResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgVerifyInvariantResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgVerifyInvariantResponse message, length delimited. Does not implicitly {@link cosmos.crisis.v1beta1.MsgVerifyInvariantResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse + * @static + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariantResponse} message MsgVerifyInvariantResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgVerifyInvariantResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgVerifyInvariantResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.crisis.v1beta1.MsgVerifyInvariantResponse} MsgVerifyInvariantResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgVerifyInvariantResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.crisis.v1beta1.MsgVerifyInvariantResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgVerifyInvariantResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.crisis.v1beta1.MsgVerifyInvariantResponse} MsgVerifyInvariantResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgVerifyInvariantResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgVerifyInvariantResponse message. + * @function verify + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgVerifyInvariantResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgVerifyInvariantResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.crisis.v1beta1.MsgVerifyInvariantResponse} MsgVerifyInvariantResponse + */ + MsgVerifyInvariantResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.crisis.v1beta1.MsgVerifyInvariantResponse) + return object; + return new $root.cosmos.crisis.v1beta1.MsgVerifyInvariantResponse(); + }; + + /** + * Creates a plain object from a MsgVerifyInvariantResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse + * @static + * @param {cosmos.crisis.v1beta1.MsgVerifyInvariantResponse} message MsgVerifyInvariantResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgVerifyInvariantResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgVerifyInvariantResponse to JSON. + * @function toJSON + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse + * @instance + * @returns {Object.} JSON object + */ + MsgVerifyInvariantResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgVerifyInvariantResponse; + })(v1beta1.MsgVerifyInvariantResponse || {}); + + return v1beta1; + })(crisis.v1beta1 || {}); + + return crisis; + })(cosmos.crisis || {}); + + /** + * Namespace distribution. + * @memberof cosmos + * @namespace + */ + + cosmos.distribution = (function(distribution) { + + /** + * Namespace v1beta1. + * @memberof cosmos.distribution + * @namespace + */ + + distribution.v1beta1 = (function(v1beta1) { + + v1beta1.Msg = (function(Msg) { + + /** + * Constructs a new Msg service. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a Msg + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Msg(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; + + /** + * Creates new Msg service using the specified rpc implementation. + * @function create + * @memberof cosmos.distribution.v1beta1.Msg + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Msg} RPC service. Useful where requests and/or responses are streamed. + */ + Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.distribution.v1beta1.Msg#setWithdrawAddress}. + * @memberof cosmos.distribution.v1beta1.Msg + * @typedef SetWithdrawAddressCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddressResponse} [response] MsgSetWithdrawAddressResponse + */ + + /** + * Calls SetWithdrawAddress. + * @function setWithdrawAddress + * @memberof cosmos.distribution.v1beta1.Msg + * @instance + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddress} request MsgSetWithdrawAddress message or plain object + * @param {cosmos.distribution.v1beta1.Msg.SetWithdrawAddressCallback} callback Node-style callback called with the error, if any, and MsgSetWithdrawAddressResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.setWithdrawAddress = function setWithdrawAddress(request, callback) { + return this.rpcCall(setWithdrawAddress, $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddress, $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse, request, callback); + }, "name", { value: "SetWithdrawAddress" }); + + /** + * Calls SetWithdrawAddress. + * @function setWithdrawAddress + * @memberof cosmos.distribution.v1beta1.Msg + * @instance + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddress} request MsgSetWithdrawAddress message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.distribution.v1beta1.Msg#withdrawDelegatorReward}. + * @memberof cosmos.distribution.v1beta1.Msg + * @typedef WithdrawDelegatorRewardCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorRewardResponse} [response] MsgWithdrawDelegatorRewardResponse + */ + + /** + * Calls WithdrawDelegatorReward. + * @function withdrawDelegatorReward + * @memberof cosmos.distribution.v1beta1.Msg + * @instance + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorReward} request MsgWithdrawDelegatorReward message or plain object + * @param {cosmos.distribution.v1beta1.Msg.WithdrawDelegatorRewardCallback} callback Node-style callback called with the error, if any, and MsgWithdrawDelegatorRewardResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.withdrawDelegatorReward = function withdrawDelegatorReward(request, callback) { + return this.rpcCall(withdrawDelegatorReward, $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward, $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse, request, callback); + }, "name", { value: "WithdrawDelegatorReward" }); + + /** + * Calls WithdrawDelegatorReward. + * @function withdrawDelegatorReward + * @memberof cosmos.distribution.v1beta1.Msg + * @instance + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorReward} request MsgWithdrawDelegatorReward message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.distribution.v1beta1.Msg#withdrawValidatorCommission}. + * @memberof cosmos.distribution.v1beta1.Msg + * @typedef WithdrawValidatorCommissionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommissionResponse} [response] MsgWithdrawValidatorCommissionResponse + */ + + /** + * Calls WithdrawValidatorCommission. + * @function withdrawValidatorCommission + * @memberof cosmos.distribution.v1beta1.Msg + * @instance + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommission} request MsgWithdrawValidatorCommission message or plain object + * @param {cosmos.distribution.v1beta1.Msg.WithdrawValidatorCommissionCallback} callback Node-style callback called with the error, if any, and MsgWithdrawValidatorCommissionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.withdrawValidatorCommission = function withdrawValidatorCommission(request, callback) { + return this.rpcCall(withdrawValidatorCommission, $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission, $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse, request, callback); + }, "name", { value: "WithdrawValidatorCommission" }); + + /** + * Calls WithdrawValidatorCommission. + * @function withdrawValidatorCommission + * @memberof cosmos.distribution.v1beta1.Msg + * @instance + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommission} request MsgWithdrawValidatorCommission message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.distribution.v1beta1.Msg#fundCommunityPool}. + * @memberof cosmos.distribution.v1beta1.Msg + * @typedef FundCommunityPoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPoolResponse} [response] MsgFundCommunityPoolResponse + */ + + /** + * Calls FundCommunityPool. + * @function fundCommunityPool + * @memberof cosmos.distribution.v1beta1.Msg + * @instance + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPool} request MsgFundCommunityPool message or plain object + * @param {cosmos.distribution.v1beta1.Msg.FundCommunityPoolCallback} callback Node-style callback called with the error, if any, and MsgFundCommunityPoolResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.fundCommunityPool = function fundCommunityPool(request, callback) { + return this.rpcCall(fundCommunityPool, $root.cosmos.distribution.v1beta1.MsgFundCommunityPool, $root.cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse, request, callback); + }, "name", { value: "FundCommunityPool" }); + + /** + * Calls FundCommunityPool. + * @function fundCommunityPool + * @memberof cosmos.distribution.v1beta1.Msg + * @instance + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPool} request MsgFundCommunityPool message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Msg; + })(v1beta1.Msg || {}); + + v1beta1.MsgSetWithdrawAddress = (function(MsgSetWithdrawAddress) { + + /** + * Properties of a MsgSetWithdrawAddress. + * @memberof cosmos.distribution.v1beta1 + * @interface IMsgSetWithdrawAddress + * @property {string|null} [delegatorAddress] MsgSetWithdrawAddress delegatorAddress + * @property {string|null} [withdrawAddress] MsgSetWithdrawAddress withdrawAddress + */ + + /** + * Constructs a new MsgSetWithdrawAddress. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a MsgSetWithdrawAddress. + * @implements IMsgSetWithdrawAddress + * @constructor + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddress=} [properties] Properties to set + */ + function MsgSetWithdrawAddress(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgSetWithdrawAddress delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @instance + */ + MsgSetWithdrawAddress.prototype.delegatorAddress = ""; + + /** + * MsgSetWithdrawAddress withdrawAddress. + * @member {string} withdrawAddress + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @instance + */ + MsgSetWithdrawAddress.prototype.withdrawAddress = ""; + + /** + * Creates a new MsgSetWithdrawAddress instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @static + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddress=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.MsgSetWithdrawAddress} MsgSetWithdrawAddress instance + */ + MsgSetWithdrawAddress.create = function create(properties) { + return new MsgSetWithdrawAddress(properties); + }; + + /** + * Encodes the specified MsgSetWithdrawAddress message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgSetWithdrawAddress.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @static + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddress} message MsgSetWithdrawAddress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSetWithdrawAddress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.withdrawAddress != null && Object.hasOwnProperty.call(message, "withdrawAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.withdrawAddress); + return writer; + }; + + /** + * Encodes the specified MsgSetWithdrawAddress message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.MsgSetWithdrawAddress.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @static + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddress} message MsgSetWithdrawAddress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSetWithdrawAddress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgSetWithdrawAddress message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.MsgSetWithdrawAddress} MsgSetWithdrawAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSetWithdrawAddress.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddress(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.withdrawAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgSetWithdrawAddress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.MsgSetWithdrawAddress} MsgSetWithdrawAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSetWithdrawAddress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgSetWithdrawAddress message. + * @function verify + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgSetWithdrawAddress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.withdrawAddress != null && message.hasOwnProperty("withdrawAddress")) + if (!$util.isString(message.withdrawAddress)) + return "withdrawAddress: string expected"; + return null; + }; + + /** + * Creates a MsgSetWithdrawAddress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.MsgSetWithdrawAddress} MsgSetWithdrawAddress + */ + MsgSetWithdrawAddress.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddress) + return object; + var message = new $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddress(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.withdrawAddress != null) + message.withdrawAddress = String(object.withdrawAddress); + return message; + }; + + /** + * Creates a plain object from a MsgSetWithdrawAddress message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @static + * @param {cosmos.distribution.v1beta1.MsgSetWithdrawAddress} message MsgSetWithdrawAddress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSetWithdrawAddress.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.delegatorAddress = ""; + object.withdrawAddress = ""; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.withdrawAddress != null && message.hasOwnProperty("withdrawAddress")) + object.withdrawAddress = message.withdrawAddress; + return object; + }; + + /** + * Converts this MsgSetWithdrawAddress to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @instance + * @returns {Object.} JSON object + */ + MsgSetWithdrawAddress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgSetWithdrawAddress; + })(v1beta1.MsgSetWithdrawAddress || {}); + + v1beta1.MsgSetWithdrawAddressResponse = (function(MsgSetWithdrawAddressResponse) { + + /** + * Properties of a MsgSetWithdrawAddressResponse. + * @memberof cosmos.distribution.v1beta1 + * @interface IMsgSetWithdrawAddressResponse + */ + + /** + * Constructs a new MsgSetWithdrawAddressResponse. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a MsgSetWithdrawAddressResponse. + * @implements IMsgSetWithdrawAddressResponse + * @constructor + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddressResponse=} [properties] Properties to set + */ + function MsgSetWithdrawAddressResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgSetWithdrawAddressResponse instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddressResponse=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse} MsgSetWithdrawAddressResponse instance + */ + MsgSetWithdrawAddressResponse.create = function create(properties) { + return new MsgSetWithdrawAddressResponse(properties); + }; + + /** + * Encodes the specified MsgSetWithdrawAddressResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddressResponse} message MsgSetWithdrawAddressResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSetWithdrawAddressResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgSetWithdrawAddressResponse message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddressResponse} message MsgSetWithdrawAddressResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSetWithdrawAddressResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgSetWithdrawAddressResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse} MsgSetWithdrawAddressResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSetWithdrawAddressResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgSetWithdrawAddressResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse} MsgSetWithdrawAddressResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSetWithdrawAddressResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgSetWithdrawAddressResponse message. + * @function verify + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgSetWithdrawAddressResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgSetWithdrawAddressResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse} MsgSetWithdrawAddressResponse + */ + MsgSetWithdrawAddressResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse) + return object; + return new $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse(); + }; + + /** + * Creates a plain object from a MsgSetWithdrawAddressResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse + * @static + * @param {cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse} message MsgSetWithdrawAddressResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSetWithdrawAddressResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgSetWithdrawAddressResponse to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse + * @instance + * @returns {Object.} JSON object + */ + MsgSetWithdrawAddressResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgSetWithdrawAddressResponse; + })(v1beta1.MsgSetWithdrawAddressResponse || {}); + + v1beta1.MsgWithdrawDelegatorReward = (function(MsgWithdrawDelegatorReward) { + + /** + * Properties of a MsgWithdrawDelegatorReward. + * @memberof cosmos.distribution.v1beta1 + * @interface IMsgWithdrawDelegatorReward + * @property {string|null} [delegatorAddress] MsgWithdrawDelegatorReward delegatorAddress + * @property {string|null} [validatorAddress] MsgWithdrawDelegatorReward validatorAddress + */ + + /** + * Constructs a new MsgWithdrawDelegatorReward. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a MsgWithdrawDelegatorReward. + * @implements IMsgWithdrawDelegatorReward + * @constructor + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorReward=} [properties] Properties to set + */ + function MsgWithdrawDelegatorReward(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgWithdrawDelegatorReward delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @instance + */ + MsgWithdrawDelegatorReward.prototype.delegatorAddress = ""; + + /** + * MsgWithdrawDelegatorReward validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @instance + */ + MsgWithdrawDelegatorReward.prototype.validatorAddress = ""; + + /** + * Creates a new MsgWithdrawDelegatorReward instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorReward=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward} MsgWithdrawDelegatorReward instance + */ + MsgWithdrawDelegatorReward.create = function create(properties) { + return new MsgWithdrawDelegatorReward(properties); + }; + + /** + * Encodes the specified MsgWithdrawDelegatorReward message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorReward} message MsgWithdrawDelegatorReward message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgWithdrawDelegatorReward.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddress); + return writer; + }; + + /** + * Encodes the specified MsgWithdrawDelegatorReward message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorReward} message MsgWithdrawDelegatorReward message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgWithdrawDelegatorReward.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgWithdrawDelegatorReward message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward} MsgWithdrawDelegatorReward + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgWithdrawDelegatorReward.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgWithdrawDelegatorReward message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward} MsgWithdrawDelegatorReward + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgWithdrawDelegatorReward.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgWithdrawDelegatorReward message. + * @function verify + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgWithdrawDelegatorReward.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + return null; + }; + + /** + * Creates a MsgWithdrawDelegatorReward message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward} MsgWithdrawDelegatorReward + */ + MsgWithdrawDelegatorReward.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward) + return object; + var message = new $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + return message; + }; + + /** + * Creates a plain object from a MsgWithdrawDelegatorReward message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @static + * @param {cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward} message MsgWithdrawDelegatorReward + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgWithdrawDelegatorReward.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.delegatorAddress = ""; + object.validatorAddress = ""; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + return object; + }; + + /** + * Converts this MsgWithdrawDelegatorReward to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @instance + * @returns {Object.} JSON object + */ + MsgWithdrawDelegatorReward.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgWithdrawDelegatorReward; + })(v1beta1.MsgWithdrawDelegatorReward || {}); + + v1beta1.MsgWithdrawDelegatorRewardResponse = (function(MsgWithdrawDelegatorRewardResponse) { + + /** + * Properties of a MsgWithdrawDelegatorRewardResponse. + * @memberof cosmos.distribution.v1beta1 + * @interface IMsgWithdrawDelegatorRewardResponse + */ + + /** + * Constructs a new MsgWithdrawDelegatorRewardResponse. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a MsgWithdrawDelegatorRewardResponse. + * @implements IMsgWithdrawDelegatorRewardResponse + * @constructor + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorRewardResponse=} [properties] Properties to set + */ + function MsgWithdrawDelegatorRewardResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgWithdrawDelegatorRewardResponse instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorRewardResponse=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse} MsgWithdrawDelegatorRewardResponse instance + */ + MsgWithdrawDelegatorRewardResponse.create = function create(properties) { + return new MsgWithdrawDelegatorRewardResponse(properties); + }; + + /** + * Encodes the specified MsgWithdrawDelegatorRewardResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorRewardResponse} message MsgWithdrawDelegatorRewardResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgWithdrawDelegatorRewardResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgWithdrawDelegatorRewardResponse message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorRewardResponse} message MsgWithdrawDelegatorRewardResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgWithdrawDelegatorRewardResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgWithdrawDelegatorRewardResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse} MsgWithdrawDelegatorRewardResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgWithdrawDelegatorRewardResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgWithdrawDelegatorRewardResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse} MsgWithdrawDelegatorRewardResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgWithdrawDelegatorRewardResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgWithdrawDelegatorRewardResponse message. + * @function verify + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgWithdrawDelegatorRewardResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgWithdrawDelegatorRewardResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse} MsgWithdrawDelegatorRewardResponse + */ + MsgWithdrawDelegatorRewardResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse) + return object; + return new $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse(); + }; + + /** + * Creates a plain object from a MsgWithdrawDelegatorRewardResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse + * @static + * @param {cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse} message MsgWithdrawDelegatorRewardResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgWithdrawDelegatorRewardResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgWithdrawDelegatorRewardResponse to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse + * @instance + * @returns {Object.} JSON object + */ + MsgWithdrawDelegatorRewardResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgWithdrawDelegatorRewardResponse; + })(v1beta1.MsgWithdrawDelegatorRewardResponse || {}); + + v1beta1.MsgWithdrawValidatorCommission = (function(MsgWithdrawValidatorCommission) { + + /** + * Properties of a MsgWithdrawValidatorCommission. + * @memberof cosmos.distribution.v1beta1 + * @interface IMsgWithdrawValidatorCommission + * @property {string|null} [validatorAddress] MsgWithdrawValidatorCommission validatorAddress + */ + + /** + * Constructs a new MsgWithdrawValidatorCommission. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a MsgWithdrawValidatorCommission. + * @implements IMsgWithdrawValidatorCommission + * @constructor + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommission=} [properties] Properties to set + */ + function MsgWithdrawValidatorCommission(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgWithdrawValidatorCommission validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission + * @instance + */ + MsgWithdrawValidatorCommission.prototype.validatorAddress = ""; + + /** + * Creates a new MsgWithdrawValidatorCommission instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommission=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission} MsgWithdrawValidatorCommission instance + */ + MsgWithdrawValidatorCommission.create = function create(properties) { + return new MsgWithdrawValidatorCommission(properties); + }; + + /** + * Encodes the specified MsgWithdrawValidatorCommission message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommission} message MsgWithdrawValidatorCommission message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgWithdrawValidatorCommission.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.validatorAddress); + return writer; + }; + + /** + * Encodes the specified MsgWithdrawValidatorCommission message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommission} message MsgWithdrawValidatorCommission message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgWithdrawValidatorCommission.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgWithdrawValidatorCommission message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission} MsgWithdrawValidatorCommission + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgWithdrawValidatorCommission.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgWithdrawValidatorCommission message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission} MsgWithdrawValidatorCommission + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgWithdrawValidatorCommission.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgWithdrawValidatorCommission message. + * @function verify + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgWithdrawValidatorCommission.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + return null; + }; + + /** + * Creates a MsgWithdrawValidatorCommission message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission} MsgWithdrawValidatorCommission + */ + MsgWithdrawValidatorCommission.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission) + return object; + var message = new $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission(); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + return message; + }; + + /** + * Creates a plain object from a MsgWithdrawValidatorCommission message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission + * @static + * @param {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission} message MsgWithdrawValidatorCommission + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgWithdrawValidatorCommission.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.validatorAddress = ""; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + return object; + }; + + /** + * Converts this MsgWithdrawValidatorCommission to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission + * @instance + * @returns {Object.} JSON object + */ + MsgWithdrawValidatorCommission.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgWithdrawValidatorCommission; + })(v1beta1.MsgWithdrawValidatorCommission || {}); + + v1beta1.MsgWithdrawValidatorCommissionResponse = (function(MsgWithdrawValidatorCommissionResponse) { + + /** + * Properties of a MsgWithdrawValidatorCommissionResponse. + * @memberof cosmos.distribution.v1beta1 + * @interface IMsgWithdrawValidatorCommissionResponse + */ + + /** + * Constructs a new MsgWithdrawValidatorCommissionResponse. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a MsgWithdrawValidatorCommissionResponse. + * @implements IMsgWithdrawValidatorCommissionResponse + * @constructor + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommissionResponse=} [properties] Properties to set + */ + function MsgWithdrawValidatorCommissionResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgWithdrawValidatorCommissionResponse instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommissionResponse=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse} MsgWithdrawValidatorCommissionResponse instance + */ + MsgWithdrawValidatorCommissionResponse.create = function create(properties) { + return new MsgWithdrawValidatorCommissionResponse(properties); + }; + + /** + * Encodes the specified MsgWithdrawValidatorCommissionResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommissionResponse} message MsgWithdrawValidatorCommissionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgWithdrawValidatorCommissionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgWithdrawValidatorCommissionResponse message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommissionResponse} message MsgWithdrawValidatorCommissionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgWithdrawValidatorCommissionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgWithdrawValidatorCommissionResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse} MsgWithdrawValidatorCommissionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgWithdrawValidatorCommissionResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgWithdrawValidatorCommissionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse} MsgWithdrawValidatorCommissionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgWithdrawValidatorCommissionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgWithdrawValidatorCommissionResponse message. + * @function verify + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgWithdrawValidatorCommissionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgWithdrawValidatorCommissionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse} MsgWithdrawValidatorCommissionResponse + */ + MsgWithdrawValidatorCommissionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse) + return object; + return new $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse(); + }; + + /** + * Creates a plain object from a MsgWithdrawValidatorCommissionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse + * @static + * @param {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse} message MsgWithdrawValidatorCommissionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgWithdrawValidatorCommissionResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgWithdrawValidatorCommissionResponse to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse + * @instance + * @returns {Object.} JSON object + */ + MsgWithdrawValidatorCommissionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgWithdrawValidatorCommissionResponse; + })(v1beta1.MsgWithdrawValidatorCommissionResponse || {}); + + v1beta1.MsgFundCommunityPool = (function(MsgFundCommunityPool) { + + /** + * Properties of a MsgFundCommunityPool. + * @memberof cosmos.distribution.v1beta1 + * @interface IMsgFundCommunityPool + * @property {Array.|null} [amount] MsgFundCommunityPool amount + * @property {string|null} [depositor] MsgFundCommunityPool depositor + */ + + /** + * Constructs a new MsgFundCommunityPool. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a MsgFundCommunityPool. + * @implements IMsgFundCommunityPool + * @constructor + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPool=} [properties] Properties to set + */ + function MsgFundCommunityPool(properties) { + this.amount = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgFundCommunityPool amount. + * @member {Array.} amount + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @instance + */ + MsgFundCommunityPool.prototype.amount = $util.emptyArray; + + /** + * MsgFundCommunityPool depositor. + * @member {string} depositor + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @instance + */ + MsgFundCommunityPool.prototype.depositor = ""; + + /** + * Creates a new MsgFundCommunityPool instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @static + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPool=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.MsgFundCommunityPool} MsgFundCommunityPool instance + */ + MsgFundCommunityPool.create = function create(properties) { + return new MsgFundCommunityPool(properties); + }; + + /** + * Encodes the specified MsgFundCommunityPool message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgFundCommunityPool.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @static + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPool} message MsgFundCommunityPool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgFundCommunityPool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.amount != null && message.amount.length) + for (var i = 0; i < message.amount.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.amount[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.depositor != null && Object.hasOwnProperty.call(message, "depositor")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.depositor); + return writer; + }; + + /** + * Encodes the specified MsgFundCommunityPool message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.MsgFundCommunityPool.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @static + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPool} message MsgFundCommunityPool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgFundCommunityPool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgFundCommunityPool message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.MsgFundCommunityPool} MsgFundCommunityPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgFundCommunityPool.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.MsgFundCommunityPool(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.amount && message.amount.length)) + message.amount = []; + message.amount.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + case 2: + message.depositor = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgFundCommunityPool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.MsgFundCommunityPool} MsgFundCommunityPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgFundCommunityPool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgFundCommunityPool message. + * @function verify + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgFundCommunityPool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + if (!Array.isArray(message.amount)) + return "amount: array expected"; + for (var i = 0; i < message.amount.length; ++i) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.amount[i]); + if (error) + return "amount." + error; + } + } + if (message.depositor != null && message.hasOwnProperty("depositor")) + if (!$util.isString(message.depositor)) + return "depositor: string expected"; + return null; + }; + + /** + * Creates a MsgFundCommunityPool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.MsgFundCommunityPool} MsgFundCommunityPool + */ + MsgFundCommunityPool.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.MsgFundCommunityPool) + return object; + var message = new $root.cosmos.distribution.v1beta1.MsgFundCommunityPool(); + if (object.amount) { + if (!Array.isArray(object.amount)) + throw TypeError(".cosmos.distribution.v1beta1.MsgFundCommunityPool.amount: array expected"); + message.amount = []; + for (var i = 0; i < object.amount.length; ++i) { + if (typeof object.amount[i] !== "object") + throw TypeError(".cosmos.distribution.v1beta1.MsgFundCommunityPool.amount: object expected"); + message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]); + } + } + if (object.depositor != null) + message.depositor = String(object.depositor); + return message; + }; + + /** + * Creates a plain object from a MsgFundCommunityPool message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @static + * @param {cosmos.distribution.v1beta1.MsgFundCommunityPool} message MsgFundCommunityPool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgFundCommunityPool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.amount = []; + if (options.defaults) + object.depositor = ""; + if (message.amount && message.amount.length) { + object.amount = []; + for (var j = 0; j < message.amount.length; ++j) + object.amount[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.amount[j], options); + } + if (message.depositor != null && message.hasOwnProperty("depositor")) + object.depositor = message.depositor; + return object; + }; + + /** + * Converts this MsgFundCommunityPool to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @instance + * @returns {Object.} JSON object + */ + MsgFundCommunityPool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgFundCommunityPool; + })(v1beta1.MsgFundCommunityPool || {}); + + v1beta1.MsgFundCommunityPoolResponse = (function(MsgFundCommunityPoolResponse) { + + /** + * Properties of a MsgFundCommunityPoolResponse. + * @memberof cosmos.distribution.v1beta1 + * @interface IMsgFundCommunityPoolResponse + */ + + /** + * Constructs a new MsgFundCommunityPoolResponse. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a MsgFundCommunityPoolResponse. + * @implements IMsgFundCommunityPoolResponse + * @constructor + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPoolResponse=} [properties] Properties to set + */ + function MsgFundCommunityPoolResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgFundCommunityPoolResponse instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPoolResponse=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse} MsgFundCommunityPoolResponse instance + */ + MsgFundCommunityPoolResponse.create = function create(properties) { + return new MsgFundCommunityPoolResponse(properties); + }; + + /** + * Encodes the specified MsgFundCommunityPoolResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPoolResponse} message MsgFundCommunityPoolResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgFundCommunityPoolResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgFundCommunityPoolResponse message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPoolResponse} message MsgFundCommunityPoolResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgFundCommunityPoolResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgFundCommunityPoolResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse} MsgFundCommunityPoolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgFundCommunityPoolResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgFundCommunityPoolResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse} MsgFundCommunityPoolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgFundCommunityPoolResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgFundCommunityPoolResponse message. + * @function verify + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgFundCommunityPoolResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgFundCommunityPoolResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse} MsgFundCommunityPoolResponse + */ + MsgFundCommunityPoolResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse) + return object; + return new $root.cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse(); + }; + + /** + * Creates a plain object from a MsgFundCommunityPoolResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse + * @static + * @param {cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse} message MsgFundCommunityPoolResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgFundCommunityPoolResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgFundCommunityPoolResponse to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse + * @instance + * @returns {Object.} JSON object + */ + MsgFundCommunityPoolResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgFundCommunityPoolResponse; + })(v1beta1.MsgFundCommunityPoolResponse || {}); + + return v1beta1; + })(distribution.v1beta1 || {}); + + return distribution; + })(cosmos.distribution || {}); + + /** + * Namespace evidence. + * @memberof cosmos + * @namespace + */ + + cosmos.evidence = (function(evidence) { + + /** + * Namespace v1beta1. + * @memberof cosmos.evidence + * @namespace + */ + + evidence.v1beta1 = (function(v1beta1) { + + v1beta1.Msg = (function(Msg) { + + /** + * Constructs a new Msg service. + * @memberof cosmos.evidence.v1beta1 + * @classdesc Represents a Msg + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Msg(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; + + /** + * Creates new Msg service using the specified rpc implementation. + * @function create + * @memberof cosmos.evidence.v1beta1.Msg + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Msg} RPC service. Useful where requests and/or responses are streamed. + */ + Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.evidence.v1beta1.Msg#submitEvidence}. + * @memberof cosmos.evidence.v1beta1.Msg + * @typedef SubmitEvidenceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidenceResponse} [response] MsgSubmitEvidenceResponse + */ + + /** + * Calls SubmitEvidence. + * @function submitEvidence + * @memberof cosmos.evidence.v1beta1.Msg + * @instance + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidence} request MsgSubmitEvidence message or plain object + * @param {cosmos.evidence.v1beta1.Msg.SubmitEvidenceCallback} callback Node-style callback called with the error, if any, and MsgSubmitEvidenceResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.submitEvidence = function submitEvidence(request, callback) { + return this.rpcCall(submitEvidence, $root.cosmos.evidence.v1beta1.MsgSubmitEvidence, $root.cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse, request, callback); + }, "name", { value: "SubmitEvidence" }); + + /** + * Calls SubmitEvidence. + * @function submitEvidence + * @memberof cosmos.evidence.v1beta1.Msg + * @instance + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidence} request MsgSubmitEvidence message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Msg; + })(v1beta1.Msg || {}); + + v1beta1.MsgSubmitEvidence = (function(MsgSubmitEvidence) { + + /** + * Properties of a MsgSubmitEvidence. + * @memberof cosmos.evidence.v1beta1 + * @interface IMsgSubmitEvidence + * @property {string|null} [submitter] MsgSubmitEvidence submitter + * @property {google.protobuf.IAny|null} [evidence] MsgSubmitEvidence evidence + */ + + /** + * Constructs a new MsgSubmitEvidence. + * @memberof cosmos.evidence.v1beta1 + * @classdesc Represents a MsgSubmitEvidence. + * @implements IMsgSubmitEvidence + * @constructor + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidence=} [properties] Properties to set + */ + function MsgSubmitEvidence(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgSubmitEvidence submitter. + * @member {string} submitter + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @instance + */ + MsgSubmitEvidence.prototype.submitter = ""; + + /** + * MsgSubmitEvidence evidence. + * @member {google.protobuf.IAny|null|undefined} evidence + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @instance + */ + MsgSubmitEvidence.prototype.evidence = null; + + /** + * Creates a new MsgSubmitEvidence instance using the specified properties. + * @function create + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @static + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidence=} [properties] Properties to set + * @returns {cosmos.evidence.v1beta1.MsgSubmitEvidence} MsgSubmitEvidence instance + */ + MsgSubmitEvidence.create = function create(properties) { + return new MsgSubmitEvidence(properties); + }; + + /** + * Encodes the specified MsgSubmitEvidence message. Does not implicitly {@link cosmos.evidence.v1beta1.MsgSubmitEvidence.verify|verify} messages. + * @function encode + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @static + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidence} message MsgSubmitEvidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitEvidence.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.submitter != null && Object.hasOwnProperty.call(message, "submitter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.submitter); + if (message.evidence != null && Object.hasOwnProperty.call(message, "evidence")) + $root.google.protobuf.Any.encode(message.evidence, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MsgSubmitEvidence message, length delimited. Does not implicitly {@link cosmos.evidence.v1beta1.MsgSubmitEvidence.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @static + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidence} message MsgSubmitEvidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitEvidence.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgSubmitEvidence message from the specified reader or buffer. + * @function decode + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.evidence.v1beta1.MsgSubmitEvidence} MsgSubmitEvidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitEvidence.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.evidence.v1beta1.MsgSubmitEvidence(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.submitter = reader.string(); + break; + case 2: + message.evidence = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgSubmitEvidence message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.evidence.v1beta1.MsgSubmitEvidence} MsgSubmitEvidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitEvidence.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgSubmitEvidence message. + * @function verify + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgSubmitEvidence.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.submitter != null && message.hasOwnProperty("submitter")) + if (!$util.isString(message.submitter)) + return "submitter: string expected"; + if (message.evidence != null && message.hasOwnProperty("evidence")) { + var error = $root.google.protobuf.Any.verify(message.evidence); + if (error) + return "evidence." + error; + } + return null; + }; + + /** + * Creates a MsgSubmitEvidence message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @static + * @param {Object.} object Plain object + * @returns {cosmos.evidence.v1beta1.MsgSubmitEvidence} MsgSubmitEvidence + */ + MsgSubmitEvidence.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.evidence.v1beta1.MsgSubmitEvidence) + return object; + var message = new $root.cosmos.evidence.v1beta1.MsgSubmitEvidence(); + if (object.submitter != null) + message.submitter = String(object.submitter); + if (object.evidence != null) { + if (typeof object.evidence !== "object") + throw TypeError(".cosmos.evidence.v1beta1.MsgSubmitEvidence.evidence: object expected"); + message.evidence = $root.google.protobuf.Any.fromObject(object.evidence); + } + return message; + }; + + /** + * Creates a plain object from a MsgSubmitEvidence message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @static + * @param {cosmos.evidence.v1beta1.MsgSubmitEvidence} message MsgSubmitEvidence + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSubmitEvidence.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.submitter = ""; + object.evidence = null; + } + if (message.submitter != null && message.hasOwnProperty("submitter")) + object.submitter = message.submitter; + if (message.evidence != null && message.hasOwnProperty("evidence")) + object.evidence = $root.google.protobuf.Any.toObject(message.evidence, options); + return object; + }; + + /** + * Converts this MsgSubmitEvidence to JSON. + * @function toJSON + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @instance + * @returns {Object.} JSON object + */ + MsgSubmitEvidence.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgSubmitEvidence; + })(v1beta1.MsgSubmitEvidence || {}); + + v1beta1.MsgSubmitEvidenceResponse = (function(MsgSubmitEvidenceResponse) { + + /** + * Properties of a MsgSubmitEvidenceResponse. + * @memberof cosmos.evidence.v1beta1 + * @interface IMsgSubmitEvidenceResponse + * @property {Uint8Array|null} [hash] MsgSubmitEvidenceResponse hash + */ + + /** + * Constructs a new MsgSubmitEvidenceResponse. + * @memberof cosmos.evidence.v1beta1 + * @classdesc Represents a MsgSubmitEvidenceResponse. + * @implements IMsgSubmitEvidenceResponse + * @constructor + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidenceResponse=} [properties] Properties to set + */ + function MsgSubmitEvidenceResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgSubmitEvidenceResponse hash. + * @member {Uint8Array} hash + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse + * @instance + */ + MsgSubmitEvidenceResponse.prototype.hash = $util.newBuffer([]); + + /** + * Creates a new MsgSubmitEvidenceResponse instance using the specified properties. + * @function create + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse + * @static + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidenceResponse=} [properties] Properties to set + * @returns {cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse} MsgSubmitEvidenceResponse instance + */ + MsgSubmitEvidenceResponse.create = function create(properties) { + return new MsgSubmitEvidenceResponse(properties); + }; + + /** + * Encodes the specified MsgSubmitEvidenceResponse message. Does not implicitly {@link cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse + * @static + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidenceResponse} message MsgSubmitEvidenceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitEvidenceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.hash); + return writer; + }; + + /** + * Encodes the specified MsgSubmitEvidenceResponse message, length delimited. Does not implicitly {@link cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse + * @static + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidenceResponse} message MsgSubmitEvidenceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitEvidenceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgSubmitEvidenceResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse} MsgSubmitEvidenceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitEvidenceResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + message.hash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgSubmitEvidenceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse} MsgSubmitEvidenceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitEvidenceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgSubmitEvidenceResponse message. + * @function verify + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgSubmitEvidenceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash))) + return "hash: buffer expected"; + return null; + }; + + /** + * Creates a MsgSubmitEvidenceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse} MsgSubmitEvidenceResponse + */ + MsgSubmitEvidenceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse) + return object; + var message = new $root.cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse(); + if (object.hash != null) + if (typeof object.hash === "string") + $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0); + else if (object.hash.length) + message.hash = object.hash; + return message; + }; + + /** + * Creates a plain object from a MsgSubmitEvidenceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse + * @static + * @param {cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse} message MsgSubmitEvidenceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSubmitEvidenceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.hash = ""; + else { + object.hash = []; + if (options.bytes !== Array) + object.hash = $util.newBuffer(object.hash); + } + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash; + return object; + }; + + /** + * Converts this MsgSubmitEvidenceResponse to JSON. + * @function toJSON + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse + * @instance + * @returns {Object.} JSON object + */ + MsgSubmitEvidenceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgSubmitEvidenceResponse; + })(v1beta1.MsgSubmitEvidenceResponse || {}); + + return v1beta1; + })(evidence.v1beta1 || {}); + + return evidence; + })(cosmos.evidence || {}); + + /** + * Namespace slashing. + * @memberof cosmos + * @namespace + */ + + cosmos.slashing = (function(slashing) { + + /** + * Namespace v1beta1. + * @memberof cosmos.slashing + * @namespace + */ + + slashing.v1beta1 = (function(v1beta1) { + + v1beta1.Msg = (function(Msg) { + + /** + * Constructs a new Msg service. + * @memberof cosmos.slashing.v1beta1 + * @classdesc Represents a Msg + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Msg(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; + + /** + * Creates new Msg service using the specified rpc implementation. + * @function create + * @memberof cosmos.slashing.v1beta1.Msg + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Msg} RPC service. Useful where requests and/or responses are streamed. + */ + Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.slashing.v1beta1.Msg#unjail}. + * @memberof cosmos.slashing.v1beta1.Msg + * @typedef UnjailCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.slashing.v1beta1.IMsgUnjailResponse} [response] MsgUnjailResponse + */ + + /** + * Calls Unjail. + * @function unjail + * @memberof cosmos.slashing.v1beta1.Msg + * @instance + * @param {cosmos.slashing.v1beta1.IMsgUnjail} request MsgUnjail message or plain object + * @param {cosmos.slashing.v1beta1.Msg.UnjailCallback} callback Node-style callback called with the error, if any, and MsgUnjailResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.unjail = function unjail(request, callback) { + return this.rpcCall(unjail, $root.cosmos.slashing.v1beta1.MsgUnjail, $root.cosmos.slashing.v1beta1.MsgUnjailResponse, request, callback); + }, "name", { value: "Unjail" }); + + /** + * Calls Unjail. + * @function unjail + * @memberof cosmos.slashing.v1beta1.Msg + * @instance + * @param {cosmos.slashing.v1beta1.IMsgUnjail} request MsgUnjail message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Msg; + })(v1beta1.Msg || {}); + + v1beta1.MsgUnjail = (function(MsgUnjail) { + + /** + * Properties of a MsgUnjail. + * @memberof cosmos.slashing.v1beta1 + * @interface IMsgUnjail + * @property {string|null} [validatorAddr] MsgUnjail validatorAddr + */ + + /** + * Constructs a new MsgUnjail. + * @memberof cosmos.slashing.v1beta1 + * @classdesc Represents a MsgUnjail. + * @implements IMsgUnjail + * @constructor + * @param {cosmos.slashing.v1beta1.IMsgUnjail=} [properties] Properties to set + */ + function MsgUnjail(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgUnjail validatorAddr. + * @member {string} validatorAddr + * @memberof cosmos.slashing.v1beta1.MsgUnjail + * @instance + */ + MsgUnjail.prototype.validatorAddr = ""; + + /** + * Creates a new MsgUnjail instance using the specified properties. + * @function create + * @memberof cosmos.slashing.v1beta1.MsgUnjail + * @static + * @param {cosmos.slashing.v1beta1.IMsgUnjail=} [properties] Properties to set + * @returns {cosmos.slashing.v1beta1.MsgUnjail} MsgUnjail instance + */ + MsgUnjail.create = function create(properties) { + return new MsgUnjail(properties); + }; + + /** + * Encodes the specified MsgUnjail message. Does not implicitly {@link cosmos.slashing.v1beta1.MsgUnjail.verify|verify} messages. + * @function encode + * @memberof cosmos.slashing.v1beta1.MsgUnjail + * @static + * @param {cosmos.slashing.v1beta1.IMsgUnjail} message MsgUnjail message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUnjail.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validatorAddr != null && Object.hasOwnProperty.call(message, "validatorAddr")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.validatorAddr); + return writer; + }; + + /** + * Encodes the specified MsgUnjail message, length delimited. Does not implicitly {@link cosmos.slashing.v1beta1.MsgUnjail.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.slashing.v1beta1.MsgUnjail + * @static + * @param {cosmos.slashing.v1beta1.IMsgUnjail} message MsgUnjail message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUnjail.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgUnjail message from the specified reader or buffer. + * @function decode + * @memberof cosmos.slashing.v1beta1.MsgUnjail + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.slashing.v1beta1.MsgUnjail} MsgUnjail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUnjail.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.slashing.v1beta1.MsgUnjail(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgUnjail message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.slashing.v1beta1.MsgUnjail + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.slashing.v1beta1.MsgUnjail} MsgUnjail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUnjail.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgUnjail message. + * @function verify + * @memberof cosmos.slashing.v1beta1.MsgUnjail + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgUnjail.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validatorAddr != null && message.hasOwnProperty("validatorAddr")) + if (!$util.isString(message.validatorAddr)) + return "validatorAddr: string expected"; + return null; + }; + + /** + * Creates a MsgUnjail message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.slashing.v1beta1.MsgUnjail + * @static + * @param {Object.} object Plain object + * @returns {cosmos.slashing.v1beta1.MsgUnjail} MsgUnjail + */ + MsgUnjail.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.slashing.v1beta1.MsgUnjail) + return object; + var message = new $root.cosmos.slashing.v1beta1.MsgUnjail(); + if (object.validatorAddr != null) + message.validatorAddr = String(object.validatorAddr); + return message; + }; + + /** + * Creates a plain object from a MsgUnjail message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.slashing.v1beta1.MsgUnjail + * @static + * @param {cosmos.slashing.v1beta1.MsgUnjail} message MsgUnjail + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgUnjail.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.validatorAddr = ""; + if (message.validatorAddr != null && message.hasOwnProperty("validatorAddr")) + object.validatorAddr = message.validatorAddr; + return object; + }; + + /** + * Converts this MsgUnjail to JSON. + * @function toJSON + * @memberof cosmos.slashing.v1beta1.MsgUnjail + * @instance + * @returns {Object.} JSON object + */ + MsgUnjail.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgUnjail; + })(v1beta1.MsgUnjail || {}); + + v1beta1.MsgUnjailResponse = (function(MsgUnjailResponse) { + + /** + * Properties of a MsgUnjailResponse. + * @memberof cosmos.slashing.v1beta1 + * @interface IMsgUnjailResponse + */ + + /** + * Constructs a new MsgUnjailResponse. + * @memberof cosmos.slashing.v1beta1 + * @classdesc Represents a MsgUnjailResponse. + * @implements IMsgUnjailResponse + * @constructor + * @param {cosmos.slashing.v1beta1.IMsgUnjailResponse=} [properties] Properties to set + */ + function MsgUnjailResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgUnjailResponse instance using the specified properties. + * @function create + * @memberof cosmos.slashing.v1beta1.MsgUnjailResponse + * @static + * @param {cosmos.slashing.v1beta1.IMsgUnjailResponse=} [properties] Properties to set + * @returns {cosmos.slashing.v1beta1.MsgUnjailResponse} MsgUnjailResponse instance + */ + MsgUnjailResponse.create = function create(properties) { + return new MsgUnjailResponse(properties); + }; + + /** + * Encodes the specified MsgUnjailResponse message. Does not implicitly {@link cosmos.slashing.v1beta1.MsgUnjailResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.slashing.v1beta1.MsgUnjailResponse + * @static + * @param {cosmos.slashing.v1beta1.IMsgUnjailResponse} message MsgUnjailResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUnjailResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgUnjailResponse message, length delimited. Does not implicitly {@link cosmos.slashing.v1beta1.MsgUnjailResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.slashing.v1beta1.MsgUnjailResponse + * @static + * @param {cosmos.slashing.v1beta1.IMsgUnjailResponse} message MsgUnjailResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUnjailResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgUnjailResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.slashing.v1beta1.MsgUnjailResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.slashing.v1beta1.MsgUnjailResponse} MsgUnjailResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUnjailResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.slashing.v1beta1.MsgUnjailResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgUnjailResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.slashing.v1beta1.MsgUnjailResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.slashing.v1beta1.MsgUnjailResponse} MsgUnjailResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUnjailResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgUnjailResponse message. + * @function verify + * @memberof cosmos.slashing.v1beta1.MsgUnjailResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgUnjailResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgUnjailResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.slashing.v1beta1.MsgUnjailResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.slashing.v1beta1.MsgUnjailResponse} MsgUnjailResponse + */ + MsgUnjailResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.slashing.v1beta1.MsgUnjailResponse) + return object; + return new $root.cosmos.slashing.v1beta1.MsgUnjailResponse(); + }; + + /** + * Creates a plain object from a MsgUnjailResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.slashing.v1beta1.MsgUnjailResponse + * @static + * @param {cosmos.slashing.v1beta1.MsgUnjailResponse} message MsgUnjailResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgUnjailResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgUnjailResponse to JSON. + * @function toJSON + * @memberof cosmos.slashing.v1beta1.MsgUnjailResponse + * @instance + * @returns {Object.} JSON object + */ + MsgUnjailResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgUnjailResponse; + })(v1beta1.MsgUnjailResponse || {}); + + return v1beta1; + })(slashing.v1beta1 || {}); + + return slashing; + })(cosmos.slashing || {}); + + /** + * Namespace vesting. + * @memberof cosmos + * @namespace + */ + + cosmos.vesting = (function(vesting) { + + /** + * Namespace v1beta1. + * @memberof cosmos.vesting + * @namespace + */ + + vesting.v1beta1 = (function(v1beta1) { + + v1beta1.Msg = (function(Msg) { + + /** + * Constructs a new Msg service. + * @memberof cosmos.vesting.v1beta1 + * @classdesc Represents a Msg + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Msg(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; + + /** + * Creates new Msg service using the specified rpc implementation. + * @function create + * @memberof cosmos.vesting.v1beta1.Msg + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Msg} RPC service. Useful where requests and/or responses are streamed. + */ + Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.vesting.v1beta1.Msg#createVestingAccount}. + * @memberof cosmos.vesting.v1beta1.Msg + * @typedef CreateVestingAccountCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccountResponse} [response] MsgCreateVestingAccountResponse + */ + + /** + * Calls CreateVestingAccount. + * @function createVestingAccount + * @memberof cosmos.vesting.v1beta1.Msg + * @instance + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccount} request MsgCreateVestingAccount message or plain object + * @param {cosmos.vesting.v1beta1.Msg.CreateVestingAccountCallback} callback Node-style callback called with the error, if any, and MsgCreateVestingAccountResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.createVestingAccount = function createVestingAccount(request, callback) { + return this.rpcCall(createVestingAccount, $root.cosmos.vesting.v1beta1.MsgCreateVestingAccount, $root.cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse, request, callback); + }, "name", { value: "CreateVestingAccount" }); + + /** + * Calls CreateVestingAccount. + * @function createVestingAccount + * @memberof cosmos.vesting.v1beta1.Msg + * @instance + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccount} request MsgCreateVestingAccount message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Msg; + })(v1beta1.Msg || {}); + + v1beta1.MsgCreateVestingAccount = (function(MsgCreateVestingAccount) { + + /** + * Properties of a MsgCreateVestingAccount. + * @memberof cosmos.vesting.v1beta1 + * @interface IMsgCreateVestingAccount + * @property {string|null} [fromAddress] MsgCreateVestingAccount fromAddress + * @property {string|null} [toAddress] MsgCreateVestingAccount toAddress + * @property {Array.|null} [amount] MsgCreateVestingAccount amount + * @property {number|Long|null} [endTime] MsgCreateVestingAccount endTime + * @property {boolean|null} [delayed] MsgCreateVestingAccount delayed + */ + + /** + * Constructs a new MsgCreateVestingAccount. + * @memberof cosmos.vesting.v1beta1 + * @classdesc Represents a MsgCreateVestingAccount. + * @implements IMsgCreateVestingAccount + * @constructor + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccount=} [properties] Properties to set + */ + function MsgCreateVestingAccount(properties) { + this.amount = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgCreateVestingAccount fromAddress. + * @member {string} fromAddress + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @instance + */ + MsgCreateVestingAccount.prototype.fromAddress = ""; + + /** + * MsgCreateVestingAccount toAddress. + * @member {string} toAddress + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @instance + */ + MsgCreateVestingAccount.prototype.toAddress = ""; + + /** + * MsgCreateVestingAccount amount. + * @member {Array.} amount + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @instance + */ + MsgCreateVestingAccount.prototype.amount = $util.emptyArray; + + /** + * MsgCreateVestingAccount endTime. + * @member {number|Long} endTime + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @instance + */ + MsgCreateVestingAccount.prototype.endTime = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * MsgCreateVestingAccount delayed. + * @member {boolean} delayed + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @instance + */ + MsgCreateVestingAccount.prototype.delayed = false; + + /** + * Creates a new MsgCreateVestingAccount instance using the specified properties. + * @function create + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @static + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccount=} [properties] Properties to set + * @returns {cosmos.vesting.v1beta1.MsgCreateVestingAccount} MsgCreateVestingAccount instance + */ + MsgCreateVestingAccount.create = function create(properties) { + return new MsgCreateVestingAccount(properties); + }; + + /** + * Encodes the specified MsgCreateVestingAccount message. Does not implicitly {@link cosmos.vesting.v1beta1.MsgCreateVestingAccount.verify|verify} messages. + * @function encode + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @static + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccount} message MsgCreateVestingAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateVestingAccount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fromAddress != null && Object.hasOwnProperty.call(message, "fromAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fromAddress); + if (message.toAddress != null && Object.hasOwnProperty.call(message, "toAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.toAddress); + if (message.amount != null && message.amount.length) + for (var i = 0; i < message.amount.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.amount[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.endTime); + if (message.delayed != null && Object.hasOwnProperty.call(message, "delayed")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.delayed); + return writer; + }; + + /** + * Encodes the specified MsgCreateVestingAccount message, length delimited. Does not implicitly {@link cosmos.vesting.v1beta1.MsgCreateVestingAccount.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @static + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccount} message MsgCreateVestingAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateVestingAccount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgCreateVestingAccount message from the specified reader or buffer. + * @function decode + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.vesting.v1beta1.MsgCreateVestingAccount} MsgCreateVestingAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateVestingAccount.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.vesting.v1beta1.MsgCreateVestingAccount(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fromAddress = reader.string(); + break; + case 2: + message.toAddress = reader.string(); + break; + case 3: + if (!(message.amount && message.amount.length)) + message.amount = []; + message.amount.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + case 4: + message.endTime = reader.int64(); + break; + case 5: + message.delayed = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgCreateVestingAccount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.vesting.v1beta1.MsgCreateVestingAccount} MsgCreateVestingAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateVestingAccount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgCreateVestingAccount message. + * @function verify + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgCreateVestingAccount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fromAddress != null && message.hasOwnProperty("fromAddress")) + if (!$util.isString(message.fromAddress)) + return "fromAddress: string expected"; + if (message.toAddress != null && message.hasOwnProperty("toAddress")) + if (!$util.isString(message.toAddress)) + return "toAddress: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + if (!Array.isArray(message.amount)) + return "amount: array expected"; + for (var i = 0; i < message.amount.length; ++i) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.amount[i]); + if (error) + return "amount." + error; + } + } + if (message.endTime != null && message.hasOwnProperty("endTime")) + if (!$util.isInteger(message.endTime) && !(message.endTime && $util.isInteger(message.endTime.low) && $util.isInteger(message.endTime.high))) + return "endTime: integer|Long expected"; + if (message.delayed != null && message.hasOwnProperty("delayed")) + if (typeof message.delayed !== "boolean") + return "delayed: boolean expected"; + return null; + }; + + /** + * Creates a MsgCreateVestingAccount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @static + * @param {Object.} object Plain object + * @returns {cosmos.vesting.v1beta1.MsgCreateVestingAccount} MsgCreateVestingAccount + */ + MsgCreateVestingAccount.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.vesting.v1beta1.MsgCreateVestingAccount) + return object; + var message = new $root.cosmos.vesting.v1beta1.MsgCreateVestingAccount(); + if (object.fromAddress != null) + message.fromAddress = String(object.fromAddress); + if (object.toAddress != null) + message.toAddress = String(object.toAddress); + if (object.amount) { + if (!Array.isArray(object.amount)) + throw TypeError(".cosmos.vesting.v1beta1.MsgCreateVestingAccount.amount: array expected"); + message.amount = []; + for (var i = 0; i < object.amount.length; ++i) { + if (typeof object.amount[i] !== "object") + throw TypeError(".cosmos.vesting.v1beta1.MsgCreateVestingAccount.amount: object expected"); + message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]); + } + } + if (object.endTime != null) + if ($util.Long) + (message.endTime = $util.Long.fromValue(object.endTime)).unsigned = false; + else if (typeof object.endTime === "string") + message.endTime = parseInt(object.endTime, 10); + else if (typeof object.endTime === "number") + message.endTime = object.endTime; + else if (typeof object.endTime === "object") + message.endTime = new $util.LongBits(object.endTime.low >>> 0, object.endTime.high >>> 0).toNumber(); + if (object.delayed != null) + message.delayed = Boolean(object.delayed); + return message; + }; + + /** + * Creates a plain object from a MsgCreateVestingAccount message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @static + * @param {cosmos.vesting.v1beta1.MsgCreateVestingAccount} message MsgCreateVestingAccount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgCreateVestingAccount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.amount = []; + if (options.defaults) { + object.fromAddress = ""; + object.toAddress = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.endTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.endTime = options.longs === String ? "0" : 0; + object.delayed = false; + } + if (message.fromAddress != null && message.hasOwnProperty("fromAddress")) + object.fromAddress = message.fromAddress; + if (message.toAddress != null && message.hasOwnProperty("toAddress")) + object.toAddress = message.toAddress; + if (message.amount && message.amount.length) { + object.amount = []; + for (var j = 0; j < message.amount.length; ++j) + object.amount[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.amount[j], options); + } + if (message.endTime != null && message.hasOwnProperty("endTime")) + if (typeof message.endTime === "number") + object.endTime = options.longs === String ? String(message.endTime) : message.endTime; + else + object.endTime = options.longs === String ? $util.Long.prototype.toString.call(message.endTime) : options.longs === Number ? new $util.LongBits(message.endTime.low >>> 0, message.endTime.high >>> 0).toNumber() : message.endTime; + if (message.delayed != null && message.hasOwnProperty("delayed")) + object.delayed = message.delayed; + return object; + }; + + /** + * Converts this MsgCreateVestingAccount to JSON. + * @function toJSON + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @instance + * @returns {Object.} JSON object + */ + MsgCreateVestingAccount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgCreateVestingAccount; + })(v1beta1.MsgCreateVestingAccount || {}); + + v1beta1.MsgCreateVestingAccountResponse = (function(MsgCreateVestingAccountResponse) { + + /** + * Properties of a MsgCreateVestingAccountResponse. + * @memberof cosmos.vesting.v1beta1 + * @interface IMsgCreateVestingAccountResponse + */ + + /** + * Constructs a new MsgCreateVestingAccountResponse. + * @memberof cosmos.vesting.v1beta1 + * @classdesc Represents a MsgCreateVestingAccountResponse. + * @implements IMsgCreateVestingAccountResponse + * @constructor + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccountResponse=} [properties] Properties to set + */ + function MsgCreateVestingAccountResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgCreateVestingAccountResponse instance using the specified properties. + * @function create + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse + * @static + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccountResponse=} [properties] Properties to set + * @returns {cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse} MsgCreateVestingAccountResponse instance + */ + MsgCreateVestingAccountResponse.create = function create(properties) { + return new MsgCreateVestingAccountResponse(properties); + }; + + /** + * Encodes the specified MsgCreateVestingAccountResponse message. Does not implicitly {@link cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse + * @static + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccountResponse} message MsgCreateVestingAccountResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateVestingAccountResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgCreateVestingAccountResponse message, length delimited. Does not implicitly {@link cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse + * @static + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccountResponse} message MsgCreateVestingAccountResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateVestingAccountResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgCreateVestingAccountResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse} MsgCreateVestingAccountResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateVestingAccountResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgCreateVestingAccountResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse} MsgCreateVestingAccountResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateVestingAccountResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgCreateVestingAccountResponse message. + * @function verify + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgCreateVestingAccountResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgCreateVestingAccountResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse} MsgCreateVestingAccountResponse + */ + MsgCreateVestingAccountResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse) + return object; + return new $root.cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse(); + }; + + /** + * Creates a plain object from a MsgCreateVestingAccountResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse + * @static + * @param {cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse} message MsgCreateVestingAccountResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgCreateVestingAccountResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgCreateVestingAccountResponse to JSON. + * @function toJSON + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse + * @instance + * @returns {Object.} JSON object + */ + MsgCreateVestingAccountResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgCreateVestingAccountResponse; + })(v1beta1.MsgCreateVestingAccountResponse || {}); + + return v1beta1; + })(vesting.v1beta1 || {}); + + return vesting; + })(cosmos.vesting || {}); + + return cosmos; +})($root.cosmos || {}); + +/** + * Namespace google. + * @exports google + * @namespace + */ + +$root.google = (function(google) { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + + google.protobuf = (function(protobuf) { + + protobuf.Timestamp = (function(Timestamp) { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Timestamp; + })(protobuf.Timestamp || {}); + + protobuf.Any = (function(Any) { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type_url = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Any; + })(protobuf.Any || {}); + + protobuf.Duration = (function(Duration) { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Duration; + })(protobuf.Duration || {}); + + return protobuf; + })(google.protobuf || {}); + + return google; +})($root.google || {}); + +/** + * Namespace tendermint. + * @exports tendermint + * @namespace + */ + +$root.tendermint = (function(tendermint) { + + /** + * Namespace abci. + * @memberof tendermint + * @namespace + */ + + tendermint.abci = (function(abci) { + + abci.Request = (function(Request) { + + /** + * Properties of a Request. + * @memberof tendermint.abci + * @interface IRequest + * @property {tendermint.abci.IRequestEcho|null} [echo] Request echo + * @property {tendermint.abci.IRequestFlush|null} [flush] Request flush + * @property {tendermint.abci.IRequestInfo|null} [info] Request info + * @property {tendermint.abci.IRequestSetOption|null} [setOption] Request setOption + * @property {tendermint.abci.IRequestInitChain|null} [initChain] Request initChain + * @property {tendermint.abci.IRequestQuery|null} [query] Request query + * @property {tendermint.abci.IRequestBeginBlock|null} [beginBlock] Request beginBlock + * @property {tendermint.abci.IRequestCheckTx|null} [checkTx] Request checkTx + * @property {tendermint.abci.IRequestDeliverTx|null} [deliverTx] Request deliverTx + * @property {tendermint.abci.IRequestEndBlock|null} [endBlock] Request endBlock + * @property {tendermint.abci.IRequestCommit|null} [commit] Request commit + * @property {tendermint.abci.IRequestListSnapshots|null} [listSnapshots] Request listSnapshots + * @property {tendermint.abci.IRequestOfferSnapshot|null} [offerSnapshot] Request offerSnapshot + * @property {tendermint.abci.IRequestLoadSnapshotChunk|null} [loadSnapshotChunk] Request loadSnapshotChunk + * @property {tendermint.abci.IRequestApplySnapshotChunk|null} [applySnapshotChunk] Request applySnapshotChunk + */ + + /** + * Constructs a new Request. + * @memberof tendermint.abci + * @classdesc Represents a Request. + * @implements IRequest + * @constructor + * @param {tendermint.abci.IRequest=} [properties] Properties to set + */ + function Request(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Request echo. + * @member {tendermint.abci.IRequestEcho|null|undefined} echo + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.echo = null; + + /** + * Request flush. + * @member {tendermint.abci.IRequestFlush|null|undefined} flush + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.flush = null; + + /** + * Request info. + * @member {tendermint.abci.IRequestInfo|null|undefined} info + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.info = null; + + /** + * Request setOption. + * @member {tendermint.abci.IRequestSetOption|null|undefined} setOption + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.setOption = null; + + /** + * Request initChain. + * @member {tendermint.abci.IRequestInitChain|null|undefined} initChain + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.initChain = null; + + /** + * Request query. + * @member {tendermint.abci.IRequestQuery|null|undefined} query + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.query = null; + + /** + * Request beginBlock. + * @member {tendermint.abci.IRequestBeginBlock|null|undefined} beginBlock + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.beginBlock = null; + + /** + * Request checkTx. + * @member {tendermint.abci.IRequestCheckTx|null|undefined} checkTx + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.checkTx = null; + + /** + * Request deliverTx. + * @member {tendermint.abci.IRequestDeliverTx|null|undefined} deliverTx + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.deliverTx = null; + + /** + * Request endBlock. + * @member {tendermint.abci.IRequestEndBlock|null|undefined} endBlock + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.endBlock = null; + + /** + * Request commit. + * @member {tendermint.abci.IRequestCommit|null|undefined} commit + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.commit = null; + + /** + * Request listSnapshots. + * @member {tendermint.abci.IRequestListSnapshots|null|undefined} listSnapshots + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.listSnapshots = null; + + /** + * Request offerSnapshot. + * @member {tendermint.abci.IRequestOfferSnapshot|null|undefined} offerSnapshot + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.offerSnapshot = null; + + /** + * Request loadSnapshotChunk. + * @member {tendermint.abci.IRequestLoadSnapshotChunk|null|undefined} loadSnapshotChunk + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.loadSnapshotChunk = null; + + /** + * Request applySnapshotChunk. + * @member {tendermint.abci.IRequestApplySnapshotChunk|null|undefined} applySnapshotChunk + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.applySnapshotChunk = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Request value. + * @member {"echo"|"flush"|"info"|"setOption"|"initChain"|"query"|"beginBlock"|"checkTx"|"deliverTx"|"endBlock"|"commit"|"listSnapshots"|"offerSnapshot"|"loadSnapshotChunk"|"applySnapshotChunk"|undefined} value + * @memberof tendermint.abci.Request + * @instance + */ + Object.defineProperty(Request.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["echo", "flush", "info", "setOption", "initChain", "query", "beginBlock", "checkTx", "deliverTx", "endBlock", "commit", "listSnapshots", "offerSnapshot", "loadSnapshotChunk", "applySnapshotChunk"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Request instance using the specified properties. + * @function create + * @memberof tendermint.abci.Request + * @static + * @param {tendermint.abci.IRequest=} [properties] Properties to set + * @returns {tendermint.abci.Request} Request instance + */ + Request.create = function create(properties) { + return new Request(properties); + }; + + /** + * Encodes the specified Request message. Does not implicitly {@link tendermint.abci.Request.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.Request + * @static + * @param {tendermint.abci.IRequest} message Request message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Request.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.echo != null && Object.hasOwnProperty.call(message, "echo")) + $root.tendermint.abci.RequestEcho.encode(message.echo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.flush != null && Object.hasOwnProperty.call(message, "flush")) + $root.tendermint.abci.RequestFlush.encode(message.flush, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.info != null && Object.hasOwnProperty.call(message, "info")) + $root.tendermint.abci.RequestInfo.encode(message.info, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.setOption != null && Object.hasOwnProperty.call(message, "setOption")) + $root.tendermint.abci.RequestSetOption.encode(message.setOption, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.initChain != null && Object.hasOwnProperty.call(message, "initChain")) + $root.tendermint.abci.RequestInitChain.encode(message.initChain, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + $root.tendermint.abci.RequestQuery.encode(message.query, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.beginBlock != null && Object.hasOwnProperty.call(message, "beginBlock")) + $root.tendermint.abci.RequestBeginBlock.encode(message.beginBlock, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.checkTx != null && Object.hasOwnProperty.call(message, "checkTx")) + $root.tendermint.abci.RequestCheckTx.encode(message.checkTx, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.deliverTx != null && Object.hasOwnProperty.call(message, "deliverTx")) + $root.tendermint.abci.RequestDeliverTx.encode(message.deliverTx, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.endBlock != null && Object.hasOwnProperty.call(message, "endBlock")) + $root.tendermint.abci.RequestEndBlock.encode(message.endBlock, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.commit != null && Object.hasOwnProperty.call(message, "commit")) + $root.tendermint.abci.RequestCommit.encode(message.commit, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.listSnapshots != null && Object.hasOwnProperty.call(message, "listSnapshots")) + $root.tendermint.abci.RequestListSnapshots.encode(message.listSnapshots, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.offerSnapshot != null && Object.hasOwnProperty.call(message, "offerSnapshot")) + $root.tendermint.abci.RequestOfferSnapshot.encode(message.offerSnapshot, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.loadSnapshotChunk != null && Object.hasOwnProperty.call(message, "loadSnapshotChunk")) + $root.tendermint.abci.RequestLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.applySnapshotChunk != null && Object.hasOwnProperty.call(message, "applySnapshotChunk")) + $root.tendermint.abci.RequestApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Request message, length delimited. Does not implicitly {@link tendermint.abci.Request.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.Request + * @static + * @param {tendermint.abci.IRequest} message Request message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Request.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Request message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.Request + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.Request} Request + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Request.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.Request(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.echo = $root.tendermint.abci.RequestEcho.decode(reader, reader.uint32()); + break; + case 2: + message.flush = $root.tendermint.abci.RequestFlush.decode(reader, reader.uint32()); + break; + case 3: + message.info = $root.tendermint.abci.RequestInfo.decode(reader, reader.uint32()); + break; + case 4: + message.setOption = $root.tendermint.abci.RequestSetOption.decode(reader, reader.uint32()); + break; + case 5: + message.initChain = $root.tendermint.abci.RequestInitChain.decode(reader, reader.uint32()); + break; + case 6: + message.query = $root.tendermint.abci.RequestQuery.decode(reader, reader.uint32()); + break; + case 7: + message.beginBlock = $root.tendermint.abci.RequestBeginBlock.decode(reader, reader.uint32()); + break; + case 8: + message.checkTx = $root.tendermint.abci.RequestCheckTx.decode(reader, reader.uint32()); + break; + case 9: + message.deliverTx = $root.tendermint.abci.RequestDeliverTx.decode(reader, reader.uint32()); + break; + case 10: + message.endBlock = $root.tendermint.abci.RequestEndBlock.decode(reader, reader.uint32()); + break; + case 11: + message.commit = $root.tendermint.abci.RequestCommit.decode(reader, reader.uint32()); + break; + case 12: + message.listSnapshots = $root.tendermint.abci.RequestListSnapshots.decode(reader, reader.uint32()); + break; + case 13: + message.offerSnapshot = $root.tendermint.abci.RequestOfferSnapshot.decode(reader, reader.uint32()); + break; + case 14: + message.loadSnapshotChunk = $root.tendermint.abci.RequestLoadSnapshotChunk.decode(reader, reader.uint32()); + break; + case 15: + message.applySnapshotChunk = $root.tendermint.abci.RequestApplySnapshotChunk.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Request message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.Request + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.Request} Request + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Request.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Request message. + * @function verify + * @memberof tendermint.abci.Request + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Request.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.echo != null && message.hasOwnProperty("echo")) { + properties.value = 1; + { + var error = $root.tendermint.abci.RequestEcho.verify(message.echo); + if (error) + return "echo." + error; + } + } + if (message.flush != null && message.hasOwnProperty("flush")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.RequestFlush.verify(message.flush); + if (error) + return "flush." + error; + } + } + if (message.info != null && message.hasOwnProperty("info")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.RequestInfo.verify(message.info); + if (error) + return "info." + error; + } + } + if (message.setOption != null && message.hasOwnProperty("setOption")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.RequestSetOption.verify(message.setOption); + if (error) + return "setOption." + error; + } + } + if (message.initChain != null && message.hasOwnProperty("initChain")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.RequestInitChain.verify(message.initChain); + if (error) + return "initChain." + error; + } + } + if (message.query != null && message.hasOwnProperty("query")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.RequestQuery.verify(message.query); + if (error) + return "query." + error; + } + } + if (message.beginBlock != null && message.hasOwnProperty("beginBlock")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.RequestBeginBlock.verify(message.beginBlock); + if (error) + return "beginBlock." + error; + } + } + if (message.checkTx != null && message.hasOwnProperty("checkTx")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.RequestCheckTx.verify(message.checkTx); + if (error) + return "checkTx." + error; + } + } + if (message.deliverTx != null && message.hasOwnProperty("deliverTx")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.RequestDeliverTx.verify(message.deliverTx); + if (error) + return "deliverTx." + error; + } + } + if (message.endBlock != null && message.hasOwnProperty("endBlock")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.RequestEndBlock.verify(message.endBlock); + if (error) + return "endBlock." + error; + } + } + if (message.commit != null && message.hasOwnProperty("commit")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.RequestCommit.verify(message.commit); + if (error) + return "commit." + error; + } + } + if (message.listSnapshots != null && message.hasOwnProperty("listSnapshots")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.RequestListSnapshots.verify(message.listSnapshots); + if (error) + return "listSnapshots." + error; + } + } + if (message.offerSnapshot != null && message.hasOwnProperty("offerSnapshot")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.RequestOfferSnapshot.verify(message.offerSnapshot); + if (error) + return "offerSnapshot." + error; + } + } + if (message.loadSnapshotChunk != null && message.hasOwnProperty("loadSnapshotChunk")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.RequestLoadSnapshotChunk.verify(message.loadSnapshotChunk); + if (error) + return "loadSnapshotChunk." + error; + } + } + if (message.applySnapshotChunk != null && message.hasOwnProperty("applySnapshotChunk")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.RequestApplySnapshotChunk.verify(message.applySnapshotChunk); + if (error) + return "applySnapshotChunk." + error; + } + } + return null; + }; + + /** + * Creates a Request message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.Request + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.Request} Request + */ + Request.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.Request) + return object; + var message = new $root.tendermint.abci.Request(); + if (object.echo != null) { + if (typeof object.echo !== "object") + throw TypeError(".tendermint.abci.Request.echo: object expected"); + message.echo = $root.tendermint.abci.RequestEcho.fromObject(object.echo); + } + if (object.flush != null) { + if (typeof object.flush !== "object") + throw TypeError(".tendermint.abci.Request.flush: object expected"); + message.flush = $root.tendermint.abci.RequestFlush.fromObject(object.flush); + } + if (object.info != null) { + if (typeof object.info !== "object") + throw TypeError(".tendermint.abci.Request.info: object expected"); + message.info = $root.tendermint.abci.RequestInfo.fromObject(object.info); + } + if (object.setOption != null) { + if (typeof object.setOption !== "object") + throw TypeError(".tendermint.abci.Request.setOption: object expected"); + message.setOption = $root.tendermint.abci.RequestSetOption.fromObject(object.setOption); + } + if (object.initChain != null) { + if (typeof object.initChain !== "object") + throw TypeError(".tendermint.abci.Request.initChain: object expected"); + message.initChain = $root.tendermint.abci.RequestInitChain.fromObject(object.initChain); + } + if (object.query != null) { + if (typeof object.query !== "object") + throw TypeError(".tendermint.abci.Request.query: object expected"); + message.query = $root.tendermint.abci.RequestQuery.fromObject(object.query); + } + if (object.beginBlock != null) { + if (typeof object.beginBlock !== "object") + throw TypeError(".tendermint.abci.Request.beginBlock: object expected"); + message.beginBlock = $root.tendermint.abci.RequestBeginBlock.fromObject(object.beginBlock); + } + if (object.checkTx != null) { + if (typeof object.checkTx !== "object") + throw TypeError(".tendermint.abci.Request.checkTx: object expected"); + message.checkTx = $root.tendermint.abci.RequestCheckTx.fromObject(object.checkTx); + } + if (object.deliverTx != null) { + if (typeof object.deliverTx !== "object") + throw TypeError(".tendermint.abci.Request.deliverTx: object expected"); + message.deliverTx = $root.tendermint.abci.RequestDeliverTx.fromObject(object.deliverTx); + } + if (object.endBlock != null) { + if (typeof object.endBlock !== "object") + throw TypeError(".tendermint.abci.Request.endBlock: object expected"); + message.endBlock = $root.tendermint.abci.RequestEndBlock.fromObject(object.endBlock); + } + if (object.commit != null) { + if (typeof object.commit !== "object") + throw TypeError(".tendermint.abci.Request.commit: object expected"); + message.commit = $root.tendermint.abci.RequestCommit.fromObject(object.commit); + } + if (object.listSnapshots != null) { + if (typeof object.listSnapshots !== "object") + throw TypeError(".tendermint.abci.Request.listSnapshots: object expected"); + message.listSnapshots = $root.tendermint.abci.RequestListSnapshots.fromObject(object.listSnapshots); + } + if (object.offerSnapshot != null) { + if (typeof object.offerSnapshot !== "object") + throw TypeError(".tendermint.abci.Request.offerSnapshot: object expected"); + message.offerSnapshot = $root.tendermint.abci.RequestOfferSnapshot.fromObject(object.offerSnapshot); + } + if (object.loadSnapshotChunk != null) { + if (typeof object.loadSnapshotChunk !== "object") + throw TypeError(".tendermint.abci.Request.loadSnapshotChunk: object expected"); + message.loadSnapshotChunk = $root.tendermint.abci.RequestLoadSnapshotChunk.fromObject(object.loadSnapshotChunk); + } + if (object.applySnapshotChunk != null) { + if (typeof object.applySnapshotChunk !== "object") + throw TypeError(".tendermint.abci.Request.applySnapshotChunk: object expected"); + message.applySnapshotChunk = $root.tendermint.abci.RequestApplySnapshotChunk.fromObject(object.applySnapshotChunk); + } + return message; + }; + + /** + * Creates a plain object from a Request message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.Request + * @static + * @param {tendermint.abci.Request} message Request + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Request.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.echo != null && message.hasOwnProperty("echo")) { + object.echo = $root.tendermint.abci.RequestEcho.toObject(message.echo, options); + if (options.oneofs) + object.value = "echo"; + } + if (message.flush != null && message.hasOwnProperty("flush")) { + object.flush = $root.tendermint.abci.RequestFlush.toObject(message.flush, options); + if (options.oneofs) + object.value = "flush"; + } + if (message.info != null && message.hasOwnProperty("info")) { + object.info = $root.tendermint.abci.RequestInfo.toObject(message.info, options); + if (options.oneofs) + object.value = "info"; + } + if (message.setOption != null && message.hasOwnProperty("setOption")) { + object.setOption = $root.tendermint.abci.RequestSetOption.toObject(message.setOption, options); + if (options.oneofs) + object.value = "setOption"; + } + if (message.initChain != null && message.hasOwnProperty("initChain")) { + object.initChain = $root.tendermint.abci.RequestInitChain.toObject(message.initChain, options); + if (options.oneofs) + object.value = "initChain"; + } + if (message.query != null && message.hasOwnProperty("query")) { + object.query = $root.tendermint.abci.RequestQuery.toObject(message.query, options); + if (options.oneofs) + object.value = "query"; + } + if (message.beginBlock != null && message.hasOwnProperty("beginBlock")) { + object.beginBlock = $root.tendermint.abci.RequestBeginBlock.toObject(message.beginBlock, options); + if (options.oneofs) + object.value = "beginBlock"; + } + if (message.checkTx != null && message.hasOwnProperty("checkTx")) { + object.checkTx = $root.tendermint.abci.RequestCheckTx.toObject(message.checkTx, options); + if (options.oneofs) + object.value = "checkTx"; + } + if (message.deliverTx != null && message.hasOwnProperty("deliverTx")) { + object.deliverTx = $root.tendermint.abci.RequestDeliverTx.toObject(message.deliverTx, options); + if (options.oneofs) + object.value = "deliverTx"; + } + if (message.endBlock != null && message.hasOwnProperty("endBlock")) { + object.endBlock = $root.tendermint.abci.RequestEndBlock.toObject(message.endBlock, options); + if (options.oneofs) + object.value = "endBlock"; + } + if (message.commit != null && message.hasOwnProperty("commit")) { + object.commit = $root.tendermint.abci.RequestCommit.toObject(message.commit, options); + if (options.oneofs) + object.value = "commit"; + } + if (message.listSnapshots != null && message.hasOwnProperty("listSnapshots")) { + object.listSnapshots = $root.tendermint.abci.RequestListSnapshots.toObject(message.listSnapshots, options); + if (options.oneofs) + object.value = "listSnapshots"; + } + if (message.offerSnapshot != null && message.hasOwnProperty("offerSnapshot")) { + object.offerSnapshot = $root.tendermint.abci.RequestOfferSnapshot.toObject(message.offerSnapshot, options); + if (options.oneofs) + object.value = "offerSnapshot"; + } + if (message.loadSnapshotChunk != null && message.hasOwnProperty("loadSnapshotChunk")) { + object.loadSnapshotChunk = $root.tendermint.abci.RequestLoadSnapshotChunk.toObject(message.loadSnapshotChunk, options); + if (options.oneofs) + object.value = "loadSnapshotChunk"; + } + if (message.applySnapshotChunk != null && message.hasOwnProperty("applySnapshotChunk")) { + object.applySnapshotChunk = $root.tendermint.abci.RequestApplySnapshotChunk.toObject(message.applySnapshotChunk, options); + if (options.oneofs) + object.value = "applySnapshotChunk"; + } + return object; + }; + + /** + * Converts this Request to JSON. + * @function toJSON + * @memberof tendermint.abci.Request + * @instance + * @returns {Object.} JSON object + */ + Request.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Request; + })(abci.Request || {}); + + abci.RequestEcho = (function(RequestEcho) { + + /** + * Properties of a RequestEcho. + * @memberof tendermint.abci + * @interface IRequestEcho + * @property {string|null} [message] RequestEcho message + */ + + /** + * Constructs a new RequestEcho. + * @memberof tendermint.abci + * @classdesc Represents a RequestEcho. + * @implements IRequestEcho + * @constructor + * @param {tendermint.abci.IRequestEcho=} [properties] Properties to set + */ + function RequestEcho(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestEcho message. + * @member {string} message + * @memberof tendermint.abci.RequestEcho + * @instance + */ + RequestEcho.prototype.message = ""; + + /** + * Creates a new RequestEcho instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestEcho + * @static + * @param {tendermint.abci.IRequestEcho=} [properties] Properties to set + * @returns {tendermint.abci.RequestEcho} RequestEcho instance + */ + RequestEcho.create = function create(properties) { + return new RequestEcho(properties); + }; + + /** + * Encodes the specified RequestEcho message. Does not implicitly {@link tendermint.abci.RequestEcho.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestEcho + * @static + * @param {tendermint.abci.IRequestEcho} message RequestEcho message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestEcho.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + return writer; + }; + + /** + * Encodes the specified RequestEcho message, length delimited. Does not implicitly {@link tendermint.abci.RequestEcho.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestEcho + * @static + * @param {tendermint.abci.IRequestEcho} message RequestEcho message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestEcho.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestEcho message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestEcho + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestEcho} RequestEcho + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestEcho.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestEcho(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestEcho message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestEcho + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestEcho} RequestEcho + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestEcho.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestEcho message. + * @function verify + * @memberof tendermint.abci.RequestEcho + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestEcho.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + return null; + }; + + /** + * Creates a RequestEcho message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestEcho + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestEcho} RequestEcho + */ + RequestEcho.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestEcho) + return object; + var message = new $root.tendermint.abci.RequestEcho(); + if (object.message != null) + message.message = String(object.message); + return message; + }; + + /** + * Creates a plain object from a RequestEcho message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestEcho + * @static + * @param {tendermint.abci.RequestEcho} message RequestEcho + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestEcho.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.message = ""; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + return object; + }; + + /** + * Converts this RequestEcho to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestEcho + * @instance + * @returns {Object.} JSON object + */ + RequestEcho.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestEcho; + })(abci.RequestEcho || {}); + + abci.RequestFlush = (function(RequestFlush) { + + /** + * Properties of a RequestFlush. + * @memberof tendermint.abci + * @interface IRequestFlush + */ + + /** + * Constructs a new RequestFlush. + * @memberof tendermint.abci + * @classdesc Represents a RequestFlush. + * @implements IRequestFlush + * @constructor + * @param {tendermint.abci.IRequestFlush=} [properties] Properties to set + */ + function RequestFlush(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new RequestFlush instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestFlush + * @static + * @param {tendermint.abci.IRequestFlush=} [properties] Properties to set + * @returns {tendermint.abci.RequestFlush} RequestFlush instance + */ + RequestFlush.create = function create(properties) { + return new RequestFlush(properties); + }; + + /** + * Encodes the specified RequestFlush message. Does not implicitly {@link tendermint.abci.RequestFlush.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestFlush + * @static + * @param {tendermint.abci.IRequestFlush} message RequestFlush message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestFlush.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RequestFlush message, length delimited. Does not implicitly {@link tendermint.abci.RequestFlush.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestFlush + * @static + * @param {tendermint.abci.IRequestFlush} message RequestFlush message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestFlush.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestFlush message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestFlush + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestFlush} RequestFlush + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestFlush.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestFlush(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestFlush message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestFlush + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestFlush} RequestFlush + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestFlush.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestFlush message. + * @function verify + * @memberof tendermint.abci.RequestFlush + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestFlush.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RequestFlush message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestFlush + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestFlush} RequestFlush + */ + RequestFlush.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestFlush) + return object; + return new $root.tendermint.abci.RequestFlush(); + }; + + /** + * Creates a plain object from a RequestFlush message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestFlush + * @static + * @param {tendermint.abci.RequestFlush} message RequestFlush + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestFlush.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RequestFlush to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestFlush + * @instance + * @returns {Object.} JSON object + */ + RequestFlush.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestFlush; + })(abci.RequestFlush || {}); + + abci.RequestInfo = (function(RequestInfo) { + + /** + * Properties of a RequestInfo. + * @memberof tendermint.abci + * @interface IRequestInfo + * @property {string|null} [version] RequestInfo version + * @property {number|Long|null} [blockVersion] RequestInfo blockVersion + * @property {number|Long|null} [p2pVersion] RequestInfo p2pVersion + */ + + /** + * Constructs a new RequestInfo. + * @memberof tendermint.abci + * @classdesc Represents a RequestInfo. + * @implements IRequestInfo + * @constructor + * @param {tendermint.abci.IRequestInfo=} [properties] Properties to set + */ + function RequestInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestInfo version. + * @member {string} version + * @memberof tendermint.abci.RequestInfo + * @instance + */ + RequestInfo.prototype.version = ""; + + /** + * RequestInfo blockVersion. + * @member {number|Long} blockVersion + * @memberof tendermint.abci.RequestInfo + * @instance + */ + RequestInfo.prototype.blockVersion = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * RequestInfo p2pVersion. + * @member {number|Long} p2pVersion + * @memberof tendermint.abci.RequestInfo + * @instance + */ + RequestInfo.prototype.p2pVersion = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new RequestInfo instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestInfo + * @static + * @param {tendermint.abci.IRequestInfo=} [properties] Properties to set + * @returns {tendermint.abci.RequestInfo} RequestInfo instance + */ + RequestInfo.create = function create(properties) { + return new RequestInfo(properties); + }; + + /** + * Encodes the specified RequestInfo message. Does not implicitly {@link tendermint.abci.RequestInfo.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestInfo + * @static + * @param {tendermint.abci.IRequestInfo} message RequestInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.blockVersion != null && Object.hasOwnProperty.call(message, "blockVersion")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.blockVersion); + if (message.p2pVersion != null && Object.hasOwnProperty.call(message, "p2pVersion")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.p2pVersion); + return writer; + }; + + /** + * Encodes the specified RequestInfo message, length delimited. Does not implicitly {@link tendermint.abci.RequestInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestInfo + * @static + * @param {tendermint.abci.IRequestInfo} message RequestInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestInfo message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestInfo} RequestInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.string(); + break; + case 2: + message.blockVersion = reader.uint64(); + break; + case 3: + message.p2pVersion = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestInfo} RequestInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestInfo message. + * @function verify + * @memberof tendermint.abci.RequestInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.blockVersion != null && message.hasOwnProperty("blockVersion")) + if (!$util.isInteger(message.blockVersion) && !(message.blockVersion && $util.isInteger(message.blockVersion.low) && $util.isInteger(message.blockVersion.high))) + return "blockVersion: integer|Long expected"; + if (message.p2pVersion != null && message.hasOwnProperty("p2pVersion")) + if (!$util.isInteger(message.p2pVersion) && !(message.p2pVersion && $util.isInteger(message.p2pVersion.low) && $util.isInteger(message.p2pVersion.high))) + return "p2pVersion: integer|Long expected"; + return null; + }; + + /** + * Creates a RequestInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestInfo + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestInfo} RequestInfo + */ + RequestInfo.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestInfo) + return object; + var message = new $root.tendermint.abci.RequestInfo(); + if (object.version != null) + message.version = String(object.version); + if (object.blockVersion != null) + if ($util.Long) + (message.blockVersion = $util.Long.fromValue(object.blockVersion)).unsigned = true; + else if (typeof object.blockVersion === "string") + message.blockVersion = parseInt(object.blockVersion, 10); + else if (typeof object.blockVersion === "number") + message.blockVersion = object.blockVersion; + else if (typeof object.blockVersion === "object") + message.blockVersion = new $util.LongBits(object.blockVersion.low >>> 0, object.blockVersion.high >>> 0).toNumber(true); + if (object.p2pVersion != null) + if ($util.Long) + (message.p2pVersion = $util.Long.fromValue(object.p2pVersion)).unsigned = true; + else if (typeof object.p2pVersion === "string") + message.p2pVersion = parseInt(object.p2pVersion, 10); + else if (typeof object.p2pVersion === "number") + message.p2pVersion = object.p2pVersion; + else if (typeof object.p2pVersion === "object") + message.p2pVersion = new $util.LongBits(object.p2pVersion.low >>> 0, object.p2pVersion.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a RequestInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestInfo + * @static + * @param {tendermint.abci.RequestInfo} message RequestInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.blockVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.blockVersion = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.p2pVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.p2pVersion = options.longs === String ? "0" : 0; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.blockVersion != null && message.hasOwnProperty("blockVersion")) + if (typeof message.blockVersion === "number") + object.blockVersion = options.longs === String ? String(message.blockVersion) : message.blockVersion; + else + object.blockVersion = options.longs === String ? $util.Long.prototype.toString.call(message.blockVersion) : options.longs === Number ? new $util.LongBits(message.blockVersion.low >>> 0, message.blockVersion.high >>> 0).toNumber(true) : message.blockVersion; + if (message.p2pVersion != null && message.hasOwnProperty("p2pVersion")) + if (typeof message.p2pVersion === "number") + object.p2pVersion = options.longs === String ? String(message.p2pVersion) : message.p2pVersion; + else + object.p2pVersion = options.longs === String ? $util.Long.prototype.toString.call(message.p2pVersion) : options.longs === Number ? new $util.LongBits(message.p2pVersion.low >>> 0, message.p2pVersion.high >>> 0).toNumber(true) : message.p2pVersion; + return object; + }; + + /** + * Converts this RequestInfo to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestInfo + * @instance + * @returns {Object.} JSON object + */ + RequestInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestInfo; + })(abci.RequestInfo || {}); + + abci.RequestSetOption = (function(RequestSetOption) { + + /** + * Properties of a RequestSetOption. + * @memberof tendermint.abci + * @interface IRequestSetOption + * @property {string|null} [key] RequestSetOption key + * @property {string|null} [value] RequestSetOption value + */ + + /** + * Constructs a new RequestSetOption. + * @memberof tendermint.abci + * @classdesc Represents a RequestSetOption. + * @implements IRequestSetOption + * @constructor + * @param {tendermint.abci.IRequestSetOption=} [properties] Properties to set + */ + function RequestSetOption(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestSetOption key. + * @member {string} key + * @memberof tendermint.abci.RequestSetOption + * @instance + */ + RequestSetOption.prototype.key = ""; + + /** + * RequestSetOption value. + * @member {string} value + * @memberof tendermint.abci.RequestSetOption + * @instance + */ + RequestSetOption.prototype.value = ""; + + /** + * Creates a new RequestSetOption instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestSetOption + * @static + * @param {tendermint.abci.IRequestSetOption=} [properties] Properties to set + * @returns {tendermint.abci.RequestSetOption} RequestSetOption instance + */ + RequestSetOption.create = function create(properties) { + return new RequestSetOption(properties); + }; + + /** + * Encodes the specified RequestSetOption message. Does not implicitly {@link tendermint.abci.RequestSetOption.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestSetOption + * @static + * @param {tendermint.abci.IRequestSetOption} message RequestSetOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestSetOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + return writer; + }; + + /** + * Encodes the specified RequestSetOption message, length delimited. Does not implicitly {@link tendermint.abci.RequestSetOption.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestSetOption + * @static + * @param {tendermint.abci.IRequestSetOption} message RequestSetOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestSetOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestSetOption message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestSetOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestSetOption} RequestSetOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestSetOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestSetOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestSetOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestSetOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestSetOption} RequestSetOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestSetOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestSetOption message. + * @function verify + * @memberof tendermint.abci.RequestSetOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestSetOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a RequestSetOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestSetOption + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestSetOption} RequestSetOption + */ + RequestSetOption.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestSetOption) + return object; + var message = new $root.tendermint.abci.RequestSetOption(); + if (object.key != null) + message.key = String(object.key); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a RequestSetOption message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestSetOption + * @static + * @param {tendermint.abci.RequestSetOption} message RequestSetOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestSetOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.key = ""; + object.value = ""; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this RequestSetOption to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestSetOption + * @instance + * @returns {Object.} JSON object + */ + RequestSetOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestSetOption; + })(abci.RequestSetOption || {}); + + abci.RequestInitChain = (function(RequestInitChain) { + + /** + * Properties of a RequestInitChain. + * @memberof tendermint.abci + * @interface IRequestInitChain + * @property {google.protobuf.ITimestamp|null} [time] RequestInitChain time + * @property {string|null} [chainId] RequestInitChain chainId + * @property {tendermint.abci.IConsensusParams|null} [consensusParams] RequestInitChain consensusParams + * @property {Array.|null} [validators] RequestInitChain validators + * @property {Uint8Array|null} [appStateBytes] RequestInitChain appStateBytes + * @property {number|Long|null} [initialHeight] RequestInitChain initialHeight + */ + + /** + * Constructs a new RequestInitChain. + * @memberof tendermint.abci + * @classdesc Represents a RequestInitChain. + * @implements IRequestInitChain + * @constructor + * @param {tendermint.abci.IRequestInitChain=} [properties] Properties to set + */ + function RequestInitChain(properties) { + this.validators = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestInitChain time. + * @member {google.protobuf.ITimestamp|null|undefined} time + * @memberof tendermint.abci.RequestInitChain + * @instance + */ + RequestInitChain.prototype.time = null; + + /** + * RequestInitChain chainId. + * @member {string} chainId + * @memberof tendermint.abci.RequestInitChain + * @instance + */ + RequestInitChain.prototype.chainId = ""; + + /** + * RequestInitChain consensusParams. + * @member {tendermint.abci.IConsensusParams|null|undefined} consensusParams + * @memberof tendermint.abci.RequestInitChain + * @instance + */ + RequestInitChain.prototype.consensusParams = null; + + /** + * RequestInitChain validators. + * @member {Array.} validators + * @memberof tendermint.abci.RequestInitChain + * @instance + */ + RequestInitChain.prototype.validators = $util.emptyArray; + + /** + * RequestInitChain appStateBytes. + * @member {Uint8Array} appStateBytes + * @memberof tendermint.abci.RequestInitChain + * @instance + */ + RequestInitChain.prototype.appStateBytes = $util.newBuffer([]); + + /** + * RequestInitChain initialHeight. + * @member {number|Long} initialHeight + * @memberof tendermint.abci.RequestInitChain + * @instance + */ + RequestInitChain.prototype.initialHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RequestInitChain instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestInitChain + * @static + * @param {tendermint.abci.IRequestInitChain=} [properties] Properties to set + * @returns {tendermint.abci.RequestInitChain} RequestInitChain instance + */ + RequestInitChain.create = function create(properties) { + return new RequestInitChain(properties); + }; + + /** + * Encodes the specified RequestInitChain message. Does not implicitly {@link tendermint.abci.RequestInitChain.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestInitChain + * @static + * @param {tendermint.abci.IRequestInitChain} message RequestInitChain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestInitChain.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.time != null && Object.hasOwnProperty.call(message, "time")) + $root.google.protobuf.Timestamp.encode(message.time, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.chainId != null && Object.hasOwnProperty.call(message, "chainId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.chainId); + if (message.consensusParams != null && Object.hasOwnProperty.call(message, "consensusParams")) + $root.tendermint.abci.ConsensusParams.encode(message.consensusParams, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.validators != null && message.validators.length) + for (var i = 0; i < message.validators.length; ++i) + $root.tendermint.abci.ValidatorUpdate.encode(message.validators[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.appStateBytes != null && Object.hasOwnProperty.call(message, "appStateBytes")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.appStateBytes); + if (message.initialHeight != null && Object.hasOwnProperty.call(message, "initialHeight")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.initialHeight); + return writer; + }; + + /** + * Encodes the specified RequestInitChain message, length delimited. Does not implicitly {@link tendermint.abci.RequestInitChain.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestInitChain + * @static + * @param {tendermint.abci.IRequestInitChain} message RequestInitChain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestInitChain.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestInitChain message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestInitChain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestInitChain} RequestInitChain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestInitChain.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestInitChain(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 2: + message.chainId = reader.string(); + break; + case 3: + message.consensusParams = $root.tendermint.abci.ConsensusParams.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.validators && message.validators.length)) + message.validators = []; + message.validators.push($root.tendermint.abci.ValidatorUpdate.decode(reader, reader.uint32())); + break; + case 5: + message.appStateBytes = reader.bytes(); + break; + case 6: + message.initialHeight = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestInitChain message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestInitChain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestInitChain} RequestInitChain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestInitChain.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestInitChain message. + * @function verify + * @memberof tendermint.abci.RequestInitChain + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestInitChain.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.time != null && message.hasOwnProperty("time")) { + var error = $root.google.protobuf.Timestamp.verify(message.time); + if (error) + return "time." + error; + } + if (message.chainId != null && message.hasOwnProperty("chainId")) + if (!$util.isString(message.chainId)) + return "chainId: string expected"; + if (message.consensusParams != null && message.hasOwnProperty("consensusParams")) { + var error = $root.tendermint.abci.ConsensusParams.verify(message.consensusParams); + if (error) + return "consensusParams." + error; + } + if (message.validators != null && message.hasOwnProperty("validators")) { + if (!Array.isArray(message.validators)) + return "validators: array expected"; + for (var i = 0; i < message.validators.length; ++i) { + var error = $root.tendermint.abci.ValidatorUpdate.verify(message.validators[i]); + if (error) + return "validators." + error; + } + } + if (message.appStateBytes != null && message.hasOwnProperty("appStateBytes")) + if (!(message.appStateBytes && typeof message.appStateBytes.length === "number" || $util.isString(message.appStateBytes))) + return "appStateBytes: buffer expected"; + if (message.initialHeight != null && message.hasOwnProperty("initialHeight")) + if (!$util.isInteger(message.initialHeight) && !(message.initialHeight && $util.isInteger(message.initialHeight.low) && $util.isInteger(message.initialHeight.high))) + return "initialHeight: integer|Long expected"; + return null; + }; + + /** + * Creates a RequestInitChain message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestInitChain + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestInitChain} RequestInitChain + */ + RequestInitChain.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestInitChain) + return object; + var message = new $root.tendermint.abci.RequestInitChain(); + if (object.time != null) { + if (typeof object.time !== "object") + throw TypeError(".tendermint.abci.RequestInitChain.time: object expected"); + message.time = $root.google.protobuf.Timestamp.fromObject(object.time); + } + if (object.chainId != null) + message.chainId = String(object.chainId); + if (object.consensusParams != null) { + if (typeof object.consensusParams !== "object") + throw TypeError(".tendermint.abci.RequestInitChain.consensusParams: object expected"); + message.consensusParams = $root.tendermint.abci.ConsensusParams.fromObject(object.consensusParams); + } + if (object.validators) { + if (!Array.isArray(object.validators)) + throw TypeError(".tendermint.abci.RequestInitChain.validators: array expected"); + message.validators = []; + for (var i = 0; i < object.validators.length; ++i) { + if (typeof object.validators[i] !== "object") + throw TypeError(".tendermint.abci.RequestInitChain.validators: object expected"); + message.validators[i] = $root.tendermint.abci.ValidatorUpdate.fromObject(object.validators[i]); + } + } + if (object.appStateBytes != null) + if (typeof object.appStateBytes === "string") + $util.base64.decode(object.appStateBytes, message.appStateBytes = $util.newBuffer($util.base64.length(object.appStateBytes)), 0); + else if (object.appStateBytes.length) + message.appStateBytes = object.appStateBytes; + if (object.initialHeight != null) + if ($util.Long) + (message.initialHeight = $util.Long.fromValue(object.initialHeight)).unsigned = false; + else if (typeof object.initialHeight === "string") + message.initialHeight = parseInt(object.initialHeight, 10); + else if (typeof object.initialHeight === "number") + message.initialHeight = object.initialHeight; + else if (typeof object.initialHeight === "object") + message.initialHeight = new $util.LongBits(object.initialHeight.low >>> 0, object.initialHeight.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a RequestInitChain message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestInitChain + * @static + * @param {tendermint.abci.RequestInitChain} message RequestInitChain + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestInitChain.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.validators = []; + if (options.defaults) { + object.time = null; + object.chainId = ""; + object.consensusParams = null; + if (options.bytes === String) + object.appStateBytes = ""; + else { + object.appStateBytes = []; + if (options.bytes !== Array) + object.appStateBytes = $util.newBuffer(object.appStateBytes); + } + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.initialHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.initialHeight = options.longs === String ? "0" : 0; + } + if (message.time != null && message.hasOwnProperty("time")) + object.time = $root.google.protobuf.Timestamp.toObject(message.time, options); + if (message.chainId != null && message.hasOwnProperty("chainId")) + object.chainId = message.chainId; + if (message.consensusParams != null && message.hasOwnProperty("consensusParams")) + object.consensusParams = $root.tendermint.abci.ConsensusParams.toObject(message.consensusParams, options); + if (message.validators && message.validators.length) { + object.validators = []; + for (var j = 0; j < message.validators.length; ++j) + object.validators[j] = $root.tendermint.abci.ValidatorUpdate.toObject(message.validators[j], options); + } + if (message.appStateBytes != null && message.hasOwnProperty("appStateBytes")) + object.appStateBytes = options.bytes === String ? $util.base64.encode(message.appStateBytes, 0, message.appStateBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.appStateBytes) : message.appStateBytes; + if (message.initialHeight != null && message.hasOwnProperty("initialHeight")) + if (typeof message.initialHeight === "number") + object.initialHeight = options.longs === String ? String(message.initialHeight) : message.initialHeight; + else + object.initialHeight = options.longs === String ? $util.Long.prototype.toString.call(message.initialHeight) : options.longs === Number ? new $util.LongBits(message.initialHeight.low >>> 0, message.initialHeight.high >>> 0).toNumber() : message.initialHeight; + return object; + }; + + /** + * Converts this RequestInitChain to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestInitChain + * @instance + * @returns {Object.} JSON object + */ + RequestInitChain.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestInitChain; + })(abci.RequestInitChain || {}); + + abci.RequestQuery = (function(RequestQuery) { + + /** + * Properties of a RequestQuery. + * @memberof tendermint.abci + * @interface IRequestQuery + * @property {Uint8Array|null} [data] RequestQuery data + * @property {string|null} [path] RequestQuery path + * @property {number|Long|null} [height] RequestQuery height + * @property {boolean|null} [prove] RequestQuery prove + */ + + /** + * Constructs a new RequestQuery. + * @memberof tendermint.abci + * @classdesc Represents a RequestQuery. + * @implements IRequestQuery + * @constructor + * @param {tendermint.abci.IRequestQuery=} [properties] Properties to set + */ + function RequestQuery(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestQuery data. + * @member {Uint8Array} data + * @memberof tendermint.abci.RequestQuery + * @instance + */ + RequestQuery.prototype.data = $util.newBuffer([]); + + /** + * RequestQuery path. + * @member {string} path + * @memberof tendermint.abci.RequestQuery + * @instance + */ + RequestQuery.prototype.path = ""; + + /** + * RequestQuery height. + * @member {number|Long} height + * @memberof tendermint.abci.RequestQuery + * @instance + */ + RequestQuery.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * RequestQuery prove. + * @member {boolean} prove + * @memberof tendermint.abci.RequestQuery + * @instance + */ + RequestQuery.prototype.prove = false; + + /** + * Creates a new RequestQuery instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestQuery + * @static + * @param {tendermint.abci.IRequestQuery=} [properties] Properties to set + * @returns {tendermint.abci.RequestQuery} RequestQuery instance + */ + RequestQuery.create = function create(properties) { + return new RequestQuery(properties); + }; + + /** + * Encodes the specified RequestQuery message. Does not implicitly {@link tendermint.abci.RequestQuery.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestQuery + * @static + * @param {tendermint.abci.IRequestQuery} message RequestQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestQuery.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.data); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.height); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified RequestQuery message, length delimited. Does not implicitly {@link tendermint.abci.RequestQuery.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestQuery + * @static + * @param {tendermint.abci.IRequestQuery} message RequestQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestQuery.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestQuery message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestQuery} RequestQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestQuery.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestQuery(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + case 2: + message.path = reader.string(); + break; + case 3: + message.height = reader.int64(); + break; + case 4: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestQuery message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestQuery} RequestQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestQuery.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestQuery message. + * @function verify + * @memberof tendermint.abci.RequestQuery + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestQuery.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a RequestQuery message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestQuery + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestQuery} RequestQuery + */ + RequestQuery.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestQuery) + return object; + var message = new $root.tendermint.abci.RequestQuery(); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length) + message.data = object.data; + if (object.path != null) + message.path = String(object.path); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a RequestQuery message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestQuery + * @static + * @param {tendermint.abci.RequestQuery} message RequestQuery + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestQuery.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + object.path = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.prove = false; + } + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this RequestQuery to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestQuery + * @instance + * @returns {Object.} JSON object + */ + RequestQuery.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestQuery; + })(abci.RequestQuery || {}); + + abci.RequestBeginBlock = (function(RequestBeginBlock) { + + /** + * Properties of a RequestBeginBlock. + * @memberof tendermint.abci + * @interface IRequestBeginBlock + * @property {Uint8Array|null} [hash] RequestBeginBlock hash + * @property {tendermint.types.IHeader|null} [header] RequestBeginBlock header + * @property {tendermint.abci.ILastCommitInfo|null} [lastCommitInfo] RequestBeginBlock lastCommitInfo + * @property {Array.|null} [byzantineValidators] RequestBeginBlock byzantineValidators + */ + + /** + * Constructs a new RequestBeginBlock. + * @memberof tendermint.abci + * @classdesc Represents a RequestBeginBlock. + * @implements IRequestBeginBlock + * @constructor + * @param {tendermint.abci.IRequestBeginBlock=} [properties] Properties to set + */ + function RequestBeginBlock(properties) { + this.byzantineValidators = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestBeginBlock hash. + * @member {Uint8Array} hash + * @memberof tendermint.abci.RequestBeginBlock + * @instance + */ + RequestBeginBlock.prototype.hash = $util.newBuffer([]); + + /** + * RequestBeginBlock header. + * @member {tendermint.types.IHeader|null|undefined} header + * @memberof tendermint.abci.RequestBeginBlock + * @instance + */ + RequestBeginBlock.prototype.header = null; + + /** + * RequestBeginBlock lastCommitInfo. + * @member {tendermint.abci.ILastCommitInfo|null|undefined} lastCommitInfo + * @memberof tendermint.abci.RequestBeginBlock + * @instance + */ + RequestBeginBlock.prototype.lastCommitInfo = null; + + /** + * RequestBeginBlock byzantineValidators. + * @member {Array.} byzantineValidators + * @memberof tendermint.abci.RequestBeginBlock + * @instance + */ + RequestBeginBlock.prototype.byzantineValidators = $util.emptyArray; + + /** + * Creates a new RequestBeginBlock instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestBeginBlock + * @static + * @param {tendermint.abci.IRequestBeginBlock=} [properties] Properties to set + * @returns {tendermint.abci.RequestBeginBlock} RequestBeginBlock instance + */ + RequestBeginBlock.create = function create(properties) { + return new RequestBeginBlock(properties); + }; + + /** + * Encodes the specified RequestBeginBlock message. Does not implicitly {@link tendermint.abci.RequestBeginBlock.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestBeginBlock + * @static + * @param {tendermint.abci.IRequestBeginBlock} message RequestBeginBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestBeginBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.hash); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + $root.tendermint.types.Header.encode(message.header, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.lastCommitInfo != null && Object.hasOwnProperty.call(message, "lastCommitInfo")) + $root.tendermint.abci.LastCommitInfo.encode(message.lastCommitInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.byzantineValidators != null && message.byzantineValidators.length) + for (var i = 0; i < message.byzantineValidators.length; ++i) + $root.tendermint.abci.Evidence.encode(message.byzantineValidators[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RequestBeginBlock message, length delimited. Does not implicitly {@link tendermint.abci.RequestBeginBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestBeginBlock + * @static + * @param {tendermint.abci.IRequestBeginBlock} message RequestBeginBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestBeginBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestBeginBlock message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestBeginBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestBeginBlock} RequestBeginBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestBeginBlock.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestBeginBlock(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.bytes(); + break; + case 2: + message.header = $root.tendermint.types.Header.decode(reader, reader.uint32()); + break; + case 3: + message.lastCommitInfo = $root.tendermint.abci.LastCommitInfo.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.byzantineValidators && message.byzantineValidators.length)) + message.byzantineValidators = []; + message.byzantineValidators.push($root.tendermint.abci.Evidence.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestBeginBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestBeginBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestBeginBlock} RequestBeginBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestBeginBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestBeginBlock message. + * @function verify + * @memberof tendermint.abci.RequestBeginBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestBeginBlock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash))) + return "hash: buffer expected"; + if (message.header != null && message.hasOwnProperty("header")) { + var error = $root.tendermint.types.Header.verify(message.header); + if (error) + return "header." + error; + } + if (message.lastCommitInfo != null && message.hasOwnProperty("lastCommitInfo")) { + var error = $root.tendermint.abci.LastCommitInfo.verify(message.lastCommitInfo); + if (error) + return "lastCommitInfo." + error; + } + if (message.byzantineValidators != null && message.hasOwnProperty("byzantineValidators")) { + if (!Array.isArray(message.byzantineValidators)) + return "byzantineValidators: array expected"; + for (var i = 0; i < message.byzantineValidators.length; ++i) { + var error = $root.tendermint.abci.Evidence.verify(message.byzantineValidators[i]); + if (error) + return "byzantineValidators." + error; + } + } + return null; + }; + + /** + * Creates a RequestBeginBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestBeginBlock + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestBeginBlock} RequestBeginBlock + */ + RequestBeginBlock.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestBeginBlock) + return object; + var message = new $root.tendermint.abci.RequestBeginBlock(); + if (object.hash != null) + if (typeof object.hash === "string") + $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0); + else if (object.hash.length) + message.hash = object.hash; + if (object.header != null) { + if (typeof object.header !== "object") + throw TypeError(".tendermint.abci.RequestBeginBlock.header: object expected"); + message.header = $root.tendermint.types.Header.fromObject(object.header); + } + if (object.lastCommitInfo != null) { + if (typeof object.lastCommitInfo !== "object") + throw TypeError(".tendermint.abci.RequestBeginBlock.lastCommitInfo: object expected"); + message.lastCommitInfo = $root.tendermint.abci.LastCommitInfo.fromObject(object.lastCommitInfo); + } + if (object.byzantineValidators) { + if (!Array.isArray(object.byzantineValidators)) + throw TypeError(".tendermint.abci.RequestBeginBlock.byzantineValidators: array expected"); + message.byzantineValidators = []; + for (var i = 0; i < object.byzantineValidators.length; ++i) { + if (typeof object.byzantineValidators[i] !== "object") + throw TypeError(".tendermint.abci.RequestBeginBlock.byzantineValidators: object expected"); + message.byzantineValidators[i] = $root.tendermint.abci.Evidence.fromObject(object.byzantineValidators[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RequestBeginBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestBeginBlock + * @static + * @param {tendermint.abci.RequestBeginBlock} message RequestBeginBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestBeginBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.byzantineValidators = []; + if (options.defaults) { + if (options.bytes === String) + object.hash = ""; + else { + object.hash = []; + if (options.bytes !== Array) + object.hash = $util.newBuffer(object.hash); + } + object.header = null; + object.lastCommitInfo = null; + } + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash; + if (message.header != null && message.hasOwnProperty("header")) + object.header = $root.tendermint.types.Header.toObject(message.header, options); + if (message.lastCommitInfo != null && message.hasOwnProperty("lastCommitInfo")) + object.lastCommitInfo = $root.tendermint.abci.LastCommitInfo.toObject(message.lastCommitInfo, options); + if (message.byzantineValidators && message.byzantineValidators.length) { + object.byzantineValidators = []; + for (var j = 0; j < message.byzantineValidators.length; ++j) + object.byzantineValidators[j] = $root.tendermint.abci.Evidence.toObject(message.byzantineValidators[j], options); + } + return object; + }; + + /** + * Converts this RequestBeginBlock to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestBeginBlock + * @instance + * @returns {Object.} JSON object + */ + RequestBeginBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestBeginBlock; + })(abci.RequestBeginBlock || {}); + + /** + * CheckTxType enum. + * @name tendermint.abci.CheckTxType + * @enum {string} + * @property {number} NEW=0 NEW value + * @property {number} RECHECK=1 RECHECK value + */ + abci.CheckTxType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NEW"] = 0; + values[valuesById[1] = "RECHECK"] = 1; + return values; + })(); + + abci.RequestCheckTx = (function(RequestCheckTx) { + + /** + * Properties of a RequestCheckTx. + * @memberof tendermint.abci + * @interface IRequestCheckTx + * @property {Uint8Array|null} [tx] RequestCheckTx tx + * @property {tendermint.abci.CheckTxType|null} [type] RequestCheckTx type + */ + + /** + * Constructs a new RequestCheckTx. + * @memberof tendermint.abci + * @classdesc Represents a RequestCheckTx. + * @implements IRequestCheckTx + * @constructor + * @param {tendermint.abci.IRequestCheckTx=} [properties] Properties to set + */ + function RequestCheckTx(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestCheckTx tx. + * @member {Uint8Array} tx + * @memberof tendermint.abci.RequestCheckTx + * @instance + */ + RequestCheckTx.prototype.tx = $util.newBuffer([]); + + /** + * RequestCheckTx type. + * @member {tendermint.abci.CheckTxType} type + * @memberof tendermint.abci.RequestCheckTx + * @instance + */ + RequestCheckTx.prototype.type = 0; + + /** + * Creates a new RequestCheckTx instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestCheckTx + * @static + * @param {tendermint.abci.IRequestCheckTx=} [properties] Properties to set + * @returns {tendermint.abci.RequestCheckTx} RequestCheckTx instance + */ + RequestCheckTx.create = function create(properties) { + return new RequestCheckTx(properties); + }; + + /** + * Encodes the specified RequestCheckTx message. Does not implicitly {@link tendermint.abci.RequestCheckTx.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestCheckTx + * @static + * @param {tendermint.abci.IRequestCheckTx} message RequestCheckTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestCheckTx.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tx != null && Object.hasOwnProperty.call(message, "tx")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tx); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + return writer; + }; + + /** + * Encodes the specified RequestCheckTx message, length delimited. Does not implicitly {@link tendermint.abci.RequestCheckTx.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestCheckTx + * @static + * @param {tendermint.abci.IRequestCheckTx} message RequestCheckTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestCheckTx.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestCheckTx message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestCheckTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestCheckTx} RequestCheckTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestCheckTx.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestCheckTx(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = reader.bytes(); + break; + case 2: + message.type = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestCheckTx message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestCheckTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestCheckTx} RequestCheckTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestCheckTx.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestCheckTx message. + * @function verify + * @memberof tendermint.abci.RequestCheckTx + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestCheckTx.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tx != null && message.hasOwnProperty("tx")) + if (!(message.tx && typeof message.tx.length === "number" || $util.isString(message.tx))) + return "tx: buffer expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a RequestCheckTx message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestCheckTx + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestCheckTx} RequestCheckTx + */ + RequestCheckTx.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestCheckTx) + return object; + var message = new $root.tendermint.abci.RequestCheckTx(); + if (object.tx != null) + if (typeof object.tx === "string") + $util.base64.decode(object.tx, message.tx = $util.newBuffer($util.base64.length(object.tx)), 0); + else if (object.tx.length) + message.tx = object.tx; + switch (object.type) { + case "NEW": + case 0: + message.type = 0; + break; + case "RECHECK": + case 1: + message.type = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a RequestCheckTx message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestCheckTx + * @static + * @param {tendermint.abci.RequestCheckTx} message RequestCheckTx + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestCheckTx.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.tx = ""; + else { + object.tx = []; + if (options.bytes !== Array) + object.tx = $util.newBuffer(object.tx); + } + object.type = options.enums === String ? "NEW" : 0; + } + if (message.tx != null && message.hasOwnProperty("tx")) + object.tx = options.bytes === String ? $util.base64.encode(message.tx, 0, message.tx.length) : options.bytes === Array ? Array.prototype.slice.call(message.tx) : message.tx; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.tendermint.abci.CheckTxType[message.type] : message.type; + return object; + }; + + /** + * Converts this RequestCheckTx to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestCheckTx + * @instance + * @returns {Object.} JSON object + */ + RequestCheckTx.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestCheckTx; + })(abci.RequestCheckTx || {}); + + abci.RequestDeliverTx = (function(RequestDeliverTx) { + + /** + * Properties of a RequestDeliverTx. + * @memberof tendermint.abci + * @interface IRequestDeliverTx + * @property {Uint8Array|null} [tx] RequestDeliverTx tx + */ + + /** + * Constructs a new RequestDeliverTx. + * @memberof tendermint.abci + * @classdesc Represents a RequestDeliverTx. + * @implements IRequestDeliverTx + * @constructor + * @param {tendermint.abci.IRequestDeliverTx=} [properties] Properties to set + */ + function RequestDeliverTx(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestDeliverTx tx. + * @member {Uint8Array} tx + * @memberof tendermint.abci.RequestDeliverTx + * @instance + */ + RequestDeliverTx.prototype.tx = $util.newBuffer([]); + + /** + * Creates a new RequestDeliverTx instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestDeliverTx + * @static + * @param {tendermint.abci.IRequestDeliverTx=} [properties] Properties to set + * @returns {tendermint.abci.RequestDeliverTx} RequestDeliverTx instance + */ + RequestDeliverTx.create = function create(properties) { + return new RequestDeliverTx(properties); + }; + + /** + * Encodes the specified RequestDeliverTx message. Does not implicitly {@link tendermint.abci.RequestDeliverTx.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestDeliverTx + * @static + * @param {tendermint.abci.IRequestDeliverTx} message RequestDeliverTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestDeliverTx.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tx != null && Object.hasOwnProperty.call(message, "tx")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tx); + return writer; + }; + + /** + * Encodes the specified RequestDeliverTx message, length delimited. Does not implicitly {@link tendermint.abci.RequestDeliverTx.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestDeliverTx + * @static + * @param {tendermint.abci.IRequestDeliverTx} message RequestDeliverTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestDeliverTx.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestDeliverTx message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestDeliverTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestDeliverTx} RequestDeliverTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestDeliverTx.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestDeliverTx(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestDeliverTx message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestDeliverTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestDeliverTx} RequestDeliverTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestDeliverTx.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestDeliverTx message. + * @function verify + * @memberof tendermint.abci.RequestDeliverTx + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestDeliverTx.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tx != null && message.hasOwnProperty("tx")) + if (!(message.tx && typeof message.tx.length === "number" || $util.isString(message.tx))) + return "tx: buffer expected"; + return null; + }; + + /** + * Creates a RequestDeliverTx message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestDeliverTx + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestDeliverTx} RequestDeliverTx + */ + RequestDeliverTx.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestDeliverTx) + return object; + var message = new $root.tendermint.abci.RequestDeliverTx(); + if (object.tx != null) + if (typeof object.tx === "string") + $util.base64.decode(object.tx, message.tx = $util.newBuffer($util.base64.length(object.tx)), 0); + else if (object.tx.length) + message.tx = object.tx; + return message; + }; + + /** + * Creates a plain object from a RequestDeliverTx message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestDeliverTx + * @static + * @param {tendermint.abci.RequestDeliverTx} message RequestDeliverTx + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestDeliverTx.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.tx = ""; + else { + object.tx = []; + if (options.bytes !== Array) + object.tx = $util.newBuffer(object.tx); + } + if (message.tx != null && message.hasOwnProperty("tx")) + object.tx = options.bytes === String ? $util.base64.encode(message.tx, 0, message.tx.length) : options.bytes === Array ? Array.prototype.slice.call(message.tx) : message.tx; + return object; + }; + + /** + * Converts this RequestDeliverTx to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestDeliverTx + * @instance + * @returns {Object.} JSON object + */ + RequestDeliverTx.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestDeliverTx; + })(abci.RequestDeliverTx || {}); + + abci.RequestEndBlock = (function(RequestEndBlock) { + + /** + * Properties of a RequestEndBlock. + * @memberof tendermint.abci + * @interface IRequestEndBlock + * @property {number|Long|null} [height] RequestEndBlock height + */ + + /** + * Constructs a new RequestEndBlock. + * @memberof tendermint.abci + * @classdesc Represents a RequestEndBlock. + * @implements IRequestEndBlock + * @constructor + * @param {tendermint.abci.IRequestEndBlock=} [properties] Properties to set + */ + function RequestEndBlock(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestEndBlock height. + * @member {number|Long} height + * @memberof tendermint.abci.RequestEndBlock + * @instance + */ + RequestEndBlock.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RequestEndBlock instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestEndBlock + * @static + * @param {tendermint.abci.IRequestEndBlock=} [properties] Properties to set + * @returns {tendermint.abci.RequestEndBlock} RequestEndBlock instance + */ + RequestEndBlock.create = function create(properties) { + return new RequestEndBlock(properties); + }; + + /** + * Encodes the specified RequestEndBlock message. Does not implicitly {@link tendermint.abci.RequestEndBlock.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestEndBlock + * @static + * @param {tendermint.abci.IRequestEndBlock} message RequestEndBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestEndBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.height); + return writer; + }; + + /** + * Encodes the specified RequestEndBlock message, length delimited. Does not implicitly {@link tendermint.abci.RequestEndBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestEndBlock + * @static + * @param {tendermint.abci.IRequestEndBlock} message RequestEndBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestEndBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestEndBlock message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestEndBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestEndBlock} RequestEndBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestEndBlock.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestEndBlock(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestEndBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestEndBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestEndBlock} RequestEndBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestEndBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestEndBlock message. + * @function verify + * @memberof tendermint.abci.RequestEndBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestEndBlock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + return null; + }; + + /** + * Creates a RequestEndBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestEndBlock + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestEndBlock} RequestEndBlock + */ + RequestEndBlock.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestEndBlock) + return object; + var message = new $root.tendermint.abci.RequestEndBlock(); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a RequestEndBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestEndBlock + * @static + * @param {tendermint.abci.RequestEndBlock} message RequestEndBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestEndBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + return object; + }; + + /** + * Converts this RequestEndBlock to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestEndBlock + * @instance + * @returns {Object.} JSON object + */ + RequestEndBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestEndBlock; + })(abci.RequestEndBlock || {}); + + abci.RequestCommit = (function(RequestCommit) { + + /** + * Properties of a RequestCommit. + * @memberof tendermint.abci + * @interface IRequestCommit + */ + + /** + * Constructs a new RequestCommit. + * @memberof tendermint.abci + * @classdesc Represents a RequestCommit. + * @implements IRequestCommit + * @constructor + * @param {tendermint.abci.IRequestCommit=} [properties] Properties to set + */ + function RequestCommit(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new RequestCommit instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestCommit + * @static + * @param {tendermint.abci.IRequestCommit=} [properties] Properties to set + * @returns {tendermint.abci.RequestCommit} RequestCommit instance + */ + RequestCommit.create = function create(properties) { + return new RequestCommit(properties); + }; + + /** + * Encodes the specified RequestCommit message. Does not implicitly {@link tendermint.abci.RequestCommit.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestCommit + * @static + * @param {tendermint.abci.IRequestCommit} message RequestCommit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestCommit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RequestCommit message, length delimited. Does not implicitly {@link tendermint.abci.RequestCommit.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestCommit + * @static + * @param {tendermint.abci.IRequestCommit} message RequestCommit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestCommit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestCommit message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestCommit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestCommit} RequestCommit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestCommit.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestCommit(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestCommit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestCommit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestCommit} RequestCommit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestCommit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestCommit message. + * @function verify + * @memberof tendermint.abci.RequestCommit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestCommit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RequestCommit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestCommit + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestCommit} RequestCommit + */ + RequestCommit.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestCommit) + return object; + return new $root.tendermint.abci.RequestCommit(); + }; + + /** + * Creates a plain object from a RequestCommit message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestCommit + * @static + * @param {tendermint.abci.RequestCommit} message RequestCommit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestCommit.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RequestCommit to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestCommit + * @instance + * @returns {Object.} JSON object + */ + RequestCommit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestCommit; + })(abci.RequestCommit || {}); + + abci.RequestListSnapshots = (function(RequestListSnapshots) { + + /** + * Properties of a RequestListSnapshots. + * @memberof tendermint.abci + * @interface IRequestListSnapshots + */ + + /** + * Constructs a new RequestListSnapshots. + * @memberof tendermint.abci + * @classdesc Represents a RequestListSnapshots. + * @implements IRequestListSnapshots + * @constructor + * @param {tendermint.abci.IRequestListSnapshots=} [properties] Properties to set + */ + function RequestListSnapshots(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new RequestListSnapshots instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestListSnapshots + * @static + * @param {tendermint.abci.IRequestListSnapshots=} [properties] Properties to set + * @returns {tendermint.abci.RequestListSnapshots} RequestListSnapshots instance + */ + RequestListSnapshots.create = function create(properties) { + return new RequestListSnapshots(properties); + }; + + /** + * Encodes the specified RequestListSnapshots message. Does not implicitly {@link tendermint.abci.RequestListSnapshots.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestListSnapshots + * @static + * @param {tendermint.abci.IRequestListSnapshots} message RequestListSnapshots message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestListSnapshots.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RequestListSnapshots message, length delimited. Does not implicitly {@link tendermint.abci.RequestListSnapshots.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestListSnapshots + * @static + * @param {tendermint.abci.IRequestListSnapshots} message RequestListSnapshots message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestListSnapshots.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestListSnapshots message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestListSnapshots + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestListSnapshots} RequestListSnapshots + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestListSnapshots.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestListSnapshots(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestListSnapshots message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestListSnapshots + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestListSnapshots} RequestListSnapshots + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestListSnapshots.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestListSnapshots message. + * @function verify + * @memberof tendermint.abci.RequestListSnapshots + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestListSnapshots.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RequestListSnapshots message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestListSnapshots + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestListSnapshots} RequestListSnapshots + */ + RequestListSnapshots.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestListSnapshots) + return object; + return new $root.tendermint.abci.RequestListSnapshots(); + }; + + /** + * Creates a plain object from a RequestListSnapshots message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestListSnapshots + * @static + * @param {tendermint.abci.RequestListSnapshots} message RequestListSnapshots + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestListSnapshots.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RequestListSnapshots to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestListSnapshots + * @instance + * @returns {Object.} JSON object + */ + RequestListSnapshots.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestListSnapshots; + })(abci.RequestListSnapshots || {}); + + abci.RequestOfferSnapshot = (function(RequestOfferSnapshot) { + + /** + * Properties of a RequestOfferSnapshot. + * @memberof tendermint.abci + * @interface IRequestOfferSnapshot + * @property {tendermint.abci.ISnapshot|null} [snapshot] RequestOfferSnapshot snapshot + * @property {Uint8Array|null} [appHash] RequestOfferSnapshot appHash + */ + + /** + * Constructs a new RequestOfferSnapshot. + * @memberof tendermint.abci + * @classdesc Represents a RequestOfferSnapshot. + * @implements IRequestOfferSnapshot + * @constructor + * @param {tendermint.abci.IRequestOfferSnapshot=} [properties] Properties to set + */ + function RequestOfferSnapshot(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestOfferSnapshot snapshot. + * @member {tendermint.abci.ISnapshot|null|undefined} snapshot + * @memberof tendermint.abci.RequestOfferSnapshot + * @instance + */ + RequestOfferSnapshot.prototype.snapshot = null; + + /** + * RequestOfferSnapshot appHash. + * @member {Uint8Array} appHash + * @memberof tendermint.abci.RequestOfferSnapshot + * @instance + */ + RequestOfferSnapshot.prototype.appHash = $util.newBuffer([]); + + /** + * Creates a new RequestOfferSnapshot instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestOfferSnapshot + * @static + * @param {tendermint.abci.IRequestOfferSnapshot=} [properties] Properties to set + * @returns {tendermint.abci.RequestOfferSnapshot} RequestOfferSnapshot instance + */ + RequestOfferSnapshot.create = function create(properties) { + return new RequestOfferSnapshot(properties); + }; + + /** + * Encodes the specified RequestOfferSnapshot message. Does not implicitly {@link tendermint.abci.RequestOfferSnapshot.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestOfferSnapshot + * @static + * @param {tendermint.abci.IRequestOfferSnapshot} message RequestOfferSnapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestOfferSnapshot.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) + $root.tendermint.abci.Snapshot.encode(message.snapshot, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.appHash != null && Object.hasOwnProperty.call(message, "appHash")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.appHash); + return writer; + }; + + /** + * Encodes the specified RequestOfferSnapshot message, length delimited. Does not implicitly {@link tendermint.abci.RequestOfferSnapshot.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestOfferSnapshot + * @static + * @param {tendermint.abci.IRequestOfferSnapshot} message RequestOfferSnapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestOfferSnapshot.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestOfferSnapshot message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestOfferSnapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestOfferSnapshot} RequestOfferSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestOfferSnapshot.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestOfferSnapshot(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.snapshot = $root.tendermint.abci.Snapshot.decode(reader, reader.uint32()); + break; + case 2: + message.appHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestOfferSnapshot message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestOfferSnapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestOfferSnapshot} RequestOfferSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestOfferSnapshot.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestOfferSnapshot message. + * @function verify + * @memberof tendermint.abci.RequestOfferSnapshot + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestOfferSnapshot.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.snapshot != null && message.hasOwnProperty("snapshot")) { + var error = $root.tendermint.abci.Snapshot.verify(message.snapshot); + if (error) + return "snapshot." + error; + } + if (message.appHash != null && message.hasOwnProperty("appHash")) + if (!(message.appHash && typeof message.appHash.length === "number" || $util.isString(message.appHash))) + return "appHash: buffer expected"; + return null; + }; + + /** + * Creates a RequestOfferSnapshot message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestOfferSnapshot + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestOfferSnapshot} RequestOfferSnapshot + */ + RequestOfferSnapshot.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestOfferSnapshot) + return object; + var message = new $root.tendermint.abci.RequestOfferSnapshot(); + if (object.snapshot != null) { + if (typeof object.snapshot !== "object") + throw TypeError(".tendermint.abci.RequestOfferSnapshot.snapshot: object expected"); + message.snapshot = $root.tendermint.abci.Snapshot.fromObject(object.snapshot); + } + if (object.appHash != null) + if (typeof object.appHash === "string") + $util.base64.decode(object.appHash, message.appHash = $util.newBuffer($util.base64.length(object.appHash)), 0); + else if (object.appHash.length) + message.appHash = object.appHash; + return message; + }; + + /** + * Creates a plain object from a RequestOfferSnapshot message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestOfferSnapshot + * @static + * @param {tendermint.abci.RequestOfferSnapshot} message RequestOfferSnapshot + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestOfferSnapshot.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.snapshot = null; + if (options.bytes === String) + object.appHash = ""; + else { + object.appHash = []; + if (options.bytes !== Array) + object.appHash = $util.newBuffer(object.appHash); + } + } + if (message.snapshot != null && message.hasOwnProperty("snapshot")) + object.snapshot = $root.tendermint.abci.Snapshot.toObject(message.snapshot, options); + if (message.appHash != null && message.hasOwnProperty("appHash")) + object.appHash = options.bytes === String ? $util.base64.encode(message.appHash, 0, message.appHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.appHash) : message.appHash; + return object; + }; + + /** + * Converts this RequestOfferSnapshot to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestOfferSnapshot + * @instance + * @returns {Object.} JSON object + */ + RequestOfferSnapshot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestOfferSnapshot; + })(abci.RequestOfferSnapshot || {}); + + abci.RequestLoadSnapshotChunk = (function(RequestLoadSnapshotChunk) { + + /** + * Properties of a RequestLoadSnapshotChunk. + * @memberof tendermint.abci + * @interface IRequestLoadSnapshotChunk + * @property {number|Long|null} [height] RequestLoadSnapshotChunk height + * @property {number|null} [format] RequestLoadSnapshotChunk format + * @property {number|null} [chunk] RequestLoadSnapshotChunk chunk + */ + + /** + * Constructs a new RequestLoadSnapshotChunk. + * @memberof tendermint.abci + * @classdesc Represents a RequestLoadSnapshotChunk. + * @implements IRequestLoadSnapshotChunk + * @constructor + * @param {tendermint.abci.IRequestLoadSnapshotChunk=} [properties] Properties to set + */ + function RequestLoadSnapshotChunk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestLoadSnapshotChunk height. + * @member {number|Long} height + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @instance + */ + RequestLoadSnapshotChunk.prototype.height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * RequestLoadSnapshotChunk format. + * @member {number} format + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @instance + */ + RequestLoadSnapshotChunk.prototype.format = 0; + + /** + * RequestLoadSnapshotChunk chunk. + * @member {number} chunk + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @instance + */ + RequestLoadSnapshotChunk.prototype.chunk = 0; + + /** + * Creates a new RequestLoadSnapshotChunk instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @static + * @param {tendermint.abci.IRequestLoadSnapshotChunk=} [properties] Properties to set + * @returns {tendermint.abci.RequestLoadSnapshotChunk} RequestLoadSnapshotChunk instance + */ + RequestLoadSnapshotChunk.create = function create(properties) { + return new RequestLoadSnapshotChunk(properties); + }; + + /** + * Encodes the specified RequestLoadSnapshotChunk message. Does not implicitly {@link tendermint.abci.RequestLoadSnapshotChunk.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @static + * @param {tendermint.abci.IRequestLoadSnapshotChunk} message RequestLoadSnapshotChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestLoadSnapshotChunk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.height); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.format); + if (message.chunk != null && Object.hasOwnProperty.call(message, "chunk")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.chunk); + return writer; + }; + + /** + * Encodes the specified RequestLoadSnapshotChunk message, length delimited. Does not implicitly {@link tendermint.abci.RequestLoadSnapshotChunk.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @static + * @param {tendermint.abci.IRequestLoadSnapshotChunk} message RequestLoadSnapshotChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestLoadSnapshotChunk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestLoadSnapshotChunk message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestLoadSnapshotChunk} RequestLoadSnapshotChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestLoadSnapshotChunk.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestLoadSnapshotChunk(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.uint64(); + break; + case 2: + message.format = reader.uint32(); + break; + case 3: + message.chunk = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestLoadSnapshotChunk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestLoadSnapshotChunk} RequestLoadSnapshotChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestLoadSnapshotChunk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestLoadSnapshotChunk message. + * @function verify + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestLoadSnapshotChunk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.format != null && message.hasOwnProperty("format")) + if (!$util.isInteger(message.format)) + return "format: integer expected"; + if (message.chunk != null && message.hasOwnProperty("chunk")) + if (!$util.isInteger(message.chunk)) + return "chunk: integer expected"; + return null; + }; + + /** + * Creates a RequestLoadSnapshotChunk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestLoadSnapshotChunk} RequestLoadSnapshotChunk + */ + RequestLoadSnapshotChunk.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestLoadSnapshotChunk) + return object; + var message = new $root.tendermint.abci.RequestLoadSnapshotChunk(); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = true; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(true); + if (object.format != null) + message.format = object.format >>> 0; + if (object.chunk != null) + message.chunk = object.chunk >>> 0; + return message; + }; + + /** + * Creates a plain object from a RequestLoadSnapshotChunk message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @static + * @param {tendermint.abci.RequestLoadSnapshotChunk} message RequestLoadSnapshotChunk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestLoadSnapshotChunk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.format = 0; + object.chunk = 0; + } + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber(true) : message.height; + if (message.format != null && message.hasOwnProperty("format")) + object.format = message.format; + if (message.chunk != null && message.hasOwnProperty("chunk")) + object.chunk = message.chunk; + return object; + }; + + /** + * Converts this RequestLoadSnapshotChunk to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @instance + * @returns {Object.} JSON object + */ + RequestLoadSnapshotChunk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestLoadSnapshotChunk; + })(abci.RequestLoadSnapshotChunk || {}); + + abci.RequestApplySnapshotChunk = (function(RequestApplySnapshotChunk) { + + /** + * Properties of a RequestApplySnapshotChunk. + * @memberof tendermint.abci + * @interface IRequestApplySnapshotChunk + * @property {number|null} [index] RequestApplySnapshotChunk index + * @property {Uint8Array|null} [chunk] RequestApplySnapshotChunk chunk + * @property {string|null} [sender] RequestApplySnapshotChunk sender + */ + + /** + * Constructs a new RequestApplySnapshotChunk. + * @memberof tendermint.abci + * @classdesc Represents a RequestApplySnapshotChunk. + * @implements IRequestApplySnapshotChunk + * @constructor + * @param {tendermint.abci.IRequestApplySnapshotChunk=} [properties] Properties to set + */ + function RequestApplySnapshotChunk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestApplySnapshotChunk index. + * @member {number} index + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @instance + */ + RequestApplySnapshotChunk.prototype.index = 0; + + /** + * RequestApplySnapshotChunk chunk. + * @member {Uint8Array} chunk + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @instance + */ + RequestApplySnapshotChunk.prototype.chunk = $util.newBuffer([]); + + /** + * RequestApplySnapshotChunk sender. + * @member {string} sender + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @instance + */ + RequestApplySnapshotChunk.prototype.sender = ""; + + /** + * Creates a new RequestApplySnapshotChunk instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @static + * @param {tendermint.abci.IRequestApplySnapshotChunk=} [properties] Properties to set + * @returns {tendermint.abci.RequestApplySnapshotChunk} RequestApplySnapshotChunk instance + */ + RequestApplySnapshotChunk.create = function create(properties) { + return new RequestApplySnapshotChunk(properties); + }; + + /** + * Encodes the specified RequestApplySnapshotChunk message. Does not implicitly {@link tendermint.abci.RequestApplySnapshotChunk.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @static + * @param {tendermint.abci.IRequestApplySnapshotChunk} message RequestApplySnapshotChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestApplySnapshotChunk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.index); + if (message.chunk != null && Object.hasOwnProperty.call(message, "chunk")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.chunk); + if (message.sender != null && Object.hasOwnProperty.call(message, "sender")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sender); + return writer; + }; + + /** + * Encodes the specified RequestApplySnapshotChunk message, length delimited. Does not implicitly {@link tendermint.abci.RequestApplySnapshotChunk.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @static + * @param {tendermint.abci.IRequestApplySnapshotChunk} message RequestApplySnapshotChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestApplySnapshotChunk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestApplySnapshotChunk message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestApplySnapshotChunk} RequestApplySnapshotChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestApplySnapshotChunk.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestApplySnapshotChunk(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.uint32(); + break; + case 2: + message.chunk = reader.bytes(); + break; + case 3: + message.sender = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestApplySnapshotChunk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestApplySnapshotChunk} RequestApplySnapshotChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestApplySnapshotChunk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestApplySnapshotChunk message. + * @function verify + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestApplySnapshotChunk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index)) + return "index: integer expected"; + if (message.chunk != null && message.hasOwnProperty("chunk")) + if (!(message.chunk && typeof message.chunk.length === "number" || $util.isString(message.chunk))) + return "chunk: buffer expected"; + if (message.sender != null && message.hasOwnProperty("sender")) + if (!$util.isString(message.sender)) + return "sender: string expected"; + return null; + }; + + /** + * Creates a RequestApplySnapshotChunk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestApplySnapshotChunk} RequestApplySnapshotChunk + */ + RequestApplySnapshotChunk.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestApplySnapshotChunk) + return object; + var message = new $root.tendermint.abci.RequestApplySnapshotChunk(); + if (object.index != null) + message.index = object.index >>> 0; + if (object.chunk != null) + if (typeof object.chunk === "string") + $util.base64.decode(object.chunk, message.chunk = $util.newBuffer($util.base64.length(object.chunk)), 0); + else if (object.chunk.length) + message.chunk = object.chunk; + if (object.sender != null) + message.sender = String(object.sender); + return message; + }; + + /** + * Creates a plain object from a RequestApplySnapshotChunk message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @static + * @param {tendermint.abci.RequestApplySnapshotChunk} message RequestApplySnapshotChunk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestApplySnapshotChunk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.index = 0; + if (options.bytes === String) + object.chunk = ""; + else { + object.chunk = []; + if (options.bytes !== Array) + object.chunk = $util.newBuffer(object.chunk); + } + object.sender = ""; + } + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + if (message.chunk != null && message.hasOwnProperty("chunk")) + object.chunk = options.bytes === String ? $util.base64.encode(message.chunk, 0, message.chunk.length) : options.bytes === Array ? Array.prototype.slice.call(message.chunk) : message.chunk; + if (message.sender != null && message.hasOwnProperty("sender")) + object.sender = message.sender; + return object; + }; + + /** + * Converts this RequestApplySnapshotChunk to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @instance + * @returns {Object.} JSON object + */ + RequestApplySnapshotChunk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestApplySnapshotChunk; + })(abci.RequestApplySnapshotChunk || {}); + + abci.Response = (function(Response) { + + /** + * Properties of a Response. + * @memberof tendermint.abci + * @interface IResponse + * @property {tendermint.abci.IResponseException|null} [exception] Response exception + * @property {tendermint.abci.IResponseEcho|null} [echo] Response echo + * @property {tendermint.abci.IResponseFlush|null} [flush] Response flush + * @property {tendermint.abci.IResponseInfo|null} [info] Response info + * @property {tendermint.abci.IResponseSetOption|null} [setOption] Response setOption + * @property {tendermint.abci.IResponseInitChain|null} [initChain] Response initChain + * @property {tendermint.abci.IResponseQuery|null} [query] Response query + * @property {tendermint.abci.IResponseBeginBlock|null} [beginBlock] Response beginBlock + * @property {tendermint.abci.IResponseCheckTx|null} [checkTx] Response checkTx + * @property {tendermint.abci.IResponseDeliverTx|null} [deliverTx] Response deliverTx + * @property {tendermint.abci.IResponseEndBlock|null} [endBlock] Response endBlock + * @property {tendermint.abci.IResponseCommit|null} [commit] Response commit + * @property {tendermint.abci.IResponseListSnapshots|null} [listSnapshots] Response listSnapshots + * @property {tendermint.abci.IResponseOfferSnapshot|null} [offerSnapshot] Response offerSnapshot + * @property {tendermint.abci.IResponseLoadSnapshotChunk|null} [loadSnapshotChunk] Response loadSnapshotChunk + * @property {tendermint.abci.IResponseApplySnapshotChunk|null} [applySnapshotChunk] Response applySnapshotChunk + */ + + /** + * Constructs a new Response. + * @memberof tendermint.abci + * @classdesc Represents a Response. + * @implements IResponse + * @constructor + * @param {tendermint.abci.IResponse=} [properties] Properties to set + */ + function Response(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Response exception. + * @member {tendermint.abci.IResponseException|null|undefined} exception + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.exception = null; + + /** + * Response echo. + * @member {tendermint.abci.IResponseEcho|null|undefined} echo + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.echo = null; + + /** + * Response flush. + * @member {tendermint.abci.IResponseFlush|null|undefined} flush + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.flush = null; + + /** + * Response info. + * @member {tendermint.abci.IResponseInfo|null|undefined} info + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.info = null; + + /** + * Response setOption. + * @member {tendermint.abci.IResponseSetOption|null|undefined} setOption + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.setOption = null; + + /** + * Response initChain. + * @member {tendermint.abci.IResponseInitChain|null|undefined} initChain + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.initChain = null; + + /** + * Response query. + * @member {tendermint.abci.IResponseQuery|null|undefined} query + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.query = null; + + /** + * Response beginBlock. + * @member {tendermint.abci.IResponseBeginBlock|null|undefined} beginBlock + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.beginBlock = null; + + /** + * Response checkTx. + * @member {tendermint.abci.IResponseCheckTx|null|undefined} checkTx + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.checkTx = null; + + /** + * Response deliverTx. + * @member {tendermint.abci.IResponseDeliverTx|null|undefined} deliverTx + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.deliverTx = null; + + /** + * Response endBlock. + * @member {tendermint.abci.IResponseEndBlock|null|undefined} endBlock + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.endBlock = null; + + /** + * Response commit. + * @member {tendermint.abci.IResponseCommit|null|undefined} commit + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.commit = null; + + /** + * Response listSnapshots. + * @member {tendermint.abci.IResponseListSnapshots|null|undefined} listSnapshots + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.listSnapshots = null; + + /** + * Response offerSnapshot. + * @member {tendermint.abci.IResponseOfferSnapshot|null|undefined} offerSnapshot + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.offerSnapshot = null; + + /** + * Response loadSnapshotChunk. + * @member {tendermint.abci.IResponseLoadSnapshotChunk|null|undefined} loadSnapshotChunk + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.loadSnapshotChunk = null; + + /** + * Response applySnapshotChunk. + * @member {tendermint.abci.IResponseApplySnapshotChunk|null|undefined} applySnapshotChunk + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.applySnapshotChunk = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Response value. + * @member {"exception"|"echo"|"flush"|"info"|"setOption"|"initChain"|"query"|"beginBlock"|"checkTx"|"deliverTx"|"endBlock"|"commit"|"listSnapshots"|"offerSnapshot"|"loadSnapshotChunk"|"applySnapshotChunk"|undefined} value + * @memberof tendermint.abci.Response + * @instance + */ + Object.defineProperty(Response.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["exception", "echo", "flush", "info", "setOption", "initChain", "query", "beginBlock", "checkTx", "deliverTx", "endBlock", "commit", "listSnapshots", "offerSnapshot", "loadSnapshotChunk", "applySnapshotChunk"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Response instance using the specified properties. + * @function create + * @memberof tendermint.abci.Response + * @static + * @param {tendermint.abci.IResponse=} [properties] Properties to set + * @returns {tendermint.abci.Response} Response instance + */ + Response.create = function create(properties) { + return new Response(properties); + }; + + /** + * Encodes the specified Response message. Does not implicitly {@link tendermint.abci.Response.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.Response + * @static + * @param {tendermint.abci.IResponse} message Response message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Response.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.exception != null && Object.hasOwnProperty.call(message, "exception")) + $root.tendermint.abci.ResponseException.encode(message.exception, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.echo != null && Object.hasOwnProperty.call(message, "echo")) + $root.tendermint.abci.ResponseEcho.encode(message.echo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.flush != null && Object.hasOwnProperty.call(message, "flush")) + $root.tendermint.abci.ResponseFlush.encode(message.flush, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.info != null && Object.hasOwnProperty.call(message, "info")) + $root.tendermint.abci.ResponseInfo.encode(message.info, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.setOption != null && Object.hasOwnProperty.call(message, "setOption")) + $root.tendermint.abci.ResponseSetOption.encode(message.setOption, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.initChain != null && Object.hasOwnProperty.call(message, "initChain")) + $root.tendermint.abci.ResponseInitChain.encode(message.initChain, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + $root.tendermint.abci.ResponseQuery.encode(message.query, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.beginBlock != null && Object.hasOwnProperty.call(message, "beginBlock")) + $root.tendermint.abci.ResponseBeginBlock.encode(message.beginBlock, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.checkTx != null && Object.hasOwnProperty.call(message, "checkTx")) + $root.tendermint.abci.ResponseCheckTx.encode(message.checkTx, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.deliverTx != null && Object.hasOwnProperty.call(message, "deliverTx")) + $root.tendermint.abci.ResponseDeliverTx.encode(message.deliverTx, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.endBlock != null && Object.hasOwnProperty.call(message, "endBlock")) + $root.tendermint.abci.ResponseEndBlock.encode(message.endBlock, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.commit != null && Object.hasOwnProperty.call(message, "commit")) + $root.tendermint.abci.ResponseCommit.encode(message.commit, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.listSnapshots != null && Object.hasOwnProperty.call(message, "listSnapshots")) + $root.tendermint.abci.ResponseListSnapshots.encode(message.listSnapshots, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.offerSnapshot != null && Object.hasOwnProperty.call(message, "offerSnapshot")) + $root.tendermint.abci.ResponseOfferSnapshot.encode(message.offerSnapshot, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.loadSnapshotChunk != null && Object.hasOwnProperty.call(message, "loadSnapshotChunk")) + $root.tendermint.abci.ResponseLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.applySnapshotChunk != null && Object.hasOwnProperty.call(message, "applySnapshotChunk")) + $root.tendermint.abci.ResponseApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Response message, length delimited. Does not implicitly {@link tendermint.abci.Response.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.Response + * @static + * @param {tendermint.abci.IResponse} message Response message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Response.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Response message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.Response + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.Response} Response + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Response.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.Response(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exception = $root.tendermint.abci.ResponseException.decode(reader, reader.uint32()); + break; + case 2: + message.echo = $root.tendermint.abci.ResponseEcho.decode(reader, reader.uint32()); + break; + case 3: + message.flush = $root.tendermint.abci.ResponseFlush.decode(reader, reader.uint32()); + break; + case 4: + message.info = $root.tendermint.abci.ResponseInfo.decode(reader, reader.uint32()); + break; + case 5: + message.setOption = $root.tendermint.abci.ResponseSetOption.decode(reader, reader.uint32()); + break; + case 6: + message.initChain = $root.tendermint.abci.ResponseInitChain.decode(reader, reader.uint32()); + break; + case 7: + message.query = $root.tendermint.abci.ResponseQuery.decode(reader, reader.uint32()); + break; + case 8: + message.beginBlock = $root.tendermint.abci.ResponseBeginBlock.decode(reader, reader.uint32()); + break; + case 9: + message.checkTx = $root.tendermint.abci.ResponseCheckTx.decode(reader, reader.uint32()); + break; + case 10: + message.deliverTx = $root.tendermint.abci.ResponseDeliverTx.decode(reader, reader.uint32()); + break; + case 11: + message.endBlock = $root.tendermint.abci.ResponseEndBlock.decode(reader, reader.uint32()); + break; + case 12: + message.commit = $root.tendermint.abci.ResponseCommit.decode(reader, reader.uint32()); + break; + case 13: + message.listSnapshots = $root.tendermint.abci.ResponseListSnapshots.decode(reader, reader.uint32()); + break; + case 14: + message.offerSnapshot = $root.tendermint.abci.ResponseOfferSnapshot.decode(reader, reader.uint32()); + break; + case 15: + message.loadSnapshotChunk = $root.tendermint.abci.ResponseLoadSnapshotChunk.decode(reader, reader.uint32()); + break; + case 16: + message.applySnapshotChunk = $root.tendermint.abci.ResponseApplySnapshotChunk.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Response message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.Response + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.Response} Response + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Response.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Response message. + * @function verify + * @memberof tendermint.abci.Response + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Response.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.exception != null && message.hasOwnProperty("exception")) { + properties.value = 1; + { + var error = $root.tendermint.abci.ResponseException.verify(message.exception); + if (error) + return "exception." + error; + } + } + if (message.echo != null && message.hasOwnProperty("echo")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.ResponseEcho.verify(message.echo); + if (error) + return "echo." + error; + } + } + if (message.flush != null && message.hasOwnProperty("flush")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.ResponseFlush.verify(message.flush); + if (error) + return "flush." + error; + } + } + if (message.info != null && message.hasOwnProperty("info")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.ResponseInfo.verify(message.info); + if (error) + return "info." + error; + } + } + if (message.setOption != null && message.hasOwnProperty("setOption")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.ResponseSetOption.verify(message.setOption); + if (error) + return "setOption." + error; + } + } + if (message.initChain != null && message.hasOwnProperty("initChain")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.ResponseInitChain.verify(message.initChain); + if (error) + return "initChain." + error; + } + } + if (message.query != null && message.hasOwnProperty("query")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.ResponseQuery.verify(message.query); + if (error) + return "query." + error; + } + } + if (message.beginBlock != null && message.hasOwnProperty("beginBlock")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.ResponseBeginBlock.verify(message.beginBlock); + if (error) + return "beginBlock." + error; + } + } + if (message.checkTx != null && message.hasOwnProperty("checkTx")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.ResponseCheckTx.verify(message.checkTx); + if (error) + return "checkTx." + error; + } + } + if (message.deliverTx != null && message.hasOwnProperty("deliverTx")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.ResponseDeliverTx.verify(message.deliverTx); + if (error) + return "deliverTx." + error; + } + } + if (message.endBlock != null && message.hasOwnProperty("endBlock")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.ResponseEndBlock.verify(message.endBlock); + if (error) + return "endBlock." + error; + } + } + if (message.commit != null && message.hasOwnProperty("commit")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.ResponseCommit.verify(message.commit); + if (error) + return "commit." + error; + } + } + if (message.listSnapshots != null && message.hasOwnProperty("listSnapshots")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.ResponseListSnapshots.verify(message.listSnapshots); + if (error) + return "listSnapshots." + error; + } + } + if (message.offerSnapshot != null && message.hasOwnProperty("offerSnapshot")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.ResponseOfferSnapshot.verify(message.offerSnapshot); + if (error) + return "offerSnapshot." + error; + } + } + if (message.loadSnapshotChunk != null && message.hasOwnProperty("loadSnapshotChunk")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.ResponseLoadSnapshotChunk.verify(message.loadSnapshotChunk); + if (error) + return "loadSnapshotChunk." + error; + } + } + if (message.applySnapshotChunk != null && message.hasOwnProperty("applySnapshotChunk")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.ResponseApplySnapshotChunk.verify(message.applySnapshotChunk); + if (error) + return "applySnapshotChunk." + error; + } + } + return null; + }; + + /** + * Creates a Response message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.Response + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.Response} Response + */ + Response.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.Response) + return object; + var message = new $root.tendermint.abci.Response(); + if (object.exception != null) { + if (typeof object.exception !== "object") + throw TypeError(".tendermint.abci.Response.exception: object expected"); + message.exception = $root.tendermint.abci.ResponseException.fromObject(object.exception); + } + if (object.echo != null) { + if (typeof object.echo !== "object") + throw TypeError(".tendermint.abci.Response.echo: object expected"); + message.echo = $root.tendermint.abci.ResponseEcho.fromObject(object.echo); + } + if (object.flush != null) { + if (typeof object.flush !== "object") + throw TypeError(".tendermint.abci.Response.flush: object expected"); + message.flush = $root.tendermint.abci.ResponseFlush.fromObject(object.flush); + } + if (object.info != null) { + if (typeof object.info !== "object") + throw TypeError(".tendermint.abci.Response.info: object expected"); + message.info = $root.tendermint.abci.ResponseInfo.fromObject(object.info); + } + if (object.setOption != null) { + if (typeof object.setOption !== "object") + throw TypeError(".tendermint.abci.Response.setOption: object expected"); + message.setOption = $root.tendermint.abci.ResponseSetOption.fromObject(object.setOption); + } + if (object.initChain != null) { + if (typeof object.initChain !== "object") + throw TypeError(".tendermint.abci.Response.initChain: object expected"); + message.initChain = $root.tendermint.abci.ResponseInitChain.fromObject(object.initChain); + } + if (object.query != null) { + if (typeof object.query !== "object") + throw TypeError(".tendermint.abci.Response.query: object expected"); + message.query = $root.tendermint.abci.ResponseQuery.fromObject(object.query); + } + if (object.beginBlock != null) { + if (typeof object.beginBlock !== "object") + throw TypeError(".tendermint.abci.Response.beginBlock: object expected"); + message.beginBlock = $root.tendermint.abci.ResponseBeginBlock.fromObject(object.beginBlock); + } + if (object.checkTx != null) { + if (typeof object.checkTx !== "object") + throw TypeError(".tendermint.abci.Response.checkTx: object expected"); + message.checkTx = $root.tendermint.abci.ResponseCheckTx.fromObject(object.checkTx); + } + if (object.deliverTx != null) { + if (typeof object.deliverTx !== "object") + throw TypeError(".tendermint.abci.Response.deliverTx: object expected"); + message.deliverTx = $root.tendermint.abci.ResponseDeliverTx.fromObject(object.deliverTx); + } + if (object.endBlock != null) { + if (typeof object.endBlock !== "object") + throw TypeError(".tendermint.abci.Response.endBlock: object expected"); + message.endBlock = $root.tendermint.abci.ResponseEndBlock.fromObject(object.endBlock); + } + if (object.commit != null) { + if (typeof object.commit !== "object") + throw TypeError(".tendermint.abci.Response.commit: object expected"); + message.commit = $root.tendermint.abci.ResponseCommit.fromObject(object.commit); + } + if (object.listSnapshots != null) { + if (typeof object.listSnapshots !== "object") + throw TypeError(".tendermint.abci.Response.listSnapshots: object expected"); + message.listSnapshots = $root.tendermint.abci.ResponseListSnapshots.fromObject(object.listSnapshots); + } + if (object.offerSnapshot != null) { + if (typeof object.offerSnapshot !== "object") + throw TypeError(".tendermint.abci.Response.offerSnapshot: object expected"); + message.offerSnapshot = $root.tendermint.abci.ResponseOfferSnapshot.fromObject(object.offerSnapshot); + } + if (object.loadSnapshotChunk != null) { + if (typeof object.loadSnapshotChunk !== "object") + throw TypeError(".tendermint.abci.Response.loadSnapshotChunk: object expected"); + message.loadSnapshotChunk = $root.tendermint.abci.ResponseLoadSnapshotChunk.fromObject(object.loadSnapshotChunk); + } + if (object.applySnapshotChunk != null) { + if (typeof object.applySnapshotChunk !== "object") + throw TypeError(".tendermint.abci.Response.applySnapshotChunk: object expected"); + message.applySnapshotChunk = $root.tendermint.abci.ResponseApplySnapshotChunk.fromObject(object.applySnapshotChunk); + } + return message; + }; + + /** + * Creates a plain object from a Response message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.Response + * @static + * @param {tendermint.abci.Response} message Response + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Response.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.exception != null && message.hasOwnProperty("exception")) { + object.exception = $root.tendermint.abci.ResponseException.toObject(message.exception, options); + if (options.oneofs) + object.value = "exception"; + } + if (message.echo != null && message.hasOwnProperty("echo")) { + object.echo = $root.tendermint.abci.ResponseEcho.toObject(message.echo, options); + if (options.oneofs) + object.value = "echo"; + } + if (message.flush != null && message.hasOwnProperty("flush")) { + object.flush = $root.tendermint.abci.ResponseFlush.toObject(message.flush, options); + if (options.oneofs) + object.value = "flush"; + } + if (message.info != null && message.hasOwnProperty("info")) { + object.info = $root.tendermint.abci.ResponseInfo.toObject(message.info, options); + if (options.oneofs) + object.value = "info"; + } + if (message.setOption != null && message.hasOwnProperty("setOption")) { + object.setOption = $root.tendermint.abci.ResponseSetOption.toObject(message.setOption, options); + if (options.oneofs) + object.value = "setOption"; + } + if (message.initChain != null && message.hasOwnProperty("initChain")) { + object.initChain = $root.tendermint.abci.ResponseInitChain.toObject(message.initChain, options); + if (options.oneofs) + object.value = "initChain"; + } + if (message.query != null && message.hasOwnProperty("query")) { + object.query = $root.tendermint.abci.ResponseQuery.toObject(message.query, options); + if (options.oneofs) + object.value = "query"; + } + if (message.beginBlock != null && message.hasOwnProperty("beginBlock")) { + object.beginBlock = $root.tendermint.abci.ResponseBeginBlock.toObject(message.beginBlock, options); + if (options.oneofs) + object.value = "beginBlock"; + } + if (message.checkTx != null && message.hasOwnProperty("checkTx")) { + object.checkTx = $root.tendermint.abci.ResponseCheckTx.toObject(message.checkTx, options); + if (options.oneofs) + object.value = "checkTx"; + } + if (message.deliverTx != null && message.hasOwnProperty("deliverTx")) { + object.deliverTx = $root.tendermint.abci.ResponseDeliverTx.toObject(message.deliverTx, options); + if (options.oneofs) + object.value = "deliverTx"; + } + if (message.endBlock != null && message.hasOwnProperty("endBlock")) { + object.endBlock = $root.tendermint.abci.ResponseEndBlock.toObject(message.endBlock, options); + if (options.oneofs) + object.value = "endBlock"; + } + if (message.commit != null && message.hasOwnProperty("commit")) { + object.commit = $root.tendermint.abci.ResponseCommit.toObject(message.commit, options); + if (options.oneofs) + object.value = "commit"; + } + if (message.listSnapshots != null && message.hasOwnProperty("listSnapshots")) { + object.listSnapshots = $root.tendermint.abci.ResponseListSnapshots.toObject(message.listSnapshots, options); + if (options.oneofs) + object.value = "listSnapshots"; + } + if (message.offerSnapshot != null && message.hasOwnProperty("offerSnapshot")) { + object.offerSnapshot = $root.tendermint.abci.ResponseOfferSnapshot.toObject(message.offerSnapshot, options); + if (options.oneofs) + object.value = "offerSnapshot"; + } + if (message.loadSnapshotChunk != null && message.hasOwnProperty("loadSnapshotChunk")) { + object.loadSnapshotChunk = $root.tendermint.abci.ResponseLoadSnapshotChunk.toObject(message.loadSnapshotChunk, options); + if (options.oneofs) + object.value = "loadSnapshotChunk"; + } + if (message.applySnapshotChunk != null && message.hasOwnProperty("applySnapshotChunk")) { + object.applySnapshotChunk = $root.tendermint.abci.ResponseApplySnapshotChunk.toObject(message.applySnapshotChunk, options); + if (options.oneofs) + object.value = "applySnapshotChunk"; + } + return object; + }; + + /** + * Converts this Response to JSON. + * @function toJSON + * @memberof tendermint.abci.Response + * @instance + * @returns {Object.} JSON object + */ + Response.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Response; + })(abci.Response || {}); + + abci.ResponseException = (function(ResponseException) { + + /** + * Properties of a ResponseException. + * @memberof tendermint.abci + * @interface IResponseException + * @property {string|null} [error] ResponseException error + */ + + /** + * Constructs a new ResponseException. + * @memberof tendermint.abci + * @classdesc Represents a ResponseException. + * @implements IResponseException + * @constructor + * @param {tendermint.abci.IResponseException=} [properties] Properties to set + */ + function ResponseException(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseException error. + * @member {string} error + * @memberof tendermint.abci.ResponseException + * @instance + */ + ResponseException.prototype.error = ""; + + /** + * Creates a new ResponseException instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseException + * @static + * @param {tendermint.abci.IResponseException=} [properties] Properties to set + * @returns {tendermint.abci.ResponseException} ResponseException instance + */ + ResponseException.create = function create(properties) { + return new ResponseException(properties); + }; + + /** + * Encodes the specified ResponseException message. Does not implicitly {@link tendermint.abci.ResponseException.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseException + * @static + * @param {tendermint.abci.IResponseException} message ResponseException message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseException.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.error); + return writer; + }; + + /** + * Encodes the specified ResponseException message, length delimited. Does not implicitly {@link tendermint.abci.ResponseException.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseException + * @static + * @param {tendermint.abci.IResponseException} message ResponseException message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseException.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseException message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseException + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseException} ResponseException + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseException.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseException(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.error = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseException message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseException + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseException} ResponseException + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseException.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseException message. + * @function verify + * @memberof tendermint.abci.ResponseException + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseException.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.error != null && message.hasOwnProperty("error")) + if (!$util.isString(message.error)) + return "error: string expected"; + return null; + }; + + /** + * Creates a ResponseException message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseException + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseException} ResponseException + */ + ResponseException.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseException) + return object; + var message = new $root.tendermint.abci.ResponseException(); + if (object.error != null) + message.error = String(object.error); + return message; + }; + + /** + * Creates a plain object from a ResponseException message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseException + * @static + * @param {tendermint.abci.ResponseException} message ResponseException + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseException.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.error = ""; + if (message.error != null && message.hasOwnProperty("error")) + object.error = message.error; + return object; + }; + + /** + * Converts this ResponseException to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseException + * @instance + * @returns {Object.} JSON object + */ + ResponseException.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseException; + })(abci.ResponseException || {}); + + abci.ResponseEcho = (function(ResponseEcho) { + + /** + * Properties of a ResponseEcho. + * @memberof tendermint.abci + * @interface IResponseEcho + * @property {string|null} [message] ResponseEcho message + */ + + /** + * Constructs a new ResponseEcho. + * @memberof tendermint.abci + * @classdesc Represents a ResponseEcho. + * @implements IResponseEcho + * @constructor + * @param {tendermint.abci.IResponseEcho=} [properties] Properties to set + */ + function ResponseEcho(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseEcho message. + * @member {string} message + * @memberof tendermint.abci.ResponseEcho + * @instance + */ + ResponseEcho.prototype.message = ""; + + /** + * Creates a new ResponseEcho instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseEcho + * @static + * @param {tendermint.abci.IResponseEcho=} [properties] Properties to set + * @returns {tendermint.abci.ResponseEcho} ResponseEcho instance + */ + ResponseEcho.create = function create(properties) { + return new ResponseEcho(properties); + }; + + /** + * Encodes the specified ResponseEcho message. Does not implicitly {@link tendermint.abci.ResponseEcho.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseEcho + * @static + * @param {tendermint.abci.IResponseEcho} message ResponseEcho message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseEcho.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + return writer; + }; + + /** + * Encodes the specified ResponseEcho message, length delimited. Does not implicitly {@link tendermint.abci.ResponseEcho.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseEcho + * @static + * @param {tendermint.abci.IResponseEcho} message ResponseEcho message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseEcho.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseEcho message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseEcho + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseEcho} ResponseEcho + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseEcho.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseEcho(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseEcho message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseEcho + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseEcho} ResponseEcho + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseEcho.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseEcho message. + * @function verify + * @memberof tendermint.abci.ResponseEcho + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseEcho.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + return null; + }; + + /** + * Creates a ResponseEcho message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseEcho + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseEcho} ResponseEcho + */ + ResponseEcho.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseEcho) + return object; + var message = new $root.tendermint.abci.ResponseEcho(); + if (object.message != null) + message.message = String(object.message); + return message; + }; + + /** + * Creates a plain object from a ResponseEcho message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseEcho + * @static + * @param {tendermint.abci.ResponseEcho} message ResponseEcho + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseEcho.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.message = ""; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + return object; + }; + + /** + * Converts this ResponseEcho to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseEcho + * @instance + * @returns {Object.} JSON object + */ + ResponseEcho.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseEcho; + })(abci.ResponseEcho || {}); + + abci.ResponseFlush = (function(ResponseFlush) { + + /** + * Properties of a ResponseFlush. + * @memberof tendermint.abci + * @interface IResponseFlush + */ + + /** + * Constructs a new ResponseFlush. + * @memberof tendermint.abci + * @classdesc Represents a ResponseFlush. + * @implements IResponseFlush + * @constructor + * @param {tendermint.abci.IResponseFlush=} [properties] Properties to set + */ + function ResponseFlush(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new ResponseFlush instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseFlush + * @static + * @param {tendermint.abci.IResponseFlush=} [properties] Properties to set + * @returns {tendermint.abci.ResponseFlush} ResponseFlush instance + */ + ResponseFlush.create = function create(properties) { + return new ResponseFlush(properties); + }; + + /** + * Encodes the specified ResponseFlush message. Does not implicitly {@link tendermint.abci.ResponseFlush.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseFlush + * @static + * @param {tendermint.abci.IResponseFlush} message ResponseFlush message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseFlush.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ResponseFlush message, length delimited. Does not implicitly {@link tendermint.abci.ResponseFlush.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseFlush + * @static + * @param {tendermint.abci.IResponseFlush} message ResponseFlush message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseFlush.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseFlush message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseFlush + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseFlush} ResponseFlush + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseFlush.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseFlush(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseFlush message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseFlush + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseFlush} ResponseFlush + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseFlush.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseFlush message. + * @function verify + * @memberof tendermint.abci.ResponseFlush + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseFlush.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a ResponseFlush message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseFlush + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseFlush} ResponseFlush + */ + ResponseFlush.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseFlush) + return object; + return new $root.tendermint.abci.ResponseFlush(); + }; + + /** + * Creates a plain object from a ResponseFlush message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseFlush + * @static + * @param {tendermint.abci.ResponseFlush} message ResponseFlush + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseFlush.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ResponseFlush to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseFlush + * @instance + * @returns {Object.} JSON object + */ + ResponseFlush.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseFlush; + })(abci.ResponseFlush || {}); + + abci.ResponseInfo = (function(ResponseInfo) { + + /** + * Properties of a ResponseInfo. + * @memberof tendermint.abci + * @interface IResponseInfo + * @property {string|null} [data] ResponseInfo data + * @property {string|null} [version] ResponseInfo version + * @property {number|Long|null} [appVersion] ResponseInfo appVersion + * @property {number|Long|null} [lastBlockHeight] ResponseInfo lastBlockHeight + * @property {Uint8Array|null} [lastBlockAppHash] ResponseInfo lastBlockAppHash + */ + + /** + * Constructs a new ResponseInfo. + * @memberof tendermint.abci + * @classdesc Represents a ResponseInfo. + * @implements IResponseInfo + * @constructor + * @param {tendermint.abci.IResponseInfo=} [properties] Properties to set + */ + function ResponseInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseInfo data. + * @member {string} data + * @memberof tendermint.abci.ResponseInfo + * @instance + */ + ResponseInfo.prototype.data = ""; + + /** + * ResponseInfo version. + * @member {string} version + * @memberof tendermint.abci.ResponseInfo + * @instance + */ + ResponseInfo.prototype.version = ""; + + /** + * ResponseInfo appVersion. + * @member {number|Long} appVersion + * @memberof tendermint.abci.ResponseInfo + * @instance + */ + ResponseInfo.prototype.appVersion = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ResponseInfo lastBlockHeight. + * @member {number|Long} lastBlockHeight + * @memberof tendermint.abci.ResponseInfo + * @instance + */ + ResponseInfo.prototype.lastBlockHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ResponseInfo lastBlockAppHash. + * @member {Uint8Array} lastBlockAppHash + * @memberof tendermint.abci.ResponseInfo + * @instance + */ + ResponseInfo.prototype.lastBlockAppHash = $util.newBuffer([]); + + /** + * Creates a new ResponseInfo instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseInfo + * @static + * @param {tendermint.abci.IResponseInfo=} [properties] Properties to set + * @returns {tendermint.abci.ResponseInfo} ResponseInfo instance + */ + ResponseInfo.create = function create(properties) { + return new ResponseInfo(properties); + }; + + /** + * Encodes the specified ResponseInfo message. Does not implicitly {@link tendermint.abci.ResponseInfo.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseInfo + * @static + * @param {tendermint.abci.IResponseInfo} message ResponseInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.data); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); + if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.appVersion); + if (message.lastBlockHeight != null && Object.hasOwnProperty.call(message, "lastBlockHeight")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.lastBlockHeight); + if (message.lastBlockAppHash != null && Object.hasOwnProperty.call(message, "lastBlockAppHash")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.lastBlockAppHash); + return writer; + }; + + /** + * Encodes the specified ResponseInfo message, length delimited. Does not implicitly {@link tendermint.abci.ResponseInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseInfo + * @static + * @param {tendermint.abci.IResponseInfo} message ResponseInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseInfo message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseInfo} ResponseInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.string(); + break; + case 2: + message.version = reader.string(); + break; + case 3: + message.appVersion = reader.uint64(); + break; + case 4: + message.lastBlockHeight = reader.int64(); + break; + case 5: + message.lastBlockAppHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseInfo} ResponseInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseInfo message. + * @function verify + * @memberof tendermint.abci.ResponseInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!$util.isString(message.data)) + return "data: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + if (!$util.isInteger(message.appVersion) && !(message.appVersion && $util.isInteger(message.appVersion.low) && $util.isInteger(message.appVersion.high))) + return "appVersion: integer|Long expected"; + if (message.lastBlockHeight != null && message.hasOwnProperty("lastBlockHeight")) + if (!$util.isInteger(message.lastBlockHeight) && !(message.lastBlockHeight && $util.isInteger(message.lastBlockHeight.low) && $util.isInteger(message.lastBlockHeight.high))) + return "lastBlockHeight: integer|Long expected"; + if (message.lastBlockAppHash != null && message.hasOwnProperty("lastBlockAppHash")) + if (!(message.lastBlockAppHash && typeof message.lastBlockAppHash.length === "number" || $util.isString(message.lastBlockAppHash))) + return "lastBlockAppHash: buffer expected"; + return null; + }; + + /** + * Creates a ResponseInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseInfo + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseInfo} ResponseInfo + */ + ResponseInfo.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseInfo) + return object; + var message = new $root.tendermint.abci.ResponseInfo(); + if (object.data != null) + message.data = String(object.data); + if (object.version != null) + message.version = String(object.version); + if (object.appVersion != null) + if ($util.Long) + (message.appVersion = $util.Long.fromValue(object.appVersion)).unsigned = true; + else if (typeof object.appVersion === "string") + message.appVersion = parseInt(object.appVersion, 10); + else if (typeof object.appVersion === "number") + message.appVersion = object.appVersion; + else if (typeof object.appVersion === "object") + message.appVersion = new $util.LongBits(object.appVersion.low >>> 0, object.appVersion.high >>> 0).toNumber(true); + if (object.lastBlockHeight != null) + if ($util.Long) + (message.lastBlockHeight = $util.Long.fromValue(object.lastBlockHeight)).unsigned = false; + else if (typeof object.lastBlockHeight === "string") + message.lastBlockHeight = parseInt(object.lastBlockHeight, 10); + else if (typeof object.lastBlockHeight === "number") + message.lastBlockHeight = object.lastBlockHeight; + else if (typeof object.lastBlockHeight === "object") + message.lastBlockHeight = new $util.LongBits(object.lastBlockHeight.low >>> 0, object.lastBlockHeight.high >>> 0).toNumber(); + if (object.lastBlockAppHash != null) + if (typeof object.lastBlockAppHash === "string") + $util.base64.decode(object.lastBlockAppHash, message.lastBlockAppHash = $util.newBuffer($util.base64.length(object.lastBlockAppHash)), 0); + else if (object.lastBlockAppHash.length) + message.lastBlockAppHash = object.lastBlockAppHash; + return message; + }; + + /** + * Creates a plain object from a ResponseInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseInfo + * @static + * @param {tendermint.abci.ResponseInfo} message ResponseInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.data = ""; + object.version = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.appVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.appVersion = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.lastBlockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.lastBlockHeight = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.lastBlockAppHash = ""; + else { + object.lastBlockAppHash = []; + if (options.bytes !== Array) + object.lastBlockAppHash = $util.newBuffer(object.lastBlockAppHash); + } + } + if (message.data != null && message.hasOwnProperty("data")) + object.data = message.data; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + if (typeof message.appVersion === "number") + object.appVersion = options.longs === String ? String(message.appVersion) : message.appVersion; + else + object.appVersion = options.longs === String ? $util.Long.prototype.toString.call(message.appVersion) : options.longs === Number ? new $util.LongBits(message.appVersion.low >>> 0, message.appVersion.high >>> 0).toNumber(true) : message.appVersion; + if (message.lastBlockHeight != null && message.hasOwnProperty("lastBlockHeight")) + if (typeof message.lastBlockHeight === "number") + object.lastBlockHeight = options.longs === String ? String(message.lastBlockHeight) : message.lastBlockHeight; + else + object.lastBlockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.lastBlockHeight) : options.longs === Number ? new $util.LongBits(message.lastBlockHeight.low >>> 0, message.lastBlockHeight.high >>> 0).toNumber() : message.lastBlockHeight; + if (message.lastBlockAppHash != null && message.hasOwnProperty("lastBlockAppHash")) + object.lastBlockAppHash = options.bytes === String ? $util.base64.encode(message.lastBlockAppHash, 0, message.lastBlockAppHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.lastBlockAppHash) : message.lastBlockAppHash; + return object; + }; + + /** + * Converts this ResponseInfo to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseInfo + * @instance + * @returns {Object.} JSON object + */ + ResponseInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseInfo; + })(abci.ResponseInfo || {}); + + abci.ResponseSetOption = (function(ResponseSetOption) { + + /** + * Properties of a ResponseSetOption. + * @memberof tendermint.abci + * @interface IResponseSetOption + * @property {number|null} [code] ResponseSetOption code + * @property {string|null} [log] ResponseSetOption log + * @property {string|null} [info] ResponseSetOption info + */ + + /** + * Constructs a new ResponseSetOption. + * @memberof tendermint.abci + * @classdesc Represents a ResponseSetOption. + * @implements IResponseSetOption + * @constructor + * @param {tendermint.abci.IResponseSetOption=} [properties] Properties to set + */ + function ResponseSetOption(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseSetOption code. + * @member {number} code + * @memberof tendermint.abci.ResponseSetOption + * @instance + */ + ResponseSetOption.prototype.code = 0; + + /** + * ResponseSetOption log. + * @member {string} log + * @memberof tendermint.abci.ResponseSetOption + * @instance + */ + ResponseSetOption.prototype.log = ""; + + /** + * ResponseSetOption info. + * @member {string} info + * @memberof tendermint.abci.ResponseSetOption + * @instance + */ + ResponseSetOption.prototype.info = ""; + + /** + * Creates a new ResponseSetOption instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseSetOption + * @static + * @param {tendermint.abci.IResponseSetOption=} [properties] Properties to set + * @returns {tendermint.abci.ResponseSetOption} ResponseSetOption instance + */ + ResponseSetOption.create = function create(properties) { + return new ResponseSetOption(properties); + }; + + /** + * Encodes the specified ResponseSetOption message. Does not implicitly {@link tendermint.abci.ResponseSetOption.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseSetOption + * @static + * @param {tendermint.abci.IResponseSetOption} message ResponseSetOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseSetOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.code); + if (message.log != null && Object.hasOwnProperty.call(message, "log")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.log); + if (message.info != null && Object.hasOwnProperty.call(message, "info")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.info); + return writer; + }; + + /** + * Encodes the specified ResponseSetOption message, length delimited. Does not implicitly {@link tendermint.abci.ResponseSetOption.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseSetOption + * @static + * @param {tendermint.abci.IResponseSetOption} message ResponseSetOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseSetOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseSetOption message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseSetOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseSetOption} ResponseSetOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseSetOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseSetOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 3: + message.log = reader.string(); + break; + case 4: + message.info = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseSetOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseSetOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseSetOption} ResponseSetOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseSetOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseSetOption message. + * @function verify + * @memberof tendermint.abci.ResponseSetOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseSetOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.log != null && message.hasOwnProperty("log")) + if (!$util.isString(message.log)) + return "log: string expected"; + if (message.info != null && message.hasOwnProperty("info")) + if (!$util.isString(message.info)) + return "info: string expected"; + return null; + }; + + /** + * Creates a ResponseSetOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseSetOption + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseSetOption} ResponseSetOption + */ + ResponseSetOption.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseSetOption) + return object; + var message = new $root.tendermint.abci.ResponseSetOption(); + if (object.code != null) + message.code = object.code >>> 0; + if (object.log != null) + message.log = String(object.log); + if (object.info != null) + message.info = String(object.info); + return message; + }; + + /** + * Creates a plain object from a ResponseSetOption message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseSetOption + * @static + * @param {tendermint.abci.ResponseSetOption} message ResponseSetOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseSetOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.code = 0; + object.log = ""; + object.info = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.log != null && message.hasOwnProperty("log")) + object.log = message.log; + if (message.info != null && message.hasOwnProperty("info")) + object.info = message.info; + return object; + }; + + /** + * Converts this ResponseSetOption to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseSetOption + * @instance + * @returns {Object.} JSON object + */ + ResponseSetOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseSetOption; + })(abci.ResponseSetOption || {}); + + abci.ResponseInitChain = (function(ResponseInitChain) { + + /** + * Properties of a ResponseInitChain. + * @memberof tendermint.abci + * @interface IResponseInitChain + * @property {tendermint.abci.IConsensusParams|null} [consensusParams] ResponseInitChain consensusParams + * @property {Array.|null} [validators] ResponseInitChain validators + * @property {Uint8Array|null} [appHash] ResponseInitChain appHash + */ + + /** + * Constructs a new ResponseInitChain. + * @memberof tendermint.abci + * @classdesc Represents a ResponseInitChain. + * @implements IResponseInitChain + * @constructor + * @param {tendermint.abci.IResponseInitChain=} [properties] Properties to set + */ + function ResponseInitChain(properties) { + this.validators = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseInitChain consensusParams. + * @member {tendermint.abci.IConsensusParams|null|undefined} consensusParams + * @memberof tendermint.abci.ResponseInitChain + * @instance + */ + ResponseInitChain.prototype.consensusParams = null; + + /** + * ResponseInitChain validators. + * @member {Array.} validators + * @memberof tendermint.abci.ResponseInitChain + * @instance + */ + ResponseInitChain.prototype.validators = $util.emptyArray; + + /** + * ResponseInitChain appHash. + * @member {Uint8Array} appHash + * @memberof tendermint.abci.ResponseInitChain + * @instance + */ + ResponseInitChain.prototype.appHash = $util.newBuffer([]); + + /** + * Creates a new ResponseInitChain instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseInitChain + * @static + * @param {tendermint.abci.IResponseInitChain=} [properties] Properties to set + * @returns {tendermint.abci.ResponseInitChain} ResponseInitChain instance + */ + ResponseInitChain.create = function create(properties) { + return new ResponseInitChain(properties); + }; + + /** + * Encodes the specified ResponseInitChain message. Does not implicitly {@link tendermint.abci.ResponseInitChain.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseInitChain + * @static + * @param {tendermint.abci.IResponseInitChain} message ResponseInitChain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseInitChain.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.consensusParams != null && Object.hasOwnProperty.call(message, "consensusParams")) + $root.tendermint.abci.ConsensusParams.encode(message.consensusParams, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.validators != null && message.validators.length) + for (var i = 0; i < message.validators.length; ++i) + $root.tendermint.abci.ValidatorUpdate.encode(message.validators[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.appHash != null && Object.hasOwnProperty.call(message, "appHash")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.appHash); + return writer; + }; + + /** + * Encodes the specified ResponseInitChain message, length delimited. Does not implicitly {@link tendermint.abci.ResponseInitChain.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseInitChain + * @static + * @param {tendermint.abci.IResponseInitChain} message ResponseInitChain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseInitChain.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseInitChain message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseInitChain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseInitChain} ResponseInitChain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseInitChain.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseInitChain(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consensusParams = $root.tendermint.abci.ConsensusParams.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.validators && message.validators.length)) + message.validators = []; + message.validators.push($root.tendermint.abci.ValidatorUpdate.decode(reader, reader.uint32())); + break; + case 3: + message.appHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseInitChain message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseInitChain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseInitChain} ResponseInitChain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseInitChain.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseInitChain message. + * @function verify + * @memberof tendermint.abci.ResponseInitChain + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseInitChain.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.consensusParams != null && message.hasOwnProperty("consensusParams")) { + var error = $root.tendermint.abci.ConsensusParams.verify(message.consensusParams); + if (error) + return "consensusParams." + error; + } + if (message.validators != null && message.hasOwnProperty("validators")) { + if (!Array.isArray(message.validators)) + return "validators: array expected"; + for (var i = 0; i < message.validators.length; ++i) { + var error = $root.tendermint.abci.ValidatorUpdate.verify(message.validators[i]); + if (error) + return "validators." + error; + } + } + if (message.appHash != null && message.hasOwnProperty("appHash")) + if (!(message.appHash && typeof message.appHash.length === "number" || $util.isString(message.appHash))) + return "appHash: buffer expected"; + return null; + }; + + /** + * Creates a ResponseInitChain message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseInitChain + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseInitChain} ResponseInitChain + */ + ResponseInitChain.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseInitChain) + return object; + var message = new $root.tendermint.abci.ResponseInitChain(); + if (object.consensusParams != null) { + if (typeof object.consensusParams !== "object") + throw TypeError(".tendermint.abci.ResponseInitChain.consensusParams: object expected"); + message.consensusParams = $root.tendermint.abci.ConsensusParams.fromObject(object.consensusParams); + } + if (object.validators) { + if (!Array.isArray(object.validators)) + throw TypeError(".tendermint.abci.ResponseInitChain.validators: array expected"); + message.validators = []; + for (var i = 0; i < object.validators.length; ++i) { + if (typeof object.validators[i] !== "object") + throw TypeError(".tendermint.abci.ResponseInitChain.validators: object expected"); + message.validators[i] = $root.tendermint.abci.ValidatorUpdate.fromObject(object.validators[i]); + } + } + if (object.appHash != null) + if (typeof object.appHash === "string") + $util.base64.decode(object.appHash, message.appHash = $util.newBuffer($util.base64.length(object.appHash)), 0); + else if (object.appHash.length) + message.appHash = object.appHash; + return message; + }; + + /** + * Creates a plain object from a ResponseInitChain message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseInitChain + * @static + * @param {tendermint.abci.ResponseInitChain} message ResponseInitChain + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseInitChain.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.validators = []; + if (options.defaults) { + object.consensusParams = null; + if (options.bytes === String) + object.appHash = ""; + else { + object.appHash = []; + if (options.bytes !== Array) + object.appHash = $util.newBuffer(object.appHash); + } + } + if (message.consensusParams != null && message.hasOwnProperty("consensusParams")) + object.consensusParams = $root.tendermint.abci.ConsensusParams.toObject(message.consensusParams, options); + if (message.validators && message.validators.length) { + object.validators = []; + for (var j = 0; j < message.validators.length; ++j) + object.validators[j] = $root.tendermint.abci.ValidatorUpdate.toObject(message.validators[j], options); + } + if (message.appHash != null && message.hasOwnProperty("appHash")) + object.appHash = options.bytes === String ? $util.base64.encode(message.appHash, 0, message.appHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.appHash) : message.appHash; + return object; + }; + + /** + * Converts this ResponseInitChain to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseInitChain + * @instance + * @returns {Object.} JSON object + */ + ResponseInitChain.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseInitChain; + })(abci.ResponseInitChain || {}); + + abci.ResponseQuery = (function(ResponseQuery) { + + /** + * Properties of a ResponseQuery. + * @memberof tendermint.abci + * @interface IResponseQuery + * @property {number|null} [code] ResponseQuery code + * @property {string|null} [log] ResponseQuery log + * @property {string|null} [info] ResponseQuery info + * @property {number|Long|null} [index] ResponseQuery index + * @property {Uint8Array|null} [key] ResponseQuery key + * @property {Uint8Array|null} [value] ResponseQuery value + * @property {tendermint.crypto.IProofOps|null} [proofOps] ResponseQuery proofOps + * @property {number|Long|null} [height] ResponseQuery height + * @property {string|null} [codespace] ResponseQuery codespace + */ + + /** + * Constructs a new ResponseQuery. + * @memberof tendermint.abci + * @classdesc Represents a ResponseQuery. + * @implements IResponseQuery + * @constructor + * @param {tendermint.abci.IResponseQuery=} [properties] Properties to set + */ + function ResponseQuery(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseQuery code. + * @member {number} code + * @memberof tendermint.abci.ResponseQuery + * @instance + */ + ResponseQuery.prototype.code = 0; + + /** + * ResponseQuery log. + * @member {string} log + * @memberof tendermint.abci.ResponseQuery + * @instance + */ + ResponseQuery.prototype.log = ""; + + /** + * ResponseQuery info. + * @member {string} info + * @memberof tendermint.abci.ResponseQuery + * @instance + */ + ResponseQuery.prototype.info = ""; + + /** + * ResponseQuery index. + * @member {number|Long} index + * @memberof tendermint.abci.ResponseQuery + * @instance + */ + ResponseQuery.prototype.index = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ResponseQuery key. + * @member {Uint8Array} key + * @memberof tendermint.abci.ResponseQuery + * @instance + */ + ResponseQuery.prototype.key = $util.newBuffer([]); + + /** + * ResponseQuery value. + * @member {Uint8Array} value + * @memberof tendermint.abci.ResponseQuery + * @instance + */ + ResponseQuery.prototype.value = $util.newBuffer([]); + + /** + * ResponseQuery proofOps. + * @member {tendermint.crypto.IProofOps|null|undefined} proofOps + * @memberof tendermint.abci.ResponseQuery + * @instance + */ + ResponseQuery.prototype.proofOps = null; + + /** + * ResponseQuery height. + * @member {number|Long} height + * @memberof tendermint.abci.ResponseQuery + * @instance + */ + ResponseQuery.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ResponseQuery codespace. + * @member {string} codespace + * @memberof tendermint.abci.ResponseQuery + * @instance + */ + ResponseQuery.prototype.codespace = ""; + + /** + * Creates a new ResponseQuery instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseQuery + * @static + * @param {tendermint.abci.IResponseQuery=} [properties] Properties to set + * @returns {tendermint.abci.ResponseQuery} ResponseQuery instance + */ + ResponseQuery.create = function create(properties) { + return new ResponseQuery(properties); + }; + + /** + * Encodes the specified ResponseQuery message. Does not implicitly {@link tendermint.abci.ResponseQuery.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseQuery + * @static + * @param {tendermint.abci.IResponseQuery} message ResponseQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseQuery.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.code); + if (message.log != null && Object.hasOwnProperty.call(message, "log")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.log); + if (message.info != null && Object.hasOwnProperty.call(message, "info")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.info); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.index); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.value); + if (message.proofOps != null && Object.hasOwnProperty.call(message, "proofOps")) + $root.tendermint.crypto.ProofOps.encode(message.proofOps, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.height); + if (message.codespace != null && Object.hasOwnProperty.call(message, "codespace")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.codespace); + return writer; + }; + + /** + * Encodes the specified ResponseQuery message, length delimited. Does not implicitly {@link tendermint.abci.ResponseQuery.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseQuery + * @static + * @param {tendermint.abci.IResponseQuery} message ResponseQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseQuery.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseQuery message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseQuery} ResponseQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseQuery.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseQuery(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 3: + message.log = reader.string(); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.index = reader.int64(); + break; + case 6: + message.key = reader.bytes(); + break; + case 7: + message.value = reader.bytes(); + break; + case 8: + message.proofOps = $root.tendermint.crypto.ProofOps.decode(reader, reader.uint32()); + break; + case 9: + message.height = reader.int64(); + break; + case 10: + message.codespace = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseQuery message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseQuery} ResponseQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseQuery.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseQuery message. + * @function verify + * @memberof tendermint.abci.ResponseQuery + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseQuery.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.log != null && message.hasOwnProperty("log")) + if (!$util.isString(message.log)) + return "log: string expected"; + if (message.info != null && message.hasOwnProperty("info")) + if (!$util.isString(message.info)) + return "info: string expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index) && !(message.index && $util.isInteger(message.index.low) && $util.isInteger(message.index.high))) + return "index: integer|Long expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + if (message.proofOps != null && message.hasOwnProperty("proofOps")) { + var error = $root.tendermint.crypto.ProofOps.verify(message.proofOps); + if (error) + return "proofOps." + error; + } + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.codespace != null && message.hasOwnProperty("codespace")) + if (!$util.isString(message.codespace)) + return "codespace: string expected"; + return null; + }; + + /** + * Creates a ResponseQuery message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseQuery + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseQuery} ResponseQuery + */ + ResponseQuery.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseQuery) + return object; + var message = new $root.tendermint.abci.ResponseQuery(); + if (object.code != null) + message.code = object.code >>> 0; + if (object.log != null) + message.log = String(object.log); + if (object.info != null) + message.info = String(object.info); + if (object.index != null) + if ($util.Long) + (message.index = $util.Long.fromValue(object.index)).unsigned = false; + else if (typeof object.index === "string") + message.index = parseInt(object.index, 10); + else if (typeof object.index === "number") + message.index = object.index; + else if (typeof object.index === "object") + message.index = new $util.LongBits(object.index.low >>> 0, object.index.high >>> 0).toNumber(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length) + message.key = object.key; + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length) + message.value = object.value; + if (object.proofOps != null) { + if (typeof object.proofOps !== "object") + throw TypeError(".tendermint.abci.ResponseQuery.proofOps: object expected"); + message.proofOps = $root.tendermint.crypto.ProofOps.fromObject(object.proofOps); + } + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + if (object.codespace != null) + message.codespace = String(object.codespace); + return message; + }; + + /** + * Creates a plain object from a ResponseQuery message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseQuery + * @static + * @param {tendermint.abci.ResponseQuery} message ResponseQuery + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseQuery.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.code = 0; + object.log = ""; + object.info = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.index = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.index = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + object.proofOps = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.codespace = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.log != null && message.hasOwnProperty("log")) + object.log = message.log; + if (message.info != null && message.hasOwnProperty("info")) + object.info = message.info; + if (message.index != null && message.hasOwnProperty("index")) + if (typeof message.index === "number") + object.index = options.longs === String ? String(message.index) : message.index; + else + object.index = options.longs === String ? $util.Long.prototype.toString.call(message.index) : options.longs === Number ? new $util.LongBits(message.index.low >>> 0, message.index.high >>> 0).toNumber() : message.index; + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + if (message.proofOps != null && message.hasOwnProperty("proofOps")) + object.proofOps = $root.tendermint.crypto.ProofOps.toObject(message.proofOps, options); + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + if (message.codespace != null && message.hasOwnProperty("codespace")) + object.codespace = message.codespace; + return object; + }; + + /** + * Converts this ResponseQuery to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseQuery + * @instance + * @returns {Object.} JSON object + */ + ResponseQuery.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseQuery; + })(abci.ResponseQuery || {}); + + abci.ResponseBeginBlock = (function(ResponseBeginBlock) { + + /** + * Properties of a ResponseBeginBlock. + * @memberof tendermint.abci + * @interface IResponseBeginBlock + * @property {Array.|null} [events] ResponseBeginBlock events + */ + + /** + * Constructs a new ResponseBeginBlock. + * @memberof tendermint.abci + * @classdesc Represents a ResponseBeginBlock. + * @implements IResponseBeginBlock + * @constructor + * @param {tendermint.abci.IResponseBeginBlock=} [properties] Properties to set + */ + function ResponseBeginBlock(properties) { + this.events = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseBeginBlock events. + * @member {Array.} events + * @memberof tendermint.abci.ResponseBeginBlock + * @instance + */ + ResponseBeginBlock.prototype.events = $util.emptyArray; + + /** + * Creates a new ResponseBeginBlock instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseBeginBlock + * @static + * @param {tendermint.abci.IResponseBeginBlock=} [properties] Properties to set + * @returns {tendermint.abci.ResponseBeginBlock} ResponseBeginBlock instance + */ + ResponseBeginBlock.create = function create(properties) { + return new ResponseBeginBlock(properties); + }; + + /** + * Encodes the specified ResponseBeginBlock message. Does not implicitly {@link tendermint.abci.ResponseBeginBlock.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseBeginBlock + * @static + * @param {tendermint.abci.IResponseBeginBlock} message ResponseBeginBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseBeginBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.events != null && message.events.length) + for (var i = 0; i < message.events.length; ++i) + $root.tendermint.abci.Event.encode(message.events[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResponseBeginBlock message, length delimited. Does not implicitly {@link tendermint.abci.ResponseBeginBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseBeginBlock + * @static + * @param {tendermint.abci.IResponseBeginBlock} message ResponseBeginBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseBeginBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseBeginBlock message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseBeginBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseBeginBlock} ResponseBeginBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseBeginBlock.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseBeginBlock(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.events && message.events.length)) + message.events = []; + message.events.push($root.tendermint.abci.Event.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseBeginBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseBeginBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseBeginBlock} ResponseBeginBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseBeginBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseBeginBlock message. + * @function verify + * @memberof tendermint.abci.ResponseBeginBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseBeginBlock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.events != null && message.hasOwnProperty("events")) { + if (!Array.isArray(message.events)) + return "events: array expected"; + for (var i = 0; i < message.events.length; ++i) { + var error = $root.tendermint.abci.Event.verify(message.events[i]); + if (error) + return "events." + error; + } + } + return null; + }; + + /** + * Creates a ResponseBeginBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseBeginBlock + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseBeginBlock} ResponseBeginBlock + */ + ResponseBeginBlock.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseBeginBlock) + return object; + var message = new $root.tendermint.abci.ResponseBeginBlock(); + if (object.events) { + if (!Array.isArray(object.events)) + throw TypeError(".tendermint.abci.ResponseBeginBlock.events: array expected"); + message.events = []; + for (var i = 0; i < object.events.length; ++i) { + if (typeof object.events[i] !== "object") + throw TypeError(".tendermint.abci.ResponseBeginBlock.events: object expected"); + message.events[i] = $root.tendermint.abci.Event.fromObject(object.events[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ResponseBeginBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseBeginBlock + * @static + * @param {tendermint.abci.ResponseBeginBlock} message ResponseBeginBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseBeginBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.events = []; + if (message.events && message.events.length) { + object.events = []; + for (var j = 0; j < message.events.length; ++j) + object.events[j] = $root.tendermint.abci.Event.toObject(message.events[j], options); + } + return object; + }; + + /** + * Converts this ResponseBeginBlock to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseBeginBlock + * @instance + * @returns {Object.} JSON object + */ + ResponseBeginBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseBeginBlock; + })(abci.ResponseBeginBlock || {}); + + abci.ResponseCheckTx = (function(ResponseCheckTx) { + + /** + * Properties of a ResponseCheckTx. + * @memberof tendermint.abci + * @interface IResponseCheckTx + * @property {number|null} [code] ResponseCheckTx code + * @property {Uint8Array|null} [data] ResponseCheckTx data + * @property {string|null} [log] ResponseCheckTx log + * @property {string|null} [info] ResponseCheckTx info + * @property {number|Long|null} [gasWanted] ResponseCheckTx gasWanted + * @property {number|Long|null} [gasUsed] ResponseCheckTx gasUsed + * @property {Array.|null} [events] ResponseCheckTx events + * @property {string|null} [codespace] ResponseCheckTx codespace + */ + + /** + * Constructs a new ResponseCheckTx. + * @memberof tendermint.abci + * @classdesc Represents a ResponseCheckTx. + * @implements IResponseCheckTx + * @constructor + * @param {tendermint.abci.IResponseCheckTx=} [properties] Properties to set + */ + function ResponseCheckTx(properties) { + this.events = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseCheckTx code. + * @member {number} code + * @memberof tendermint.abci.ResponseCheckTx + * @instance + */ + ResponseCheckTx.prototype.code = 0; + + /** + * ResponseCheckTx data. + * @member {Uint8Array} data + * @memberof tendermint.abci.ResponseCheckTx + * @instance + */ + ResponseCheckTx.prototype.data = $util.newBuffer([]); + + /** + * ResponseCheckTx log. + * @member {string} log + * @memberof tendermint.abci.ResponseCheckTx + * @instance + */ + ResponseCheckTx.prototype.log = ""; + + /** + * ResponseCheckTx info. + * @member {string} info + * @memberof tendermint.abci.ResponseCheckTx + * @instance + */ + ResponseCheckTx.prototype.info = ""; + + /** + * ResponseCheckTx gasWanted. + * @member {number|Long} gasWanted + * @memberof tendermint.abci.ResponseCheckTx + * @instance + */ + ResponseCheckTx.prototype.gasWanted = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ResponseCheckTx gasUsed. + * @member {number|Long} gasUsed + * @memberof tendermint.abci.ResponseCheckTx + * @instance + */ + ResponseCheckTx.prototype.gasUsed = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ResponseCheckTx events. + * @member {Array.} events + * @memberof tendermint.abci.ResponseCheckTx + * @instance + */ + ResponseCheckTx.prototype.events = $util.emptyArray; + + /** + * ResponseCheckTx codespace. + * @member {string} codespace + * @memberof tendermint.abci.ResponseCheckTx + * @instance + */ + ResponseCheckTx.prototype.codespace = ""; + + /** + * Creates a new ResponseCheckTx instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseCheckTx + * @static + * @param {tendermint.abci.IResponseCheckTx=} [properties] Properties to set + * @returns {tendermint.abci.ResponseCheckTx} ResponseCheckTx instance + */ + ResponseCheckTx.create = function create(properties) { + return new ResponseCheckTx(properties); + }; + + /** + * Encodes the specified ResponseCheckTx message. Does not implicitly {@link tendermint.abci.ResponseCheckTx.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseCheckTx + * @static + * @param {tendermint.abci.IResponseCheckTx} message ResponseCheckTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseCheckTx.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.code); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); + if (message.log != null && Object.hasOwnProperty.call(message, "log")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.log); + if (message.info != null && Object.hasOwnProperty.call(message, "info")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.info); + if (message.gasWanted != null && Object.hasOwnProperty.call(message, "gasWanted")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.gasWanted); + if (message.gasUsed != null && Object.hasOwnProperty.call(message, "gasUsed")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.gasUsed); + if (message.events != null && message.events.length) + for (var i = 0; i < message.events.length; ++i) + $root.tendermint.abci.Event.encode(message.events[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.codespace != null && Object.hasOwnProperty.call(message, "codespace")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.codespace); + return writer; + }; + + /** + * Encodes the specified ResponseCheckTx message, length delimited. Does not implicitly {@link tendermint.abci.ResponseCheckTx.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseCheckTx + * @static + * @param {tendermint.abci.IResponseCheckTx} message ResponseCheckTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseCheckTx.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseCheckTx message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseCheckTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseCheckTx} ResponseCheckTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseCheckTx.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseCheckTx(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 2: + message.data = reader.bytes(); + break; + case 3: + message.log = reader.string(); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.gasWanted = reader.int64(); + break; + case 6: + message.gasUsed = reader.int64(); + break; + case 7: + if (!(message.events && message.events.length)) + message.events = []; + message.events.push($root.tendermint.abci.Event.decode(reader, reader.uint32())); + break; + case 8: + message.codespace = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseCheckTx message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseCheckTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseCheckTx} ResponseCheckTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseCheckTx.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseCheckTx message. + * @function verify + * @memberof tendermint.abci.ResponseCheckTx + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseCheckTx.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + if (message.log != null && message.hasOwnProperty("log")) + if (!$util.isString(message.log)) + return "log: string expected"; + if (message.info != null && message.hasOwnProperty("info")) + if (!$util.isString(message.info)) + return "info: string expected"; + if (message.gasWanted != null && message.hasOwnProperty("gasWanted")) + if (!$util.isInteger(message.gasWanted) && !(message.gasWanted && $util.isInteger(message.gasWanted.low) && $util.isInteger(message.gasWanted.high))) + return "gasWanted: integer|Long expected"; + if (message.gasUsed != null && message.hasOwnProperty("gasUsed")) + if (!$util.isInteger(message.gasUsed) && !(message.gasUsed && $util.isInteger(message.gasUsed.low) && $util.isInteger(message.gasUsed.high))) + return "gasUsed: integer|Long expected"; + if (message.events != null && message.hasOwnProperty("events")) { + if (!Array.isArray(message.events)) + return "events: array expected"; + for (var i = 0; i < message.events.length; ++i) { + var error = $root.tendermint.abci.Event.verify(message.events[i]); + if (error) + return "events." + error; + } + } + if (message.codespace != null && message.hasOwnProperty("codespace")) + if (!$util.isString(message.codespace)) + return "codespace: string expected"; + return null; + }; + + /** + * Creates a ResponseCheckTx message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseCheckTx + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseCheckTx} ResponseCheckTx + */ + ResponseCheckTx.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseCheckTx) + return object; + var message = new $root.tendermint.abci.ResponseCheckTx(); + if (object.code != null) + message.code = object.code >>> 0; + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length) + message.data = object.data; + if (object.log != null) + message.log = String(object.log); + if (object.info != null) + message.info = String(object.info); + if (object.gasWanted != null) + if ($util.Long) + (message.gasWanted = $util.Long.fromValue(object.gasWanted)).unsigned = false; + else if (typeof object.gasWanted === "string") + message.gasWanted = parseInt(object.gasWanted, 10); + else if (typeof object.gasWanted === "number") + message.gasWanted = object.gasWanted; + else if (typeof object.gasWanted === "object") + message.gasWanted = new $util.LongBits(object.gasWanted.low >>> 0, object.gasWanted.high >>> 0).toNumber(); + if (object.gasUsed != null) + if ($util.Long) + (message.gasUsed = $util.Long.fromValue(object.gasUsed)).unsigned = false; + else if (typeof object.gasUsed === "string") + message.gasUsed = parseInt(object.gasUsed, 10); + else if (typeof object.gasUsed === "number") + message.gasUsed = object.gasUsed; + else if (typeof object.gasUsed === "object") + message.gasUsed = new $util.LongBits(object.gasUsed.low >>> 0, object.gasUsed.high >>> 0).toNumber(); + if (object.events) { + if (!Array.isArray(object.events)) + throw TypeError(".tendermint.abci.ResponseCheckTx.events: array expected"); + message.events = []; + for (var i = 0; i < object.events.length; ++i) { + if (typeof object.events[i] !== "object") + throw TypeError(".tendermint.abci.ResponseCheckTx.events: object expected"); + message.events[i] = $root.tendermint.abci.Event.fromObject(object.events[i]); + } + } + if (object.codespace != null) + message.codespace = String(object.codespace); + return message; + }; + + /** + * Creates a plain object from a ResponseCheckTx message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseCheckTx + * @static + * @param {tendermint.abci.ResponseCheckTx} message ResponseCheckTx + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseCheckTx.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.events = []; + if (options.defaults) { + object.code = 0; + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + object.log = ""; + object.info = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.gasWanted = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.gasWanted = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.gasUsed = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.gasUsed = options.longs === String ? "0" : 0; + object.codespace = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + if (message.log != null && message.hasOwnProperty("log")) + object.log = message.log; + if (message.info != null && message.hasOwnProperty("info")) + object.info = message.info; + if (message.gasWanted != null && message.hasOwnProperty("gasWanted")) + if (typeof message.gasWanted === "number") + object.gasWanted = options.longs === String ? String(message.gasWanted) : message.gasWanted; + else + object.gasWanted = options.longs === String ? $util.Long.prototype.toString.call(message.gasWanted) : options.longs === Number ? new $util.LongBits(message.gasWanted.low >>> 0, message.gasWanted.high >>> 0).toNumber() : message.gasWanted; + if (message.gasUsed != null && message.hasOwnProperty("gasUsed")) + if (typeof message.gasUsed === "number") + object.gasUsed = options.longs === String ? String(message.gasUsed) : message.gasUsed; + else + object.gasUsed = options.longs === String ? $util.Long.prototype.toString.call(message.gasUsed) : options.longs === Number ? new $util.LongBits(message.gasUsed.low >>> 0, message.gasUsed.high >>> 0).toNumber() : message.gasUsed; + if (message.events && message.events.length) { + object.events = []; + for (var j = 0; j < message.events.length; ++j) + object.events[j] = $root.tendermint.abci.Event.toObject(message.events[j], options); + } + if (message.codespace != null && message.hasOwnProperty("codespace")) + object.codespace = message.codespace; + return object; + }; + + /** + * Converts this ResponseCheckTx to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseCheckTx + * @instance + * @returns {Object.} JSON object + */ + ResponseCheckTx.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseCheckTx; + })(abci.ResponseCheckTx || {}); + + abci.ResponseDeliverTx = (function(ResponseDeliverTx) { + + /** + * Properties of a ResponseDeliverTx. + * @memberof tendermint.abci + * @interface IResponseDeliverTx + * @property {number|null} [code] ResponseDeliverTx code + * @property {Uint8Array|null} [data] ResponseDeliverTx data + * @property {string|null} [log] ResponseDeliverTx log + * @property {string|null} [info] ResponseDeliverTx info + * @property {number|Long|null} [gasWanted] ResponseDeliverTx gasWanted + * @property {number|Long|null} [gasUsed] ResponseDeliverTx gasUsed + * @property {Array.|null} [events] ResponseDeliverTx events + * @property {string|null} [codespace] ResponseDeliverTx codespace + */ + + /** + * Constructs a new ResponseDeliverTx. + * @memberof tendermint.abci + * @classdesc Represents a ResponseDeliverTx. + * @implements IResponseDeliverTx + * @constructor + * @param {tendermint.abci.IResponseDeliverTx=} [properties] Properties to set + */ + function ResponseDeliverTx(properties) { + this.events = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseDeliverTx code. + * @member {number} code + * @memberof tendermint.abci.ResponseDeliverTx + * @instance + */ + ResponseDeliverTx.prototype.code = 0; + + /** + * ResponseDeliverTx data. + * @member {Uint8Array} data + * @memberof tendermint.abci.ResponseDeliverTx + * @instance + */ + ResponseDeliverTx.prototype.data = $util.newBuffer([]); + + /** + * ResponseDeliverTx log. + * @member {string} log + * @memberof tendermint.abci.ResponseDeliverTx + * @instance + */ + ResponseDeliverTx.prototype.log = ""; + + /** + * ResponseDeliverTx info. + * @member {string} info + * @memberof tendermint.abci.ResponseDeliverTx + * @instance + */ + ResponseDeliverTx.prototype.info = ""; + + /** + * ResponseDeliverTx gasWanted. + * @member {number|Long} gasWanted + * @memberof tendermint.abci.ResponseDeliverTx + * @instance + */ + ResponseDeliverTx.prototype.gasWanted = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ResponseDeliverTx gasUsed. + * @member {number|Long} gasUsed + * @memberof tendermint.abci.ResponseDeliverTx + * @instance + */ + ResponseDeliverTx.prototype.gasUsed = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ResponseDeliverTx events. + * @member {Array.} events + * @memberof tendermint.abci.ResponseDeliverTx + * @instance + */ + ResponseDeliverTx.prototype.events = $util.emptyArray; + + /** + * ResponseDeliverTx codespace. + * @member {string} codespace + * @memberof tendermint.abci.ResponseDeliverTx + * @instance + */ + ResponseDeliverTx.prototype.codespace = ""; + + /** + * Creates a new ResponseDeliverTx instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseDeliverTx + * @static + * @param {tendermint.abci.IResponseDeliverTx=} [properties] Properties to set + * @returns {tendermint.abci.ResponseDeliverTx} ResponseDeliverTx instance + */ + ResponseDeliverTx.create = function create(properties) { + return new ResponseDeliverTx(properties); + }; + + /** + * Encodes the specified ResponseDeliverTx message. Does not implicitly {@link tendermint.abci.ResponseDeliverTx.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseDeliverTx + * @static + * @param {tendermint.abci.IResponseDeliverTx} message ResponseDeliverTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseDeliverTx.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.code); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); + if (message.log != null && Object.hasOwnProperty.call(message, "log")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.log); + if (message.info != null && Object.hasOwnProperty.call(message, "info")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.info); + if (message.gasWanted != null && Object.hasOwnProperty.call(message, "gasWanted")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.gasWanted); + if (message.gasUsed != null && Object.hasOwnProperty.call(message, "gasUsed")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.gasUsed); + if (message.events != null && message.events.length) + for (var i = 0; i < message.events.length; ++i) + $root.tendermint.abci.Event.encode(message.events[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.codespace != null && Object.hasOwnProperty.call(message, "codespace")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.codespace); + return writer; + }; + + /** + * Encodes the specified ResponseDeliverTx message, length delimited. Does not implicitly {@link tendermint.abci.ResponseDeliverTx.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseDeliverTx + * @static + * @param {tendermint.abci.IResponseDeliverTx} message ResponseDeliverTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseDeliverTx.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseDeliverTx message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseDeliverTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseDeliverTx} ResponseDeliverTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseDeliverTx.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseDeliverTx(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 2: + message.data = reader.bytes(); + break; + case 3: + message.log = reader.string(); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.gasWanted = reader.int64(); + break; + case 6: + message.gasUsed = reader.int64(); + break; + case 7: + if (!(message.events && message.events.length)) + message.events = []; + message.events.push($root.tendermint.abci.Event.decode(reader, reader.uint32())); + break; + case 8: + message.codespace = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseDeliverTx message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseDeliverTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseDeliverTx} ResponseDeliverTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseDeliverTx.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseDeliverTx message. + * @function verify + * @memberof tendermint.abci.ResponseDeliverTx + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseDeliverTx.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + if (message.log != null && message.hasOwnProperty("log")) + if (!$util.isString(message.log)) + return "log: string expected"; + if (message.info != null && message.hasOwnProperty("info")) + if (!$util.isString(message.info)) + return "info: string expected"; + if (message.gasWanted != null && message.hasOwnProperty("gasWanted")) + if (!$util.isInteger(message.gasWanted) && !(message.gasWanted && $util.isInteger(message.gasWanted.low) && $util.isInteger(message.gasWanted.high))) + return "gasWanted: integer|Long expected"; + if (message.gasUsed != null && message.hasOwnProperty("gasUsed")) + if (!$util.isInteger(message.gasUsed) && !(message.gasUsed && $util.isInteger(message.gasUsed.low) && $util.isInteger(message.gasUsed.high))) + return "gasUsed: integer|Long expected"; + if (message.events != null && message.hasOwnProperty("events")) { + if (!Array.isArray(message.events)) + return "events: array expected"; + for (var i = 0; i < message.events.length; ++i) { + var error = $root.tendermint.abci.Event.verify(message.events[i]); + if (error) + return "events." + error; + } + } + if (message.codespace != null && message.hasOwnProperty("codespace")) + if (!$util.isString(message.codespace)) + return "codespace: string expected"; + return null; + }; + + /** + * Creates a ResponseDeliverTx message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseDeliverTx + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseDeliverTx} ResponseDeliverTx + */ + ResponseDeliverTx.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseDeliverTx) + return object; + var message = new $root.tendermint.abci.ResponseDeliverTx(); + if (object.code != null) + message.code = object.code >>> 0; + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length) + message.data = object.data; + if (object.log != null) + message.log = String(object.log); + if (object.info != null) + message.info = String(object.info); + if (object.gasWanted != null) + if ($util.Long) + (message.gasWanted = $util.Long.fromValue(object.gasWanted)).unsigned = false; + else if (typeof object.gasWanted === "string") + message.gasWanted = parseInt(object.gasWanted, 10); + else if (typeof object.gasWanted === "number") + message.gasWanted = object.gasWanted; + else if (typeof object.gasWanted === "object") + message.gasWanted = new $util.LongBits(object.gasWanted.low >>> 0, object.gasWanted.high >>> 0).toNumber(); + if (object.gasUsed != null) + if ($util.Long) + (message.gasUsed = $util.Long.fromValue(object.gasUsed)).unsigned = false; + else if (typeof object.gasUsed === "string") + message.gasUsed = parseInt(object.gasUsed, 10); + else if (typeof object.gasUsed === "number") + message.gasUsed = object.gasUsed; + else if (typeof object.gasUsed === "object") + message.gasUsed = new $util.LongBits(object.gasUsed.low >>> 0, object.gasUsed.high >>> 0).toNumber(); + if (object.events) { + if (!Array.isArray(object.events)) + throw TypeError(".tendermint.abci.ResponseDeliverTx.events: array expected"); + message.events = []; + for (var i = 0; i < object.events.length; ++i) { + if (typeof object.events[i] !== "object") + throw TypeError(".tendermint.abci.ResponseDeliverTx.events: object expected"); + message.events[i] = $root.tendermint.abci.Event.fromObject(object.events[i]); + } + } + if (object.codespace != null) + message.codespace = String(object.codespace); + return message; + }; + + /** + * Creates a plain object from a ResponseDeliverTx message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseDeliverTx + * @static + * @param {tendermint.abci.ResponseDeliverTx} message ResponseDeliverTx + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseDeliverTx.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.events = []; + if (options.defaults) { + object.code = 0; + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + object.log = ""; + object.info = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.gasWanted = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.gasWanted = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.gasUsed = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.gasUsed = options.longs === String ? "0" : 0; + object.codespace = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + if (message.log != null && message.hasOwnProperty("log")) + object.log = message.log; + if (message.info != null && message.hasOwnProperty("info")) + object.info = message.info; + if (message.gasWanted != null && message.hasOwnProperty("gasWanted")) + if (typeof message.gasWanted === "number") + object.gasWanted = options.longs === String ? String(message.gasWanted) : message.gasWanted; + else + object.gasWanted = options.longs === String ? $util.Long.prototype.toString.call(message.gasWanted) : options.longs === Number ? new $util.LongBits(message.gasWanted.low >>> 0, message.gasWanted.high >>> 0).toNumber() : message.gasWanted; + if (message.gasUsed != null && message.hasOwnProperty("gasUsed")) + if (typeof message.gasUsed === "number") + object.gasUsed = options.longs === String ? String(message.gasUsed) : message.gasUsed; + else + object.gasUsed = options.longs === String ? $util.Long.prototype.toString.call(message.gasUsed) : options.longs === Number ? new $util.LongBits(message.gasUsed.low >>> 0, message.gasUsed.high >>> 0).toNumber() : message.gasUsed; + if (message.events && message.events.length) { + object.events = []; + for (var j = 0; j < message.events.length; ++j) + object.events[j] = $root.tendermint.abci.Event.toObject(message.events[j], options); + } + if (message.codespace != null && message.hasOwnProperty("codespace")) + object.codespace = message.codespace; + return object; + }; + + /** + * Converts this ResponseDeliverTx to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseDeliverTx + * @instance + * @returns {Object.} JSON object + */ + ResponseDeliverTx.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseDeliverTx; + })(abci.ResponseDeliverTx || {}); + + abci.ResponseEndBlock = (function(ResponseEndBlock) { + + /** + * Properties of a ResponseEndBlock. + * @memberof tendermint.abci + * @interface IResponseEndBlock + * @property {Array.|null} [validatorUpdates] ResponseEndBlock validatorUpdates + * @property {tendermint.abci.IConsensusParams|null} [consensusParamUpdates] ResponseEndBlock consensusParamUpdates + * @property {Array.|null} [events] ResponseEndBlock events + */ + + /** + * Constructs a new ResponseEndBlock. + * @memberof tendermint.abci + * @classdesc Represents a ResponseEndBlock. + * @implements IResponseEndBlock + * @constructor + * @param {tendermint.abci.IResponseEndBlock=} [properties] Properties to set + */ + function ResponseEndBlock(properties) { + this.validatorUpdates = []; + this.events = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseEndBlock validatorUpdates. + * @member {Array.} validatorUpdates + * @memberof tendermint.abci.ResponseEndBlock + * @instance + */ + ResponseEndBlock.prototype.validatorUpdates = $util.emptyArray; + + /** + * ResponseEndBlock consensusParamUpdates. + * @member {tendermint.abci.IConsensusParams|null|undefined} consensusParamUpdates + * @memberof tendermint.abci.ResponseEndBlock + * @instance + */ + ResponseEndBlock.prototype.consensusParamUpdates = null; + + /** + * ResponseEndBlock events. + * @member {Array.} events + * @memberof tendermint.abci.ResponseEndBlock + * @instance + */ + ResponseEndBlock.prototype.events = $util.emptyArray; + + /** + * Creates a new ResponseEndBlock instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseEndBlock + * @static + * @param {tendermint.abci.IResponseEndBlock=} [properties] Properties to set + * @returns {tendermint.abci.ResponseEndBlock} ResponseEndBlock instance + */ + ResponseEndBlock.create = function create(properties) { + return new ResponseEndBlock(properties); + }; + + /** + * Encodes the specified ResponseEndBlock message. Does not implicitly {@link tendermint.abci.ResponseEndBlock.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseEndBlock + * @static + * @param {tendermint.abci.IResponseEndBlock} message ResponseEndBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseEndBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validatorUpdates != null && message.validatorUpdates.length) + for (var i = 0; i < message.validatorUpdates.length; ++i) + $root.tendermint.abci.ValidatorUpdate.encode(message.validatorUpdates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.consensusParamUpdates != null && Object.hasOwnProperty.call(message, "consensusParamUpdates")) + $root.tendermint.abci.ConsensusParams.encode(message.consensusParamUpdates, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.events != null && message.events.length) + for (var i = 0; i < message.events.length; ++i) + $root.tendermint.abci.Event.encode(message.events[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResponseEndBlock message, length delimited. Does not implicitly {@link tendermint.abci.ResponseEndBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseEndBlock + * @static + * @param {tendermint.abci.IResponseEndBlock} message ResponseEndBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseEndBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseEndBlock message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseEndBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseEndBlock} ResponseEndBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseEndBlock.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseEndBlock(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.validatorUpdates && message.validatorUpdates.length)) + message.validatorUpdates = []; + message.validatorUpdates.push($root.tendermint.abci.ValidatorUpdate.decode(reader, reader.uint32())); + break; + case 2: + message.consensusParamUpdates = $root.tendermint.abci.ConsensusParams.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.events && message.events.length)) + message.events = []; + message.events.push($root.tendermint.abci.Event.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseEndBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseEndBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseEndBlock} ResponseEndBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseEndBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseEndBlock message. + * @function verify + * @memberof tendermint.abci.ResponseEndBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseEndBlock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validatorUpdates != null && message.hasOwnProperty("validatorUpdates")) { + if (!Array.isArray(message.validatorUpdates)) + return "validatorUpdates: array expected"; + for (var i = 0; i < message.validatorUpdates.length; ++i) { + var error = $root.tendermint.abci.ValidatorUpdate.verify(message.validatorUpdates[i]); + if (error) + return "validatorUpdates." + error; + } + } + if (message.consensusParamUpdates != null && message.hasOwnProperty("consensusParamUpdates")) { + var error = $root.tendermint.abci.ConsensusParams.verify(message.consensusParamUpdates); + if (error) + return "consensusParamUpdates." + error; + } + if (message.events != null && message.hasOwnProperty("events")) { + if (!Array.isArray(message.events)) + return "events: array expected"; + for (var i = 0; i < message.events.length; ++i) { + var error = $root.tendermint.abci.Event.verify(message.events[i]); + if (error) + return "events." + error; + } + } + return null; + }; + + /** + * Creates a ResponseEndBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseEndBlock + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseEndBlock} ResponseEndBlock + */ + ResponseEndBlock.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseEndBlock) + return object; + var message = new $root.tendermint.abci.ResponseEndBlock(); + if (object.validatorUpdates) { + if (!Array.isArray(object.validatorUpdates)) + throw TypeError(".tendermint.abci.ResponseEndBlock.validatorUpdates: array expected"); + message.validatorUpdates = []; + for (var i = 0; i < object.validatorUpdates.length; ++i) { + if (typeof object.validatorUpdates[i] !== "object") + throw TypeError(".tendermint.abci.ResponseEndBlock.validatorUpdates: object expected"); + message.validatorUpdates[i] = $root.tendermint.abci.ValidatorUpdate.fromObject(object.validatorUpdates[i]); + } + } + if (object.consensusParamUpdates != null) { + if (typeof object.consensusParamUpdates !== "object") + throw TypeError(".tendermint.abci.ResponseEndBlock.consensusParamUpdates: object expected"); + message.consensusParamUpdates = $root.tendermint.abci.ConsensusParams.fromObject(object.consensusParamUpdates); + } + if (object.events) { + if (!Array.isArray(object.events)) + throw TypeError(".tendermint.abci.ResponseEndBlock.events: array expected"); + message.events = []; + for (var i = 0; i < object.events.length; ++i) { + if (typeof object.events[i] !== "object") + throw TypeError(".tendermint.abci.ResponseEndBlock.events: object expected"); + message.events[i] = $root.tendermint.abci.Event.fromObject(object.events[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ResponseEndBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseEndBlock + * @static + * @param {tendermint.abci.ResponseEndBlock} message ResponseEndBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseEndBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.validatorUpdates = []; + object.events = []; + } + if (options.defaults) + object.consensusParamUpdates = null; + if (message.validatorUpdates && message.validatorUpdates.length) { + object.validatorUpdates = []; + for (var j = 0; j < message.validatorUpdates.length; ++j) + object.validatorUpdates[j] = $root.tendermint.abci.ValidatorUpdate.toObject(message.validatorUpdates[j], options); + } + if (message.consensusParamUpdates != null && message.hasOwnProperty("consensusParamUpdates")) + object.consensusParamUpdates = $root.tendermint.abci.ConsensusParams.toObject(message.consensusParamUpdates, options); + if (message.events && message.events.length) { + object.events = []; + for (var j = 0; j < message.events.length; ++j) + object.events[j] = $root.tendermint.abci.Event.toObject(message.events[j], options); + } + return object; + }; + + /** + * Converts this ResponseEndBlock to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseEndBlock + * @instance + * @returns {Object.} JSON object + */ + ResponseEndBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseEndBlock; + })(abci.ResponseEndBlock || {}); + + abci.ResponseCommit = (function(ResponseCommit) { + + /** + * Properties of a ResponseCommit. + * @memberof tendermint.abci + * @interface IResponseCommit + * @property {Uint8Array|null} [data] ResponseCommit data + * @property {number|Long|null} [retainHeight] ResponseCommit retainHeight + */ + + /** + * Constructs a new ResponseCommit. + * @memberof tendermint.abci + * @classdesc Represents a ResponseCommit. + * @implements IResponseCommit + * @constructor + * @param {tendermint.abci.IResponseCommit=} [properties] Properties to set + */ + function ResponseCommit(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseCommit data. + * @member {Uint8Array} data + * @memberof tendermint.abci.ResponseCommit + * @instance + */ + ResponseCommit.prototype.data = $util.newBuffer([]); + + /** + * ResponseCommit retainHeight. + * @member {number|Long} retainHeight + * @memberof tendermint.abci.ResponseCommit + * @instance + */ + ResponseCommit.prototype.retainHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ResponseCommit instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseCommit + * @static + * @param {tendermint.abci.IResponseCommit=} [properties] Properties to set + * @returns {tendermint.abci.ResponseCommit} ResponseCommit instance + */ + ResponseCommit.create = function create(properties) { + return new ResponseCommit(properties); + }; + + /** + * Encodes the specified ResponseCommit message. Does not implicitly {@link tendermint.abci.ResponseCommit.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseCommit + * @static + * @param {tendermint.abci.IResponseCommit} message ResponseCommit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseCommit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); + if (message.retainHeight != null && Object.hasOwnProperty.call(message, "retainHeight")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.retainHeight); + return writer; + }; + + /** + * Encodes the specified ResponseCommit message, length delimited. Does not implicitly {@link tendermint.abci.ResponseCommit.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseCommit + * @static + * @param {tendermint.abci.IResponseCommit} message ResponseCommit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseCommit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseCommit message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseCommit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseCommit} ResponseCommit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseCommit.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseCommit(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.data = reader.bytes(); + break; + case 3: + message.retainHeight = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseCommit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseCommit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseCommit} ResponseCommit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseCommit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseCommit message. + * @function verify + * @memberof tendermint.abci.ResponseCommit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseCommit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + if (message.retainHeight != null && message.hasOwnProperty("retainHeight")) + if (!$util.isInteger(message.retainHeight) && !(message.retainHeight && $util.isInteger(message.retainHeight.low) && $util.isInteger(message.retainHeight.high))) + return "retainHeight: integer|Long expected"; + return null; + }; + + /** + * Creates a ResponseCommit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseCommit + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseCommit} ResponseCommit + */ + ResponseCommit.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseCommit) + return object; + var message = new $root.tendermint.abci.ResponseCommit(); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length) + message.data = object.data; + if (object.retainHeight != null) + if ($util.Long) + (message.retainHeight = $util.Long.fromValue(object.retainHeight)).unsigned = false; + else if (typeof object.retainHeight === "string") + message.retainHeight = parseInt(object.retainHeight, 10); + else if (typeof object.retainHeight === "number") + message.retainHeight = object.retainHeight; + else if (typeof object.retainHeight === "object") + message.retainHeight = new $util.LongBits(object.retainHeight.low >>> 0, object.retainHeight.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ResponseCommit message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseCommit + * @static + * @param {tendermint.abci.ResponseCommit} message ResponseCommit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseCommit.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.retainHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.retainHeight = options.longs === String ? "0" : 0; + } + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + if (message.retainHeight != null && message.hasOwnProperty("retainHeight")) + if (typeof message.retainHeight === "number") + object.retainHeight = options.longs === String ? String(message.retainHeight) : message.retainHeight; + else + object.retainHeight = options.longs === String ? $util.Long.prototype.toString.call(message.retainHeight) : options.longs === Number ? new $util.LongBits(message.retainHeight.low >>> 0, message.retainHeight.high >>> 0).toNumber() : message.retainHeight; + return object; + }; + + /** + * Converts this ResponseCommit to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseCommit + * @instance + * @returns {Object.} JSON object + */ + ResponseCommit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseCommit; + })(abci.ResponseCommit || {}); + + abci.ResponseListSnapshots = (function(ResponseListSnapshots) { + + /** + * Properties of a ResponseListSnapshots. + * @memberof tendermint.abci + * @interface IResponseListSnapshots + * @property {Array.|null} [snapshots] ResponseListSnapshots snapshots + */ + + /** + * Constructs a new ResponseListSnapshots. + * @memberof tendermint.abci + * @classdesc Represents a ResponseListSnapshots. + * @implements IResponseListSnapshots + * @constructor + * @param {tendermint.abci.IResponseListSnapshots=} [properties] Properties to set + */ + function ResponseListSnapshots(properties) { + this.snapshots = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseListSnapshots snapshots. + * @member {Array.} snapshots + * @memberof tendermint.abci.ResponseListSnapshots + * @instance + */ + ResponseListSnapshots.prototype.snapshots = $util.emptyArray; + + /** + * Creates a new ResponseListSnapshots instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseListSnapshots + * @static + * @param {tendermint.abci.IResponseListSnapshots=} [properties] Properties to set + * @returns {tendermint.abci.ResponseListSnapshots} ResponseListSnapshots instance + */ + ResponseListSnapshots.create = function create(properties) { + return new ResponseListSnapshots(properties); + }; + + /** + * Encodes the specified ResponseListSnapshots message. Does not implicitly {@link tendermint.abci.ResponseListSnapshots.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseListSnapshots + * @static + * @param {tendermint.abci.IResponseListSnapshots} message ResponseListSnapshots message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseListSnapshots.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.snapshots != null && message.snapshots.length) + for (var i = 0; i < message.snapshots.length; ++i) + $root.tendermint.abci.Snapshot.encode(message.snapshots[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResponseListSnapshots message, length delimited. Does not implicitly {@link tendermint.abci.ResponseListSnapshots.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseListSnapshots + * @static + * @param {tendermint.abci.IResponseListSnapshots} message ResponseListSnapshots message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseListSnapshots.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseListSnapshots message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseListSnapshots + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseListSnapshots} ResponseListSnapshots + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseListSnapshots.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseListSnapshots(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.snapshots && message.snapshots.length)) + message.snapshots = []; + message.snapshots.push($root.tendermint.abci.Snapshot.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseListSnapshots message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseListSnapshots + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseListSnapshots} ResponseListSnapshots + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseListSnapshots.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseListSnapshots message. + * @function verify + * @memberof tendermint.abci.ResponseListSnapshots + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseListSnapshots.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.snapshots != null && message.hasOwnProperty("snapshots")) { + if (!Array.isArray(message.snapshots)) + return "snapshots: array expected"; + for (var i = 0; i < message.snapshots.length; ++i) { + var error = $root.tendermint.abci.Snapshot.verify(message.snapshots[i]); + if (error) + return "snapshots." + error; + } + } + return null; + }; + + /** + * Creates a ResponseListSnapshots message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseListSnapshots + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseListSnapshots} ResponseListSnapshots + */ + ResponseListSnapshots.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseListSnapshots) + return object; + var message = new $root.tendermint.abci.ResponseListSnapshots(); + if (object.snapshots) { + if (!Array.isArray(object.snapshots)) + throw TypeError(".tendermint.abci.ResponseListSnapshots.snapshots: array expected"); + message.snapshots = []; + for (var i = 0; i < object.snapshots.length; ++i) { + if (typeof object.snapshots[i] !== "object") + throw TypeError(".tendermint.abci.ResponseListSnapshots.snapshots: object expected"); + message.snapshots[i] = $root.tendermint.abci.Snapshot.fromObject(object.snapshots[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ResponseListSnapshots message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseListSnapshots + * @static + * @param {tendermint.abci.ResponseListSnapshots} message ResponseListSnapshots + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseListSnapshots.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.snapshots = []; + if (message.snapshots && message.snapshots.length) { + object.snapshots = []; + for (var j = 0; j < message.snapshots.length; ++j) + object.snapshots[j] = $root.tendermint.abci.Snapshot.toObject(message.snapshots[j], options); + } + return object; + }; + + /** + * Converts this ResponseListSnapshots to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseListSnapshots + * @instance + * @returns {Object.} JSON object + */ + ResponseListSnapshots.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseListSnapshots; + })(abci.ResponseListSnapshots || {}); + + abci.ResponseOfferSnapshot = (function(ResponseOfferSnapshot) { + + /** + * Properties of a ResponseOfferSnapshot. + * @memberof tendermint.abci + * @interface IResponseOfferSnapshot + * @property {tendermint.abci.ResponseOfferSnapshot.Result|null} [result] ResponseOfferSnapshot result + */ + + /** + * Constructs a new ResponseOfferSnapshot. + * @memberof tendermint.abci + * @classdesc Represents a ResponseOfferSnapshot. + * @implements IResponseOfferSnapshot + * @constructor + * @param {tendermint.abci.IResponseOfferSnapshot=} [properties] Properties to set + */ + function ResponseOfferSnapshot(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseOfferSnapshot result. + * @member {tendermint.abci.ResponseOfferSnapshot.Result} result + * @memberof tendermint.abci.ResponseOfferSnapshot + * @instance + */ + ResponseOfferSnapshot.prototype.result = 0; + + /** + * Creates a new ResponseOfferSnapshot instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseOfferSnapshot + * @static + * @param {tendermint.abci.IResponseOfferSnapshot=} [properties] Properties to set + * @returns {tendermint.abci.ResponseOfferSnapshot} ResponseOfferSnapshot instance + */ + ResponseOfferSnapshot.create = function create(properties) { + return new ResponseOfferSnapshot(properties); + }; + + /** + * Encodes the specified ResponseOfferSnapshot message. Does not implicitly {@link tendermint.abci.ResponseOfferSnapshot.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseOfferSnapshot + * @static + * @param {tendermint.abci.IResponseOfferSnapshot} message ResponseOfferSnapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseOfferSnapshot.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.result != null && Object.hasOwnProperty.call(message, "result")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.result); + return writer; + }; + + /** + * Encodes the specified ResponseOfferSnapshot message, length delimited. Does not implicitly {@link tendermint.abci.ResponseOfferSnapshot.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseOfferSnapshot + * @static + * @param {tendermint.abci.IResponseOfferSnapshot} message ResponseOfferSnapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseOfferSnapshot.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseOfferSnapshot message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseOfferSnapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseOfferSnapshot} ResponseOfferSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseOfferSnapshot.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseOfferSnapshot(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.result = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseOfferSnapshot message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseOfferSnapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseOfferSnapshot} ResponseOfferSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseOfferSnapshot.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseOfferSnapshot message. + * @function verify + * @memberof tendermint.abci.ResponseOfferSnapshot + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseOfferSnapshot.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.result != null && message.hasOwnProperty("result")) + switch (message.result) { + default: + return "result: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a ResponseOfferSnapshot message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseOfferSnapshot + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseOfferSnapshot} ResponseOfferSnapshot + */ + ResponseOfferSnapshot.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseOfferSnapshot) + return object; + var message = new $root.tendermint.abci.ResponseOfferSnapshot(); + switch (object.result) { + case "UNKNOWN": + case 0: + message.result = 0; + break; + case "ACCEPT": + case 1: + message.result = 1; + break; + case "ABORT": + case 2: + message.result = 2; + break; + case "REJECT": + case 3: + message.result = 3; + break; + case "REJECT_FORMAT": + case 4: + message.result = 4; + break; + case "REJECT_SENDER": + case 5: + message.result = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a ResponseOfferSnapshot message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseOfferSnapshot + * @static + * @param {tendermint.abci.ResponseOfferSnapshot} message ResponseOfferSnapshot + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseOfferSnapshot.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.result = options.enums === String ? "UNKNOWN" : 0; + if (message.result != null && message.hasOwnProperty("result")) + object.result = options.enums === String ? $root.tendermint.abci.ResponseOfferSnapshot.Result[message.result] : message.result; + return object; + }; + + /** + * Converts this ResponseOfferSnapshot to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseOfferSnapshot + * @instance + * @returns {Object.} JSON object + */ + ResponseOfferSnapshot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Result enum. + * @name tendermint.abci.ResponseOfferSnapshot.Result + * @enum {string} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} ACCEPT=1 ACCEPT value + * @property {number} ABORT=2 ABORT value + * @property {number} REJECT=3 REJECT value + * @property {number} REJECT_FORMAT=4 REJECT_FORMAT value + * @property {number} REJECT_SENDER=5 REJECT_SENDER value + */ + ResponseOfferSnapshot.Result = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "ACCEPT"] = 1; + values[valuesById[2] = "ABORT"] = 2; + values[valuesById[3] = "REJECT"] = 3; + values[valuesById[4] = "REJECT_FORMAT"] = 4; + values[valuesById[5] = "REJECT_SENDER"] = 5; + return values; + })(); + + return ResponseOfferSnapshot; + })(abci.ResponseOfferSnapshot || {}); + + abci.ResponseLoadSnapshotChunk = (function(ResponseLoadSnapshotChunk) { + + /** + * Properties of a ResponseLoadSnapshotChunk. + * @memberof tendermint.abci + * @interface IResponseLoadSnapshotChunk + * @property {Uint8Array|null} [chunk] ResponseLoadSnapshotChunk chunk + */ + + /** + * Constructs a new ResponseLoadSnapshotChunk. + * @memberof tendermint.abci + * @classdesc Represents a ResponseLoadSnapshotChunk. + * @implements IResponseLoadSnapshotChunk + * @constructor + * @param {tendermint.abci.IResponseLoadSnapshotChunk=} [properties] Properties to set + */ + function ResponseLoadSnapshotChunk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseLoadSnapshotChunk chunk. + * @member {Uint8Array} chunk + * @memberof tendermint.abci.ResponseLoadSnapshotChunk + * @instance + */ + ResponseLoadSnapshotChunk.prototype.chunk = $util.newBuffer([]); + + /** + * Creates a new ResponseLoadSnapshotChunk instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseLoadSnapshotChunk + * @static + * @param {tendermint.abci.IResponseLoadSnapshotChunk=} [properties] Properties to set + * @returns {tendermint.abci.ResponseLoadSnapshotChunk} ResponseLoadSnapshotChunk instance + */ + ResponseLoadSnapshotChunk.create = function create(properties) { + return new ResponseLoadSnapshotChunk(properties); + }; + + /** + * Encodes the specified ResponseLoadSnapshotChunk message. Does not implicitly {@link tendermint.abci.ResponseLoadSnapshotChunk.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseLoadSnapshotChunk + * @static + * @param {tendermint.abci.IResponseLoadSnapshotChunk} message ResponseLoadSnapshotChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseLoadSnapshotChunk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.chunk != null && Object.hasOwnProperty.call(message, "chunk")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.chunk); + return writer; + }; + + /** + * Encodes the specified ResponseLoadSnapshotChunk message, length delimited. Does not implicitly {@link tendermint.abci.ResponseLoadSnapshotChunk.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseLoadSnapshotChunk + * @static + * @param {tendermint.abci.IResponseLoadSnapshotChunk} message ResponseLoadSnapshotChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseLoadSnapshotChunk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseLoadSnapshotChunk message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseLoadSnapshotChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseLoadSnapshotChunk} ResponseLoadSnapshotChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseLoadSnapshotChunk.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseLoadSnapshotChunk(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chunk = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseLoadSnapshotChunk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseLoadSnapshotChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseLoadSnapshotChunk} ResponseLoadSnapshotChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseLoadSnapshotChunk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseLoadSnapshotChunk message. + * @function verify + * @memberof tendermint.abci.ResponseLoadSnapshotChunk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseLoadSnapshotChunk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.chunk != null && message.hasOwnProperty("chunk")) + if (!(message.chunk && typeof message.chunk.length === "number" || $util.isString(message.chunk))) + return "chunk: buffer expected"; + return null; + }; + + /** + * Creates a ResponseLoadSnapshotChunk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseLoadSnapshotChunk + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseLoadSnapshotChunk} ResponseLoadSnapshotChunk + */ + ResponseLoadSnapshotChunk.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseLoadSnapshotChunk) + return object; + var message = new $root.tendermint.abci.ResponseLoadSnapshotChunk(); + if (object.chunk != null) + if (typeof object.chunk === "string") + $util.base64.decode(object.chunk, message.chunk = $util.newBuffer($util.base64.length(object.chunk)), 0); + else if (object.chunk.length) + message.chunk = object.chunk; + return message; + }; + + /** + * Creates a plain object from a ResponseLoadSnapshotChunk message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseLoadSnapshotChunk + * @static + * @param {tendermint.abci.ResponseLoadSnapshotChunk} message ResponseLoadSnapshotChunk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseLoadSnapshotChunk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.chunk = ""; + else { + object.chunk = []; + if (options.bytes !== Array) + object.chunk = $util.newBuffer(object.chunk); + } + if (message.chunk != null && message.hasOwnProperty("chunk")) + object.chunk = options.bytes === String ? $util.base64.encode(message.chunk, 0, message.chunk.length) : options.bytes === Array ? Array.prototype.slice.call(message.chunk) : message.chunk; + return object; + }; + + /** + * Converts this ResponseLoadSnapshotChunk to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseLoadSnapshotChunk + * @instance + * @returns {Object.} JSON object + */ + ResponseLoadSnapshotChunk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseLoadSnapshotChunk; + })(abci.ResponseLoadSnapshotChunk || {}); + + abci.ResponseApplySnapshotChunk = (function(ResponseApplySnapshotChunk) { + + /** + * Properties of a ResponseApplySnapshotChunk. + * @memberof tendermint.abci + * @interface IResponseApplySnapshotChunk + * @property {tendermint.abci.ResponseApplySnapshotChunk.Result|null} [result] ResponseApplySnapshotChunk result + * @property {Array.|null} [refetchChunks] ResponseApplySnapshotChunk refetchChunks + * @property {Array.|null} [rejectSenders] ResponseApplySnapshotChunk rejectSenders + */ + + /** + * Constructs a new ResponseApplySnapshotChunk. + * @memberof tendermint.abci + * @classdesc Represents a ResponseApplySnapshotChunk. + * @implements IResponseApplySnapshotChunk + * @constructor + * @param {tendermint.abci.IResponseApplySnapshotChunk=} [properties] Properties to set + */ + function ResponseApplySnapshotChunk(properties) { + this.refetchChunks = []; + this.rejectSenders = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseApplySnapshotChunk result. + * @member {tendermint.abci.ResponseApplySnapshotChunk.Result} result + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @instance + */ + ResponseApplySnapshotChunk.prototype.result = 0; + + /** + * ResponseApplySnapshotChunk refetchChunks. + * @member {Array.} refetchChunks + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @instance + */ + ResponseApplySnapshotChunk.prototype.refetchChunks = $util.emptyArray; + + /** + * ResponseApplySnapshotChunk rejectSenders. + * @member {Array.} rejectSenders + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @instance + */ + ResponseApplySnapshotChunk.prototype.rejectSenders = $util.emptyArray; + + /** + * Creates a new ResponseApplySnapshotChunk instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @static + * @param {tendermint.abci.IResponseApplySnapshotChunk=} [properties] Properties to set + * @returns {tendermint.abci.ResponseApplySnapshotChunk} ResponseApplySnapshotChunk instance + */ + ResponseApplySnapshotChunk.create = function create(properties) { + return new ResponseApplySnapshotChunk(properties); + }; + + /** + * Encodes the specified ResponseApplySnapshotChunk message. Does not implicitly {@link tendermint.abci.ResponseApplySnapshotChunk.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @static + * @param {tendermint.abci.IResponseApplySnapshotChunk} message ResponseApplySnapshotChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseApplySnapshotChunk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.result != null && Object.hasOwnProperty.call(message, "result")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.result); + if (message.refetchChunks != null && message.refetchChunks.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.refetchChunks.length; ++i) + writer.uint32(message.refetchChunks[i]); + writer.ldelim(); + } + if (message.rejectSenders != null && message.rejectSenders.length) + for (var i = 0; i < message.rejectSenders.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.rejectSenders[i]); + return writer; + }; + + /** + * Encodes the specified ResponseApplySnapshotChunk message, length delimited. Does not implicitly {@link tendermint.abci.ResponseApplySnapshotChunk.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @static + * @param {tendermint.abci.IResponseApplySnapshotChunk} message ResponseApplySnapshotChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseApplySnapshotChunk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseApplySnapshotChunk message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseApplySnapshotChunk} ResponseApplySnapshotChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseApplySnapshotChunk.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseApplySnapshotChunk(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.result = reader.int32(); + break; + case 2: + if (!(message.refetchChunks && message.refetchChunks.length)) + message.refetchChunks = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.refetchChunks.push(reader.uint32()); + } else + message.refetchChunks.push(reader.uint32()); + break; + case 3: + if (!(message.rejectSenders && message.rejectSenders.length)) + message.rejectSenders = []; + message.rejectSenders.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseApplySnapshotChunk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseApplySnapshotChunk} ResponseApplySnapshotChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseApplySnapshotChunk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseApplySnapshotChunk message. + * @function verify + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseApplySnapshotChunk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.result != null && message.hasOwnProperty("result")) + switch (message.result) { + default: + return "result: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.refetchChunks != null && message.hasOwnProperty("refetchChunks")) { + if (!Array.isArray(message.refetchChunks)) + return "refetchChunks: array expected"; + for (var i = 0; i < message.refetchChunks.length; ++i) + if (!$util.isInteger(message.refetchChunks[i])) + return "refetchChunks: integer[] expected"; + } + if (message.rejectSenders != null && message.hasOwnProperty("rejectSenders")) { + if (!Array.isArray(message.rejectSenders)) + return "rejectSenders: array expected"; + for (var i = 0; i < message.rejectSenders.length; ++i) + if (!$util.isString(message.rejectSenders[i])) + return "rejectSenders: string[] expected"; + } + return null; + }; + + /** + * Creates a ResponseApplySnapshotChunk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseApplySnapshotChunk} ResponseApplySnapshotChunk + */ + ResponseApplySnapshotChunk.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseApplySnapshotChunk) + return object; + var message = new $root.tendermint.abci.ResponseApplySnapshotChunk(); + switch (object.result) { + case "UNKNOWN": + case 0: + message.result = 0; + break; + case "ACCEPT": + case 1: + message.result = 1; + break; + case "ABORT": + case 2: + message.result = 2; + break; + case "RETRY": + case 3: + message.result = 3; + break; + case "RETRY_SNAPSHOT": + case 4: + message.result = 4; + break; + case "REJECT_SNAPSHOT": + case 5: + message.result = 5; + break; + } + if (object.refetchChunks) { + if (!Array.isArray(object.refetchChunks)) + throw TypeError(".tendermint.abci.ResponseApplySnapshotChunk.refetchChunks: array expected"); + message.refetchChunks = []; + for (var i = 0; i < object.refetchChunks.length; ++i) + message.refetchChunks[i] = object.refetchChunks[i] >>> 0; + } + if (object.rejectSenders) { + if (!Array.isArray(object.rejectSenders)) + throw TypeError(".tendermint.abci.ResponseApplySnapshotChunk.rejectSenders: array expected"); + message.rejectSenders = []; + for (var i = 0; i < object.rejectSenders.length; ++i) + message.rejectSenders[i] = String(object.rejectSenders[i]); + } + return message; + }; + + /** + * Creates a plain object from a ResponseApplySnapshotChunk message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @static + * @param {tendermint.abci.ResponseApplySnapshotChunk} message ResponseApplySnapshotChunk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseApplySnapshotChunk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.refetchChunks = []; + object.rejectSenders = []; + } + if (options.defaults) + object.result = options.enums === String ? "UNKNOWN" : 0; + if (message.result != null && message.hasOwnProperty("result")) + object.result = options.enums === String ? $root.tendermint.abci.ResponseApplySnapshotChunk.Result[message.result] : message.result; + if (message.refetchChunks && message.refetchChunks.length) { + object.refetchChunks = []; + for (var j = 0; j < message.refetchChunks.length; ++j) + object.refetchChunks[j] = message.refetchChunks[j]; + } + if (message.rejectSenders && message.rejectSenders.length) { + object.rejectSenders = []; + for (var j = 0; j < message.rejectSenders.length; ++j) + object.rejectSenders[j] = message.rejectSenders[j]; + } + return object; + }; + + /** + * Converts this ResponseApplySnapshotChunk to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @instance + * @returns {Object.} JSON object + */ + ResponseApplySnapshotChunk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Result enum. + * @name tendermint.abci.ResponseApplySnapshotChunk.Result + * @enum {string} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} ACCEPT=1 ACCEPT value + * @property {number} ABORT=2 ABORT value + * @property {number} RETRY=3 RETRY value + * @property {number} RETRY_SNAPSHOT=4 RETRY_SNAPSHOT value + * @property {number} REJECT_SNAPSHOT=5 REJECT_SNAPSHOT value + */ + ResponseApplySnapshotChunk.Result = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "ACCEPT"] = 1; + values[valuesById[2] = "ABORT"] = 2; + values[valuesById[3] = "RETRY"] = 3; + values[valuesById[4] = "RETRY_SNAPSHOT"] = 4; + values[valuesById[5] = "REJECT_SNAPSHOT"] = 5; + return values; + })(); + + return ResponseApplySnapshotChunk; + })(abci.ResponseApplySnapshotChunk || {}); + + abci.ConsensusParams = (function(ConsensusParams) { + + /** + * Properties of a ConsensusParams. + * @memberof tendermint.abci + * @interface IConsensusParams + * @property {tendermint.abci.IBlockParams|null} [block] ConsensusParams block + * @property {tendermint.types.IEvidenceParams|null} [evidence] ConsensusParams evidence + * @property {tendermint.types.IValidatorParams|null} [validator] ConsensusParams validator + * @property {tendermint.types.IVersionParams|null} [version] ConsensusParams version + */ + + /** + * Constructs a new ConsensusParams. + * @memberof tendermint.abci + * @classdesc Represents a ConsensusParams. + * @implements IConsensusParams + * @constructor + * @param {tendermint.abci.IConsensusParams=} [properties] Properties to set + */ + function ConsensusParams(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConsensusParams block. + * @member {tendermint.abci.IBlockParams|null|undefined} block + * @memberof tendermint.abci.ConsensusParams + * @instance + */ + ConsensusParams.prototype.block = null; + + /** + * ConsensusParams evidence. + * @member {tendermint.types.IEvidenceParams|null|undefined} evidence + * @memberof tendermint.abci.ConsensusParams + * @instance + */ + ConsensusParams.prototype.evidence = null; + + /** + * ConsensusParams validator. + * @member {tendermint.types.IValidatorParams|null|undefined} validator + * @memberof tendermint.abci.ConsensusParams + * @instance + */ + ConsensusParams.prototype.validator = null; + + /** + * ConsensusParams version. + * @member {tendermint.types.IVersionParams|null|undefined} version + * @memberof tendermint.abci.ConsensusParams + * @instance + */ + ConsensusParams.prototype.version = null; + + /** + * Creates a new ConsensusParams instance using the specified properties. + * @function create + * @memberof tendermint.abci.ConsensusParams + * @static + * @param {tendermint.abci.IConsensusParams=} [properties] Properties to set + * @returns {tendermint.abci.ConsensusParams} ConsensusParams instance + */ + ConsensusParams.create = function create(properties) { + return new ConsensusParams(properties); + }; + + /** + * Encodes the specified ConsensusParams message. Does not implicitly {@link tendermint.abci.ConsensusParams.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ConsensusParams + * @static + * @param {tendermint.abci.IConsensusParams} message ConsensusParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.block != null && Object.hasOwnProperty.call(message, "block")) + $root.tendermint.abci.BlockParams.encode(message.block, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.evidence != null && Object.hasOwnProperty.call(message, "evidence")) + $root.tendermint.types.EvidenceParams.encode(message.evidence, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.validator != null && Object.hasOwnProperty.call(message, "validator")) + $root.tendermint.types.ValidatorParams.encode(message.validator, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + $root.tendermint.types.VersionParams.encode(message.version, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConsensusParams message, length delimited. Does not implicitly {@link tendermint.abci.ConsensusParams.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ConsensusParams + * @static + * @param {tendermint.abci.IConsensusParams} message ConsensusParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConsensusParams message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ConsensusParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ConsensusParams} ConsensusParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ConsensusParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.block = $root.tendermint.abci.BlockParams.decode(reader, reader.uint32()); + break; + case 2: + message.evidence = $root.tendermint.types.EvidenceParams.decode(reader, reader.uint32()); + break; + case 3: + message.validator = $root.tendermint.types.ValidatorParams.decode(reader, reader.uint32()); + break; + case 4: + message.version = $root.tendermint.types.VersionParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConsensusParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ConsensusParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ConsensusParams} ConsensusParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConsensusParams message. + * @function verify + * @memberof tendermint.abci.ConsensusParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConsensusParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.block != null && message.hasOwnProperty("block")) { + var error = $root.tendermint.abci.BlockParams.verify(message.block); + if (error) + return "block." + error; + } + if (message.evidence != null && message.hasOwnProperty("evidence")) { + var error = $root.tendermint.types.EvidenceParams.verify(message.evidence); + if (error) + return "evidence." + error; + } + if (message.validator != null && message.hasOwnProperty("validator")) { + var error = $root.tendermint.types.ValidatorParams.verify(message.validator); + if (error) + return "validator." + error; + } + if (message.version != null && message.hasOwnProperty("version")) { + var error = $root.tendermint.types.VersionParams.verify(message.version); + if (error) + return "version." + error; + } + return null; + }; + + /** + * Creates a ConsensusParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ConsensusParams + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ConsensusParams} ConsensusParams + */ + ConsensusParams.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ConsensusParams) + return object; + var message = new $root.tendermint.abci.ConsensusParams(); + if (object.block != null) { + if (typeof object.block !== "object") + throw TypeError(".tendermint.abci.ConsensusParams.block: object expected"); + message.block = $root.tendermint.abci.BlockParams.fromObject(object.block); + } + if (object.evidence != null) { + if (typeof object.evidence !== "object") + throw TypeError(".tendermint.abci.ConsensusParams.evidence: object expected"); + message.evidence = $root.tendermint.types.EvidenceParams.fromObject(object.evidence); + } + if (object.validator != null) { + if (typeof object.validator !== "object") + throw TypeError(".tendermint.abci.ConsensusParams.validator: object expected"); + message.validator = $root.tendermint.types.ValidatorParams.fromObject(object.validator); + } + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".tendermint.abci.ConsensusParams.version: object expected"); + message.version = $root.tendermint.types.VersionParams.fromObject(object.version); + } + return message; + }; + + /** + * Creates a plain object from a ConsensusParams message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ConsensusParams + * @static + * @param {tendermint.abci.ConsensusParams} message ConsensusParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConsensusParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.block = null; + object.evidence = null; + object.validator = null; + object.version = null; + } + if (message.block != null && message.hasOwnProperty("block")) + object.block = $root.tendermint.abci.BlockParams.toObject(message.block, options); + if (message.evidence != null && message.hasOwnProperty("evidence")) + object.evidence = $root.tendermint.types.EvidenceParams.toObject(message.evidence, options); + if (message.validator != null && message.hasOwnProperty("validator")) + object.validator = $root.tendermint.types.ValidatorParams.toObject(message.validator, options); + if (message.version != null && message.hasOwnProperty("version")) + object.version = $root.tendermint.types.VersionParams.toObject(message.version, options); + return object; + }; + + /** + * Converts this ConsensusParams to JSON. + * @function toJSON + * @memberof tendermint.abci.ConsensusParams + * @instance + * @returns {Object.} JSON object + */ + ConsensusParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ConsensusParams; + })(abci.ConsensusParams || {}); + + abci.BlockParams = (function(BlockParams) { + + /** + * Properties of a BlockParams. + * @memberof tendermint.abci + * @interface IBlockParams + * @property {number|Long|null} [maxBytes] BlockParams maxBytes + * @property {number|Long|null} [maxGas] BlockParams maxGas + */ + + /** + * Constructs a new BlockParams. + * @memberof tendermint.abci + * @classdesc Represents a BlockParams. + * @implements IBlockParams + * @constructor + * @param {tendermint.abci.IBlockParams=} [properties] Properties to set + */ + function BlockParams(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BlockParams maxBytes. + * @member {number|Long} maxBytes + * @memberof tendermint.abci.BlockParams + * @instance + */ + BlockParams.prototype.maxBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BlockParams maxGas. + * @member {number|Long} maxGas + * @memberof tendermint.abci.BlockParams + * @instance + */ + BlockParams.prototype.maxGas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new BlockParams instance using the specified properties. + * @function create + * @memberof tendermint.abci.BlockParams + * @static + * @param {tendermint.abci.IBlockParams=} [properties] Properties to set + * @returns {tendermint.abci.BlockParams} BlockParams instance + */ + BlockParams.create = function create(properties) { + return new BlockParams(properties); + }; + + /** + * Encodes the specified BlockParams message. Does not implicitly {@link tendermint.abci.BlockParams.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.BlockParams + * @static + * @param {tendermint.abci.IBlockParams} message BlockParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlockParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxBytes != null && Object.hasOwnProperty.call(message, "maxBytes")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.maxBytes); + if (message.maxGas != null && Object.hasOwnProperty.call(message, "maxGas")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.maxGas); + return writer; + }; + + /** + * Encodes the specified BlockParams message, length delimited. Does not implicitly {@link tendermint.abci.BlockParams.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.BlockParams + * @static + * @param {tendermint.abci.IBlockParams} message BlockParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlockParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BlockParams message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.BlockParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.BlockParams} BlockParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlockParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.BlockParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxBytes = reader.int64(); + break; + case 2: + message.maxGas = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BlockParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.BlockParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.BlockParams} BlockParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlockParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BlockParams message. + * @function verify + * @memberof tendermint.abci.BlockParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BlockParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + if (!$util.isInteger(message.maxBytes) && !(message.maxBytes && $util.isInteger(message.maxBytes.low) && $util.isInteger(message.maxBytes.high))) + return "maxBytes: integer|Long expected"; + if (message.maxGas != null && message.hasOwnProperty("maxGas")) + if (!$util.isInteger(message.maxGas) && !(message.maxGas && $util.isInteger(message.maxGas.low) && $util.isInteger(message.maxGas.high))) + return "maxGas: integer|Long expected"; + return null; + }; + + /** + * Creates a BlockParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.BlockParams + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.BlockParams} BlockParams + */ + BlockParams.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.BlockParams) + return object; + var message = new $root.tendermint.abci.BlockParams(); + if (object.maxBytes != null) + if ($util.Long) + (message.maxBytes = $util.Long.fromValue(object.maxBytes)).unsigned = false; + else if (typeof object.maxBytes === "string") + message.maxBytes = parseInt(object.maxBytes, 10); + else if (typeof object.maxBytes === "number") + message.maxBytes = object.maxBytes; + else if (typeof object.maxBytes === "object") + message.maxBytes = new $util.LongBits(object.maxBytes.low >>> 0, object.maxBytes.high >>> 0).toNumber(); + if (object.maxGas != null) + if ($util.Long) + (message.maxGas = $util.Long.fromValue(object.maxGas)).unsigned = false; + else if (typeof object.maxGas === "string") + message.maxGas = parseInt(object.maxGas, 10); + else if (typeof object.maxGas === "number") + message.maxGas = object.maxGas; + else if (typeof object.maxGas === "object") + message.maxGas = new $util.LongBits(object.maxGas.low >>> 0, object.maxGas.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a BlockParams message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.BlockParams + * @static + * @param {tendermint.abci.BlockParams} message BlockParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BlockParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxBytes = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxGas = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxGas = options.longs === String ? "0" : 0; + } + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + if (typeof message.maxBytes === "number") + object.maxBytes = options.longs === String ? String(message.maxBytes) : message.maxBytes; + else + object.maxBytes = options.longs === String ? $util.Long.prototype.toString.call(message.maxBytes) : options.longs === Number ? new $util.LongBits(message.maxBytes.low >>> 0, message.maxBytes.high >>> 0).toNumber() : message.maxBytes; + if (message.maxGas != null && message.hasOwnProperty("maxGas")) + if (typeof message.maxGas === "number") + object.maxGas = options.longs === String ? String(message.maxGas) : message.maxGas; + else + object.maxGas = options.longs === String ? $util.Long.prototype.toString.call(message.maxGas) : options.longs === Number ? new $util.LongBits(message.maxGas.low >>> 0, message.maxGas.high >>> 0).toNumber() : message.maxGas; + return object; + }; + + /** + * Converts this BlockParams to JSON. + * @function toJSON + * @memberof tendermint.abci.BlockParams + * @instance + * @returns {Object.} JSON object + */ + BlockParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BlockParams; + })(abci.BlockParams || {}); + + abci.LastCommitInfo = (function(LastCommitInfo) { + + /** + * Properties of a LastCommitInfo. + * @memberof tendermint.abci + * @interface ILastCommitInfo + * @property {number|null} [round] LastCommitInfo round + * @property {Array.|null} [votes] LastCommitInfo votes + */ + + /** + * Constructs a new LastCommitInfo. + * @memberof tendermint.abci + * @classdesc Represents a LastCommitInfo. + * @implements ILastCommitInfo + * @constructor + * @param {tendermint.abci.ILastCommitInfo=} [properties] Properties to set + */ + function LastCommitInfo(properties) { + this.votes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LastCommitInfo round. + * @member {number} round + * @memberof tendermint.abci.LastCommitInfo + * @instance + */ + LastCommitInfo.prototype.round = 0; + + /** + * LastCommitInfo votes. + * @member {Array.} votes + * @memberof tendermint.abci.LastCommitInfo + * @instance + */ + LastCommitInfo.prototype.votes = $util.emptyArray; + + /** + * Creates a new LastCommitInfo instance using the specified properties. + * @function create + * @memberof tendermint.abci.LastCommitInfo + * @static + * @param {tendermint.abci.ILastCommitInfo=} [properties] Properties to set + * @returns {tendermint.abci.LastCommitInfo} LastCommitInfo instance + */ + LastCommitInfo.create = function create(properties) { + return new LastCommitInfo(properties); + }; + + /** + * Encodes the specified LastCommitInfo message. Does not implicitly {@link tendermint.abci.LastCommitInfo.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.LastCommitInfo + * @static + * @param {tendermint.abci.ILastCommitInfo} message LastCommitInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LastCommitInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.round != null && Object.hasOwnProperty.call(message, "round")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.round); + if (message.votes != null && message.votes.length) + for (var i = 0; i < message.votes.length; ++i) + $root.tendermint.abci.VoteInfo.encode(message.votes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LastCommitInfo message, length delimited. Does not implicitly {@link tendermint.abci.LastCommitInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.LastCommitInfo + * @static + * @param {tendermint.abci.ILastCommitInfo} message LastCommitInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LastCommitInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LastCommitInfo message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.LastCommitInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.LastCommitInfo} LastCommitInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LastCommitInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.LastCommitInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.round = reader.int32(); + break; + case 2: + if (!(message.votes && message.votes.length)) + message.votes = []; + message.votes.push($root.tendermint.abci.VoteInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LastCommitInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.LastCommitInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.LastCommitInfo} LastCommitInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LastCommitInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LastCommitInfo message. + * @function verify + * @memberof tendermint.abci.LastCommitInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LastCommitInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.round != null && message.hasOwnProperty("round")) + if (!$util.isInteger(message.round)) + return "round: integer expected"; + if (message.votes != null && message.hasOwnProperty("votes")) { + if (!Array.isArray(message.votes)) + return "votes: array expected"; + for (var i = 0; i < message.votes.length; ++i) { + var error = $root.tendermint.abci.VoteInfo.verify(message.votes[i]); + if (error) + return "votes." + error; + } + } + return null; + }; + + /** + * Creates a LastCommitInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.LastCommitInfo + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.LastCommitInfo} LastCommitInfo + */ + LastCommitInfo.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.LastCommitInfo) + return object; + var message = new $root.tendermint.abci.LastCommitInfo(); + if (object.round != null) + message.round = object.round | 0; + if (object.votes) { + if (!Array.isArray(object.votes)) + throw TypeError(".tendermint.abci.LastCommitInfo.votes: array expected"); + message.votes = []; + for (var i = 0; i < object.votes.length; ++i) { + if (typeof object.votes[i] !== "object") + throw TypeError(".tendermint.abci.LastCommitInfo.votes: object expected"); + message.votes[i] = $root.tendermint.abci.VoteInfo.fromObject(object.votes[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a LastCommitInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.LastCommitInfo + * @static + * @param {tendermint.abci.LastCommitInfo} message LastCommitInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LastCommitInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.votes = []; + if (options.defaults) + object.round = 0; + if (message.round != null && message.hasOwnProperty("round")) + object.round = message.round; + if (message.votes && message.votes.length) { + object.votes = []; + for (var j = 0; j < message.votes.length; ++j) + object.votes[j] = $root.tendermint.abci.VoteInfo.toObject(message.votes[j], options); + } + return object; + }; + + /** + * Converts this LastCommitInfo to JSON. + * @function toJSON + * @memberof tendermint.abci.LastCommitInfo + * @instance + * @returns {Object.} JSON object + */ + LastCommitInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LastCommitInfo; + })(abci.LastCommitInfo || {}); + + abci.Event = (function(Event) { + + /** + * Properties of an Event. + * @memberof tendermint.abci + * @interface IEvent + * @property {string|null} [type] Event type + * @property {Array.|null} [attributes] Event attributes + */ + + /** + * Constructs a new Event. + * @memberof tendermint.abci + * @classdesc Represents an Event. + * @implements IEvent + * @constructor + * @param {tendermint.abci.IEvent=} [properties] Properties to set + */ + function Event(properties) { + this.attributes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Event type. + * @member {string} type + * @memberof tendermint.abci.Event + * @instance + */ + Event.prototype.type = ""; + + /** + * Event attributes. + * @member {Array.} attributes + * @memberof tendermint.abci.Event + * @instance + */ + Event.prototype.attributes = $util.emptyArray; + + /** + * Creates a new Event instance using the specified properties. + * @function create + * @memberof tendermint.abci.Event + * @static + * @param {tendermint.abci.IEvent=} [properties] Properties to set + * @returns {tendermint.abci.Event} Event instance + */ + Event.create = function create(properties) { + return new Event(properties); + }; + + /** + * Encodes the specified Event message. Does not implicitly {@link tendermint.abci.Event.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.Event + * @static + * @param {tendermint.abci.IEvent} message Event message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Event.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.attributes != null && message.attributes.length) + for (var i = 0; i < message.attributes.length; ++i) + $root.tendermint.abci.EventAttribute.encode(message.attributes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Event message, length delimited. Does not implicitly {@link tendermint.abci.Event.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.Event + * @static + * @param {tendermint.abci.IEvent} message Event message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Event.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Event message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.Event + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.Event} Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Event.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.Event(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + if (!(message.attributes && message.attributes.length)) + message.attributes = []; + message.attributes.push($root.tendermint.abci.EventAttribute.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Event message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.Event + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.Event} Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Event.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Event message. + * @function verify + * @memberof tendermint.abci.Event + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Event.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!Array.isArray(message.attributes)) + return "attributes: array expected"; + for (var i = 0; i < message.attributes.length; ++i) { + var error = $root.tendermint.abci.EventAttribute.verify(message.attributes[i]); + if (error) + return "attributes." + error; + } + } + return null; + }; + + /** + * Creates an Event message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.Event + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.Event} Event + */ + Event.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.Event) + return object; + var message = new $root.tendermint.abci.Event(); + if (object.type != null) + message.type = String(object.type); + if (object.attributes) { + if (!Array.isArray(object.attributes)) + throw TypeError(".tendermint.abci.Event.attributes: array expected"); + message.attributes = []; + for (var i = 0; i < object.attributes.length; ++i) { + if (typeof object.attributes[i] !== "object") + throw TypeError(".tendermint.abci.Event.attributes: object expected"); + message.attributes[i] = $root.tendermint.abci.EventAttribute.fromObject(object.attributes[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Event message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.Event + * @static + * @param {tendermint.abci.Event} message Event + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Event.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.attributes = []; + if (options.defaults) + object.type = ""; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.attributes && message.attributes.length) { + object.attributes = []; + for (var j = 0; j < message.attributes.length; ++j) + object.attributes[j] = $root.tendermint.abci.EventAttribute.toObject(message.attributes[j], options); + } + return object; + }; + + /** + * Converts this Event to JSON. + * @function toJSON + * @memberof tendermint.abci.Event + * @instance + * @returns {Object.} JSON object + */ + Event.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Event; + })(abci.Event || {}); + + abci.EventAttribute = (function(EventAttribute) { + + /** + * Properties of an EventAttribute. + * @memberof tendermint.abci + * @interface IEventAttribute + * @property {Uint8Array|null} [key] EventAttribute key + * @property {Uint8Array|null} [value] EventAttribute value + * @property {boolean|null} [index] EventAttribute index + */ + + /** + * Constructs a new EventAttribute. + * @memberof tendermint.abci + * @classdesc Represents an EventAttribute. + * @implements IEventAttribute + * @constructor + * @param {tendermint.abci.IEventAttribute=} [properties] Properties to set + */ + function EventAttribute(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EventAttribute key. + * @member {Uint8Array} key + * @memberof tendermint.abci.EventAttribute + * @instance + */ + EventAttribute.prototype.key = $util.newBuffer([]); + + /** + * EventAttribute value. + * @member {Uint8Array} value + * @memberof tendermint.abci.EventAttribute + * @instance + */ + EventAttribute.prototype.value = $util.newBuffer([]); + + /** + * EventAttribute index. + * @member {boolean} index + * @memberof tendermint.abci.EventAttribute + * @instance + */ + EventAttribute.prototype.index = false; + + /** + * Creates a new EventAttribute instance using the specified properties. + * @function create + * @memberof tendermint.abci.EventAttribute + * @static + * @param {tendermint.abci.IEventAttribute=} [properties] Properties to set + * @returns {tendermint.abci.EventAttribute} EventAttribute instance + */ + EventAttribute.create = function create(properties) { + return new EventAttribute(properties); + }; + + /** + * Encodes the specified EventAttribute message. Does not implicitly {@link tendermint.abci.EventAttribute.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.EventAttribute + * @static + * @param {tendermint.abci.IEventAttribute} message EventAttribute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventAttribute.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.index); + return writer; + }; + + /** + * Encodes the specified EventAttribute message, length delimited. Does not implicitly {@link tendermint.abci.EventAttribute.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.EventAttribute + * @static + * @param {tendermint.abci.IEventAttribute} message EventAttribute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventAttribute.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EventAttribute message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.EventAttribute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.EventAttribute} EventAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventAttribute.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.EventAttribute(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + case 3: + message.index = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EventAttribute message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.EventAttribute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.EventAttribute} EventAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventAttribute.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EventAttribute message. + * @function verify + * @memberof tendermint.abci.EventAttribute + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EventAttribute.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (typeof message.index !== "boolean") + return "index: boolean expected"; + return null; + }; + + /** + * Creates an EventAttribute message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.EventAttribute + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.EventAttribute} EventAttribute + */ + EventAttribute.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.EventAttribute) + return object; + var message = new $root.tendermint.abci.EventAttribute(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length) + message.key = object.key; + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length) + message.value = object.value; + if (object.index != null) + message.index = Boolean(object.index); + return message; + }; + + /** + * Creates a plain object from an EventAttribute message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.EventAttribute + * @static + * @param {tendermint.abci.EventAttribute} message EventAttribute + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EventAttribute.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + object.index = false; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + return object; + }; + + /** + * Converts this EventAttribute to JSON. + * @function toJSON + * @memberof tendermint.abci.EventAttribute + * @instance + * @returns {Object.} JSON object + */ + EventAttribute.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EventAttribute; + })(abci.EventAttribute || {}); + + abci.TxResult = (function(TxResult) { + + /** + * Properties of a TxResult. + * @memberof tendermint.abci + * @interface ITxResult + * @property {number|Long|null} [height] TxResult height + * @property {number|null} [index] TxResult index + * @property {Uint8Array|null} [tx] TxResult tx + * @property {tendermint.abci.IResponseDeliverTx|null} [result] TxResult result + */ + + /** + * Constructs a new TxResult. + * @memberof tendermint.abci + * @classdesc Represents a TxResult. + * @implements ITxResult + * @constructor + * @param {tendermint.abci.ITxResult=} [properties] Properties to set + */ + function TxResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TxResult height. + * @member {number|Long} height + * @memberof tendermint.abci.TxResult + * @instance + */ + TxResult.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TxResult index. + * @member {number} index + * @memberof tendermint.abci.TxResult + * @instance + */ + TxResult.prototype.index = 0; + + /** + * TxResult tx. + * @member {Uint8Array} tx + * @memberof tendermint.abci.TxResult + * @instance + */ + TxResult.prototype.tx = $util.newBuffer([]); + + /** + * TxResult result. + * @member {tendermint.abci.IResponseDeliverTx|null|undefined} result + * @memberof tendermint.abci.TxResult + * @instance + */ + TxResult.prototype.result = null; + + /** + * Creates a new TxResult instance using the specified properties. + * @function create + * @memberof tendermint.abci.TxResult + * @static + * @param {tendermint.abci.ITxResult=} [properties] Properties to set + * @returns {tendermint.abci.TxResult} TxResult instance + */ + TxResult.create = function create(properties) { + return new TxResult(properties); + }; + + /** + * Encodes the specified TxResult message. Does not implicitly {@link tendermint.abci.TxResult.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.TxResult + * @static + * @param {tendermint.abci.ITxResult} message TxResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TxResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.height); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.index); + if (message.tx != null && Object.hasOwnProperty.call(message, "tx")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.tx); + if (message.result != null && Object.hasOwnProperty.call(message, "result")) + $root.tendermint.abci.ResponseDeliverTx.encode(message.result, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TxResult message, length delimited. Does not implicitly {@link tendermint.abci.TxResult.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.TxResult + * @static + * @param {tendermint.abci.ITxResult} message TxResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TxResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TxResult message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.TxResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.TxResult} TxResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TxResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.TxResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + case 2: + message.index = reader.uint32(); + break; + case 3: + message.tx = reader.bytes(); + break; + case 4: + message.result = $root.tendermint.abci.ResponseDeliverTx.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TxResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.TxResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.TxResult} TxResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TxResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TxResult message. + * @function verify + * @memberof tendermint.abci.TxResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TxResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index)) + return "index: integer expected"; + if (message.tx != null && message.hasOwnProperty("tx")) + if (!(message.tx && typeof message.tx.length === "number" || $util.isString(message.tx))) + return "tx: buffer expected"; + if (message.result != null && message.hasOwnProperty("result")) { + var error = $root.tendermint.abci.ResponseDeliverTx.verify(message.result); + if (error) + return "result." + error; + } + return null; + }; + + /** + * Creates a TxResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.TxResult + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.TxResult} TxResult + */ + TxResult.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.TxResult) + return object; + var message = new $root.tendermint.abci.TxResult(); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + if (object.index != null) + message.index = object.index >>> 0; + if (object.tx != null) + if (typeof object.tx === "string") + $util.base64.decode(object.tx, message.tx = $util.newBuffer($util.base64.length(object.tx)), 0); + else if (object.tx.length) + message.tx = object.tx; + if (object.result != null) { + if (typeof object.result !== "object") + throw TypeError(".tendermint.abci.TxResult.result: object expected"); + message.result = $root.tendermint.abci.ResponseDeliverTx.fromObject(object.result); + } + return message; + }; + + /** + * Creates a plain object from a TxResult message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.TxResult + * @static + * @param {tendermint.abci.TxResult} message TxResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TxResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.index = 0; + if (options.bytes === String) + object.tx = ""; + else { + object.tx = []; + if (options.bytes !== Array) + object.tx = $util.newBuffer(object.tx); + } + object.result = null; + } + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + if (message.tx != null && message.hasOwnProperty("tx")) + object.tx = options.bytes === String ? $util.base64.encode(message.tx, 0, message.tx.length) : options.bytes === Array ? Array.prototype.slice.call(message.tx) : message.tx; + if (message.result != null && message.hasOwnProperty("result")) + object.result = $root.tendermint.abci.ResponseDeliverTx.toObject(message.result, options); + return object; + }; + + /** + * Converts this TxResult to JSON. + * @function toJSON + * @memberof tendermint.abci.TxResult + * @instance + * @returns {Object.} JSON object + */ + TxResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TxResult; + })(abci.TxResult || {}); + + abci.Validator = (function(Validator) { + + /** + * Properties of a Validator. + * @memberof tendermint.abci + * @interface IValidator + * @property {Uint8Array|null} [address] Validator address + * @property {number|Long|null} [power] Validator power + */ + + /** + * Constructs a new Validator. + * @memberof tendermint.abci + * @classdesc Represents a Validator. + * @implements IValidator + * @constructor + * @param {tendermint.abci.IValidator=} [properties] Properties to set + */ + function Validator(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Validator address. + * @member {Uint8Array} address + * @memberof tendermint.abci.Validator + * @instance + */ + Validator.prototype.address = $util.newBuffer([]); + + /** + * Validator power. + * @member {number|Long} power + * @memberof tendermint.abci.Validator + * @instance + */ + Validator.prototype.power = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Validator instance using the specified properties. + * @function create + * @memberof tendermint.abci.Validator + * @static + * @param {tendermint.abci.IValidator=} [properties] Properties to set + * @returns {tendermint.abci.Validator} Validator instance + */ + Validator.create = function create(properties) { + return new Validator(properties); + }; + + /** + * Encodes the specified Validator message. Does not implicitly {@link tendermint.abci.Validator.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.Validator + * @static + * @param {tendermint.abci.IValidator} message Validator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Validator.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.address); + if (message.power != null && Object.hasOwnProperty.call(message, "power")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.power); + return writer; + }; + + /** + * Encodes the specified Validator message, length delimited. Does not implicitly {@link tendermint.abci.Validator.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.Validator + * @static + * @param {tendermint.abci.IValidator} message Validator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Validator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Validator message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.Validator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.Validator} Validator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Validator.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.Validator(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.bytes(); + break; + case 3: + message.power = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Validator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.Validator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.Validator} Validator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Validator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Validator message. + * @function verify + * @memberof tendermint.abci.Validator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Validator.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!(message.address && typeof message.address.length === "number" || $util.isString(message.address))) + return "address: buffer expected"; + if (message.power != null && message.hasOwnProperty("power")) + if (!$util.isInteger(message.power) && !(message.power && $util.isInteger(message.power.low) && $util.isInteger(message.power.high))) + return "power: integer|Long expected"; + return null; + }; + + /** + * Creates a Validator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.Validator + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.Validator} Validator + */ + Validator.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.Validator) + return object; + var message = new $root.tendermint.abci.Validator(); + if (object.address != null) + if (typeof object.address === "string") + $util.base64.decode(object.address, message.address = $util.newBuffer($util.base64.length(object.address)), 0); + else if (object.address.length) + message.address = object.address; + if (object.power != null) + if ($util.Long) + (message.power = $util.Long.fromValue(object.power)).unsigned = false; + else if (typeof object.power === "string") + message.power = parseInt(object.power, 10); + else if (typeof object.power === "number") + message.power = object.power; + else if (typeof object.power === "object") + message.power = new $util.LongBits(object.power.low >>> 0, object.power.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a Validator message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.Validator + * @static + * @param {tendermint.abci.Validator} message Validator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Validator.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.address = ""; + else { + object.address = []; + if (options.bytes !== Array) + object.address = $util.newBuffer(object.address); + } + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.power = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.power = options.longs === String ? "0" : 0; + } + if (message.address != null && message.hasOwnProperty("address")) + object.address = options.bytes === String ? $util.base64.encode(message.address, 0, message.address.length) : options.bytes === Array ? Array.prototype.slice.call(message.address) : message.address; + if (message.power != null && message.hasOwnProperty("power")) + if (typeof message.power === "number") + object.power = options.longs === String ? String(message.power) : message.power; + else + object.power = options.longs === String ? $util.Long.prototype.toString.call(message.power) : options.longs === Number ? new $util.LongBits(message.power.low >>> 0, message.power.high >>> 0).toNumber() : message.power; + return object; + }; + + /** + * Converts this Validator to JSON. + * @function toJSON + * @memberof tendermint.abci.Validator + * @instance + * @returns {Object.} JSON object + */ + Validator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Validator; + })(abci.Validator || {}); + + abci.ValidatorUpdate = (function(ValidatorUpdate) { + + /** + * Properties of a ValidatorUpdate. + * @memberof tendermint.abci + * @interface IValidatorUpdate + * @property {tendermint.crypto.IPublicKey|null} [pubKey] ValidatorUpdate pubKey + * @property {number|Long|null} [power] ValidatorUpdate power + */ + + /** + * Constructs a new ValidatorUpdate. + * @memberof tendermint.abci + * @classdesc Represents a ValidatorUpdate. + * @implements IValidatorUpdate + * @constructor + * @param {tendermint.abci.IValidatorUpdate=} [properties] Properties to set + */ + function ValidatorUpdate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidatorUpdate pubKey. + * @member {tendermint.crypto.IPublicKey|null|undefined} pubKey + * @memberof tendermint.abci.ValidatorUpdate + * @instance + */ + ValidatorUpdate.prototype.pubKey = null; + + /** + * ValidatorUpdate power. + * @member {number|Long} power + * @memberof tendermint.abci.ValidatorUpdate + * @instance + */ + ValidatorUpdate.prototype.power = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ValidatorUpdate instance using the specified properties. + * @function create + * @memberof tendermint.abci.ValidatorUpdate + * @static + * @param {tendermint.abci.IValidatorUpdate=} [properties] Properties to set + * @returns {tendermint.abci.ValidatorUpdate} ValidatorUpdate instance + */ + ValidatorUpdate.create = function create(properties) { + return new ValidatorUpdate(properties); + }; + + /** + * Encodes the specified ValidatorUpdate message. Does not implicitly {@link tendermint.abci.ValidatorUpdate.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ValidatorUpdate + * @static + * @param {tendermint.abci.IValidatorUpdate} message ValidatorUpdate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorUpdate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pubKey != null && Object.hasOwnProperty.call(message, "pubKey")) + $root.tendermint.crypto.PublicKey.encode(message.pubKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.power != null && Object.hasOwnProperty.call(message, "power")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.power); + return writer; + }; + + /** + * Encodes the specified ValidatorUpdate message, length delimited. Does not implicitly {@link tendermint.abci.ValidatorUpdate.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ValidatorUpdate + * @static + * @param {tendermint.abci.IValidatorUpdate} message ValidatorUpdate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorUpdate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidatorUpdate message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ValidatorUpdate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ValidatorUpdate} ValidatorUpdate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorUpdate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ValidatorUpdate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pubKey = $root.tendermint.crypto.PublicKey.decode(reader, reader.uint32()); + break; + case 2: + message.power = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidatorUpdate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ValidatorUpdate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ValidatorUpdate} ValidatorUpdate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorUpdate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidatorUpdate message. + * @function verify + * @memberof tendermint.abci.ValidatorUpdate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidatorUpdate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pubKey != null && message.hasOwnProperty("pubKey")) { + var error = $root.tendermint.crypto.PublicKey.verify(message.pubKey); + if (error) + return "pubKey." + error; + } + if (message.power != null && message.hasOwnProperty("power")) + if (!$util.isInteger(message.power) && !(message.power && $util.isInteger(message.power.low) && $util.isInteger(message.power.high))) + return "power: integer|Long expected"; + return null; + }; + + /** + * Creates a ValidatorUpdate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ValidatorUpdate + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ValidatorUpdate} ValidatorUpdate + */ + ValidatorUpdate.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ValidatorUpdate) + return object; + var message = new $root.tendermint.abci.ValidatorUpdate(); + if (object.pubKey != null) { + if (typeof object.pubKey !== "object") + throw TypeError(".tendermint.abci.ValidatorUpdate.pubKey: object expected"); + message.pubKey = $root.tendermint.crypto.PublicKey.fromObject(object.pubKey); + } + if (object.power != null) + if ($util.Long) + (message.power = $util.Long.fromValue(object.power)).unsigned = false; + else if (typeof object.power === "string") + message.power = parseInt(object.power, 10); + else if (typeof object.power === "number") + message.power = object.power; + else if (typeof object.power === "object") + message.power = new $util.LongBits(object.power.low >>> 0, object.power.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ValidatorUpdate message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ValidatorUpdate + * @static + * @param {tendermint.abci.ValidatorUpdate} message ValidatorUpdate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidatorUpdate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pubKey = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.power = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.power = options.longs === String ? "0" : 0; + } + if (message.pubKey != null && message.hasOwnProperty("pubKey")) + object.pubKey = $root.tendermint.crypto.PublicKey.toObject(message.pubKey, options); + if (message.power != null && message.hasOwnProperty("power")) + if (typeof message.power === "number") + object.power = options.longs === String ? String(message.power) : message.power; + else + object.power = options.longs === String ? $util.Long.prototype.toString.call(message.power) : options.longs === Number ? new $util.LongBits(message.power.low >>> 0, message.power.high >>> 0).toNumber() : message.power; + return object; + }; + + /** + * Converts this ValidatorUpdate to JSON. + * @function toJSON + * @memberof tendermint.abci.ValidatorUpdate + * @instance + * @returns {Object.} JSON object + */ + ValidatorUpdate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidatorUpdate; + })(abci.ValidatorUpdate || {}); + + abci.VoteInfo = (function(VoteInfo) { + + /** + * Properties of a VoteInfo. + * @memberof tendermint.abci + * @interface IVoteInfo + * @property {tendermint.abci.IValidator|null} [validator] VoteInfo validator + * @property {boolean|null} [signedLastBlock] VoteInfo signedLastBlock + */ + + /** + * Constructs a new VoteInfo. + * @memberof tendermint.abci + * @classdesc Represents a VoteInfo. + * @implements IVoteInfo + * @constructor + * @param {tendermint.abci.IVoteInfo=} [properties] Properties to set + */ + function VoteInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VoteInfo validator. + * @member {tendermint.abci.IValidator|null|undefined} validator + * @memberof tendermint.abci.VoteInfo + * @instance + */ + VoteInfo.prototype.validator = null; + + /** + * VoteInfo signedLastBlock. + * @member {boolean} signedLastBlock + * @memberof tendermint.abci.VoteInfo + * @instance + */ + VoteInfo.prototype.signedLastBlock = false; + + /** + * Creates a new VoteInfo instance using the specified properties. + * @function create + * @memberof tendermint.abci.VoteInfo + * @static + * @param {tendermint.abci.IVoteInfo=} [properties] Properties to set + * @returns {tendermint.abci.VoteInfo} VoteInfo instance + */ + VoteInfo.create = function create(properties) { + return new VoteInfo(properties); + }; + + /** + * Encodes the specified VoteInfo message. Does not implicitly {@link tendermint.abci.VoteInfo.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.VoteInfo + * @static + * @param {tendermint.abci.IVoteInfo} message VoteInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VoteInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validator != null && Object.hasOwnProperty.call(message, "validator")) + $root.tendermint.abci.Validator.encode(message.validator, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.signedLastBlock != null && Object.hasOwnProperty.call(message, "signedLastBlock")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.signedLastBlock); + return writer; + }; + + /** + * Encodes the specified VoteInfo message, length delimited. Does not implicitly {@link tendermint.abci.VoteInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.VoteInfo + * @static + * @param {tendermint.abci.IVoteInfo} message VoteInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VoteInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VoteInfo message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.VoteInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.VoteInfo} VoteInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VoteInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.VoteInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validator = $root.tendermint.abci.Validator.decode(reader, reader.uint32()); + break; + case 2: + message.signedLastBlock = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VoteInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.VoteInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.VoteInfo} VoteInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VoteInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VoteInfo message. + * @function verify + * @memberof tendermint.abci.VoteInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VoteInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validator != null && message.hasOwnProperty("validator")) { + var error = $root.tendermint.abci.Validator.verify(message.validator); + if (error) + return "validator." + error; + } + if (message.signedLastBlock != null && message.hasOwnProperty("signedLastBlock")) + if (typeof message.signedLastBlock !== "boolean") + return "signedLastBlock: boolean expected"; + return null; + }; + + /** + * Creates a VoteInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.VoteInfo + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.VoteInfo} VoteInfo + */ + VoteInfo.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.VoteInfo) + return object; + var message = new $root.tendermint.abci.VoteInfo(); + if (object.validator != null) { + if (typeof object.validator !== "object") + throw TypeError(".tendermint.abci.VoteInfo.validator: object expected"); + message.validator = $root.tendermint.abci.Validator.fromObject(object.validator); + } + if (object.signedLastBlock != null) + message.signedLastBlock = Boolean(object.signedLastBlock); + return message; + }; + + /** + * Creates a plain object from a VoteInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.VoteInfo + * @static + * @param {tendermint.abci.VoteInfo} message VoteInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VoteInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.validator = null; + object.signedLastBlock = false; + } + if (message.validator != null && message.hasOwnProperty("validator")) + object.validator = $root.tendermint.abci.Validator.toObject(message.validator, options); + if (message.signedLastBlock != null && message.hasOwnProperty("signedLastBlock")) + object.signedLastBlock = message.signedLastBlock; + return object; + }; + + /** + * Converts this VoteInfo to JSON. + * @function toJSON + * @memberof tendermint.abci.VoteInfo + * @instance + * @returns {Object.} JSON object + */ + VoteInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VoteInfo; + })(abci.VoteInfo || {}); + + /** + * EvidenceType enum. + * @name tendermint.abci.EvidenceType + * @enum {string} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} DUPLICATE_VOTE=1 DUPLICATE_VOTE value + * @property {number} LIGHT_CLIENT_ATTACK=2 LIGHT_CLIENT_ATTACK value + */ + abci.EvidenceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "DUPLICATE_VOTE"] = 1; + values[valuesById[2] = "LIGHT_CLIENT_ATTACK"] = 2; + return values; + })(); + + abci.Evidence = (function(Evidence) { + + /** + * Properties of an Evidence. + * @memberof tendermint.abci + * @interface IEvidence + * @property {tendermint.abci.EvidenceType|null} [type] Evidence type + * @property {tendermint.abci.IValidator|null} [validator] Evidence validator + * @property {number|Long|null} [height] Evidence height + * @property {google.protobuf.ITimestamp|null} [time] Evidence time + * @property {number|Long|null} [totalVotingPower] Evidence totalVotingPower + */ + + /** + * Constructs a new Evidence. + * @memberof tendermint.abci + * @classdesc Represents an Evidence. + * @implements IEvidence + * @constructor + * @param {tendermint.abci.IEvidence=} [properties] Properties to set + */ + function Evidence(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Evidence type. + * @member {tendermint.abci.EvidenceType} type + * @memberof tendermint.abci.Evidence + * @instance + */ + Evidence.prototype.type = 0; + + /** + * Evidence validator. + * @member {tendermint.abci.IValidator|null|undefined} validator + * @memberof tendermint.abci.Evidence + * @instance + */ + Evidence.prototype.validator = null; + + /** + * Evidence height. + * @member {number|Long} height + * @memberof tendermint.abci.Evidence + * @instance + */ + Evidence.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Evidence time. + * @member {google.protobuf.ITimestamp|null|undefined} time + * @memberof tendermint.abci.Evidence + * @instance + */ + Evidence.prototype.time = null; + + /** + * Evidence totalVotingPower. + * @member {number|Long} totalVotingPower + * @memberof tendermint.abci.Evidence + * @instance + */ + Evidence.prototype.totalVotingPower = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Evidence instance using the specified properties. + * @function create + * @memberof tendermint.abci.Evidence + * @static + * @param {tendermint.abci.IEvidence=} [properties] Properties to set + * @returns {tendermint.abci.Evidence} Evidence instance + */ + Evidence.create = function create(properties) { + return new Evidence(properties); + }; + + /** + * Encodes the specified Evidence message. Does not implicitly {@link tendermint.abci.Evidence.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.Evidence + * @static + * @param {tendermint.abci.IEvidence} message Evidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Evidence.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.validator != null && Object.hasOwnProperty.call(message, "validator")) + $root.tendermint.abci.Validator.encode(message.validator, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.height); + if (message.time != null && Object.hasOwnProperty.call(message, "time")) + $root.google.protobuf.Timestamp.encode(message.time, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.totalVotingPower != null && Object.hasOwnProperty.call(message, "totalVotingPower")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.totalVotingPower); + return writer; + }; + + /** + * Encodes the specified Evidence message, length delimited. Does not implicitly {@link tendermint.abci.Evidence.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.Evidence + * @static + * @param {tendermint.abci.IEvidence} message Evidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Evidence.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Evidence message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.Evidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.Evidence} Evidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Evidence.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.Evidence(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32(); + break; + case 2: + message.validator = $root.tendermint.abci.Validator.decode(reader, reader.uint32()); + break; + case 3: + message.height = reader.int64(); + break; + case 4: + message.time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.totalVotingPower = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Evidence message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.Evidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.Evidence} Evidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Evidence.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Evidence message. + * @function verify + * @memberof tendermint.abci.Evidence + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Evidence.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.validator != null && message.hasOwnProperty("validator")) { + var error = $root.tendermint.abci.Validator.verify(message.validator); + if (error) + return "validator." + error; + } + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.time != null && message.hasOwnProperty("time")) { + var error = $root.google.protobuf.Timestamp.verify(message.time); + if (error) + return "time." + error; + } + if (message.totalVotingPower != null && message.hasOwnProperty("totalVotingPower")) + if (!$util.isInteger(message.totalVotingPower) && !(message.totalVotingPower && $util.isInteger(message.totalVotingPower.low) && $util.isInteger(message.totalVotingPower.high))) + return "totalVotingPower: integer|Long expected"; + return null; + }; + + /** + * Creates an Evidence message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.Evidence + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.Evidence} Evidence + */ + Evidence.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.Evidence) + return object; + var message = new $root.tendermint.abci.Evidence(); + switch (object.type) { + case "UNKNOWN": + case 0: + message.type = 0; + break; + case "DUPLICATE_VOTE": + case 1: + message.type = 1; + break; + case "LIGHT_CLIENT_ATTACK": + case 2: + message.type = 2; + break; + } + if (object.validator != null) { + if (typeof object.validator !== "object") + throw TypeError(".tendermint.abci.Evidence.validator: object expected"); + message.validator = $root.tendermint.abci.Validator.fromObject(object.validator); + } + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + if (object.time != null) { + if (typeof object.time !== "object") + throw TypeError(".tendermint.abci.Evidence.time: object expected"); + message.time = $root.google.protobuf.Timestamp.fromObject(object.time); + } + if (object.totalVotingPower != null) + if ($util.Long) + (message.totalVotingPower = $util.Long.fromValue(object.totalVotingPower)).unsigned = false; + else if (typeof object.totalVotingPower === "string") + message.totalVotingPower = parseInt(object.totalVotingPower, 10); + else if (typeof object.totalVotingPower === "number") + message.totalVotingPower = object.totalVotingPower; + else if (typeof object.totalVotingPower === "object") + message.totalVotingPower = new $util.LongBits(object.totalVotingPower.low >>> 0, object.totalVotingPower.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Evidence message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.Evidence + * @static + * @param {tendermint.abci.Evidence} message Evidence + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Evidence.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "UNKNOWN" : 0; + object.validator = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.time = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalVotingPower = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalVotingPower = options.longs === String ? "0" : 0; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.tendermint.abci.EvidenceType[message.type] : message.type; + if (message.validator != null && message.hasOwnProperty("validator")) + object.validator = $root.tendermint.abci.Validator.toObject(message.validator, options); + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + if (message.time != null && message.hasOwnProperty("time")) + object.time = $root.google.protobuf.Timestamp.toObject(message.time, options); + if (message.totalVotingPower != null && message.hasOwnProperty("totalVotingPower")) + if (typeof message.totalVotingPower === "number") + object.totalVotingPower = options.longs === String ? String(message.totalVotingPower) : message.totalVotingPower; + else + object.totalVotingPower = options.longs === String ? $util.Long.prototype.toString.call(message.totalVotingPower) : options.longs === Number ? new $util.LongBits(message.totalVotingPower.low >>> 0, message.totalVotingPower.high >>> 0).toNumber() : message.totalVotingPower; + return object; + }; + + /** + * Converts this Evidence to JSON. + * @function toJSON + * @memberof tendermint.abci.Evidence + * @instance + * @returns {Object.} JSON object + */ + Evidence.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Evidence; + })(abci.Evidence || {}); + + abci.Snapshot = (function(Snapshot) { + + /** + * Properties of a Snapshot. + * @memberof tendermint.abci + * @interface ISnapshot + * @property {number|Long|null} [height] Snapshot height + * @property {number|null} [format] Snapshot format + * @property {number|null} [chunks] Snapshot chunks + * @property {Uint8Array|null} [hash] Snapshot hash + * @property {Uint8Array|null} [metadata] Snapshot metadata + */ + + /** + * Constructs a new Snapshot. + * @memberof tendermint.abci + * @classdesc Represents a Snapshot. + * @implements ISnapshot + * @constructor + * @param {tendermint.abci.ISnapshot=} [properties] Properties to set + */ + function Snapshot(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Snapshot height. + * @member {number|Long} height + * @memberof tendermint.abci.Snapshot + * @instance + */ + Snapshot.prototype.height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Snapshot format. + * @member {number} format + * @memberof tendermint.abci.Snapshot + * @instance + */ + Snapshot.prototype.format = 0; + + /** + * Snapshot chunks. + * @member {number} chunks + * @memberof tendermint.abci.Snapshot + * @instance + */ + Snapshot.prototype.chunks = 0; + + /** + * Snapshot hash. + * @member {Uint8Array} hash + * @memberof tendermint.abci.Snapshot + * @instance + */ + Snapshot.prototype.hash = $util.newBuffer([]); + + /** + * Snapshot metadata. + * @member {Uint8Array} metadata + * @memberof tendermint.abci.Snapshot + * @instance + */ + Snapshot.prototype.metadata = $util.newBuffer([]); + + /** + * Creates a new Snapshot instance using the specified properties. + * @function create + * @memberof tendermint.abci.Snapshot + * @static + * @param {tendermint.abci.ISnapshot=} [properties] Properties to set + * @returns {tendermint.abci.Snapshot} Snapshot instance + */ + Snapshot.create = function create(properties) { + return new Snapshot(properties); + }; + + /** + * Encodes the specified Snapshot message. Does not implicitly {@link tendermint.abci.Snapshot.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.Snapshot + * @static + * @param {tendermint.abci.ISnapshot} message Snapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Snapshot.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.height); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.format); + if (message.chunks != null && Object.hasOwnProperty.call(message, "chunks")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.chunks); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.hash); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.metadata); + return writer; + }; + + /** + * Encodes the specified Snapshot message, length delimited. Does not implicitly {@link tendermint.abci.Snapshot.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.Snapshot + * @static + * @param {tendermint.abci.ISnapshot} message Snapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Snapshot.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Snapshot message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.Snapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.Snapshot} Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Snapshot.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.Snapshot(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.uint64(); + break; + case 2: + message.format = reader.uint32(); + break; + case 3: + message.chunks = reader.uint32(); + break; + case 4: + message.hash = reader.bytes(); + break; + case 5: + message.metadata = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Snapshot message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.Snapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.Snapshot} Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Snapshot.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Snapshot message. + * @function verify + * @memberof tendermint.abci.Snapshot + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Snapshot.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.format != null && message.hasOwnProperty("format")) + if (!$util.isInteger(message.format)) + return "format: integer expected"; + if (message.chunks != null && message.hasOwnProperty("chunks")) + if (!$util.isInteger(message.chunks)) + return "chunks: integer expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash))) + return "hash: buffer expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) + if (!(message.metadata && typeof message.metadata.length === "number" || $util.isString(message.metadata))) + return "metadata: buffer expected"; + return null; + }; + + /** + * Creates a Snapshot message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.Snapshot + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.Snapshot} Snapshot + */ + Snapshot.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.Snapshot) + return object; + var message = new $root.tendermint.abci.Snapshot(); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = true; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(true); + if (object.format != null) + message.format = object.format >>> 0; + if (object.chunks != null) + message.chunks = object.chunks >>> 0; + if (object.hash != null) + if (typeof object.hash === "string") + $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0); + else if (object.hash.length) + message.hash = object.hash; + if (object.metadata != null) + if (typeof object.metadata === "string") + $util.base64.decode(object.metadata, message.metadata = $util.newBuffer($util.base64.length(object.metadata)), 0); + else if (object.metadata.length) + message.metadata = object.metadata; + return message; + }; + + /** + * Creates a plain object from a Snapshot message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.Snapshot + * @static + * @param {tendermint.abci.Snapshot} message Snapshot + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Snapshot.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.format = 0; + object.chunks = 0; + if (options.bytes === String) + object.hash = ""; + else { + object.hash = []; + if (options.bytes !== Array) + object.hash = $util.newBuffer(object.hash); + } + if (options.bytes === String) + object.metadata = ""; + else { + object.metadata = []; + if (options.bytes !== Array) + object.metadata = $util.newBuffer(object.metadata); + } + } + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber(true) : message.height; + if (message.format != null && message.hasOwnProperty("format")) + object.format = message.format; + if (message.chunks != null && message.hasOwnProperty("chunks")) + object.chunks = message.chunks; + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = options.bytes === String ? $util.base64.encode(message.metadata, 0, message.metadata.length) : options.bytes === Array ? Array.prototype.slice.call(message.metadata) : message.metadata; + return object; + }; + + /** + * Converts this Snapshot to JSON. + * @function toJSON + * @memberof tendermint.abci.Snapshot + * @instance + * @returns {Object.} JSON object + */ + Snapshot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Snapshot; + })(abci.Snapshot || {}); + + abci.ABCIApplication = (function(ABCIApplication) { + + /** + * Constructs a new ABCIApplication service. + * @memberof tendermint.abci + * @classdesc Represents a ABCIApplication + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function ABCIApplication(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ABCIApplication.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ABCIApplication; + + /** + * Creates new ABCIApplication service using the specified rpc implementation. + * @function create + * @memberof tendermint.abci.ABCIApplication + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {ABCIApplication} RPC service. Useful where requests and/or responses are streamed. + */ + ABCIApplication.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#echo}. + * @memberof tendermint.abci.ABCIApplication + * @typedef EchoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseEcho} [response] ResponseEcho + */ + + /** + * Calls Echo. + * @function echo + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestEcho} request RequestEcho message or plain object + * @param {tendermint.abci.ABCIApplication.EchoCallback} callback Node-style callback called with the error, if any, and ResponseEcho + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.echo = function echo(request, callback) { + return this.rpcCall(echo, $root.tendermint.abci.RequestEcho, $root.tendermint.abci.ResponseEcho, request, callback); + }, "name", { value: "Echo" }); + + /** + * Calls Echo. + * @function echo + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestEcho} request RequestEcho message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#flush}. + * @memberof tendermint.abci.ABCIApplication + * @typedef FlushCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseFlush} [response] ResponseFlush + */ + + /** + * Calls Flush. + * @function flush + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestFlush} request RequestFlush message or plain object + * @param {tendermint.abci.ABCIApplication.FlushCallback} callback Node-style callback called with the error, if any, and ResponseFlush + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.flush = function flush(request, callback) { + return this.rpcCall(flush, $root.tendermint.abci.RequestFlush, $root.tendermint.abci.ResponseFlush, request, callback); + }, "name", { value: "Flush" }); + + /** + * Calls Flush. + * @function flush + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestFlush} request RequestFlush message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#info}. + * @memberof tendermint.abci.ABCIApplication + * @typedef InfoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseInfo} [response] ResponseInfo + */ + + /** + * Calls Info. + * @function info + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestInfo} request RequestInfo message or plain object + * @param {tendermint.abci.ABCIApplication.InfoCallback} callback Node-style callback called with the error, if any, and ResponseInfo + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.info = function info(request, callback) { + return this.rpcCall(info, $root.tendermint.abci.RequestInfo, $root.tendermint.abci.ResponseInfo, request, callback); + }, "name", { value: "Info" }); + + /** + * Calls Info. + * @function info + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestInfo} request RequestInfo message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#setOption}. + * @memberof tendermint.abci.ABCIApplication + * @typedef SetOptionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseSetOption} [response] ResponseSetOption + */ + + /** + * Calls SetOption. + * @function setOption + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestSetOption} request RequestSetOption message or plain object + * @param {tendermint.abci.ABCIApplication.SetOptionCallback} callback Node-style callback called with the error, if any, and ResponseSetOption + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.setOption = function setOption(request, callback) { + return this.rpcCall(setOption, $root.tendermint.abci.RequestSetOption, $root.tendermint.abci.ResponseSetOption, request, callback); + }, "name", { value: "SetOption" }); + + /** + * Calls SetOption. + * @function setOption + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestSetOption} request RequestSetOption message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#deliverTx}. + * @memberof tendermint.abci.ABCIApplication + * @typedef DeliverTxCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseDeliverTx} [response] ResponseDeliverTx + */ + + /** + * Calls DeliverTx. + * @function deliverTx + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestDeliverTx} request RequestDeliverTx message or plain object + * @param {tendermint.abci.ABCIApplication.DeliverTxCallback} callback Node-style callback called with the error, if any, and ResponseDeliverTx + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.deliverTx = function deliverTx(request, callback) { + return this.rpcCall(deliverTx, $root.tendermint.abci.RequestDeliverTx, $root.tendermint.abci.ResponseDeliverTx, request, callback); + }, "name", { value: "DeliverTx" }); + + /** + * Calls DeliverTx. + * @function deliverTx + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestDeliverTx} request RequestDeliverTx message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#checkTx}. + * @memberof tendermint.abci.ABCIApplication + * @typedef CheckTxCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseCheckTx} [response] ResponseCheckTx + */ + + /** + * Calls CheckTx. + * @function checkTx + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestCheckTx} request RequestCheckTx message or plain object + * @param {tendermint.abci.ABCIApplication.CheckTxCallback} callback Node-style callback called with the error, if any, and ResponseCheckTx + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.checkTx = function checkTx(request, callback) { + return this.rpcCall(checkTx, $root.tendermint.abci.RequestCheckTx, $root.tendermint.abci.ResponseCheckTx, request, callback); + }, "name", { value: "CheckTx" }); + + /** + * Calls CheckTx. + * @function checkTx + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestCheckTx} request RequestCheckTx message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#query}. + * @memberof tendermint.abci.ABCIApplication + * @typedef QueryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseQuery} [response] ResponseQuery + */ + + /** + * Calls Query. + * @function query + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestQuery} request RequestQuery message or plain object + * @param {tendermint.abci.ABCIApplication.QueryCallback} callback Node-style callback called with the error, if any, and ResponseQuery + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.query = function query(request, callback) { + return this.rpcCall(query, $root.tendermint.abci.RequestQuery, $root.tendermint.abci.ResponseQuery, request, callback); + }, "name", { value: "Query" }); + + /** + * Calls Query. + * @function query + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestQuery} request RequestQuery message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#commit}. + * @memberof tendermint.abci.ABCIApplication + * @typedef CommitCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseCommit} [response] ResponseCommit + */ + + /** + * Calls Commit. + * @function commit + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestCommit} request RequestCommit message or plain object + * @param {tendermint.abci.ABCIApplication.CommitCallback} callback Node-style callback called with the error, if any, and ResponseCommit + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.commit = function commit(request, callback) { + return this.rpcCall(commit, $root.tendermint.abci.RequestCommit, $root.tendermint.abci.ResponseCommit, request, callback); + }, "name", { value: "Commit" }); + + /** + * Calls Commit. + * @function commit + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestCommit} request RequestCommit message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#initChain}. + * @memberof tendermint.abci.ABCIApplication + * @typedef InitChainCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseInitChain} [response] ResponseInitChain + */ + + /** + * Calls InitChain. + * @function initChain + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestInitChain} request RequestInitChain message or plain object + * @param {tendermint.abci.ABCIApplication.InitChainCallback} callback Node-style callback called with the error, if any, and ResponseInitChain + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.initChain = function initChain(request, callback) { + return this.rpcCall(initChain, $root.tendermint.abci.RequestInitChain, $root.tendermint.abci.ResponseInitChain, request, callback); + }, "name", { value: "InitChain" }); + + /** + * Calls InitChain. + * @function initChain + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestInitChain} request RequestInitChain message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#beginBlock}. + * @memberof tendermint.abci.ABCIApplication + * @typedef BeginBlockCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseBeginBlock} [response] ResponseBeginBlock + */ + + /** + * Calls BeginBlock. + * @function beginBlock + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestBeginBlock} request RequestBeginBlock message or plain object + * @param {tendermint.abci.ABCIApplication.BeginBlockCallback} callback Node-style callback called with the error, if any, and ResponseBeginBlock + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.beginBlock = function beginBlock(request, callback) { + return this.rpcCall(beginBlock, $root.tendermint.abci.RequestBeginBlock, $root.tendermint.abci.ResponseBeginBlock, request, callback); + }, "name", { value: "BeginBlock" }); + + /** + * Calls BeginBlock. + * @function beginBlock + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestBeginBlock} request RequestBeginBlock message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#endBlock}. + * @memberof tendermint.abci.ABCIApplication + * @typedef EndBlockCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseEndBlock} [response] ResponseEndBlock + */ + + /** + * Calls EndBlock. + * @function endBlock + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestEndBlock} request RequestEndBlock message or plain object + * @param {tendermint.abci.ABCIApplication.EndBlockCallback} callback Node-style callback called with the error, if any, and ResponseEndBlock + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.endBlock = function endBlock(request, callback) { + return this.rpcCall(endBlock, $root.tendermint.abci.RequestEndBlock, $root.tendermint.abci.ResponseEndBlock, request, callback); + }, "name", { value: "EndBlock" }); + + /** + * Calls EndBlock. + * @function endBlock + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestEndBlock} request RequestEndBlock message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#listSnapshots}. + * @memberof tendermint.abci.ABCIApplication + * @typedef ListSnapshotsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseListSnapshots} [response] ResponseListSnapshots + */ + + /** + * Calls ListSnapshots. + * @function listSnapshots + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestListSnapshots} request RequestListSnapshots message or plain object + * @param {tendermint.abci.ABCIApplication.ListSnapshotsCallback} callback Node-style callback called with the error, if any, and ResponseListSnapshots + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.listSnapshots = function listSnapshots(request, callback) { + return this.rpcCall(listSnapshots, $root.tendermint.abci.RequestListSnapshots, $root.tendermint.abci.ResponseListSnapshots, request, callback); + }, "name", { value: "ListSnapshots" }); + + /** + * Calls ListSnapshots. + * @function listSnapshots + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestListSnapshots} request RequestListSnapshots message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#offerSnapshot}. + * @memberof tendermint.abci.ABCIApplication + * @typedef OfferSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseOfferSnapshot} [response] ResponseOfferSnapshot + */ + + /** + * Calls OfferSnapshot. + * @function offerSnapshot + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestOfferSnapshot} request RequestOfferSnapshot message or plain object + * @param {tendermint.abci.ABCIApplication.OfferSnapshotCallback} callback Node-style callback called with the error, if any, and ResponseOfferSnapshot + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.offerSnapshot = function offerSnapshot(request, callback) { + return this.rpcCall(offerSnapshot, $root.tendermint.abci.RequestOfferSnapshot, $root.tendermint.abci.ResponseOfferSnapshot, request, callback); + }, "name", { value: "OfferSnapshot" }); + + /** + * Calls OfferSnapshot. + * @function offerSnapshot + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestOfferSnapshot} request RequestOfferSnapshot message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#loadSnapshotChunk}. + * @memberof tendermint.abci.ABCIApplication + * @typedef LoadSnapshotChunkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseLoadSnapshotChunk} [response] ResponseLoadSnapshotChunk + */ + + /** + * Calls LoadSnapshotChunk. + * @function loadSnapshotChunk + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestLoadSnapshotChunk} request RequestLoadSnapshotChunk message or plain object + * @param {tendermint.abci.ABCIApplication.LoadSnapshotChunkCallback} callback Node-style callback called with the error, if any, and ResponseLoadSnapshotChunk + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.loadSnapshotChunk = function loadSnapshotChunk(request, callback) { + return this.rpcCall(loadSnapshotChunk, $root.tendermint.abci.RequestLoadSnapshotChunk, $root.tendermint.abci.ResponseLoadSnapshotChunk, request, callback); + }, "name", { value: "LoadSnapshotChunk" }); + + /** + * Calls LoadSnapshotChunk. + * @function loadSnapshotChunk + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestLoadSnapshotChunk} request RequestLoadSnapshotChunk message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#applySnapshotChunk}. + * @memberof tendermint.abci.ABCIApplication + * @typedef ApplySnapshotChunkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseApplySnapshotChunk} [response] ResponseApplySnapshotChunk + */ + + /** + * Calls ApplySnapshotChunk. + * @function applySnapshotChunk + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestApplySnapshotChunk} request RequestApplySnapshotChunk message or plain object + * @param {tendermint.abci.ABCIApplication.ApplySnapshotChunkCallback} callback Node-style callback called with the error, if any, and ResponseApplySnapshotChunk + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.applySnapshotChunk = function applySnapshotChunk(request, callback) { + return this.rpcCall(applySnapshotChunk, $root.tendermint.abci.RequestApplySnapshotChunk, $root.tendermint.abci.ResponseApplySnapshotChunk, request, callback); + }, "name", { value: "ApplySnapshotChunk" }); + + /** + * Calls ApplySnapshotChunk. + * @function applySnapshotChunk + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestApplySnapshotChunk} request RequestApplySnapshotChunk message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ABCIApplication; + })(abci.ABCIApplication || {}); + + return abci; + })(tendermint.abci || {}); + + /** + * Namespace crypto. + * @memberof tendermint + * @namespace + */ + + tendermint.crypto = (function(crypto) { + + crypto.PublicKey = (function(PublicKey) { + + /** + * Properties of a PublicKey. + * @memberof tendermint.crypto + * @interface IPublicKey + * @property {Uint8Array|null} [ed25519] PublicKey ed25519 + * @property {Uint8Array|null} [secp256k1] PublicKey secp256k1 + */ + + /** + * Constructs a new PublicKey. + * @memberof tendermint.crypto + * @classdesc Represents a PublicKey. + * @implements IPublicKey + * @constructor + * @param {tendermint.crypto.IPublicKey=} [properties] Properties to set + */ + function PublicKey(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PublicKey ed25519. + * @member {Uint8Array} ed25519 + * @memberof tendermint.crypto.PublicKey + * @instance + */ + PublicKey.prototype.ed25519 = $util.newBuffer([]); + + /** + * PublicKey secp256k1. + * @member {Uint8Array} secp256k1 + * @memberof tendermint.crypto.PublicKey + * @instance + */ + PublicKey.prototype.secp256k1 = $util.newBuffer([]); + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PublicKey sum. + * @member {"ed25519"|"secp256k1"|undefined} sum + * @memberof tendermint.crypto.PublicKey + * @instance + */ + Object.defineProperty(PublicKey.prototype, "sum", { + get: $util.oneOfGetter($oneOfFields = ["ed25519", "secp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PublicKey instance using the specified properties. + * @function create + * @memberof tendermint.crypto.PublicKey + * @static + * @param {tendermint.crypto.IPublicKey=} [properties] Properties to set + * @returns {tendermint.crypto.PublicKey} PublicKey instance + */ + PublicKey.create = function create(properties) { + return new PublicKey(properties); + }; + + /** + * Encodes the specified PublicKey message. Does not implicitly {@link tendermint.crypto.PublicKey.verify|verify} messages. + * @function encode + * @memberof tendermint.crypto.PublicKey + * @static + * @param {tendermint.crypto.IPublicKey} message PublicKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ed25519 != null && Object.hasOwnProperty.call(message, "ed25519")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.ed25519); + if (message.secp256k1 != null && Object.hasOwnProperty.call(message, "secp256k1")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.secp256k1); + return writer; + }; + + /** + * Encodes the specified PublicKey message, length delimited. Does not implicitly {@link tendermint.crypto.PublicKey.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.crypto.PublicKey + * @static + * @param {tendermint.crypto.IPublicKey} message PublicKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PublicKey message from the specified reader or buffer. + * @function decode + * @memberof tendermint.crypto.PublicKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.crypto.PublicKey} PublicKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicKey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.PublicKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ed25519 = reader.bytes(); + break; + case 2: + message.secp256k1 = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PublicKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.crypto.PublicKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.crypto.PublicKey} PublicKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PublicKey message. + * @function verify + * @memberof tendermint.crypto.PublicKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PublicKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.ed25519 != null && message.hasOwnProperty("ed25519")) { + properties.sum = 1; + if (!(message.ed25519 && typeof message.ed25519.length === "number" || $util.isString(message.ed25519))) + return "ed25519: buffer expected"; + } + if (message.secp256k1 != null && message.hasOwnProperty("secp256k1")) { + if (properties.sum === 1) + return "sum: multiple values"; + properties.sum = 1; + if (!(message.secp256k1 && typeof message.secp256k1.length === "number" || $util.isString(message.secp256k1))) + return "secp256k1: buffer expected"; + } + return null; + }; + + /** + * Creates a PublicKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.crypto.PublicKey + * @static + * @param {Object.} object Plain object + * @returns {tendermint.crypto.PublicKey} PublicKey + */ + PublicKey.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.crypto.PublicKey) + return object; + var message = new $root.tendermint.crypto.PublicKey(); + if (object.ed25519 != null) + if (typeof object.ed25519 === "string") + $util.base64.decode(object.ed25519, message.ed25519 = $util.newBuffer($util.base64.length(object.ed25519)), 0); + else if (object.ed25519.length) + message.ed25519 = object.ed25519; + if (object.secp256k1 != null) + if (typeof object.secp256k1 === "string") + $util.base64.decode(object.secp256k1, message.secp256k1 = $util.newBuffer($util.base64.length(object.secp256k1)), 0); + else if (object.secp256k1.length) + message.secp256k1 = object.secp256k1; + return message; + }; + + /** + * Creates a plain object from a PublicKey message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.crypto.PublicKey + * @static + * @param {tendermint.crypto.PublicKey} message PublicKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PublicKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.ed25519 != null && message.hasOwnProperty("ed25519")) { + object.ed25519 = options.bytes === String ? $util.base64.encode(message.ed25519, 0, message.ed25519.length) : options.bytes === Array ? Array.prototype.slice.call(message.ed25519) : message.ed25519; + if (options.oneofs) + object.sum = "ed25519"; + } + if (message.secp256k1 != null && message.hasOwnProperty("secp256k1")) { + object.secp256k1 = options.bytes === String ? $util.base64.encode(message.secp256k1, 0, message.secp256k1.length) : options.bytes === Array ? Array.prototype.slice.call(message.secp256k1) : message.secp256k1; + if (options.oneofs) + object.sum = "secp256k1"; + } + return object; + }; + + /** + * Converts this PublicKey to JSON. + * @function toJSON + * @memberof tendermint.crypto.PublicKey + * @instance + * @returns {Object.} JSON object + */ + PublicKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PublicKey; + })(crypto.PublicKey || {}); + + crypto.Proof = (function(Proof) { + + /** + * Properties of a Proof. + * @memberof tendermint.crypto + * @interface IProof + * @property {number|Long|null} [total] Proof total + * @property {number|Long|null} [index] Proof index + * @property {Uint8Array|null} [leafHash] Proof leafHash + * @property {Array.|null} [aunts] Proof aunts + */ + + /** + * Constructs a new Proof. + * @memberof tendermint.crypto + * @classdesc Represents a Proof. + * @implements IProof + * @constructor + * @param {tendermint.crypto.IProof=} [properties] Properties to set + */ + function Proof(properties) { + this.aunts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Proof total. + * @member {number|Long} total + * @memberof tendermint.crypto.Proof + * @instance + */ + Proof.prototype.total = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Proof index. + * @member {number|Long} index + * @memberof tendermint.crypto.Proof + * @instance + */ + Proof.prototype.index = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Proof leafHash. + * @member {Uint8Array} leafHash + * @memberof tendermint.crypto.Proof + * @instance + */ + Proof.prototype.leafHash = $util.newBuffer([]); + + /** + * Proof aunts. + * @member {Array.} aunts + * @memberof tendermint.crypto.Proof + * @instance + */ + Proof.prototype.aunts = $util.emptyArray; + + /** + * Creates a new Proof instance using the specified properties. + * @function create + * @memberof tendermint.crypto.Proof + * @static + * @param {tendermint.crypto.IProof=} [properties] Properties to set + * @returns {tendermint.crypto.Proof} Proof instance + */ + Proof.create = function create(properties) { + return new Proof(properties); + }; + + /** + * Encodes the specified Proof message. Does not implicitly {@link tendermint.crypto.Proof.verify|verify} messages. + * @function encode + * @memberof tendermint.crypto.Proof + * @static + * @param {tendermint.crypto.IProof} message Proof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proof.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.total != null && Object.hasOwnProperty.call(message, "total")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.total); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.index); + if (message.leafHash != null && Object.hasOwnProperty.call(message, "leafHash")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.leafHash); + if (message.aunts != null && message.aunts.length) + for (var i = 0; i < message.aunts.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.aunts[i]); + return writer; + }; + + /** + * Encodes the specified Proof message, length delimited. Does not implicitly {@link tendermint.crypto.Proof.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.crypto.Proof + * @static + * @param {tendermint.crypto.IProof} message Proof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proof.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Proof message from the specified reader or buffer. + * @function decode + * @memberof tendermint.crypto.Proof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.crypto.Proof} Proof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proof.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.Proof(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.total = reader.int64(); + break; + case 2: + message.index = reader.int64(); + break; + case 3: + message.leafHash = reader.bytes(); + break; + case 4: + if (!(message.aunts && message.aunts.length)) + message.aunts = []; + message.aunts.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Proof message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.crypto.Proof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.crypto.Proof} Proof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proof.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Proof message. + * @function verify + * @memberof tendermint.crypto.Proof + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Proof.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.total != null && message.hasOwnProperty("total")) + if (!$util.isInteger(message.total) && !(message.total && $util.isInteger(message.total.low) && $util.isInteger(message.total.high))) + return "total: integer|Long expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index) && !(message.index && $util.isInteger(message.index.low) && $util.isInteger(message.index.high))) + return "index: integer|Long expected"; + if (message.leafHash != null && message.hasOwnProperty("leafHash")) + if (!(message.leafHash && typeof message.leafHash.length === "number" || $util.isString(message.leafHash))) + return "leafHash: buffer expected"; + if (message.aunts != null && message.hasOwnProperty("aunts")) { + if (!Array.isArray(message.aunts)) + return "aunts: array expected"; + for (var i = 0; i < message.aunts.length; ++i) + if (!(message.aunts[i] && typeof message.aunts[i].length === "number" || $util.isString(message.aunts[i]))) + return "aunts: buffer[] expected"; + } + return null; + }; + + /** + * Creates a Proof message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.crypto.Proof + * @static + * @param {Object.} object Plain object + * @returns {tendermint.crypto.Proof} Proof + */ + Proof.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.crypto.Proof) + return object; + var message = new $root.tendermint.crypto.Proof(); + if (object.total != null) + if ($util.Long) + (message.total = $util.Long.fromValue(object.total)).unsigned = false; + else if (typeof object.total === "string") + message.total = parseInt(object.total, 10); + else if (typeof object.total === "number") + message.total = object.total; + else if (typeof object.total === "object") + message.total = new $util.LongBits(object.total.low >>> 0, object.total.high >>> 0).toNumber(); + if (object.index != null) + if ($util.Long) + (message.index = $util.Long.fromValue(object.index)).unsigned = false; + else if (typeof object.index === "string") + message.index = parseInt(object.index, 10); + else if (typeof object.index === "number") + message.index = object.index; + else if (typeof object.index === "object") + message.index = new $util.LongBits(object.index.low >>> 0, object.index.high >>> 0).toNumber(); + if (object.leafHash != null) + if (typeof object.leafHash === "string") + $util.base64.decode(object.leafHash, message.leafHash = $util.newBuffer($util.base64.length(object.leafHash)), 0); + else if (object.leafHash.length) + message.leafHash = object.leafHash; + if (object.aunts) { + if (!Array.isArray(object.aunts)) + throw TypeError(".tendermint.crypto.Proof.aunts: array expected"); + message.aunts = []; + for (var i = 0; i < object.aunts.length; ++i) + if (typeof object.aunts[i] === "string") + $util.base64.decode(object.aunts[i], message.aunts[i] = $util.newBuffer($util.base64.length(object.aunts[i])), 0); + else if (object.aunts[i].length) + message.aunts[i] = object.aunts[i]; + } + return message; + }; + + /** + * Creates a plain object from a Proof message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.crypto.Proof + * @static + * @param {tendermint.crypto.Proof} message Proof + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Proof.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.aunts = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.total = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.total = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.index = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.index = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.leafHash = ""; + else { + object.leafHash = []; + if (options.bytes !== Array) + object.leafHash = $util.newBuffer(object.leafHash); + } + } + if (message.total != null && message.hasOwnProperty("total")) + if (typeof message.total === "number") + object.total = options.longs === String ? String(message.total) : message.total; + else + object.total = options.longs === String ? $util.Long.prototype.toString.call(message.total) : options.longs === Number ? new $util.LongBits(message.total.low >>> 0, message.total.high >>> 0).toNumber() : message.total; + if (message.index != null && message.hasOwnProperty("index")) + if (typeof message.index === "number") + object.index = options.longs === String ? String(message.index) : message.index; + else + object.index = options.longs === String ? $util.Long.prototype.toString.call(message.index) : options.longs === Number ? new $util.LongBits(message.index.low >>> 0, message.index.high >>> 0).toNumber() : message.index; + if (message.leafHash != null && message.hasOwnProperty("leafHash")) + object.leafHash = options.bytes === String ? $util.base64.encode(message.leafHash, 0, message.leafHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.leafHash) : message.leafHash; + if (message.aunts && message.aunts.length) { + object.aunts = []; + for (var j = 0; j < message.aunts.length; ++j) + object.aunts[j] = options.bytes === String ? $util.base64.encode(message.aunts[j], 0, message.aunts[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.aunts[j]) : message.aunts[j]; + } + return object; + }; + + /** + * Converts this Proof to JSON. + * @function toJSON + * @memberof tendermint.crypto.Proof + * @instance + * @returns {Object.} JSON object + */ + Proof.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Proof; + })(crypto.Proof || {}); + + crypto.ValueOp = (function(ValueOp) { + + /** + * Properties of a ValueOp. + * @memberof tendermint.crypto + * @interface IValueOp + * @property {Uint8Array|null} [key] ValueOp key + * @property {tendermint.crypto.IProof|null} [proof] ValueOp proof + */ + + /** + * Constructs a new ValueOp. + * @memberof tendermint.crypto + * @classdesc Represents a ValueOp. + * @implements IValueOp + * @constructor + * @param {tendermint.crypto.IValueOp=} [properties] Properties to set + */ + function ValueOp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValueOp key. + * @member {Uint8Array} key + * @memberof tendermint.crypto.ValueOp + * @instance + */ + ValueOp.prototype.key = $util.newBuffer([]); + + /** + * ValueOp proof. + * @member {tendermint.crypto.IProof|null|undefined} proof + * @memberof tendermint.crypto.ValueOp + * @instance + */ + ValueOp.prototype.proof = null; + + /** + * Creates a new ValueOp instance using the specified properties. + * @function create + * @memberof tendermint.crypto.ValueOp + * @static + * @param {tendermint.crypto.IValueOp=} [properties] Properties to set + * @returns {tendermint.crypto.ValueOp} ValueOp instance + */ + ValueOp.create = function create(properties) { + return new ValueOp(properties); + }; + + /** + * Encodes the specified ValueOp message. Does not implicitly {@link tendermint.crypto.ValueOp.verify|verify} messages. + * @function encode + * @memberof tendermint.crypto.ValueOp + * @static + * @param {tendermint.crypto.IValueOp} message ValueOp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValueOp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.tendermint.crypto.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ValueOp message, length delimited. Does not implicitly {@link tendermint.crypto.ValueOp.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.crypto.ValueOp + * @static + * @param {tendermint.crypto.IValueOp} message ValueOp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValueOp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValueOp message from the specified reader or buffer. + * @function decode + * @memberof tendermint.crypto.ValueOp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.crypto.ValueOp} ValueOp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValueOp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.ValueOp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.proof = $root.tendermint.crypto.Proof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValueOp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.crypto.ValueOp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.crypto.ValueOp} ValueOp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValueOp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValueOp message. + * @function verify + * @memberof tendermint.crypto.ValueOp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValueOp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + if (message.proof != null && message.hasOwnProperty("proof")) { + var error = $root.tendermint.crypto.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + return null; + }; + + /** + * Creates a ValueOp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.crypto.ValueOp + * @static + * @param {Object.} object Plain object + * @returns {tendermint.crypto.ValueOp} ValueOp + */ + ValueOp.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.crypto.ValueOp) + return object; + var message = new $root.tendermint.crypto.ValueOp(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length) + message.key = object.key; + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".tendermint.crypto.ValueOp.proof: object expected"); + message.proof = $root.tendermint.crypto.Proof.fromObject(object.proof); + } + return message; + }; + + /** + * Creates a plain object from a ValueOp message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.crypto.ValueOp + * @static + * @param {tendermint.crypto.ValueOp} message ValueOp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValueOp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + object.proof = null; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.proof != null && message.hasOwnProperty("proof")) + object.proof = $root.tendermint.crypto.Proof.toObject(message.proof, options); + return object; + }; + + /** + * Converts this ValueOp to JSON. + * @function toJSON + * @memberof tendermint.crypto.ValueOp + * @instance + * @returns {Object.} JSON object + */ + ValueOp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValueOp; + })(crypto.ValueOp || {}); + + crypto.DominoOp = (function(DominoOp) { + + /** + * Properties of a DominoOp. + * @memberof tendermint.crypto + * @interface IDominoOp + * @property {string|null} [key] DominoOp key + * @property {string|null} [input] DominoOp input + * @property {string|null} [output] DominoOp output + */ + + /** + * Constructs a new DominoOp. + * @memberof tendermint.crypto + * @classdesc Represents a DominoOp. + * @implements IDominoOp + * @constructor + * @param {tendermint.crypto.IDominoOp=} [properties] Properties to set + */ + function DominoOp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DominoOp key. + * @member {string} key + * @memberof tendermint.crypto.DominoOp + * @instance + */ + DominoOp.prototype.key = ""; + + /** + * DominoOp input. + * @member {string} input + * @memberof tendermint.crypto.DominoOp + * @instance + */ + DominoOp.prototype.input = ""; + + /** + * DominoOp output. + * @member {string} output + * @memberof tendermint.crypto.DominoOp + * @instance + */ + DominoOp.prototype.output = ""; + + /** + * Creates a new DominoOp instance using the specified properties. + * @function create + * @memberof tendermint.crypto.DominoOp + * @static + * @param {tendermint.crypto.IDominoOp=} [properties] Properties to set + * @returns {tendermint.crypto.DominoOp} DominoOp instance + */ + DominoOp.create = function create(properties) { + return new DominoOp(properties); + }; + + /** + * Encodes the specified DominoOp message. Does not implicitly {@link tendermint.crypto.DominoOp.verify|verify} messages. + * @function encode + * @memberof tendermint.crypto.DominoOp + * @static + * @param {tendermint.crypto.IDominoOp} message DominoOp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DominoOp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.input != null && Object.hasOwnProperty.call(message, "input")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.input); + if (message.output != null && Object.hasOwnProperty.call(message, "output")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.output); + return writer; + }; + + /** + * Encodes the specified DominoOp message, length delimited. Does not implicitly {@link tendermint.crypto.DominoOp.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.crypto.DominoOp + * @static + * @param {tendermint.crypto.IDominoOp} message DominoOp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DominoOp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DominoOp message from the specified reader or buffer. + * @function decode + * @memberof tendermint.crypto.DominoOp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.crypto.DominoOp} DominoOp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DominoOp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.DominoOp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.input = reader.string(); + break; + case 3: + message.output = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DominoOp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.crypto.DominoOp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.crypto.DominoOp} DominoOp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DominoOp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DominoOp message. + * @function verify + * @memberof tendermint.crypto.DominoOp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DominoOp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.input != null && message.hasOwnProperty("input")) + if (!$util.isString(message.input)) + return "input: string expected"; + if (message.output != null && message.hasOwnProperty("output")) + if (!$util.isString(message.output)) + return "output: string expected"; + return null; + }; + + /** + * Creates a DominoOp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.crypto.DominoOp + * @static + * @param {Object.} object Plain object + * @returns {tendermint.crypto.DominoOp} DominoOp + */ + DominoOp.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.crypto.DominoOp) + return object; + var message = new $root.tendermint.crypto.DominoOp(); + if (object.key != null) + message.key = String(object.key); + if (object.input != null) + message.input = String(object.input); + if (object.output != null) + message.output = String(object.output); + return message; + }; + + /** + * Creates a plain object from a DominoOp message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.crypto.DominoOp + * @static + * @param {tendermint.crypto.DominoOp} message DominoOp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DominoOp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.key = ""; + object.input = ""; + object.output = ""; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.input != null && message.hasOwnProperty("input")) + object.input = message.input; + if (message.output != null && message.hasOwnProperty("output")) + object.output = message.output; + return object; + }; + + /** + * Converts this DominoOp to JSON. + * @function toJSON + * @memberof tendermint.crypto.DominoOp + * @instance + * @returns {Object.} JSON object + */ + DominoOp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DominoOp; + })(crypto.DominoOp || {}); + + crypto.ProofOp = (function(ProofOp) { + + /** + * Properties of a ProofOp. + * @memberof tendermint.crypto + * @interface IProofOp + * @property {string|null} [type] ProofOp type + * @property {Uint8Array|null} [key] ProofOp key + * @property {Uint8Array|null} [data] ProofOp data + */ + + /** + * Constructs a new ProofOp. + * @memberof tendermint.crypto + * @classdesc Represents a ProofOp. + * @implements IProofOp + * @constructor + * @param {tendermint.crypto.IProofOp=} [properties] Properties to set + */ + function ProofOp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProofOp type. + * @member {string} type + * @memberof tendermint.crypto.ProofOp + * @instance + */ + ProofOp.prototype.type = ""; + + /** + * ProofOp key. + * @member {Uint8Array} key + * @memberof tendermint.crypto.ProofOp + * @instance + */ + ProofOp.prototype.key = $util.newBuffer([]); + + /** + * ProofOp data. + * @member {Uint8Array} data + * @memberof tendermint.crypto.ProofOp + * @instance + */ + ProofOp.prototype.data = $util.newBuffer([]); + + /** + * Creates a new ProofOp instance using the specified properties. + * @function create + * @memberof tendermint.crypto.ProofOp + * @static + * @param {tendermint.crypto.IProofOp=} [properties] Properties to set + * @returns {tendermint.crypto.ProofOp} ProofOp instance + */ + ProofOp.create = function create(properties) { + return new ProofOp(properties); + }; + + /** + * Encodes the specified ProofOp message. Does not implicitly {@link tendermint.crypto.ProofOp.verify|verify} messages. + * @function encode + * @memberof tendermint.crypto.ProofOp + * @static + * @param {tendermint.crypto.IProofOp} message ProofOp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProofOp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.key); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.data); + return writer; + }; + + /** + * Encodes the specified ProofOp message, length delimited. Does not implicitly {@link tendermint.crypto.ProofOp.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.crypto.ProofOp + * @static + * @param {tendermint.crypto.IProofOp} message ProofOp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProofOp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProofOp message from the specified reader or buffer. + * @function decode + * @memberof tendermint.crypto.ProofOp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.crypto.ProofOp} ProofOp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProofOp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.ProofOp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.key = reader.bytes(); + break; + case 3: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProofOp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.crypto.ProofOp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.crypto.ProofOp} ProofOp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProofOp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProofOp message. + * @function verify + * @memberof tendermint.crypto.ProofOp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProofOp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + return null; + }; + + /** + * Creates a ProofOp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.crypto.ProofOp + * @static + * @param {Object.} object Plain object + * @returns {tendermint.crypto.ProofOp} ProofOp + */ + ProofOp.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.crypto.ProofOp) + return object; + var message = new $root.tendermint.crypto.ProofOp(); + if (object.type != null) + message.type = String(object.type); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length) + message.key = object.key; + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length) + message.data = object.data; + return message; + }; + + /** + * Creates a plain object from a ProofOp message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.crypto.ProofOp + * @static + * @param {tendermint.crypto.ProofOp} message ProofOp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProofOp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + return object; + }; + + /** + * Converts this ProofOp to JSON. + * @function toJSON + * @memberof tendermint.crypto.ProofOp + * @instance + * @returns {Object.} JSON object + */ + ProofOp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ProofOp; + })(crypto.ProofOp || {}); + + crypto.ProofOps = (function(ProofOps) { + + /** + * Properties of a ProofOps. + * @memberof tendermint.crypto + * @interface IProofOps + * @property {Array.|null} [ops] ProofOps ops + */ + + /** + * Constructs a new ProofOps. + * @memberof tendermint.crypto + * @classdesc Represents a ProofOps. + * @implements IProofOps + * @constructor + * @param {tendermint.crypto.IProofOps=} [properties] Properties to set + */ + function ProofOps(properties) { + this.ops = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProofOps ops. + * @member {Array.} ops + * @memberof tendermint.crypto.ProofOps + * @instance + */ + ProofOps.prototype.ops = $util.emptyArray; + + /** + * Creates a new ProofOps instance using the specified properties. + * @function create + * @memberof tendermint.crypto.ProofOps + * @static + * @param {tendermint.crypto.IProofOps=} [properties] Properties to set + * @returns {tendermint.crypto.ProofOps} ProofOps instance + */ + ProofOps.create = function create(properties) { + return new ProofOps(properties); + }; + + /** + * Encodes the specified ProofOps message. Does not implicitly {@link tendermint.crypto.ProofOps.verify|verify} messages. + * @function encode + * @memberof tendermint.crypto.ProofOps + * @static + * @param {tendermint.crypto.IProofOps} message ProofOps message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProofOps.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ops != null && message.ops.length) + for (var i = 0; i < message.ops.length; ++i) + $root.tendermint.crypto.ProofOp.encode(message.ops[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProofOps message, length delimited. Does not implicitly {@link tendermint.crypto.ProofOps.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.crypto.ProofOps + * @static + * @param {tendermint.crypto.IProofOps} message ProofOps message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProofOps.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProofOps message from the specified reader or buffer. + * @function decode + * @memberof tendermint.crypto.ProofOps + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.crypto.ProofOps} ProofOps + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProofOps.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.ProofOps(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.ops && message.ops.length)) + message.ops = []; + message.ops.push($root.tendermint.crypto.ProofOp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProofOps message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.crypto.ProofOps + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.crypto.ProofOps} ProofOps + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProofOps.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProofOps message. + * @function verify + * @memberof tendermint.crypto.ProofOps + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProofOps.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ops != null && message.hasOwnProperty("ops")) { + if (!Array.isArray(message.ops)) + return "ops: array expected"; + for (var i = 0; i < message.ops.length; ++i) { + var error = $root.tendermint.crypto.ProofOp.verify(message.ops[i]); + if (error) + return "ops." + error; + } + } + return null; + }; + + /** + * Creates a ProofOps message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.crypto.ProofOps + * @static + * @param {Object.} object Plain object + * @returns {tendermint.crypto.ProofOps} ProofOps + */ + ProofOps.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.crypto.ProofOps) + return object; + var message = new $root.tendermint.crypto.ProofOps(); + if (object.ops) { + if (!Array.isArray(object.ops)) + throw TypeError(".tendermint.crypto.ProofOps.ops: array expected"); + message.ops = []; + for (var i = 0; i < object.ops.length; ++i) { + if (typeof object.ops[i] !== "object") + throw TypeError(".tendermint.crypto.ProofOps.ops: object expected"); + message.ops[i] = $root.tendermint.crypto.ProofOp.fromObject(object.ops[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ProofOps message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.crypto.ProofOps + * @static + * @param {tendermint.crypto.ProofOps} message ProofOps + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProofOps.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ops = []; + if (message.ops && message.ops.length) { + object.ops = []; + for (var j = 0; j < message.ops.length; ++j) + object.ops[j] = $root.tendermint.crypto.ProofOp.toObject(message.ops[j], options); + } + return object; + }; + + /** + * Converts this ProofOps to JSON. + * @function toJSON + * @memberof tendermint.crypto.ProofOps + * @instance + * @returns {Object.} JSON object + */ + ProofOps.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ProofOps; + })(crypto.ProofOps || {}); + + return crypto; + })(tendermint.crypto || {}); + + /** + * Namespace p2p. + * @memberof tendermint + * @namespace + */ + + tendermint.p2p = (function(p2p) { + + p2p.NetAddress = (function(NetAddress) { + + /** + * Properties of a NetAddress. + * @memberof tendermint.p2p + * @interface INetAddress + * @property {string|null} [id] NetAddress id + * @property {string|null} [ip] NetAddress ip + * @property {number|null} [port] NetAddress port + */ + + /** + * Constructs a new NetAddress. + * @memberof tendermint.p2p + * @classdesc Represents a NetAddress. + * @implements INetAddress + * @constructor + * @param {tendermint.p2p.INetAddress=} [properties] Properties to set + */ + function NetAddress(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetAddress id. + * @member {string} id + * @memberof tendermint.p2p.NetAddress + * @instance + */ + NetAddress.prototype.id = ""; + + /** + * NetAddress ip. + * @member {string} ip + * @memberof tendermint.p2p.NetAddress + * @instance + */ + NetAddress.prototype.ip = ""; + + /** + * NetAddress port. + * @member {number} port + * @memberof tendermint.p2p.NetAddress + * @instance + */ + NetAddress.prototype.port = 0; + + /** + * Creates a new NetAddress instance using the specified properties. + * @function create + * @memberof tendermint.p2p.NetAddress + * @static + * @param {tendermint.p2p.INetAddress=} [properties] Properties to set + * @returns {tendermint.p2p.NetAddress} NetAddress instance + */ + NetAddress.create = function create(properties) { + return new NetAddress(properties); + }; + + /** + * Encodes the specified NetAddress message. Does not implicitly {@link tendermint.p2p.NetAddress.verify|verify} messages. + * @function encode + * @memberof tendermint.p2p.NetAddress + * @static + * @param {tendermint.p2p.INetAddress} message NetAddress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetAddress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.ip != null && Object.hasOwnProperty.call(message, "ip")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ip); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.port); + return writer; + }; + + /** + * Encodes the specified NetAddress message, length delimited. Does not implicitly {@link tendermint.p2p.NetAddress.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.p2p.NetAddress + * @static + * @param {tendermint.p2p.INetAddress} message NetAddress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetAddress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetAddress message from the specified reader or buffer. + * @function decode + * @memberof tendermint.p2p.NetAddress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.p2p.NetAddress} NetAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetAddress.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.p2p.NetAddress(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.ip = reader.string(); + break; + case 3: + message.port = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetAddress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.p2p.NetAddress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.p2p.NetAddress} NetAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetAddress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetAddress message. + * @function verify + * @memberof tendermint.p2p.NetAddress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetAddress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.ip != null && message.hasOwnProperty("ip")) + if (!$util.isString(message.ip)) + return "ip: string expected"; + if (message.port != null && message.hasOwnProperty("port")) + if (!$util.isInteger(message.port)) + return "port: integer expected"; + return null; + }; + + /** + * Creates a NetAddress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.p2p.NetAddress + * @static + * @param {Object.} object Plain object + * @returns {tendermint.p2p.NetAddress} NetAddress + */ + NetAddress.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.p2p.NetAddress) + return object; + var message = new $root.tendermint.p2p.NetAddress(); + if (object.id != null) + message.id = String(object.id); + if (object.ip != null) + message.ip = String(object.ip); + if (object.port != null) + message.port = object.port >>> 0; + return message; + }; + + /** + * Creates a plain object from a NetAddress message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.p2p.NetAddress + * @static + * @param {tendermint.p2p.NetAddress} message NetAddress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetAddress.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.ip = ""; + object.port = 0; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.ip != null && message.hasOwnProperty("ip")) + object.ip = message.ip; + if (message.port != null && message.hasOwnProperty("port")) + object.port = message.port; + return object; + }; + + /** + * Converts this NetAddress to JSON. + * @function toJSON + * @memberof tendermint.p2p.NetAddress + * @instance + * @returns {Object.} JSON object + */ + NetAddress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NetAddress; + })(p2p.NetAddress || {}); + + p2p.ProtocolVersion = (function(ProtocolVersion) { + + /** + * Properties of a ProtocolVersion. + * @memberof tendermint.p2p + * @interface IProtocolVersion + * @property {number|Long|null} [p2p] ProtocolVersion p2p + * @property {number|Long|null} [block] ProtocolVersion block + * @property {number|Long|null} [app] ProtocolVersion app + */ + + /** + * Constructs a new ProtocolVersion. + * @memberof tendermint.p2p + * @classdesc Represents a ProtocolVersion. + * @implements IProtocolVersion + * @constructor + * @param {tendermint.p2p.IProtocolVersion=} [properties] Properties to set + */ + function ProtocolVersion(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProtocolVersion p2p. + * @member {number|Long} p2p + * @memberof tendermint.p2p.ProtocolVersion + * @instance + */ + ProtocolVersion.prototype.p2p = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ProtocolVersion block. + * @member {number|Long} block + * @memberof tendermint.p2p.ProtocolVersion + * @instance + */ + ProtocolVersion.prototype.block = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ProtocolVersion app. + * @member {number|Long} app + * @memberof tendermint.p2p.ProtocolVersion + * @instance + */ + ProtocolVersion.prototype.app = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new ProtocolVersion instance using the specified properties. + * @function create + * @memberof tendermint.p2p.ProtocolVersion + * @static + * @param {tendermint.p2p.IProtocolVersion=} [properties] Properties to set + * @returns {tendermint.p2p.ProtocolVersion} ProtocolVersion instance + */ + ProtocolVersion.create = function create(properties) { + return new ProtocolVersion(properties); + }; + + /** + * Encodes the specified ProtocolVersion message. Does not implicitly {@link tendermint.p2p.ProtocolVersion.verify|verify} messages. + * @function encode + * @memberof tendermint.p2p.ProtocolVersion + * @static + * @param {tendermint.p2p.IProtocolVersion} message ProtocolVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtocolVersion.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.p2p != null && Object.hasOwnProperty.call(message, "p2p")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.p2p); + if (message.block != null && Object.hasOwnProperty.call(message, "block")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.block); + if (message.app != null && Object.hasOwnProperty.call(message, "app")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.app); + return writer; + }; + + /** + * Encodes the specified ProtocolVersion message, length delimited. Does not implicitly {@link tendermint.p2p.ProtocolVersion.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.p2p.ProtocolVersion + * @static + * @param {tendermint.p2p.IProtocolVersion} message ProtocolVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtocolVersion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProtocolVersion message from the specified reader or buffer. + * @function decode + * @memberof tendermint.p2p.ProtocolVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.p2p.ProtocolVersion} ProtocolVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtocolVersion.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.p2p.ProtocolVersion(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.p2p = reader.uint64(); + break; + case 2: + message.block = reader.uint64(); + break; + case 3: + message.app = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProtocolVersion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.p2p.ProtocolVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.p2p.ProtocolVersion} ProtocolVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtocolVersion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProtocolVersion message. + * @function verify + * @memberof tendermint.p2p.ProtocolVersion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProtocolVersion.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.p2p != null && message.hasOwnProperty("p2p")) + if (!$util.isInteger(message.p2p) && !(message.p2p && $util.isInteger(message.p2p.low) && $util.isInteger(message.p2p.high))) + return "p2p: integer|Long expected"; + if (message.block != null && message.hasOwnProperty("block")) + if (!$util.isInteger(message.block) && !(message.block && $util.isInteger(message.block.low) && $util.isInteger(message.block.high))) + return "block: integer|Long expected"; + if (message.app != null && message.hasOwnProperty("app")) + if (!$util.isInteger(message.app) && !(message.app && $util.isInteger(message.app.low) && $util.isInteger(message.app.high))) + return "app: integer|Long expected"; + return null; + }; + + /** + * Creates a ProtocolVersion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.p2p.ProtocolVersion + * @static + * @param {Object.} object Plain object + * @returns {tendermint.p2p.ProtocolVersion} ProtocolVersion + */ + ProtocolVersion.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.p2p.ProtocolVersion) + return object; + var message = new $root.tendermint.p2p.ProtocolVersion(); + if (object.p2p != null) + if ($util.Long) + (message.p2p = $util.Long.fromValue(object.p2p)).unsigned = true; + else if (typeof object.p2p === "string") + message.p2p = parseInt(object.p2p, 10); + else if (typeof object.p2p === "number") + message.p2p = object.p2p; + else if (typeof object.p2p === "object") + message.p2p = new $util.LongBits(object.p2p.low >>> 0, object.p2p.high >>> 0).toNumber(true); + if (object.block != null) + if ($util.Long) + (message.block = $util.Long.fromValue(object.block)).unsigned = true; + else if (typeof object.block === "string") + message.block = parseInt(object.block, 10); + else if (typeof object.block === "number") + message.block = object.block; + else if (typeof object.block === "object") + message.block = new $util.LongBits(object.block.low >>> 0, object.block.high >>> 0).toNumber(true); + if (object.app != null) + if ($util.Long) + (message.app = $util.Long.fromValue(object.app)).unsigned = true; + else if (typeof object.app === "string") + message.app = parseInt(object.app, 10); + else if (typeof object.app === "number") + message.app = object.app; + else if (typeof object.app === "object") + message.app = new $util.LongBits(object.app.low >>> 0, object.app.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a ProtocolVersion message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.p2p.ProtocolVersion + * @static + * @param {tendermint.p2p.ProtocolVersion} message ProtocolVersion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProtocolVersion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.p2p = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.p2p = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.block = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.block = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.app = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.app = options.longs === String ? "0" : 0; + } + if (message.p2p != null && message.hasOwnProperty("p2p")) + if (typeof message.p2p === "number") + object.p2p = options.longs === String ? String(message.p2p) : message.p2p; + else + object.p2p = options.longs === String ? $util.Long.prototype.toString.call(message.p2p) : options.longs === Number ? new $util.LongBits(message.p2p.low >>> 0, message.p2p.high >>> 0).toNumber(true) : message.p2p; + if (message.block != null && message.hasOwnProperty("block")) + if (typeof message.block === "number") + object.block = options.longs === String ? String(message.block) : message.block; + else + object.block = options.longs === String ? $util.Long.prototype.toString.call(message.block) : options.longs === Number ? new $util.LongBits(message.block.low >>> 0, message.block.high >>> 0).toNumber(true) : message.block; + if (message.app != null && message.hasOwnProperty("app")) + if (typeof message.app === "number") + object.app = options.longs === String ? String(message.app) : message.app; + else + object.app = options.longs === String ? $util.Long.prototype.toString.call(message.app) : options.longs === Number ? new $util.LongBits(message.app.low >>> 0, message.app.high >>> 0).toNumber(true) : message.app; + return object; + }; + + /** + * Converts this ProtocolVersion to JSON. + * @function toJSON + * @memberof tendermint.p2p.ProtocolVersion + * @instance + * @returns {Object.} JSON object + */ + ProtocolVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ProtocolVersion; + })(p2p.ProtocolVersion || {}); + + p2p.DefaultNodeInfo = (function(DefaultNodeInfo) { + + /** + * Properties of a DefaultNodeInfo. + * @memberof tendermint.p2p + * @interface IDefaultNodeInfo + * @property {tendermint.p2p.IProtocolVersion|null} [protocolVersion] DefaultNodeInfo protocolVersion + * @property {string|null} [defaultNodeId] DefaultNodeInfo defaultNodeId + * @property {string|null} [listenAddr] DefaultNodeInfo listenAddr + * @property {string|null} [network] DefaultNodeInfo network + * @property {string|null} [version] DefaultNodeInfo version + * @property {Uint8Array|null} [channels] DefaultNodeInfo channels + * @property {string|null} [moniker] DefaultNodeInfo moniker + * @property {tendermint.p2p.IDefaultNodeInfoOther|null} [other] DefaultNodeInfo other + */ + + /** + * Constructs a new DefaultNodeInfo. + * @memberof tendermint.p2p + * @classdesc Represents a DefaultNodeInfo. + * @implements IDefaultNodeInfo + * @constructor + * @param {tendermint.p2p.IDefaultNodeInfo=} [properties] Properties to set + */ + function DefaultNodeInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DefaultNodeInfo protocolVersion. + * @member {tendermint.p2p.IProtocolVersion|null|undefined} protocolVersion + * @memberof tendermint.p2p.DefaultNodeInfo + * @instance + */ + DefaultNodeInfo.prototype.protocolVersion = null; + + /** + * DefaultNodeInfo defaultNodeId. + * @member {string} defaultNodeId + * @memberof tendermint.p2p.DefaultNodeInfo + * @instance + */ + DefaultNodeInfo.prototype.defaultNodeId = ""; + + /** + * DefaultNodeInfo listenAddr. + * @member {string} listenAddr + * @memberof tendermint.p2p.DefaultNodeInfo + * @instance + */ + DefaultNodeInfo.prototype.listenAddr = ""; + + /** + * DefaultNodeInfo network. + * @member {string} network + * @memberof tendermint.p2p.DefaultNodeInfo + * @instance + */ + DefaultNodeInfo.prototype.network = ""; + + /** + * DefaultNodeInfo version. + * @member {string} version + * @memberof tendermint.p2p.DefaultNodeInfo + * @instance + */ + DefaultNodeInfo.prototype.version = ""; + + /** + * DefaultNodeInfo channels. + * @member {Uint8Array} channels + * @memberof tendermint.p2p.DefaultNodeInfo + * @instance + */ + DefaultNodeInfo.prototype.channels = $util.newBuffer([]); + + /** + * DefaultNodeInfo moniker. + * @member {string} moniker + * @memberof tendermint.p2p.DefaultNodeInfo + * @instance + */ + DefaultNodeInfo.prototype.moniker = ""; + + /** + * DefaultNodeInfo other. + * @member {tendermint.p2p.IDefaultNodeInfoOther|null|undefined} other + * @memberof tendermint.p2p.DefaultNodeInfo + * @instance + */ + DefaultNodeInfo.prototype.other = null; + + /** + * Creates a new DefaultNodeInfo instance using the specified properties. + * @function create + * @memberof tendermint.p2p.DefaultNodeInfo + * @static + * @param {tendermint.p2p.IDefaultNodeInfo=} [properties] Properties to set + * @returns {tendermint.p2p.DefaultNodeInfo} DefaultNodeInfo instance + */ + DefaultNodeInfo.create = function create(properties) { + return new DefaultNodeInfo(properties); + }; + + /** + * Encodes the specified DefaultNodeInfo message. Does not implicitly {@link tendermint.p2p.DefaultNodeInfo.verify|verify} messages. + * @function encode + * @memberof tendermint.p2p.DefaultNodeInfo + * @static + * @param {tendermint.p2p.IDefaultNodeInfo} message DefaultNodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DefaultNodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.protocolVersion != null && Object.hasOwnProperty.call(message, "protocolVersion")) + $root.tendermint.p2p.ProtocolVersion.encode(message.protocolVersion, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.defaultNodeId != null && Object.hasOwnProperty.call(message, "defaultNodeId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.defaultNodeId); + if (message.listenAddr != null && Object.hasOwnProperty.call(message, "listenAddr")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.listenAddr); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.network); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.version); + if (message.channels != null && Object.hasOwnProperty.call(message, "channels")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.channels); + if (message.moniker != null && Object.hasOwnProperty.call(message, "moniker")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.moniker); + if (message.other != null && Object.hasOwnProperty.call(message, "other")) + $root.tendermint.p2p.DefaultNodeInfoOther.encode(message.other, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DefaultNodeInfo message, length delimited. Does not implicitly {@link tendermint.p2p.DefaultNodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.p2p.DefaultNodeInfo + * @static + * @param {tendermint.p2p.IDefaultNodeInfo} message DefaultNodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DefaultNodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DefaultNodeInfo message from the specified reader or buffer. + * @function decode + * @memberof tendermint.p2p.DefaultNodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.p2p.DefaultNodeInfo} DefaultNodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DefaultNodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.p2p.DefaultNodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.protocolVersion = $root.tendermint.p2p.ProtocolVersion.decode(reader, reader.uint32()); + break; + case 2: + message.defaultNodeId = reader.string(); + break; + case 3: + message.listenAddr = reader.string(); + break; + case 4: + message.network = reader.string(); + break; + case 5: + message.version = reader.string(); + break; + case 6: + message.channels = reader.bytes(); + break; + case 7: + message.moniker = reader.string(); + break; + case 8: + message.other = $root.tendermint.p2p.DefaultNodeInfoOther.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DefaultNodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.p2p.DefaultNodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.p2p.DefaultNodeInfo} DefaultNodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DefaultNodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DefaultNodeInfo message. + * @function verify + * @memberof tendermint.p2p.DefaultNodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DefaultNodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) { + var error = $root.tendermint.p2p.ProtocolVersion.verify(message.protocolVersion); + if (error) + return "protocolVersion." + error; + } + if (message.defaultNodeId != null && message.hasOwnProperty("defaultNodeId")) + if (!$util.isString(message.defaultNodeId)) + return "defaultNodeId: string expected"; + if (message.listenAddr != null && message.hasOwnProperty("listenAddr")) + if (!$util.isString(message.listenAddr)) + return "listenAddr: string expected"; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.channels != null && message.hasOwnProperty("channels")) + if (!(message.channels && typeof message.channels.length === "number" || $util.isString(message.channels))) + return "channels: buffer expected"; + if (message.moniker != null && message.hasOwnProperty("moniker")) + if (!$util.isString(message.moniker)) + return "moniker: string expected"; + if (message.other != null && message.hasOwnProperty("other")) { + var error = $root.tendermint.p2p.DefaultNodeInfoOther.verify(message.other); + if (error) + return "other." + error; + } + return null; + }; + + /** + * Creates a DefaultNodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.p2p.DefaultNodeInfo + * @static + * @param {Object.} object Plain object + * @returns {tendermint.p2p.DefaultNodeInfo} DefaultNodeInfo + */ + DefaultNodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.p2p.DefaultNodeInfo) + return object; + var message = new $root.tendermint.p2p.DefaultNodeInfo(); + if (object.protocolVersion != null) { + if (typeof object.protocolVersion !== "object") + throw TypeError(".tendermint.p2p.DefaultNodeInfo.protocolVersion: object expected"); + message.protocolVersion = $root.tendermint.p2p.ProtocolVersion.fromObject(object.protocolVersion); + } + if (object.defaultNodeId != null) + message.defaultNodeId = String(object.defaultNodeId); + if (object.listenAddr != null) + message.listenAddr = String(object.listenAddr); + if (object.network != null) + message.network = String(object.network); + if (object.version != null) + message.version = String(object.version); + if (object.channels != null) + if (typeof object.channels === "string") + $util.base64.decode(object.channels, message.channels = $util.newBuffer($util.base64.length(object.channels)), 0); + else if (object.channels.length) + message.channels = object.channels; + if (object.moniker != null) + message.moniker = String(object.moniker); + if (object.other != null) { + if (typeof object.other !== "object") + throw TypeError(".tendermint.p2p.DefaultNodeInfo.other: object expected"); + message.other = $root.tendermint.p2p.DefaultNodeInfoOther.fromObject(object.other); + } + return message; + }; + + /** + * Creates a plain object from a DefaultNodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.p2p.DefaultNodeInfo + * @static + * @param {tendermint.p2p.DefaultNodeInfo} message DefaultNodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DefaultNodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.protocolVersion = null; + object.defaultNodeId = ""; + object.listenAddr = ""; + object.network = ""; + object.version = ""; + if (options.bytes === String) + object.channels = ""; + else { + object.channels = []; + if (options.bytes !== Array) + object.channels = $util.newBuffer(object.channels); + } + object.moniker = ""; + object.other = null; + } + if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) + object.protocolVersion = $root.tendermint.p2p.ProtocolVersion.toObject(message.protocolVersion, options); + if (message.defaultNodeId != null && message.hasOwnProperty("defaultNodeId")) + object.defaultNodeId = message.defaultNodeId; + if (message.listenAddr != null && message.hasOwnProperty("listenAddr")) + object.listenAddr = message.listenAddr; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.channels != null && message.hasOwnProperty("channels")) + object.channels = options.bytes === String ? $util.base64.encode(message.channels, 0, message.channels.length) : options.bytes === Array ? Array.prototype.slice.call(message.channels) : message.channels; + if (message.moniker != null && message.hasOwnProperty("moniker")) + object.moniker = message.moniker; + if (message.other != null && message.hasOwnProperty("other")) + object.other = $root.tendermint.p2p.DefaultNodeInfoOther.toObject(message.other, options); + return object; + }; + + /** + * Converts this DefaultNodeInfo to JSON. + * @function toJSON + * @memberof tendermint.p2p.DefaultNodeInfo + * @instance + * @returns {Object.} JSON object + */ + DefaultNodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DefaultNodeInfo; + })(p2p.DefaultNodeInfo || {}); + + p2p.DefaultNodeInfoOther = (function(DefaultNodeInfoOther) { + + /** + * Properties of a DefaultNodeInfoOther. + * @memberof tendermint.p2p + * @interface IDefaultNodeInfoOther + * @property {string|null} [txIndex] DefaultNodeInfoOther txIndex + * @property {string|null} [rpcAddress] DefaultNodeInfoOther rpcAddress + */ + + /** + * Constructs a new DefaultNodeInfoOther. + * @memberof tendermint.p2p + * @classdesc Represents a DefaultNodeInfoOther. + * @implements IDefaultNodeInfoOther + * @constructor + * @param {tendermint.p2p.IDefaultNodeInfoOther=} [properties] Properties to set + */ + function DefaultNodeInfoOther(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DefaultNodeInfoOther txIndex. + * @member {string} txIndex + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @instance + */ + DefaultNodeInfoOther.prototype.txIndex = ""; + + /** + * DefaultNodeInfoOther rpcAddress. + * @member {string} rpcAddress + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @instance + */ + DefaultNodeInfoOther.prototype.rpcAddress = ""; + + /** + * Creates a new DefaultNodeInfoOther instance using the specified properties. + * @function create + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @static + * @param {tendermint.p2p.IDefaultNodeInfoOther=} [properties] Properties to set + * @returns {tendermint.p2p.DefaultNodeInfoOther} DefaultNodeInfoOther instance + */ + DefaultNodeInfoOther.create = function create(properties) { + return new DefaultNodeInfoOther(properties); + }; + + /** + * Encodes the specified DefaultNodeInfoOther message. Does not implicitly {@link tendermint.p2p.DefaultNodeInfoOther.verify|verify} messages. + * @function encode + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @static + * @param {tendermint.p2p.IDefaultNodeInfoOther} message DefaultNodeInfoOther message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DefaultNodeInfoOther.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.txIndex != null && Object.hasOwnProperty.call(message, "txIndex")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.txIndex); + if (message.rpcAddress != null && Object.hasOwnProperty.call(message, "rpcAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.rpcAddress); + return writer; + }; + + /** + * Encodes the specified DefaultNodeInfoOther message, length delimited. Does not implicitly {@link tendermint.p2p.DefaultNodeInfoOther.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @static + * @param {tendermint.p2p.IDefaultNodeInfoOther} message DefaultNodeInfoOther message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DefaultNodeInfoOther.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DefaultNodeInfoOther message from the specified reader or buffer. + * @function decode + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.p2p.DefaultNodeInfoOther} DefaultNodeInfoOther + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DefaultNodeInfoOther.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.p2p.DefaultNodeInfoOther(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txIndex = reader.string(); + break; + case 2: + message.rpcAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DefaultNodeInfoOther message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.p2p.DefaultNodeInfoOther} DefaultNodeInfoOther + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DefaultNodeInfoOther.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DefaultNodeInfoOther message. + * @function verify + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DefaultNodeInfoOther.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.txIndex != null && message.hasOwnProperty("txIndex")) + if (!$util.isString(message.txIndex)) + return "txIndex: string expected"; + if (message.rpcAddress != null && message.hasOwnProperty("rpcAddress")) + if (!$util.isString(message.rpcAddress)) + return "rpcAddress: string expected"; + return null; + }; + + /** + * Creates a DefaultNodeInfoOther message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @static + * @param {Object.} object Plain object + * @returns {tendermint.p2p.DefaultNodeInfoOther} DefaultNodeInfoOther + */ + DefaultNodeInfoOther.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.p2p.DefaultNodeInfoOther) + return object; + var message = new $root.tendermint.p2p.DefaultNodeInfoOther(); + if (object.txIndex != null) + message.txIndex = String(object.txIndex); + if (object.rpcAddress != null) + message.rpcAddress = String(object.rpcAddress); + return message; + }; + + /** + * Creates a plain object from a DefaultNodeInfoOther message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @static + * @param {tendermint.p2p.DefaultNodeInfoOther} message DefaultNodeInfoOther + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DefaultNodeInfoOther.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.txIndex = ""; + object.rpcAddress = ""; + } + if (message.txIndex != null && message.hasOwnProperty("txIndex")) + object.txIndex = message.txIndex; + if (message.rpcAddress != null && message.hasOwnProperty("rpcAddress")) + object.rpcAddress = message.rpcAddress; + return object; + }; + + /** + * Converts this DefaultNodeInfoOther to JSON. + * @function toJSON + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @instance + * @returns {Object.} JSON object + */ + DefaultNodeInfoOther.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DefaultNodeInfoOther; + })(p2p.DefaultNodeInfoOther || {}); + + return p2p; + })(tendermint.p2p || {}); + + /** + * Namespace types. + * @memberof tendermint + * @namespace + */ + + tendermint.types = (function(types) { + + types.Block = (function(Block) { + + /** + * Properties of a Block. + * @memberof tendermint.types + * @interface IBlock + * @property {tendermint.types.IHeader|null} [header] Block header + * @property {tendermint.types.IData|null} [data] Block data + * @property {tendermint.types.IEvidenceList|null} [evidence] Block evidence + * @property {tendermint.types.ICommit|null} [lastCommit] Block lastCommit + */ + + /** + * Constructs a new Block. + * @memberof tendermint.types + * @classdesc Represents a Block. + * @implements IBlock + * @constructor + * @param {tendermint.types.IBlock=} [properties] Properties to set + */ + function Block(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Block header. + * @member {tendermint.types.IHeader|null|undefined} header + * @memberof tendermint.types.Block + * @instance + */ + Block.prototype.header = null; + + /** + * Block data. + * @member {tendermint.types.IData|null|undefined} data + * @memberof tendermint.types.Block + * @instance + */ + Block.prototype.data = null; + + /** + * Block evidence. + * @member {tendermint.types.IEvidenceList|null|undefined} evidence + * @memberof tendermint.types.Block + * @instance + */ + Block.prototype.evidence = null; + + /** + * Block lastCommit. + * @member {tendermint.types.ICommit|null|undefined} lastCommit + * @memberof tendermint.types.Block + * @instance + */ + Block.prototype.lastCommit = null; + + /** + * Creates a new Block instance using the specified properties. + * @function create + * @memberof tendermint.types.Block + * @static + * @param {tendermint.types.IBlock=} [properties] Properties to set + * @returns {tendermint.types.Block} Block instance + */ + Block.create = function create(properties) { + return new Block(properties); + }; + + /** + * Encodes the specified Block message. Does not implicitly {@link tendermint.types.Block.verify|verify} messages. + * @function encode + * @memberof tendermint.types.Block + * @static + * @param {tendermint.types.IBlock} message Block message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Block.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + $root.tendermint.types.Header.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + $root.tendermint.types.Data.encode(message.data, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.evidence != null && Object.hasOwnProperty.call(message, "evidence")) + $root.tendermint.types.EvidenceList.encode(message.evidence, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.lastCommit != null && Object.hasOwnProperty.call(message, "lastCommit")) + $root.tendermint.types.Commit.encode(message.lastCommit, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Block message, length delimited. Does not implicitly {@link tendermint.types.Block.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.Block + * @static + * @param {tendermint.types.IBlock} message Block message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Block.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Block message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.Block + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.Block} Block + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Block.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Block(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.header = $root.tendermint.types.Header.decode(reader, reader.uint32()); + break; + case 2: + message.data = $root.tendermint.types.Data.decode(reader, reader.uint32()); + break; + case 3: + message.evidence = $root.tendermint.types.EvidenceList.decode(reader, reader.uint32()); + break; + case 4: + message.lastCommit = $root.tendermint.types.Commit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Block message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.Block + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.Block} Block + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Block.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Block message. + * @function verify + * @memberof tendermint.types.Block + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Block.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.header != null && message.hasOwnProperty("header")) { + var error = $root.tendermint.types.Header.verify(message.header); + if (error) + return "header." + error; + } + if (message.data != null && message.hasOwnProperty("data")) { + var error = $root.tendermint.types.Data.verify(message.data); + if (error) + return "data." + error; + } + if (message.evidence != null && message.hasOwnProperty("evidence")) { + var error = $root.tendermint.types.EvidenceList.verify(message.evidence); + if (error) + return "evidence." + error; + } + if (message.lastCommit != null && message.hasOwnProperty("lastCommit")) { + var error = $root.tendermint.types.Commit.verify(message.lastCommit); + if (error) + return "lastCommit." + error; + } + return null; + }; + + /** + * Creates a Block message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.Block + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.Block} Block + */ + Block.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.Block) + return object; + var message = new $root.tendermint.types.Block(); + if (object.header != null) { + if (typeof object.header !== "object") + throw TypeError(".tendermint.types.Block.header: object expected"); + message.header = $root.tendermint.types.Header.fromObject(object.header); + } + if (object.data != null) { + if (typeof object.data !== "object") + throw TypeError(".tendermint.types.Block.data: object expected"); + message.data = $root.tendermint.types.Data.fromObject(object.data); + } + if (object.evidence != null) { + if (typeof object.evidence !== "object") + throw TypeError(".tendermint.types.Block.evidence: object expected"); + message.evidence = $root.tendermint.types.EvidenceList.fromObject(object.evidence); + } + if (object.lastCommit != null) { + if (typeof object.lastCommit !== "object") + throw TypeError(".tendermint.types.Block.lastCommit: object expected"); + message.lastCommit = $root.tendermint.types.Commit.fromObject(object.lastCommit); + } + return message; + }; + + /** + * Creates a plain object from a Block message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.Block + * @static + * @param {tendermint.types.Block} message Block + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Block.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.header = null; + object.data = null; + object.evidence = null; + object.lastCommit = null; + } + if (message.header != null && message.hasOwnProperty("header")) + object.header = $root.tendermint.types.Header.toObject(message.header, options); + if (message.data != null && message.hasOwnProperty("data")) + object.data = $root.tendermint.types.Data.toObject(message.data, options); + if (message.evidence != null && message.hasOwnProperty("evidence")) + object.evidence = $root.tendermint.types.EvidenceList.toObject(message.evidence, options); + if (message.lastCommit != null && message.hasOwnProperty("lastCommit")) + object.lastCommit = $root.tendermint.types.Commit.toObject(message.lastCommit, options); + return object; + }; + + /** + * Converts this Block to JSON. + * @function toJSON + * @memberof tendermint.types.Block + * @instance + * @returns {Object.} JSON object + */ + Block.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Block; + })(types.Block || {}); + + types.Evidence = (function(Evidence) { + + /** + * Properties of an Evidence. + * @memberof tendermint.types + * @interface IEvidence + * @property {tendermint.types.IDuplicateVoteEvidence|null} [duplicateVoteEvidence] Evidence duplicateVoteEvidence + * @property {tendermint.types.ILightClientAttackEvidence|null} [lightClientAttackEvidence] Evidence lightClientAttackEvidence + */ + + /** + * Constructs a new Evidence. + * @memberof tendermint.types + * @classdesc Represents an Evidence. + * @implements IEvidence + * @constructor + * @param {tendermint.types.IEvidence=} [properties] Properties to set + */ + function Evidence(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Evidence duplicateVoteEvidence. + * @member {tendermint.types.IDuplicateVoteEvidence|null|undefined} duplicateVoteEvidence + * @memberof tendermint.types.Evidence + * @instance + */ + Evidence.prototype.duplicateVoteEvidence = null; + + /** + * Evidence lightClientAttackEvidence. + * @member {tendermint.types.ILightClientAttackEvidence|null|undefined} lightClientAttackEvidence + * @memberof tendermint.types.Evidence + * @instance + */ + Evidence.prototype.lightClientAttackEvidence = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Evidence sum. + * @member {"duplicateVoteEvidence"|"lightClientAttackEvidence"|undefined} sum + * @memberof tendermint.types.Evidence + * @instance + */ + Object.defineProperty(Evidence.prototype, "sum", { + get: $util.oneOfGetter($oneOfFields = ["duplicateVoteEvidence", "lightClientAttackEvidence"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Evidence instance using the specified properties. + * @function create + * @memberof tendermint.types.Evidence + * @static + * @param {tendermint.types.IEvidence=} [properties] Properties to set + * @returns {tendermint.types.Evidence} Evidence instance + */ + Evidence.create = function create(properties) { + return new Evidence(properties); + }; + + /** + * Encodes the specified Evidence message. Does not implicitly {@link tendermint.types.Evidence.verify|verify} messages. + * @function encode + * @memberof tendermint.types.Evidence + * @static + * @param {tendermint.types.IEvidence} message Evidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Evidence.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.duplicateVoteEvidence != null && Object.hasOwnProperty.call(message, "duplicateVoteEvidence")) + $root.tendermint.types.DuplicateVoteEvidence.encode(message.duplicateVoteEvidence, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.lightClientAttackEvidence != null && Object.hasOwnProperty.call(message, "lightClientAttackEvidence")) + $root.tendermint.types.LightClientAttackEvidence.encode(message.lightClientAttackEvidence, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Evidence message, length delimited. Does not implicitly {@link tendermint.types.Evidence.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.Evidence + * @static + * @param {tendermint.types.IEvidence} message Evidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Evidence.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Evidence message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.Evidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.Evidence} Evidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Evidence.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Evidence(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.duplicateVoteEvidence = $root.tendermint.types.DuplicateVoteEvidence.decode(reader, reader.uint32()); + break; + case 2: + message.lightClientAttackEvidence = $root.tendermint.types.LightClientAttackEvidence.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Evidence message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.Evidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.Evidence} Evidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Evidence.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Evidence message. + * @function verify + * @memberof tendermint.types.Evidence + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Evidence.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.duplicateVoteEvidence != null && message.hasOwnProperty("duplicateVoteEvidence")) { + properties.sum = 1; + { + var error = $root.tendermint.types.DuplicateVoteEvidence.verify(message.duplicateVoteEvidence); + if (error) + return "duplicateVoteEvidence." + error; + } + } + if (message.lightClientAttackEvidence != null && message.hasOwnProperty("lightClientAttackEvidence")) { + if (properties.sum === 1) + return "sum: multiple values"; + properties.sum = 1; + { + var error = $root.tendermint.types.LightClientAttackEvidence.verify(message.lightClientAttackEvidence); + if (error) + return "lightClientAttackEvidence." + error; + } + } + return null; + }; + + /** + * Creates an Evidence message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.Evidence + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.Evidence} Evidence + */ + Evidence.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.Evidence) + return object; + var message = new $root.tendermint.types.Evidence(); + if (object.duplicateVoteEvidence != null) { + if (typeof object.duplicateVoteEvidence !== "object") + throw TypeError(".tendermint.types.Evidence.duplicateVoteEvidence: object expected"); + message.duplicateVoteEvidence = $root.tendermint.types.DuplicateVoteEvidence.fromObject(object.duplicateVoteEvidence); + } + if (object.lightClientAttackEvidence != null) { + if (typeof object.lightClientAttackEvidence !== "object") + throw TypeError(".tendermint.types.Evidence.lightClientAttackEvidence: object expected"); + message.lightClientAttackEvidence = $root.tendermint.types.LightClientAttackEvidence.fromObject(object.lightClientAttackEvidence); + } + return message; + }; + + /** + * Creates a plain object from an Evidence message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.Evidence + * @static + * @param {tendermint.types.Evidence} message Evidence + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Evidence.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.duplicateVoteEvidence != null && message.hasOwnProperty("duplicateVoteEvidence")) { + object.duplicateVoteEvidence = $root.tendermint.types.DuplicateVoteEvidence.toObject(message.duplicateVoteEvidence, options); + if (options.oneofs) + object.sum = "duplicateVoteEvidence"; + } + if (message.lightClientAttackEvidence != null && message.hasOwnProperty("lightClientAttackEvidence")) { + object.lightClientAttackEvidence = $root.tendermint.types.LightClientAttackEvidence.toObject(message.lightClientAttackEvidence, options); + if (options.oneofs) + object.sum = "lightClientAttackEvidence"; + } + return object; + }; + + /** + * Converts this Evidence to JSON. + * @function toJSON + * @memberof tendermint.types.Evidence + * @instance + * @returns {Object.} JSON object + */ + Evidence.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Evidence; + })(types.Evidence || {}); + + types.DuplicateVoteEvidence = (function(DuplicateVoteEvidence) { + + /** + * Properties of a DuplicateVoteEvidence. + * @memberof tendermint.types + * @interface IDuplicateVoteEvidence + * @property {tendermint.types.IVote|null} [voteA] DuplicateVoteEvidence voteA + * @property {tendermint.types.IVote|null} [voteB] DuplicateVoteEvidence voteB + * @property {number|Long|null} [totalVotingPower] DuplicateVoteEvidence totalVotingPower + * @property {number|Long|null} [validatorPower] DuplicateVoteEvidence validatorPower + * @property {google.protobuf.ITimestamp|null} [timestamp] DuplicateVoteEvidence timestamp + */ + + /** + * Constructs a new DuplicateVoteEvidence. + * @memberof tendermint.types + * @classdesc Represents a DuplicateVoteEvidence. + * @implements IDuplicateVoteEvidence + * @constructor + * @param {tendermint.types.IDuplicateVoteEvidence=} [properties] Properties to set + */ + function DuplicateVoteEvidence(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DuplicateVoteEvidence voteA. + * @member {tendermint.types.IVote|null|undefined} voteA + * @memberof tendermint.types.DuplicateVoteEvidence + * @instance + */ + DuplicateVoteEvidence.prototype.voteA = null; + + /** + * DuplicateVoteEvidence voteB. + * @member {tendermint.types.IVote|null|undefined} voteB + * @memberof tendermint.types.DuplicateVoteEvidence + * @instance + */ + DuplicateVoteEvidence.prototype.voteB = null; + + /** + * DuplicateVoteEvidence totalVotingPower. + * @member {number|Long} totalVotingPower + * @memberof tendermint.types.DuplicateVoteEvidence + * @instance + */ + DuplicateVoteEvidence.prototype.totalVotingPower = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DuplicateVoteEvidence validatorPower. + * @member {number|Long} validatorPower + * @memberof tendermint.types.DuplicateVoteEvidence + * @instance + */ + DuplicateVoteEvidence.prototype.validatorPower = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DuplicateVoteEvidence timestamp. + * @member {google.protobuf.ITimestamp|null|undefined} timestamp + * @memberof tendermint.types.DuplicateVoteEvidence + * @instance + */ + DuplicateVoteEvidence.prototype.timestamp = null; + + /** + * Creates a new DuplicateVoteEvidence instance using the specified properties. + * @function create + * @memberof tendermint.types.DuplicateVoteEvidence + * @static + * @param {tendermint.types.IDuplicateVoteEvidence=} [properties] Properties to set + * @returns {tendermint.types.DuplicateVoteEvidence} DuplicateVoteEvidence instance + */ + DuplicateVoteEvidence.create = function create(properties) { + return new DuplicateVoteEvidence(properties); + }; + + /** + * Encodes the specified DuplicateVoteEvidence message. Does not implicitly {@link tendermint.types.DuplicateVoteEvidence.verify|verify} messages. + * @function encode + * @memberof tendermint.types.DuplicateVoteEvidence + * @static + * @param {tendermint.types.IDuplicateVoteEvidence} message DuplicateVoteEvidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DuplicateVoteEvidence.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.voteA != null && Object.hasOwnProperty.call(message, "voteA")) + $root.tendermint.types.Vote.encode(message.voteA, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.voteB != null && Object.hasOwnProperty.call(message, "voteB")) + $root.tendermint.types.Vote.encode(message.voteB, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.totalVotingPower != null && Object.hasOwnProperty.call(message, "totalVotingPower")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.totalVotingPower); + if (message.validatorPower != null && Object.hasOwnProperty.call(message, "validatorPower")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.validatorPower); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DuplicateVoteEvidence message, length delimited. Does not implicitly {@link tendermint.types.DuplicateVoteEvidence.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.DuplicateVoteEvidence + * @static + * @param {tendermint.types.IDuplicateVoteEvidence} message DuplicateVoteEvidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DuplicateVoteEvidence.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DuplicateVoteEvidence message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.DuplicateVoteEvidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.DuplicateVoteEvidence} DuplicateVoteEvidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DuplicateVoteEvidence.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.DuplicateVoteEvidence(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.voteA = $root.tendermint.types.Vote.decode(reader, reader.uint32()); + break; + case 2: + message.voteB = $root.tendermint.types.Vote.decode(reader, reader.uint32()); + break; + case 3: + message.totalVotingPower = reader.int64(); + break; + case 4: + message.validatorPower = reader.int64(); + break; + case 5: + message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DuplicateVoteEvidence message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.DuplicateVoteEvidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.DuplicateVoteEvidence} DuplicateVoteEvidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DuplicateVoteEvidence.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DuplicateVoteEvidence message. + * @function verify + * @memberof tendermint.types.DuplicateVoteEvidence + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DuplicateVoteEvidence.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.voteA != null && message.hasOwnProperty("voteA")) { + var error = $root.tendermint.types.Vote.verify(message.voteA); + if (error) + return "voteA." + error; + } + if (message.voteB != null && message.hasOwnProperty("voteB")) { + var error = $root.tendermint.types.Vote.verify(message.voteB); + if (error) + return "voteB." + error; + } + if (message.totalVotingPower != null && message.hasOwnProperty("totalVotingPower")) + if (!$util.isInteger(message.totalVotingPower) && !(message.totalVotingPower && $util.isInteger(message.totalVotingPower.low) && $util.isInteger(message.totalVotingPower.high))) + return "totalVotingPower: integer|Long expected"; + if (message.validatorPower != null && message.hasOwnProperty("validatorPower")) + if (!$util.isInteger(message.validatorPower) && !(message.validatorPower && $util.isInteger(message.validatorPower.low) && $util.isInteger(message.validatorPower.high))) + return "validatorPower: integer|Long expected"; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.timestamp); + if (error) + return "timestamp." + error; + } + return null; + }; + + /** + * Creates a DuplicateVoteEvidence message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.DuplicateVoteEvidence + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.DuplicateVoteEvidence} DuplicateVoteEvidence + */ + DuplicateVoteEvidence.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.DuplicateVoteEvidence) + return object; + var message = new $root.tendermint.types.DuplicateVoteEvidence(); + if (object.voteA != null) { + if (typeof object.voteA !== "object") + throw TypeError(".tendermint.types.DuplicateVoteEvidence.voteA: object expected"); + message.voteA = $root.tendermint.types.Vote.fromObject(object.voteA); + } + if (object.voteB != null) { + if (typeof object.voteB !== "object") + throw TypeError(".tendermint.types.DuplicateVoteEvidence.voteB: object expected"); + message.voteB = $root.tendermint.types.Vote.fromObject(object.voteB); + } + if (object.totalVotingPower != null) + if ($util.Long) + (message.totalVotingPower = $util.Long.fromValue(object.totalVotingPower)).unsigned = false; + else if (typeof object.totalVotingPower === "string") + message.totalVotingPower = parseInt(object.totalVotingPower, 10); + else if (typeof object.totalVotingPower === "number") + message.totalVotingPower = object.totalVotingPower; + else if (typeof object.totalVotingPower === "object") + message.totalVotingPower = new $util.LongBits(object.totalVotingPower.low >>> 0, object.totalVotingPower.high >>> 0).toNumber(); + if (object.validatorPower != null) + if ($util.Long) + (message.validatorPower = $util.Long.fromValue(object.validatorPower)).unsigned = false; + else if (typeof object.validatorPower === "string") + message.validatorPower = parseInt(object.validatorPower, 10); + else if (typeof object.validatorPower === "number") + message.validatorPower = object.validatorPower; + else if (typeof object.validatorPower === "object") + message.validatorPower = new $util.LongBits(object.validatorPower.low >>> 0, object.validatorPower.high >>> 0).toNumber(); + if (object.timestamp != null) { + if (typeof object.timestamp !== "object") + throw TypeError(".tendermint.types.DuplicateVoteEvidence.timestamp: object expected"); + message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); + } + return message; + }; + + /** + * Creates a plain object from a DuplicateVoteEvidence message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.DuplicateVoteEvidence + * @static + * @param {tendermint.types.DuplicateVoteEvidence} message DuplicateVoteEvidence + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DuplicateVoteEvidence.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.voteA = null; + object.voteB = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalVotingPower = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalVotingPower = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.validatorPower = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.validatorPower = options.longs === String ? "0" : 0; + object.timestamp = null; + } + if (message.voteA != null && message.hasOwnProperty("voteA")) + object.voteA = $root.tendermint.types.Vote.toObject(message.voteA, options); + if (message.voteB != null && message.hasOwnProperty("voteB")) + object.voteB = $root.tendermint.types.Vote.toObject(message.voteB, options); + if (message.totalVotingPower != null && message.hasOwnProperty("totalVotingPower")) + if (typeof message.totalVotingPower === "number") + object.totalVotingPower = options.longs === String ? String(message.totalVotingPower) : message.totalVotingPower; + else + object.totalVotingPower = options.longs === String ? $util.Long.prototype.toString.call(message.totalVotingPower) : options.longs === Number ? new $util.LongBits(message.totalVotingPower.low >>> 0, message.totalVotingPower.high >>> 0).toNumber() : message.totalVotingPower; + if (message.validatorPower != null && message.hasOwnProperty("validatorPower")) + if (typeof message.validatorPower === "number") + object.validatorPower = options.longs === String ? String(message.validatorPower) : message.validatorPower; + else + object.validatorPower = options.longs === String ? $util.Long.prototype.toString.call(message.validatorPower) : options.longs === Number ? new $util.LongBits(message.validatorPower.low >>> 0, message.validatorPower.high >>> 0).toNumber() : message.validatorPower; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); + return object; + }; + + /** + * Converts this DuplicateVoteEvidence to JSON. + * @function toJSON + * @memberof tendermint.types.DuplicateVoteEvidence + * @instance + * @returns {Object.} JSON object + */ + DuplicateVoteEvidence.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DuplicateVoteEvidence; + })(types.DuplicateVoteEvidence || {}); + + types.LightClientAttackEvidence = (function(LightClientAttackEvidence) { + + /** + * Properties of a LightClientAttackEvidence. + * @memberof tendermint.types + * @interface ILightClientAttackEvidence + * @property {tendermint.types.ILightBlock|null} [conflictingBlock] LightClientAttackEvidence conflictingBlock + * @property {number|Long|null} [commonHeight] LightClientAttackEvidence commonHeight + * @property {Array.|null} [byzantineValidators] LightClientAttackEvidence byzantineValidators + * @property {number|Long|null} [totalVotingPower] LightClientAttackEvidence totalVotingPower + * @property {google.protobuf.ITimestamp|null} [timestamp] LightClientAttackEvidence timestamp + */ + + /** + * Constructs a new LightClientAttackEvidence. + * @memberof tendermint.types + * @classdesc Represents a LightClientAttackEvidence. + * @implements ILightClientAttackEvidence + * @constructor + * @param {tendermint.types.ILightClientAttackEvidence=} [properties] Properties to set + */ + function LightClientAttackEvidence(properties) { + this.byzantineValidators = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LightClientAttackEvidence conflictingBlock. + * @member {tendermint.types.ILightBlock|null|undefined} conflictingBlock + * @memberof tendermint.types.LightClientAttackEvidence + * @instance + */ + LightClientAttackEvidence.prototype.conflictingBlock = null; + + /** + * LightClientAttackEvidence commonHeight. + * @member {number|Long} commonHeight + * @memberof tendermint.types.LightClientAttackEvidence + * @instance + */ + LightClientAttackEvidence.prototype.commonHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * LightClientAttackEvidence byzantineValidators. + * @member {Array.} byzantineValidators + * @memberof tendermint.types.LightClientAttackEvidence + * @instance + */ + LightClientAttackEvidence.prototype.byzantineValidators = $util.emptyArray; + + /** + * LightClientAttackEvidence totalVotingPower. + * @member {number|Long} totalVotingPower + * @memberof tendermint.types.LightClientAttackEvidence + * @instance + */ + LightClientAttackEvidence.prototype.totalVotingPower = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * LightClientAttackEvidence timestamp. + * @member {google.protobuf.ITimestamp|null|undefined} timestamp + * @memberof tendermint.types.LightClientAttackEvidence + * @instance + */ + LightClientAttackEvidence.prototype.timestamp = null; + + /** + * Creates a new LightClientAttackEvidence instance using the specified properties. + * @function create + * @memberof tendermint.types.LightClientAttackEvidence + * @static + * @param {tendermint.types.ILightClientAttackEvidence=} [properties] Properties to set + * @returns {tendermint.types.LightClientAttackEvidence} LightClientAttackEvidence instance + */ + LightClientAttackEvidence.create = function create(properties) { + return new LightClientAttackEvidence(properties); + }; + + /** + * Encodes the specified LightClientAttackEvidence message. Does not implicitly {@link tendermint.types.LightClientAttackEvidence.verify|verify} messages. + * @function encode + * @memberof tendermint.types.LightClientAttackEvidence + * @static + * @param {tendermint.types.ILightClientAttackEvidence} message LightClientAttackEvidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LightClientAttackEvidence.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conflictingBlock != null && Object.hasOwnProperty.call(message, "conflictingBlock")) + $root.tendermint.types.LightBlock.encode(message.conflictingBlock, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.commonHeight != null && Object.hasOwnProperty.call(message, "commonHeight")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.commonHeight); + if (message.byzantineValidators != null && message.byzantineValidators.length) + for (var i = 0; i < message.byzantineValidators.length; ++i) + $root.tendermint.types.Validator.encode(message.byzantineValidators[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalVotingPower != null && Object.hasOwnProperty.call(message, "totalVotingPower")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.totalVotingPower); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LightClientAttackEvidence message, length delimited. Does not implicitly {@link tendermint.types.LightClientAttackEvidence.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.LightClientAttackEvidence + * @static + * @param {tendermint.types.ILightClientAttackEvidence} message LightClientAttackEvidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LightClientAttackEvidence.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LightClientAttackEvidence message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.LightClientAttackEvidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.LightClientAttackEvidence} LightClientAttackEvidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LightClientAttackEvidence.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.LightClientAttackEvidence(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.conflictingBlock = $root.tendermint.types.LightBlock.decode(reader, reader.uint32()); + break; + case 2: + message.commonHeight = reader.int64(); + break; + case 3: + if (!(message.byzantineValidators && message.byzantineValidators.length)) + message.byzantineValidators = []; + message.byzantineValidators.push($root.tendermint.types.Validator.decode(reader, reader.uint32())); + break; + case 4: + message.totalVotingPower = reader.int64(); + break; + case 5: + message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LightClientAttackEvidence message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.LightClientAttackEvidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.LightClientAttackEvidence} LightClientAttackEvidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LightClientAttackEvidence.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LightClientAttackEvidence message. + * @function verify + * @memberof tendermint.types.LightClientAttackEvidence + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LightClientAttackEvidence.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conflictingBlock != null && message.hasOwnProperty("conflictingBlock")) { + var error = $root.tendermint.types.LightBlock.verify(message.conflictingBlock); + if (error) + return "conflictingBlock." + error; + } + if (message.commonHeight != null && message.hasOwnProperty("commonHeight")) + if (!$util.isInteger(message.commonHeight) && !(message.commonHeight && $util.isInteger(message.commonHeight.low) && $util.isInteger(message.commonHeight.high))) + return "commonHeight: integer|Long expected"; + if (message.byzantineValidators != null && message.hasOwnProperty("byzantineValidators")) { + if (!Array.isArray(message.byzantineValidators)) + return "byzantineValidators: array expected"; + for (var i = 0; i < message.byzantineValidators.length; ++i) { + var error = $root.tendermint.types.Validator.verify(message.byzantineValidators[i]); + if (error) + return "byzantineValidators." + error; + } + } + if (message.totalVotingPower != null && message.hasOwnProperty("totalVotingPower")) + if (!$util.isInteger(message.totalVotingPower) && !(message.totalVotingPower && $util.isInteger(message.totalVotingPower.low) && $util.isInteger(message.totalVotingPower.high))) + return "totalVotingPower: integer|Long expected"; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.timestamp); + if (error) + return "timestamp." + error; + } + return null; + }; + + /** + * Creates a LightClientAttackEvidence message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.LightClientAttackEvidence + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.LightClientAttackEvidence} LightClientAttackEvidence + */ + LightClientAttackEvidence.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.LightClientAttackEvidence) + return object; + var message = new $root.tendermint.types.LightClientAttackEvidence(); + if (object.conflictingBlock != null) { + if (typeof object.conflictingBlock !== "object") + throw TypeError(".tendermint.types.LightClientAttackEvidence.conflictingBlock: object expected"); + message.conflictingBlock = $root.tendermint.types.LightBlock.fromObject(object.conflictingBlock); + } + if (object.commonHeight != null) + if ($util.Long) + (message.commonHeight = $util.Long.fromValue(object.commonHeight)).unsigned = false; + else if (typeof object.commonHeight === "string") + message.commonHeight = parseInt(object.commonHeight, 10); + else if (typeof object.commonHeight === "number") + message.commonHeight = object.commonHeight; + else if (typeof object.commonHeight === "object") + message.commonHeight = new $util.LongBits(object.commonHeight.low >>> 0, object.commonHeight.high >>> 0).toNumber(); + if (object.byzantineValidators) { + if (!Array.isArray(object.byzantineValidators)) + throw TypeError(".tendermint.types.LightClientAttackEvidence.byzantineValidators: array expected"); + message.byzantineValidators = []; + for (var i = 0; i < object.byzantineValidators.length; ++i) { + if (typeof object.byzantineValidators[i] !== "object") + throw TypeError(".tendermint.types.LightClientAttackEvidence.byzantineValidators: object expected"); + message.byzantineValidators[i] = $root.tendermint.types.Validator.fromObject(object.byzantineValidators[i]); + } + } + if (object.totalVotingPower != null) + if ($util.Long) + (message.totalVotingPower = $util.Long.fromValue(object.totalVotingPower)).unsigned = false; + else if (typeof object.totalVotingPower === "string") + message.totalVotingPower = parseInt(object.totalVotingPower, 10); + else if (typeof object.totalVotingPower === "number") + message.totalVotingPower = object.totalVotingPower; + else if (typeof object.totalVotingPower === "object") + message.totalVotingPower = new $util.LongBits(object.totalVotingPower.low >>> 0, object.totalVotingPower.high >>> 0).toNumber(); + if (object.timestamp != null) { + if (typeof object.timestamp !== "object") + throw TypeError(".tendermint.types.LightClientAttackEvidence.timestamp: object expected"); + message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); + } + return message; + }; + + /** + * Creates a plain object from a LightClientAttackEvidence message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.LightClientAttackEvidence + * @static + * @param {tendermint.types.LightClientAttackEvidence} message LightClientAttackEvidence + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LightClientAttackEvidence.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.byzantineValidators = []; + if (options.defaults) { + object.conflictingBlock = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.commonHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.commonHeight = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalVotingPower = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalVotingPower = options.longs === String ? "0" : 0; + object.timestamp = null; + } + if (message.conflictingBlock != null && message.hasOwnProperty("conflictingBlock")) + object.conflictingBlock = $root.tendermint.types.LightBlock.toObject(message.conflictingBlock, options); + if (message.commonHeight != null && message.hasOwnProperty("commonHeight")) + if (typeof message.commonHeight === "number") + object.commonHeight = options.longs === String ? String(message.commonHeight) : message.commonHeight; + else + object.commonHeight = options.longs === String ? $util.Long.prototype.toString.call(message.commonHeight) : options.longs === Number ? new $util.LongBits(message.commonHeight.low >>> 0, message.commonHeight.high >>> 0).toNumber() : message.commonHeight; + if (message.byzantineValidators && message.byzantineValidators.length) { + object.byzantineValidators = []; + for (var j = 0; j < message.byzantineValidators.length; ++j) + object.byzantineValidators[j] = $root.tendermint.types.Validator.toObject(message.byzantineValidators[j], options); + } + if (message.totalVotingPower != null && message.hasOwnProperty("totalVotingPower")) + if (typeof message.totalVotingPower === "number") + object.totalVotingPower = options.longs === String ? String(message.totalVotingPower) : message.totalVotingPower; + else + object.totalVotingPower = options.longs === String ? $util.Long.prototype.toString.call(message.totalVotingPower) : options.longs === Number ? new $util.LongBits(message.totalVotingPower.low >>> 0, message.totalVotingPower.high >>> 0).toNumber() : message.totalVotingPower; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); + return object; + }; + + /** + * Converts this LightClientAttackEvidence to JSON. + * @function toJSON + * @memberof tendermint.types.LightClientAttackEvidence + * @instance + * @returns {Object.} JSON object + */ + LightClientAttackEvidence.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LightClientAttackEvidence; + })(types.LightClientAttackEvidence || {}); + + types.EvidenceList = (function(EvidenceList) { + + /** + * Properties of an EvidenceList. + * @memberof tendermint.types + * @interface IEvidenceList + * @property {Array.|null} [evidence] EvidenceList evidence + */ + + /** + * Constructs a new EvidenceList. + * @memberof tendermint.types + * @classdesc Represents an EvidenceList. + * @implements IEvidenceList + * @constructor + * @param {tendermint.types.IEvidenceList=} [properties] Properties to set + */ + function EvidenceList(properties) { + this.evidence = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvidenceList evidence. + * @member {Array.} evidence + * @memberof tendermint.types.EvidenceList + * @instance + */ + EvidenceList.prototype.evidence = $util.emptyArray; + + /** + * Creates a new EvidenceList instance using the specified properties. + * @function create + * @memberof tendermint.types.EvidenceList + * @static + * @param {tendermint.types.IEvidenceList=} [properties] Properties to set + * @returns {tendermint.types.EvidenceList} EvidenceList instance + */ + EvidenceList.create = function create(properties) { + return new EvidenceList(properties); + }; + + /** + * Encodes the specified EvidenceList message. Does not implicitly {@link tendermint.types.EvidenceList.verify|verify} messages. + * @function encode + * @memberof tendermint.types.EvidenceList + * @static + * @param {tendermint.types.IEvidenceList} message EvidenceList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvidenceList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evidence != null && message.evidence.length) + for (var i = 0; i < message.evidence.length; ++i) + $root.tendermint.types.Evidence.encode(message.evidence[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EvidenceList message, length delimited. Does not implicitly {@link tendermint.types.EvidenceList.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.EvidenceList + * @static + * @param {tendermint.types.IEvidenceList} message EvidenceList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvidenceList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvidenceList message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.EvidenceList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.EvidenceList} EvidenceList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvidenceList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.EvidenceList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.evidence && message.evidence.length)) + message.evidence = []; + message.evidence.push($root.tendermint.types.Evidence.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvidenceList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.EvidenceList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.EvidenceList} EvidenceList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvidenceList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvidenceList message. + * @function verify + * @memberof tendermint.types.EvidenceList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvidenceList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evidence != null && message.hasOwnProperty("evidence")) { + if (!Array.isArray(message.evidence)) + return "evidence: array expected"; + for (var i = 0; i < message.evidence.length; ++i) { + var error = $root.tendermint.types.Evidence.verify(message.evidence[i]); + if (error) + return "evidence." + error; + } + } + return null; + }; + + /** + * Creates an EvidenceList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.EvidenceList + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.EvidenceList} EvidenceList + */ + EvidenceList.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.EvidenceList) + return object; + var message = new $root.tendermint.types.EvidenceList(); + if (object.evidence) { + if (!Array.isArray(object.evidence)) + throw TypeError(".tendermint.types.EvidenceList.evidence: array expected"); + message.evidence = []; + for (var i = 0; i < object.evidence.length; ++i) { + if (typeof object.evidence[i] !== "object") + throw TypeError(".tendermint.types.EvidenceList.evidence: object expected"); + message.evidence[i] = $root.tendermint.types.Evidence.fromObject(object.evidence[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EvidenceList message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.EvidenceList + * @static + * @param {tendermint.types.EvidenceList} message EvidenceList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvidenceList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.evidence = []; + if (message.evidence && message.evidence.length) { + object.evidence = []; + for (var j = 0; j < message.evidence.length; ++j) + object.evidence[j] = $root.tendermint.types.Evidence.toObject(message.evidence[j], options); + } + return object; + }; + + /** + * Converts this EvidenceList to JSON. + * @function toJSON + * @memberof tendermint.types.EvidenceList + * @instance + * @returns {Object.} JSON object + */ + EvidenceList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EvidenceList; + })(types.EvidenceList || {}); + + types.ConsensusParams = (function(ConsensusParams) { + + /** + * Properties of a ConsensusParams. + * @memberof tendermint.types + * @interface IConsensusParams + * @property {tendermint.types.IBlockParams|null} [block] ConsensusParams block + * @property {tendermint.types.IEvidenceParams|null} [evidence] ConsensusParams evidence + * @property {tendermint.types.IValidatorParams|null} [validator] ConsensusParams validator + * @property {tendermint.types.IVersionParams|null} [version] ConsensusParams version + */ + + /** + * Constructs a new ConsensusParams. + * @memberof tendermint.types + * @classdesc Represents a ConsensusParams. + * @implements IConsensusParams + * @constructor + * @param {tendermint.types.IConsensusParams=} [properties] Properties to set + */ + function ConsensusParams(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConsensusParams block. + * @member {tendermint.types.IBlockParams|null|undefined} block + * @memberof tendermint.types.ConsensusParams + * @instance + */ + ConsensusParams.prototype.block = null; + + /** + * ConsensusParams evidence. + * @member {tendermint.types.IEvidenceParams|null|undefined} evidence + * @memberof tendermint.types.ConsensusParams + * @instance + */ + ConsensusParams.prototype.evidence = null; + + /** + * ConsensusParams validator. + * @member {tendermint.types.IValidatorParams|null|undefined} validator + * @memberof tendermint.types.ConsensusParams + * @instance + */ + ConsensusParams.prototype.validator = null; + + /** + * ConsensusParams version. + * @member {tendermint.types.IVersionParams|null|undefined} version + * @memberof tendermint.types.ConsensusParams + * @instance + */ + ConsensusParams.prototype.version = null; + + /** + * Creates a new ConsensusParams instance using the specified properties. + * @function create + * @memberof tendermint.types.ConsensusParams + * @static + * @param {tendermint.types.IConsensusParams=} [properties] Properties to set + * @returns {tendermint.types.ConsensusParams} ConsensusParams instance + */ + ConsensusParams.create = function create(properties) { + return new ConsensusParams(properties); + }; + + /** + * Encodes the specified ConsensusParams message. Does not implicitly {@link tendermint.types.ConsensusParams.verify|verify} messages. + * @function encode + * @memberof tendermint.types.ConsensusParams + * @static + * @param {tendermint.types.IConsensusParams} message ConsensusParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.block != null && Object.hasOwnProperty.call(message, "block")) + $root.tendermint.types.BlockParams.encode(message.block, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.evidence != null && Object.hasOwnProperty.call(message, "evidence")) + $root.tendermint.types.EvidenceParams.encode(message.evidence, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.validator != null && Object.hasOwnProperty.call(message, "validator")) + $root.tendermint.types.ValidatorParams.encode(message.validator, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + $root.tendermint.types.VersionParams.encode(message.version, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConsensusParams message, length delimited. Does not implicitly {@link tendermint.types.ConsensusParams.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.ConsensusParams + * @static + * @param {tendermint.types.IConsensusParams} message ConsensusParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConsensusParams message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.ConsensusParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.ConsensusParams} ConsensusParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.ConsensusParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.block = $root.tendermint.types.BlockParams.decode(reader, reader.uint32()); + break; + case 2: + message.evidence = $root.tendermint.types.EvidenceParams.decode(reader, reader.uint32()); + break; + case 3: + message.validator = $root.tendermint.types.ValidatorParams.decode(reader, reader.uint32()); + break; + case 4: + message.version = $root.tendermint.types.VersionParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConsensusParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.ConsensusParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.ConsensusParams} ConsensusParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConsensusParams message. + * @function verify + * @memberof tendermint.types.ConsensusParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConsensusParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.block != null && message.hasOwnProperty("block")) { + var error = $root.tendermint.types.BlockParams.verify(message.block); + if (error) + return "block." + error; + } + if (message.evidence != null && message.hasOwnProperty("evidence")) { + var error = $root.tendermint.types.EvidenceParams.verify(message.evidence); + if (error) + return "evidence." + error; + } + if (message.validator != null && message.hasOwnProperty("validator")) { + var error = $root.tendermint.types.ValidatorParams.verify(message.validator); + if (error) + return "validator." + error; + } + if (message.version != null && message.hasOwnProperty("version")) { + var error = $root.tendermint.types.VersionParams.verify(message.version); + if (error) + return "version." + error; + } + return null; + }; + + /** + * Creates a ConsensusParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.ConsensusParams + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.ConsensusParams} ConsensusParams + */ + ConsensusParams.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.ConsensusParams) + return object; + var message = new $root.tendermint.types.ConsensusParams(); + if (object.block != null) { + if (typeof object.block !== "object") + throw TypeError(".tendermint.types.ConsensusParams.block: object expected"); + message.block = $root.tendermint.types.BlockParams.fromObject(object.block); + } + if (object.evidence != null) { + if (typeof object.evidence !== "object") + throw TypeError(".tendermint.types.ConsensusParams.evidence: object expected"); + message.evidence = $root.tendermint.types.EvidenceParams.fromObject(object.evidence); + } + if (object.validator != null) { + if (typeof object.validator !== "object") + throw TypeError(".tendermint.types.ConsensusParams.validator: object expected"); + message.validator = $root.tendermint.types.ValidatorParams.fromObject(object.validator); + } + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".tendermint.types.ConsensusParams.version: object expected"); + message.version = $root.tendermint.types.VersionParams.fromObject(object.version); + } + return message; + }; + + /** + * Creates a plain object from a ConsensusParams message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.ConsensusParams + * @static + * @param {tendermint.types.ConsensusParams} message ConsensusParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConsensusParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.block = null; + object.evidence = null; + object.validator = null; + object.version = null; + } + if (message.block != null && message.hasOwnProperty("block")) + object.block = $root.tendermint.types.BlockParams.toObject(message.block, options); + if (message.evidence != null && message.hasOwnProperty("evidence")) + object.evidence = $root.tendermint.types.EvidenceParams.toObject(message.evidence, options); + if (message.validator != null && message.hasOwnProperty("validator")) + object.validator = $root.tendermint.types.ValidatorParams.toObject(message.validator, options); + if (message.version != null && message.hasOwnProperty("version")) + object.version = $root.tendermint.types.VersionParams.toObject(message.version, options); + return object; + }; + + /** + * Converts this ConsensusParams to JSON. + * @function toJSON + * @memberof tendermint.types.ConsensusParams + * @instance + * @returns {Object.} JSON object + */ + ConsensusParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ConsensusParams; + })(types.ConsensusParams || {}); + + types.BlockParams = (function(BlockParams) { + + /** + * Properties of a BlockParams. + * @memberof tendermint.types + * @interface IBlockParams + * @property {number|Long|null} [maxBytes] BlockParams maxBytes + * @property {number|Long|null} [maxGas] BlockParams maxGas + * @property {number|Long|null} [timeIotaMs] BlockParams timeIotaMs + */ + + /** + * Constructs a new BlockParams. + * @memberof tendermint.types + * @classdesc Represents a BlockParams. + * @implements IBlockParams + * @constructor + * @param {tendermint.types.IBlockParams=} [properties] Properties to set + */ + function BlockParams(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BlockParams maxBytes. + * @member {number|Long} maxBytes + * @memberof tendermint.types.BlockParams + * @instance + */ + BlockParams.prototype.maxBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BlockParams maxGas. + * @member {number|Long} maxGas + * @memberof tendermint.types.BlockParams + * @instance + */ + BlockParams.prototype.maxGas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BlockParams timeIotaMs. + * @member {number|Long} timeIotaMs + * @memberof tendermint.types.BlockParams + * @instance + */ + BlockParams.prototype.timeIotaMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new BlockParams instance using the specified properties. + * @function create + * @memberof tendermint.types.BlockParams + * @static + * @param {tendermint.types.IBlockParams=} [properties] Properties to set + * @returns {tendermint.types.BlockParams} BlockParams instance + */ + BlockParams.create = function create(properties) { + return new BlockParams(properties); + }; + + /** + * Encodes the specified BlockParams message. Does not implicitly {@link tendermint.types.BlockParams.verify|verify} messages. + * @function encode + * @memberof tendermint.types.BlockParams + * @static + * @param {tendermint.types.IBlockParams} message BlockParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlockParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxBytes != null && Object.hasOwnProperty.call(message, "maxBytes")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.maxBytes); + if (message.maxGas != null && Object.hasOwnProperty.call(message, "maxGas")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.maxGas); + if (message.timeIotaMs != null && Object.hasOwnProperty.call(message, "timeIotaMs")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.timeIotaMs); + return writer; + }; + + /** + * Encodes the specified BlockParams message, length delimited. Does not implicitly {@link tendermint.types.BlockParams.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.BlockParams + * @static + * @param {tendermint.types.IBlockParams} message BlockParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlockParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BlockParams message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.BlockParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.BlockParams} BlockParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlockParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.BlockParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxBytes = reader.int64(); + break; + case 2: + message.maxGas = reader.int64(); + break; + case 3: + message.timeIotaMs = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BlockParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.BlockParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.BlockParams} BlockParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlockParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BlockParams message. + * @function verify + * @memberof tendermint.types.BlockParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BlockParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + if (!$util.isInteger(message.maxBytes) && !(message.maxBytes && $util.isInteger(message.maxBytes.low) && $util.isInteger(message.maxBytes.high))) + return "maxBytes: integer|Long expected"; + if (message.maxGas != null && message.hasOwnProperty("maxGas")) + if (!$util.isInteger(message.maxGas) && !(message.maxGas && $util.isInteger(message.maxGas.low) && $util.isInteger(message.maxGas.high))) + return "maxGas: integer|Long expected"; + if (message.timeIotaMs != null && message.hasOwnProperty("timeIotaMs")) + if (!$util.isInteger(message.timeIotaMs) && !(message.timeIotaMs && $util.isInteger(message.timeIotaMs.low) && $util.isInteger(message.timeIotaMs.high))) + return "timeIotaMs: integer|Long expected"; + return null; + }; + + /** + * Creates a BlockParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.BlockParams + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.BlockParams} BlockParams + */ + BlockParams.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.BlockParams) + return object; + var message = new $root.tendermint.types.BlockParams(); + if (object.maxBytes != null) + if ($util.Long) + (message.maxBytes = $util.Long.fromValue(object.maxBytes)).unsigned = false; + else if (typeof object.maxBytes === "string") + message.maxBytes = parseInt(object.maxBytes, 10); + else if (typeof object.maxBytes === "number") + message.maxBytes = object.maxBytes; + else if (typeof object.maxBytes === "object") + message.maxBytes = new $util.LongBits(object.maxBytes.low >>> 0, object.maxBytes.high >>> 0).toNumber(); + if (object.maxGas != null) + if ($util.Long) + (message.maxGas = $util.Long.fromValue(object.maxGas)).unsigned = false; + else if (typeof object.maxGas === "string") + message.maxGas = parseInt(object.maxGas, 10); + else if (typeof object.maxGas === "number") + message.maxGas = object.maxGas; + else if (typeof object.maxGas === "object") + message.maxGas = new $util.LongBits(object.maxGas.low >>> 0, object.maxGas.high >>> 0).toNumber(); + if (object.timeIotaMs != null) + if ($util.Long) + (message.timeIotaMs = $util.Long.fromValue(object.timeIotaMs)).unsigned = false; + else if (typeof object.timeIotaMs === "string") + message.timeIotaMs = parseInt(object.timeIotaMs, 10); + else if (typeof object.timeIotaMs === "number") + message.timeIotaMs = object.timeIotaMs; + else if (typeof object.timeIotaMs === "object") + message.timeIotaMs = new $util.LongBits(object.timeIotaMs.low >>> 0, object.timeIotaMs.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a BlockParams message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.BlockParams + * @static + * @param {tendermint.types.BlockParams} message BlockParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BlockParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxBytes = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxGas = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxGas = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.timeIotaMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timeIotaMs = options.longs === String ? "0" : 0; + } + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + if (typeof message.maxBytes === "number") + object.maxBytes = options.longs === String ? String(message.maxBytes) : message.maxBytes; + else + object.maxBytes = options.longs === String ? $util.Long.prototype.toString.call(message.maxBytes) : options.longs === Number ? new $util.LongBits(message.maxBytes.low >>> 0, message.maxBytes.high >>> 0).toNumber() : message.maxBytes; + if (message.maxGas != null && message.hasOwnProperty("maxGas")) + if (typeof message.maxGas === "number") + object.maxGas = options.longs === String ? String(message.maxGas) : message.maxGas; + else + object.maxGas = options.longs === String ? $util.Long.prototype.toString.call(message.maxGas) : options.longs === Number ? new $util.LongBits(message.maxGas.low >>> 0, message.maxGas.high >>> 0).toNumber() : message.maxGas; + if (message.timeIotaMs != null && message.hasOwnProperty("timeIotaMs")) + if (typeof message.timeIotaMs === "number") + object.timeIotaMs = options.longs === String ? String(message.timeIotaMs) : message.timeIotaMs; + else + object.timeIotaMs = options.longs === String ? $util.Long.prototype.toString.call(message.timeIotaMs) : options.longs === Number ? new $util.LongBits(message.timeIotaMs.low >>> 0, message.timeIotaMs.high >>> 0).toNumber() : message.timeIotaMs; + return object; + }; + + /** + * Converts this BlockParams to JSON. + * @function toJSON + * @memberof tendermint.types.BlockParams + * @instance + * @returns {Object.} JSON object + */ + BlockParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BlockParams; + })(types.BlockParams || {}); + + types.EvidenceParams = (function(EvidenceParams) { + + /** + * Properties of an EvidenceParams. + * @memberof tendermint.types + * @interface IEvidenceParams + * @property {number|Long|null} [maxAgeNumBlocks] EvidenceParams maxAgeNumBlocks + * @property {google.protobuf.IDuration|null} [maxAgeDuration] EvidenceParams maxAgeDuration + * @property {number|Long|null} [maxBytes] EvidenceParams maxBytes + */ + + /** + * Constructs a new EvidenceParams. + * @memberof tendermint.types + * @classdesc Represents an EvidenceParams. + * @implements IEvidenceParams + * @constructor + * @param {tendermint.types.IEvidenceParams=} [properties] Properties to set + */ + function EvidenceParams(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvidenceParams maxAgeNumBlocks. + * @member {number|Long} maxAgeNumBlocks + * @memberof tendermint.types.EvidenceParams + * @instance + */ + EvidenceParams.prototype.maxAgeNumBlocks = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * EvidenceParams maxAgeDuration. + * @member {google.protobuf.IDuration|null|undefined} maxAgeDuration + * @memberof tendermint.types.EvidenceParams + * @instance + */ + EvidenceParams.prototype.maxAgeDuration = null; + + /** + * EvidenceParams maxBytes. + * @member {number|Long} maxBytes + * @memberof tendermint.types.EvidenceParams + * @instance + */ + EvidenceParams.prototype.maxBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new EvidenceParams instance using the specified properties. + * @function create + * @memberof tendermint.types.EvidenceParams + * @static + * @param {tendermint.types.IEvidenceParams=} [properties] Properties to set + * @returns {tendermint.types.EvidenceParams} EvidenceParams instance + */ + EvidenceParams.create = function create(properties) { + return new EvidenceParams(properties); + }; + + /** + * Encodes the specified EvidenceParams message. Does not implicitly {@link tendermint.types.EvidenceParams.verify|verify} messages. + * @function encode + * @memberof tendermint.types.EvidenceParams + * @static + * @param {tendermint.types.IEvidenceParams} message EvidenceParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvidenceParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxAgeNumBlocks != null && Object.hasOwnProperty.call(message, "maxAgeNumBlocks")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.maxAgeNumBlocks); + if (message.maxAgeDuration != null && Object.hasOwnProperty.call(message, "maxAgeDuration")) + $root.google.protobuf.Duration.encode(message.maxAgeDuration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.maxBytes != null && Object.hasOwnProperty.call(message, "maxBytes")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.maxBytes); + return writer; + }; + + /** + * Encodes the specified EvidenceParams message, length delimited. Does not implicitly {@link tendermint.types.EvidenceParams.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.EvidenceParams + * @static + * @param {tendermint.types.IEvidenceParams} message EvidenceParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvidenceParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvidenceParams message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.EvidenceParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.EvidenceParams} EvidenceParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvidenceParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.EvidenceParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxAgeNumBlocks = reader.int64(); + break; + case 2: + message.maxAgeDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 3: + message.maxBytes = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvidenceParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.EvidenceParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.EvidenceParams} EvidenceParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvidenceParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvidenceParams message. + * @function verify + * @memberof tendermint.types.EvidenceParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvidenceParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maxAgeNumBlocks != null && message.hasOwnProperty("maxAgeNumBlocks")) + if (!$util.isInteger(message.maxAgeNumBlocks) && !(message.maxAgeNumBlocks && $util.isInteger(message.maxAgeNumBlocks.low) && $util.isInteger(message.maxAgeNumBlocks.high))) + return "maxAgeNumBlocks: integer|Long expected"; + if (message.maxAgeDuration != null && message.hasOwnProperty("maxAgeDuration")) { + var error = $root.google.protobuf.Duration.verify(message.maxAgeDuration); + if (error) + return "maxAgeDuration." + error; + } + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + if (!$util.isInteger(message.maxBytes) && !(message.maxBytes && $util.isInteger(message.maxBytes.low) && $util.isInteger(message.maxBytes.high))) + return "maxBytes: integer|Long expected"; + return null; + }; + + /** + * Creates an EvidenceParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.EvidenceParams + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.EvidenceParams} EvidenceParams + */ + EvidenceParams.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.EvidenceParams) + return object; + var message = new $root.tendermint.types.EvidenceParams(); + if (object.maxAgeNumBlocks != null) + if ($util.Long) + (message.maxAgeNumBlocks = $util.Long.fromValue(object.maxAgeNumBlocks)).unsigned = false; + else if (typeof object.maxAgeNumBlocks === "string") + message.maxAgeNumBlocks = parseInt(object.maxAgeNumBlocks, 10); + else if (typeof object.maxAgeNumBlocks === "number") + message.maxAgeNumBlocks = object.maxAgeNumBlocks; + else if (typeof object.maxAgeNumBlocks === "object") + message.maxAgeNumBlocks = new $util.LongBits(object.maxAgeNumBlocks.low >>> 0, object.maxAgeNumBlocks.high >>> 0).toNumber(); + if (object.maxAgeDuration != null) { + if (typeof object.maxAgeDuration !== "object") + throw TypeError(".tendermint.types.EvidenceParams.maxAgeDuration: object expected"); + message.maxAgeDuration = $root.google.protobuf.Duration.fromObject(object.maxAgeDuration); + } + if (object.maxBytes != null) + if ($util.Long) + (message.maxBytes = $util.Long.fromValue(object.maxBytes)).unsigned = false; + else if (typeof object.maxBytes === "string") + message.maxBytes = parseInt(object.maxBytes, 10); + else if (typeof object.maxBytes === "number") + message.maxBytes = object.maxBytes; + else if (typeof object.maxBytes === "object") + message.maxBytes = new $util.LongBits(object.maxBytes.low >>> 0, object.maxBytes.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an EvidenceParams message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.EvidenceParams + * @static + * @param {tendermint.types.EvidenceParams} message EvidenceParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvidenceParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxAgeNumBlocks = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxAgeNumBlocks = options.longs === String ? "0" : 0; + object.maxAgeDuration = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxBytes = options.longs === String ? "0" : 0; + } + if (message.maxAgeNumBlocks != null && message.hasOwnProperty("maxAgeNumBlocks")) + if (typeof message.maxAgeNumBlocks === "number") + object.maxAgeNumBlocks = options.longs === String ? String(message.maxAgeNumBlocks) : message.maxAgeNumBlocks; + else + object.maxAgeNumBlocks = options.longs === String ? $util.Long.prototype.toString.call(message.maxAgeNumBlocks) : options.longs === Number ? new $util.LongBits(message.maxAgeNumBlocks.low >>> 0, message.maxAgeNumBlocks.high >>> 0).toNumber() : message.maxAgeNumBlocks; + if (message.maxAgeDuration != null && message.hasOwnProperty("maxAgeDuration")) + object.maxAgeDuration = $root.google.protobuf.Duration.toObject(message.maxAgeDuration, options); + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + if (typeof message.maxBytes === "number") + object.maxBytes = options.longs === String ? String(message.maxBytes) : message.maxBytes; + else + object.maxBytes = options.longs === String ? $util.Long.prototype.toString.call(message.maxBytes) : options.longs === Number ? new $util.LongBits(message.maxBytes.low >>> 0, message.maxBytes.high >>> 0).toNumber() : message.maxBytes; + return object; + }; + + /** + * Converts this EvidenceParams to JSON. + * @function toJSON + * @memberof tendermint.types.EvidenceParams + * @instance + * @returns {Object.} JSON object + */ + EvidenceParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EvidenceParams; + })(types.EvidenceParams || {}); + + types.ValidatorParams = (function(ValidatorParams) { + + /** + * Properties of a ValidatorParams. + * @memberof tendermint.types + * @interface IValidatorParams + * @property {Array.|null} [pubKeyTypes] ValidatorParams pubKeyTypes + */ + + /** + * Constructs a new ValidatorParams. + * @memberof tendermint.types + * @classdesc Represents a ValidatorParams. + * @implements IValidatorParams + * @constructor + * @param {tendermint.types.IValidatorParams=} [properties] Properties to set + */ + function ValidatorParams(properties) { + this.pubKeyTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidatorParams pubKeyTypes. + * @member {Array.} pubKeyTypes + * @memberof tendermint.types.ValidatorParams + * @instance + */ + ValidatorParams.prototype.pubKeyTypes = $util.emptyArray; + + /** + * Creates a new ValidatorParams instance using the specified properties. + * @function create + * @memberof tendermint.types.ValidatorParams + * @static + * @param {tendermint.types.IValidatorParams=} [properties] Properties to set + * @returns {tendermint.types.ValidatorParams} ValidatorParams instance + */ + ValidatorParams.create = function create(properties) { + return new ValidatorParams(properties); + }; + + /** + * Encodes the specified ValidatorParams message. Does not implicitly {@link tendermint.types.ValidatorParams.verify|verify} messages. + * @function encode + * @memberof tendermint.types.ValidatorParams + * @static + * @param {tendermint.types.IValidatorParams} message ValidatorParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pubKeyTypes != null && message.pubKeyTypes.length) + for (var i = 0; i < message.pubKeyTypes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pubKeyTypes[i]); + return writer; + }; + + /** + * Encodes the specified ValidatorParams message, length delimited. Does not implicitly {@link tendermint.types.ValidatorParams.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.ValidatorParams + * @static + * @param {tendermint.types.IValidatorParams} message ValidatorParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidatorParams message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.ValidatorParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.ValidatorParams} ValidatorParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.ValidatorParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.pubKeyTypes && message.pubKeyTypes.length)) + message.pubKeyTypes = []; + message.pubKeyTypes.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidatorParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.ValidatorParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.ValidatorParams} ValidatorParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidatorParams message. + * @function verify + * @memberof tendermint.types.ValidatorParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidatorParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pubKeyTypes != null && message.hasOwnProperty("pubKeyTypes")) { + if (!Array.isArray(message.pubKeyTypes)) + return "pubKeyTypes: array expected"; + for (var i = 0; i < message.pubKeyTypes.length; ++i) + if (!$util.isString(message.pubKeyTypes[i])) + return "pubKeyTypes: string[] expected"; + } + return null; + }; + + /** + * Creates a ValidatorParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.ValidatorParams + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.ValidatorParams} ValidatorParams + */ + ValidatorParams.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.ValidatorParams) + return object; + var message = new $root.tendermint.types.ValidatorParams(); + if (object.pubKeyTypes) { + if (!Array.isArray(object.pubKeyTypes)) + throw TypeError(".tendermint.types.ValidatorParams.pubKeyTypes: array expected"); + message.pubKeyTypes = []; + for (var i = 0; i < object.pubKeyTypes.length; ++i) + message.pubKeyTypes[i] = String(object.pubKeyTypes[i]); + } + return message; + }; + + /** + * Creates a plain object from a ValidatorParams message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.ValidatorParams + * @static + * @param {tendermint.types.ValidatorParams} message ValidatorParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidatorParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pubKeyTypes = []; + if (message.pubKeyTypes && message.pubKeyTypes.length) { + object.pubKeyTypes = []; + for (var j = 0; j < message.pubKeyTypes.length; ++j) + object.pubKeyTypes[j] = message.pubKeyTypes[j]; + } + return object; + }; + + /** + * Converts this ValidatorParams to JSON. + * @function toJSON + * @memberof tendermint.types.ValidatorParams + * @instance + * @returns {Object.} JSON object + */ + ValidatorParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidatorParams; + })(types.ValidatorParams || {}); + + types.VersionParams = (function(VersionParams) { + + /** + * Properties of a VersionParams. + * @memberof tendermint.types + * @interface IVersionParams + * @property {number|Long|null} [appVersion] VersionParams appVersion + */ + + /** + * Constructs a new VersionParams. + * @memberof tendermint.types + * @classdesc Represents a VersionParams. + * @implements IVersionParams + * @constructor + * @param {tendermint.types.IVersionParams=} [properties] Properties to set + */ + function VersionParams(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VersionParams appVersion. + * @member {number|Long} appVersion + * @memberof tendermint.types.VersionParams + * @instance + */ + VersionParams.prototype.appVersion = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new VersionParams instance using the specified properties. + * @function create + * @memberof tendermint.types.VersionParams + * @static + * @param {tendermint.types.IVersionParams=} [properties] Properties to set + * @returns {tendermint.types.VersionParams} VersionParams instance + */ + VersionParams.create = function create(properties) { + return new VersionParams(properties); + }; + + /** + * Encodes the specified VersionParams message. Does not implicitly {@link tendermint.types.VersionParams.verify|verify} messages. + * @function encode + * @memberof tendermint.types.VersionParams + * @static + * @param {tendermint.types.IVersionParams} message VersionParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.appVersion); + return writer; + }; + + /** + * Encodes the specified VersionParams message, length delimited. Does not implicitly {@link tendermint.types.VersionParams.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.VersionParams + * @static + * @param {tendermint.types.IVersionParams} message VersionParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VersionParams message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.VersionParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.VersionParams} VersionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.VersionParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.appVersion = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VersionParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.VersionParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.VersionParams} VersionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VersionParams message. + * @function verify + * @memberof tendermint.types.VersionParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VersionParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + if (!$util.isInteger(message.appVersion) && !(message.appVersion && $util.isInteger(message.appVersion.low) && $util.isInteger(message.appVersion.high))) + return "appVersion: integer|Long expected"; + return null; + }; + + /** + * Creates a VersionParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.VersionParams + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.VersionParams} VersionParams + */ + VersionParams.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.VersionParams) + return object; + var message = new $root.tendermint.types.VersionParams(); + if (object.appVersion != null) + if ($util.Long) + (message.appVersion = $util.Long.fromValue(object.appVersion)).unsigned = true; + else if (typeof object.appVersion === "string") + message.appVersion = parseInt(object.appVersion, 10); + else if (typeof object.appVersion === "number") + message.appVersion = object.appVersion; + else if (typeof object.appVersion === "object") + message.appVersion = new $util.LongBits(object.appVersion.low >>> 0, object.appVersion.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a VersionParams message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.VersionParams + * @static + * @param {tendermint.types.VersionParams} message VersionParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VersionParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.appVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.appVersion = options.longs === String ? "0" : 0; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + if (typeof message.appVersion === "number") + object.appVersion = options.longs === String ? String(message.appVersion) : message.appVersion; + else + object.appVersion = options.longs === String ? $util.Long.prototype.toString.call(message.appVersion) : options.longs === Number ? new $util.LongBits(message.appVersion.low >>> 0, message.appVersion.high >>> 0).toNumber(true) : message.appVersion; + return object; + }; + + /** + * Converts this VersionParams to JSON. + * @function toJSON + * @memberof tendermint.types.VersionParams + * @instance + * @returns {Object.} JSON object + */ + VersionParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VersionParams; + })(types.VersionParams || {}); + + types.HashedParams = (function(HashedParams) { + + /** + * Properties of a HashedParams. + * @memberof tendermint.types + * @interface IHashedParams + * @property {number|Long|null} [blockMaxBytes] HashedParams blockMaxBytes + * @property {number|Long|null} [blockMaxGas] HashedParams blockMaxGas + */ + + /** + * Constructs a new HashedParams. + * @memberof tendermint.types + * @classdesc Represents a HashedParams. + * @implements IHashedParams + * @constructor + * @param {tendermint.types.IHashedParams=} [properties] Properties to set + */ + function HashedParams(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HashedParams blockMaxBytes. + * @member {number|Long} blockMaxBytes + * @memberof tendermint.types.HashedParams + * @instance + */ + HashedParams.prototype.blockMaxBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * HashedParams blockMaxGas. + * @member {number|Long} blockMaxGas + * @memberof tendermint.types.HashedParams + * @instance + */ + HashedParams.prototype.blockMaxGas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new HashedParams instance using the specified properties. + * @function create + * @memberof tendermint.types.HashedParams + * @static + * @param {tendermint.types.IHashedParams=} [properties] Properties to set + * @returns {tendermint.types.HashedParams} HashedParams instance + */ + HashedParams.create = function create(properties) { + return new HashedParams(properties); + }; + + /** + * Encodes the specified HashedParams message. Does not implicitly {@link tendermint.types.HashedParams.verify|verify} messages. + * @function encode + * @memberof tendermint.types.HashedParams + * @static + * @param {tendermint.types.IHashedParams} message HashedParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HashedParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.blockMaxBytes != null && Object.hasOwnProperty.call(message, "blockMaxBytes")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.blockMaxBytes); + if (message.blockMaxGas != null && Object.hasOwnProperty.call(message, "blockMaxGas")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.blockMaxGas); + return writer; + }; + + /** + * Encodes the specified HashedParams message, length delimited. Does not implicitly {@link tendermint.types.HashedParams.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.HashedParams + * @static + * @param {tendermint.types.IHashedParams} message HashedParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HashedParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HashedParams message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.HashedParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.HashedParams} HashedParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HashedParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.HashedParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockMaxBytes = reader.int64(); + break; + case 2: + message.blockMaxGas = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HashedParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.HashedParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.HashedParams} HashedParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HashedParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HashedParams message. + * @function verify + * @memberof tendermint.types.HashedParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HashedParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.blockMaxBytes != null && message.hasOwnProperty("blockMaxBytes")) + if (!$util.isInteger(message.blockMaxBytes) && !(message.blockMaxBytes && $util.isInteger(message.blockMaxBytes.low) && $util.isInteger(message.blockMaxBytes.high))) + return "blockMaxBytes: integer|Long expected"; + if (message.blockMaxGas != null && message.hasOwnProperty("blockMaxGas")) + if (!$util.isInteger(message.blockMaxGas) && !(message.blockMaxGas && $util.isInteger(message.blockMaxGas.low) && $util.isInteger(message.blockMaxGas.high))) + return "blockMaxGas: integer|Long expected"; + return null; + }; + + /** + * Creates a HashedParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.HashedParams + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.HashedParams} HashedParams + */ + HashedParams.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.HashedParams) + return object; + var message = new $root.tendermint.types.HashedParams(); + if (object.blockMaxBytes != null) + if ($util.Long) + (message.blockMaxBytes = $util.Long.fromValue(object.blockMaxBytes)).unsigned = false; + else if (typeof object.blockMaxBytes === "string") + message.blockMaxBytes = parseInt(object.blockMaxBytes, 10); + else if (typeof object.blockMaxBytes === "number") + message.blockMaxBytes = object.blockMaxBytes; + else if (typeof object.blockMaxBytes === "object") + message.blockMaxBytes = new $util.LongBits(object.blockMaxBytes.low >>> 0, object.blockMaxBytes.high >>> 0).toNumber(); + if (object.blockMaxGas != null) + if ($util.Long) + (message.blockMaxGas = $util.Long.fromValue(object.blockMaxGas)).unsigned = false; + else if (typeof object.blockMaxGas === "string") + message.blockMaxGas = parseInt(object.blockMaxGas, 10); + else if (typeof object.blockMaxGas === "number") + message.blockMaxGas = object.blockMaxGas; + else if (typeof object.blockMaxGas === "object") + message.blockMaxGas = new $util.LongBits(object.blockMaxGas.low >>> 0, object.blockMaxGas.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a HashedParams message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.HashedParams + * @static + * @param {tendermint.types.HashedParams} message HashedParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HashedParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.blockMaxBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.blockMaxBytes = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.blockMaxGas = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.blockMaxGas = options.longs === String ? "0" : 0; + } + if (message.blockMaxBytes != null && message.hasOwnProperty("blockMaxBytes")) + if (typeof message.blockMaxBytes === "number") + object.blockMaxBytes = options.longs === String ? String(message.blockMaxBytes) : message.blockMaxBytes; + else + object.blockMaxBytes = options.longs === String ? $util.Long.prototype.toString.call(message.blockMaxBytes) : options.longs === Number ? new $util.LongBits(message.blockMaxBytes.low >>> 0, message.blockMaxBytes.high >>> 0).toNumber() : message.blockMaxBytes; + if (message.blockMaxGas != null && message.hasOwnProperty("blockMaxGas")) + if (typeof message.blockMaxGas === "number") + object.blockMaxGas = options.longs === String ? String(message.blockMaxGas) : message.blockMaxGas; + else + object.blockMaxGas = options.longs === String ? $util.Long.prototype.toString.call(message.blockMaxGas) : options.longs === Number ? new $util.LongBits(message.blockMaxGas.low >>> 0, message.blockMaxGas.high >>> 0).toNumber() : message.blockMaxGas; + return object; + }; + + /** + * Converts this HashedParams to JSON. + * @function toJSON + * @memberof tendermint.types.HashedParams + * @instance + * @returns {Object.} JSON object + */ + HashedParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HashedParams; + })(types.HashedParams || {}); + + /** + * BlockIDFlag enum. + * @name tendermint.types.BlockIDFlag + * @enum {string} + * @property {number} BLOCK_ID_FLAG_UNKNOWN=0 BLOCK_ID_FLAG_UNKNOWN value + * @property {number} BLOCK_ID_FLAG_ABSENT=1 BLOCK_ID_FLAG_ABSENT value + * @property {number} BLOCK_ID_FLAG_COMMIT=2 BLOCK_ID_FLAG_COMMIT value + * @property {number} BLOCK_ID_FLAG_NIL=3 BLOCK_ID_FLAG_NIL value + */ + types.BlockIDFlag = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BLOCK_ID_FLAG_UNKNOWN"] = 0; + values[valuesById[1] = "BLOCK_ID_FLAG_ABSENT"] = 1; + values[valuesById[2] = "BLOCK_ID_FLAG_COMMIT"] = 2; + values[valuesById[3] = "BLOCK_ID_FLAG_NIL"] = 3; + return values; + })(); + + /** + * SignedMsgType enum. + * @name tendermint.types.SignedMsgType + * @enum {string} + * @property {number} SIGNED_MSG_TYPE_UNKNOWN=0 SIGNED_MSG_TYPE_UNKNOWN value + * @property {number} SIGNED_MSG_TYPE_PREVOTE=1 SIGNED_MSG_TYPE_PREVOTE value + * @property {number} SIGNED_MSG_TYPE_PRECOMMIT=2 SIGNED_MSG_TYPE_PRECOMMIT value + * @property {number} SIGNED_MSG_TYPE_PROPOSAL=32 SIGNED_MSG_TYPE_PROPOSAL value + */ + types.SignedMsgType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SIGNED_MSG_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "SIGNED_MSG_TYPE_PREVOTE"] = 1; + values[valuesById[2] = "SIGNED_MSG_TYPE_PRECOMMIT"] = 2; + values[valuesById[32] = "SIGNED_MSG_TYPE_PROPOSAL"] = 32; + return values; + })(); + + types.PartSetHeader = (function(PartSetHeader) { + + /** + * Properties of a PartSetHeader. + * @memberof tendermint.types + * @interface IPartSetHeader + * @property {number|null} [total] PartSetHeader total + * @property {Uint8Array|null} [hash] PartSetHeader hash + */ + + /** + * Constructs a new PartSetHeader. + * @memberof tendermint.types + * @classdesc Represents a PartSetHeader. + * @implements IPartSetHeader + * @constructor + * @param {tendermint.types.IPartSetHeader=} [properties] Properties to set + */ + function PartSetHeader(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartSetHeader total. + * @member {number} total + * @memberof tendermint.types.PartSetHeader + * @instance + */ + PartSetHeader.prototype.total = 0; + + /** + * PartSetHeader hash. + * @member {Uint8Array} hash + * @memberof tendermint.types.PartSetHeader + * @instance + */ + PartSetHeader.prototype.hash = $util.newBuffer([]); + + /** + * Creates a new PartSetHeader instance using the specified properties. + * @function create + * @memberof tendermint.types.PartSetHeader + * @static + * @param {tendermint.types.IPartSetHeader=} [properties] Properties to set + * @returns {tendermint.types.PartSetHeader} PartSetHeader instance + */ + PartSetHeader.create = function create(properties) { + return new PartSetHeader(properties); + }; + + /** + * Encodes the specified PartSetHeader message. Does not implicitly {@link tendermint.types.PartSetHeader.verify|verify} messages. + * @function encode + * @memberof tendermint.types.PartSetHeader + * @static + * @param {tendermint.types.IPartSetHeader} message PartSetHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartSetHeader.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.total != null && Object.hasOwnProperty.call(message, "total")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.total); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.hash); + return writer; + }; + + /** + * Encodes the specified PartSetHeader message, length delimited. Does not implicitly {@link tendermint.types.PartSetHeader.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.PartSetHeader + * @static + * @param {tendermint.types.IPartSetHeader} message PartSetHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartSetHeader.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartSetHeader message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.PartSetHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.PartSetHeader} PartSetHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartSetHeader.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.PartSetHeader(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.total = reader.uint32(); + break; + case 2: + message.hash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartSetHeader message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.PartSetHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.PartSetHeader} PartSetHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartSetHeader.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartSetHeader message. + * @function verify + * @memberof tendermint.types.PartSetHeader + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartSetHeader.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.total != null && message.hasOwnProperty("total")) + if (!$util.isInteger(message.total)) + return "total: integer expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash))) + return "hash: buffer expected"; + return null; + }; + + /** + * Creates a PartSetHeader message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.PartSetHeader + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.PartSetHeader} PartSetHeader + */ + PartSetHeader.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.PartSetHeader) + return object; + var message = new $root.tendermint.types.PartSetHeader(); + if (object.total != null) + message.total = object.total >>> 0; + if (object.hash != null) + if (typeof object.hash === "string") + $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0); + else if (object.hash.length) + message.hash = object.hash; + return message; + }; + + /** + * Creates a plain object from a PartSetHeader message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.PartSetHeader + * @static + * @param {tendermint.types.PartSetHeader} message PartSetHeader + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartSetHeader.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.total = 0; + if (options.bytes === String) + object.hash = ""; + else { + object.hash = []; + if (options.bytes !== Array) + object.hash = $util.newBuffer(object.hash); + } + } + if (message.total != null && message.hasOwnProperty("total")) + object.total = message.total; + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash; + return object; + }; + + /** + * Converts this PartSetHeader to JSON. + * @function toJSON + * @memberof tendermint.types.PartSetHeader + * @instance + * @returns {Object.} JSON object + */ + PartSetHeader.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PartSetHeader; + })(types.PartSetHeader || {}); + + types.Part = (function(Part) { + + /** + * Properties of a Part. + * @memberof tendermint.types + * @interface IPart + * @property {number|null} [index] Part index + * @property {Uint8Array|null} [bytes] Part bytes + * @property {tendermint.crypto.IProof|null} [proof] Part proof + */ + + /** + * Constructs a new Part. + * @memberof tendermint.types + * @classdesc Represents a Part. + * @implements IPart + * @constructor + * @param {tendermint.types.IPart=} [properties] Properties to set + */ + function Part(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Part index. + * @member {number} index + * @memberof tendermint.types.Part + * @instance + */ + Part.prototype.index = 0; + + /** + * Part bytes. + * @member {Uint8Array} bytes + * @memberof tendermint.types.Part + * @instance + */ + Part.prototype.bytes = $util.newBuffer([]); + + /** + * Part proof. + * @member {tendermint.crypto.IProof|null|undefined} proof + * @memberof tendermint.types.Part + * @instance + */ + Part.prototype.proof = null; + + /** + * Creates a new Part instance using the specified properties. + * @function create + * @memberof tendermint.types.Part + * @static + * @param {tendermint.types.IPart=} [properties] Properties to set + * @returns {tendermint.types.Part} Part instance + */ + Part.create = function create(properties) { + return new Part(properties); + }; + + /** + * Encodes the specified Part message. Does not implicitly {@link tendermint.types.Part.verify|verify} messages. + * @function encode + * @memberof tendermint.types.Part + * @static + * @param {tendermint.types.IPart} message Part message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Part.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.index); + if (message.bytes != null && Object.hasOwnProperty.call(message, "bytes")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.bytes); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.tendermint.crypto.Proof.encode(message.proof, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Part message, length delimited. Does not implicitly {@link tendermint.types.Part.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.Part + * @static + * @param {tendermint.types.IPart} message Part message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Part.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Part message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.Part + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.Part} Part + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Part.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Part(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.uint32(); + break; + case 2: + message.bytes = reader.bytes(); + break; + case 3: + message.proof = $root.tendermint.crypto.Proof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Part message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.Part + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.Part} Part + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Part.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Part message. + * @function verify + * @memberof tendermint.types.Part + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Part.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index)) + return "index: integer expected"; + if (message.bytes != null && message.hasOwnProperty("bytes")) + if (!(message.bytes && typeof message.bytes.length === "number" || $util.isString(message.bytes))) + return "bytes: buffer expected"; + if (message.proof != null && message.hasOwnProperty("proof")) { + var error = $root.tendermint.crypto.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + return null; + }; + + /** + * Creates a Part message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.Part + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.Part} Part + */ + Part.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.Part) + return object; + var message = new $root.tendermint.types.Part(); + if (object.index != null) + message.index = object.index >>> 0; + if (object.bytes != null) + if (typeof object.bytes === "string") + $util.base64.decode(object.bytes, message.bytes = $util.newBuffer($util.base64.length(object.bytes)), 0); + else if (object.bytes.length) + message.bytes = object.bytes; + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".tendermint.types.Part.proof: object expected"); + message.proof = $root.tendermint.crypto.Proof.fromObject(object.proof); + } + return message; + }; + + /** + * Creates a plain object from a Part message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.Part + * @static + * @param {tendermint.types.Part} message Part + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Part.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.index = 0; + if (options.bytes === String) + object.bytes = ""; + else { + object.bytes = []; + if (options.bytes !== Array) + object.bytes = $util.newBuffer(object.bytes); + } + object.proof = null; + } + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + if (message.bytes != null && message.hasOwnProperty("bytes")) + object.bytes = options.bytes === String ? $util.base64.encode(message.bytes, 0, message.bytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.bytes) : message.bytes; + if (message.proof != null && message.hasOwnProperty("proof")) + object.proof = $root.tendermint.crypto.Proof.toObject(message.proof, options); + return object; + }; + + /** + * Converts this Part to JSON. + * @function toJSON + * @memberof tendermint.types.Part + * @instance + * @returns {Object.} JSON object + */ + Part.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Part; + })(types.Part || {}); + + types.BlockID = (function(BlockID) { + + /** + * Properties of a BlockID. + * @memberof tendermint.types + * @interface IBlockID + * @property {Uint8Array|null} [hash] BlockID hash + * @property {tendermint.types.IPartSetHeader|null} [partSetHeader] BlockID partSetHeader + */ + + /** + * Constructs a new BlockID. + * @memberof tendermint.types + * @classdesc Represents a BlockID. + * @implements IBlockID + * @constructor + * @param {tendermint.types.IBlockID=} [properties] Properties to set + */ + function BlockID(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BlockID hash. + * @member {Uint8Array} hash + * @memberof tendermint.types.BlockID + * @instance + */ + BlockID.prototype.hash = $util.newBuffer([]); + + /** + * BlockID partSetHeader. + * @member {tendermint.types.IPartSetHeader|null|undefined} partSetHeader + * @memberof tendermint.types.BlockID + * @instance + */ + BlockID.prototype.partSetHeader = null; + + /** + * Creates a new BlockID instance using the specified properties. + * @function create + * @memberof tendermint.types.BlockID + * @static + * @param {tendermint.types.IBlockID=} [properties] Properties to set + * @returns {tendermint.types.BlockID} BlockID instance + */ + BlockID.create = function create(properties) { + return new BlockID(properties); + }; + + /** + * Encodes the specified BlockID message. Does not implicitly {@link tendermint.types.BlockID.verify|verify} messages. + * @function encode + * @memberof tendermint.types.BlockID + * @static + * @param {tendermint.types.IBlockID} message BlockID message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlockID.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.hash); + if (message.partSetHeader != null && Object.hasOwnProperty.call(message, "partSetHeader")) + $root.tendermint.types.PartSetHeader.encode(message.partSetHeader, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BlockID message, length delimited. Does not implicitly {@link tendermint.types.BlockID.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.BlockID + * @static + * @param {tendermint.types.IBlockID} message BlockID message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlockID.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BlockID message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.BlockID + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.BlockID} BlockID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlockID.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.BlockID(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.bytes(); + break; + case 2: + message.partSetHeader = $root.tendermint.types.PartSetHeader.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BlockID message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.BlockID + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.BlockID} BlockID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlockID.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BlockID message. + * @function verify + * @memberof tendermint.types.BlockID + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BlockID.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash))) + return "hash: buffer expected"; + if (message.partSetHeader != null && message.hasOwnProperty("partSetHeader")) { + var error = $root.tendermint.types.PartSetHeader.verify(message.partSetHeader); + if (error) + return "partSetHeader." + error; + } + return null; + }; + + /** + * Creates a BlockID message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.BlockID + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.BlockID} BlockID + */ + BlockID.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.BlockID) + return object; + var message = new $root.tendermint.types.BlockID(); + if (object.hash != null) + if (typeof object.hash === "string") + $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0); + else if (object.hash.length) + message.hash = object.hash; + if (object.partSetHeader != null) { + if (typeof object.partSetHeader !== "object") + throw TypeError(".tendermint.types.BlockID.partSetHeader: object expected"); + message.partSetHeader = $root.tendermint.types.PartSetHeader.fromObject(object.partSetHeader); + } + return message; + }; + + /** + * Creates a plain object from a BlockID message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.BlockID + * @static + * @param {tendermint.types.BlockID} message BlockID + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BlockID.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.hash = ""; + else { + object.hash = []; + if (options.bytes !== Array) + object.hash = $util.newBuffer(object.hash); + } + object.partSetHeader = null; + } + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash; + if (message.partSetHeader != null && message.hasOwnProperty("partSetHeader")) + object.partSetHeader = $root.tendermint.types.PartSetHeader.toObject(message.partSetHeader, options); + return object; + }; + + /** + * Converts this BlockID to JSON. + * @function toJSON + * @memberof tendermint.types.BlockID + * @instance + * @returns {Object.} JSON object + */ + BlockID.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BlockID; + })(types.BlockID || {}); + + types.Header = (function(Header) { + + /** + * Properties of a Header. + * @memberof tendermint.types + * @interface IHeader + * @property {tendermint.version.IConsensus|null} [version] Header version + * @property {string|null} [chainId] Header chainId + * @property {number|Long|null} [height] Header height + * @property {google.protobuf.ITimestamp|null} [time] Header time + * @property {tendermint.types.IBlockID|null} [lastBlockId] Header lastBlockId + * @property {Uint8Array|null} [lastCommitHash] Header lastCommitHash + * @property {Uint8Array|null} [dataHash] Header dataHash + * @property {Uint8Array|null} [validatorsHash] Header validatorsHash + * @property {Uint8Array|null} [nextValidatorsHash] Header nextValidatorsHash + * @property {Uint8Array|null} [consensusHash] Header consensusHash + * @property {Uint8Array|null} [appHash] Header appHash + * @property {Uint8Array|null} [lastResultsHash] Header lastResultsHash + * @property {Uint8Array|null} [evidenceHash] Header evidenceHash + * @property {Uint8Array|null} [proposerAddress] Header proposerAddress + */ + + /** + * Constructs a new Header. + * @memberof tendermint.types + * @classdesc Represents a Header. + * @implements IHeader + * @constructor + * @param {tendermint.types.IHeader=} [properties] Properties to set + */ + function Header(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Header version. + * @member {tendermint.version.IConsensus|null|undefined} version + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.version = null; + + /** + * Header chainId. + * @member {string} chainId + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.chainId = ""; + + /** + * Header height. + * @member {number|Long} height + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Header time. + * @member {google.protobuf.ITimestamp|null|undefined} time + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.time = null; + + /** + * Header lastBlockId. + * @member {tendermint.types.IBlockID|null|undefined} lastBlockId + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.lastBlockId = null; + + /** + * Header lastCommitHash. + * @member {Uint8Array} lastCommitHash + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.lastCommitHash = $util.newBuffer([]); + + /** + * Header dataHash. + * @member {Uint8Array} dataHash + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.dataHash = $util.newBuffer([]); + + /** + * Header validatorsHash. + * @member {Uint8Array} validatorsHash + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.validatorsHash = $util.newBuffer([]); + + /** + * Header nextValidatorsHash. + * @member {Uint8Array} nextValidatorsHash + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.nextValidatorsHash = $util.newBuffer([]); + + /** + * Header consensusHash. + * @member {Uint8Array} consensusHash + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.consensusHash = $util.newBuffer([]); + + /** + * Header appHash. + * @member {Uint8Array} appHash + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.appHash = $util.newBuffer([]); + + /** + * Header lastResultsHash. + * @member {Uint8Array} lastResultsHash + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.lastResultsHash = $util.newBuffer([]); + + /** + * Header evidenceHash. + * @member {Uint8Array} evidenceHash + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.evidenceHash = $util.newBuffer([]); + + /** + * Header proposerAddress. + * @member {Uint8Array} proposerAddress + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.proposerAddress = $util.newBuffer([]); + + /** + * Creates a new Header instance using the specified properties. + * @function create + * @memberof tendermint.types.Header + * @static + * @param {tendermint.types.IHeader=} [properties] Properties to set + * @returns {tendermint.types.Header} Header instance + */ + Header.create = function create(properties) { + return new Header(properties); + }; + + /** + * Encodes the specified Header message. Does not implicitly {@link tendermint.types.Header.verify|verify} messages. + * @function encode + * @memberof tendermint.types.Header + * @static + * @param {tendermint.types.IHeader} message Header message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Header.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + $root.tendermint.version.Consensus.encode(message.version, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.chainId != null && Object.hasOwnProperty.call(message, "chainId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.chainId); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.height); + if (message.time != null && Object.hasOwnProperty.call(message, "time")) + $root.google.protobuf.Timestamp.encode(message.time, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.lastBlockId != null && Object.hasOwnProperty.call(message, "lastBlockId")) + $root.tendermint.types.BlockID.encode(message.lastBlockId, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.lastCommitHash != null && Object.hasOwnProperty.call(message, "lastCommitHash")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.lastCommitHash); + if (message.dataHash != null && Object.hasOwnProperty.call(message, "dataHash")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.dataHash); + if (message.validatorsHash != null && Object.hasOwnProperty.call(message, "validatorsHash")) + writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.validatorsHash); + if (message.nextValidatorsHash != null && Object.hasOwnProperty.call(message, "nextValidatorsHash")) + writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.nextValidatorsHash); + if (message.consensusHash != null && Object.hasOwnProperty.call(message, "consensusHash")) + writer.uint32(/* id 10, wireType 2 =*/82).bytes(message.consensusHash); + if (message.appHash != null && Object.hasOwnProperty.call(message, "appHash")) + writer.uint32(/* id 11, wireType 2 =*/90).bytes(message.appHash); + if (message.lastResultsHash != null && Object.hasOwnProperty.call(message, "lastResultsHash")) + writer.uint32(/* id 12, wireType 2 =*/98).bytes(message.lastResultsHash); + if (message.evidenceHash != null && Object.hasOwnProperty.call(message, "evidenceHash")) + writer.uint32(/* id 13, wireType 2 =*/106).bytes(message.evidenceHash); + if (message.proposerAddress != null && Object.hasOwnProperty.call(message, "proposerAddress")) + writer.uint32(/* id 14, wireType 2 =*/114).bytes(message.proposerAddress); + return writer; + }; + + /** + * Encodes the specified Header message, length delimited. Does not implicitly {@link tendermint.types.Header.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.Header + * @static + * @param {tendermint.types.IHeader} message Header message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Header.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Header message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.Header + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.Header} Header + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Header.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Header(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = $root.tendermint.version.Consensus.decode(reader, reader.uint32()); + break; + case 2: + message.chainId = reader.string(); + break; + case 3: + message.height = reader.int64(); + break; + case 4: + message.time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.lastBlockId = $root.tendermint.types.BlockID.decode(reader, reader.uint32()); + break; + case 6: + message.lastCommitHash = reader.bytes(); + break; + case 7: + message.dataHash = reader.bytes(); + break; + case 8: + message.validatorsHash = reader.bytes(); + break; + case 9: + message.nextValidatorsHash = reader.bytes(); + break; + case 10: + message.consensusHash = reader.bytes(); + break; + case 11: + message.appHash = reader.bytes(); + break; + case 12: + message.lastResultsHash = reader.bytes(); + break; + case 13: + message.evidenceHash = reader.bytes(); + break; + case 14: + message.proposerAddress = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Header message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.Header + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.Header} Header + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Header.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Header message. + * @function verify + * @memberof tendermint.types.Header + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Header.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) { + var error = $root.tendermint.version.Consensus.verify(message.version); + if (error) + return "version." + error; + } + if (message.chainId != null && message.hasOwnProperty("chainId")) + if (!$util.isString(message.chainId)) + return "chainId: string expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.time != null && message.hasOwnProperty("time")) { + var error = $root.google.protobuf.Timestamp.verify(message.time); + if (error) + return "time." + error; + } + if (message.lastBlockId != null && message.hasOwnProperty("lastBlockId")) { + var error = $root.tendermint.types.BlockID.verify(message.lastBlockId); + if (error) + return "lastBlockId." + error; + } + if (message.lastCommitHash != null && message.hasOwnProperty("lastCommitHash")) + if (!(message.lastCommitHash && typeof message.lastCommitHash.length === "number" || $util.isString(message.lastCommitHash))) + return "lastCommitHash: buffer expected"; + if (message.dataHash != null && message.hasOwnProperty("dataHash")) + if (!(message.dataHash && typeof message.dataHash.length === "number" || $util.isString(message.dataHash))) + return "dataHash: buffer expected"; + if (message.validatorsHash != null && message.hasOwnProperty("validatorsHash")) + if (!(message.validatorsHash && typeof message.validatorsHash.length === "number" || $util.isString(message.validatorsHash))) + return "validatorsHash: buffer expected"; + if (message.nextValidatorsHash != null && message.hasOwnProperty("nextValidatorsHash")) + if (!(message.nextValidatorsHash && typeof message.nextValidatorsHash.length === "number" || $util.isString(message.nextValidatorsHash))) + return "nextValidatorsHash: buffer expected"; + if (message.consensusHash != null && message.hasOwnProperty("consensusHash")) + if (!(message.consensusHash && typeof message.consensusHash.length === "number" || $util.isString(message.consensusHash))) + return "consensusHash: buffer expected"; + if (message.appHash != null && message.hasOwnProperty("appHash")) + if (!(message.appHash && typeof message.appHash.length === "number" || $util.isString(message.appHash))) + return "appHash: buffer expected"; + if (message.lastResultsHash != null && message.hasOwnProperty("lastResultsHash")) + if (!(message.lastResultsHash && typeof message.lastResultsHash.length === "number" || $util.isString(message.lastResultsHash))) + return "lastResultsHash: buffer expected"; + if (message.evidenceHash != null && message.hasOwnProperty("evidenceHash")) + if (!(message.evidenceHash && typeof message.evidenceHash.length === "number" || $util.isString(message.evidenceHash))) + return "evidenceHash: buffer expected"; + if (message.proposerAddress != null && message.hasOwnProperty("proposerAddress")) + if (!(message.proposerAddress && typeof message.proposerAddress.length === "number" || $util.isString(message.proposerAddress))) + return "proposerAddress: buffer expected"; + return null; + }; + + /** + * Creates a Header message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.Header + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.Header} Header + */ + Header.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.Header) + return object; + var message = new $root.tendermint.types.Header(); + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".tendermint.types.Header.version: object expected"); + message.version = $root.tendermint.version.Consensus.fromObject(object.version); + } + if (object.chainId != null) + message.chainId = String(object.chainId); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + if (object.time != null) { + if (typeof object.time !== "object") + throw TypeError(".tendermint.types.Header.time: object expected"); + message.time = $root.google.protobuf.Timestamp.fromObject(object.time); + } + if (object.lastBlockId != null) { + if (typeof object.lastBlockId !== "object") + throw TypeError(".tendermint.types.Header.lastBlockId: object expected"); + message.lastBlockId = $root.tendermint.types.BlockID.fromObject(object.lastBlockId); + } + if (object.lastCommitHash != null) + if (typeof object.lastCommitHash === "string") + $util.base64.decode(object.lastCommitHash, message.lastCommitHash = $util.newBuffer($util.base64.length(object.lastCommitHash)), 0); + else if (object.lastCommitHash.length) + message.lastCommitHash = object.lastCommitHash; + if (object.dataHash != null) + if (typeof object.dataHash === "string") + $util.base64.decode(object.dataHash, message.dataHash = $util.newBuffer($util.base64.length(object.dataHash)), 0); + else if (object.dataHash.length) + message.dataHash = object.dataHash; + if (object.validatorsHash != null) + if (typeof object.validatorsHash === "string") + $util.base64.decode(object.validatorsHash, message.validatorsHash = $util.newBuffer($util.base64.length(object.validatorsHash)), 0); + else if (object.validatorsHash.length) + message.validatorsHash = object.validatorsHash; + if (object.nextValidatorsHash != null) + if (typeof object.nextValidatorsHash === "string") + $util.base64.decode(object.nextValidatorsHash, message.nextValidatorsHash = $util.newBuffer($util.base64.length(object.nextValidatorsHash)), 0); + else if (object.nextValidatorsHash.length) + message.nextValidatorsHash = object.nextValidatorsHash; + if (object.consensusHash != null) + if (typeof object.consensusHash === "string") + $util.base64.decode(object.consensusHash, message.consensusHash = $util.newBuffer($util.base64.length(object.consensusHash)), 0); + else if (object.consensusHash.length) + message.consensusHash = object.consensusHash; + if (object.appHash != null) + if (typeof object.appHash === "string") + $util.base64.decode(object.appHash, message.appHash = $util.newBuffer($util.base64.length(object.appHash)), 0); + else if (object.appHash.length) + message.appHash = object.appHash; + if (object.lastResultsHash != null) + if (typeof object.lastResultsHash === "string") + $util.base64.decode(object.lastResultsHash, message.lastResultsHash = $util.newBuffer($util.base64.length(object.lastResultsHash)), 0); + else if (object.lastResultsHash.length) + message.lastResultsHash = object.lastResultsHash; + if (object.evidenceHash != null) + if (typeof object.evidenceHash === "string") + $util.base64.decode(object.evidenceHash, message.evidenceHash = $util.newBuffer($util.base64.length(object.evidenceHash)), 0); + else if (object.evidenceHash.length) + message.evidenceHash = object.evidenceHash; + if (object.proposerAddress != null) + if (typeof object.proposerAddress === "string") + $util.base64.decode(object.proposerAddress, message.proposerAddress = $util.newBuffer($util.base64.length(object.proposerAddress)), 0); + else if (object.proposerAddress.length) + message.proposerAddress = object.proposerAddress; + return message; + }; + + /** + * Creates a plain object from a Header message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.Header + * @static + * @param {tendermint.types.Header} message Header + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Header.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = null; + object.chainId = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.time = null; + object.lastBlockId = null; + if (options.bytes === String) + object.lastCommitHash = ""; + else { + object.lastCommitHash = []; + if (options.bytes !== Array) + object.lastCommitHash = $util.newBuffer(object.lastCommitHash); + } + if (options.bytes === String) + object.dataHash = ""; + else { + object.dataHash = []; + if (options.bytes !== Array) + object.dataHash = $util.newBuffer(object.dataHash); + } + if (options.bytes === String) + object.validatorsHash = ""; + else { + object.validatorsHash = []; + if (options.bytes !== Array) + object.validatorsHash = $util.newBuffer(object.validatorsHash); + } + if (options.bytes === String) + object.nextValidatorsHash = ""; + else { + object.nextValidatorsHash = []; + if (options.bytes !== Array) + object.nextValidatorsHash = $util.newBuffer(object.nextValidatorsHash); + } + if (options.bytes === String) + object.consensusHash = ""; + else { + object.consensusHash = []; + if (options.bytes !== Array) + object.consensusHash = $util.newBuffer(object.consensusHash); + } + if (options.bytes === String) + object.appHash = ""; + else { + object.appHash = []; + if (options.bytes !== Array) + object.appHash = $util.newBuffer(object.appHash); + } + if (options.bytes === String) + object.lastResultsHash = ""; + else { + object.lastResultsHash = []; + if (options.bytes !== Array) + object.lastResultsHash = $util.newBuffer(object.lastResultsHash); + } + if (options.bytes === String) + object.evidenceHash = ""; + else { + object.evidenceHash = []; + if (options.bytes !== Array) + object.evidenceHash = $util.newBuffer(object.evidenceHash); + } + if (options.bytes === String) + object.proposerAddress = ""; + else { + object.proposerAddress = []; + if (options.bytes !== Array) + object.proposerAddress = $util.newBuffer(object.proposerAddress); + } + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = $root.tendermint.version.Consensus.toObject(message.version, options); + if (message.chainId != null && message.hasOwnProperty("chainId")) + object.chainId = message.chainId; + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + if (message.time != null && message.hasOwnProperty("time")) + object.time = $root.google.protobuf.Timestamp.toObject(message.time, options); + if (message.lastBlockId != null && message.hasOwnProperty("lastBlockId")) + object.lastBlockId = $root.tendermint.types.BlockID.toObject(message.lastBlockId, options); + if (message.lastCommitHash != null && message.hasOwnProperty("lastCommitHash")) + object.lastCommitHash = options.bytes === String ? $util.base64.encode(message.lastCommitHash, 0, message.lastCommitHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.lastCommitHash) : message.lastCommitHash; + if (message.dataHash != null && message.hasOwnProperty("dataHash")) + object.dataHash = options.bytes === String ? $util.base64.encode(message.dataHash, 0, message.dataHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.dataHash) : message.dataHash; + if (message.validatorsHash != null && message.hasOwnProperty("validatorsHash")) + object.validatorsHash = options.bytes === String ? $util.base64.encode(message.validatorsHash, 0, message.validatorsHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.validatorsHash) : message.validatorsHash; + if (message.nextValidatorsHash != null && message.hasOwnProperty("nextValidatorsHash")) + object.nextValidatorsHash = options.bytes === String ? $util.base64.encode(message.nextValidatorsHash, 0, message.nextValidatorsHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.nextValidatorsHash) : message.nextValidatorsHash; + if (message.consensusHash != null && message.hasOwnProperty("consensusHash")) + object.consensusHash = options.bytes === String ? $util.base64.encode(message.consensusHash, 0, message.consensusHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.consensusHash) : message.consensusHash; + if (message.appHash != null && message.hasOwnProperty("appHash")) + object.appHash = options.bytes === String ? $util.base64.encode(message.appHash, 0, message.appHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.appHash) : message.appHash; + if (message.lastResultsHash != null && message.hasOwnProperty("lastResultsHash")) + object.lastResultsHash = options.bytes === String ? $util.base64.encode(message.lastResultsHash, 0, message.lastResultsHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.lastResultsHash) : message.lastResultsHash; + if (message.evidenceHash != null && message.hasOwnProperty("evidenceHash")) + object.evidenceHash = options.bytes === String ? $util.base64.encode(message.evidenceHash, 0, message.evidenceHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.evidenceHash) : message.evidenceHash; + if (message.proposerAddress != null && message.hasOwnProperty("proposerAddress")) + object.proposerAddress = options.bytes === String ? $util.base64.encode(message.proposerAddress, 0, message.proposerAddress.length) : options.bytes === Array ? Array.prototype.slice.call(message.proposerAddress) : message.proposerAddress; + return object; + }; + + /** + * Converts this Header to JSON. + * @function toJSON + * @memberof tendermint.types.Header + * @instance + * @returns {Object.} JSON object + */ + Header.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Header; + })(types.Header || {}); + + types.Data = (function(Data) { + + /** + * Properties of a Data. + * @memberof tendermint.types + * @interface IData + * @property {Array.|null} [txs] Data txs + */ + + /** + * Constructs a new Data. + * @memberof tendermint.types + * @classdesc Represents a Data. + * @implements IData + * @constructor + * @param {tendermint.types.IData=} [properties] Properties to set + */ + function Data(properties) { + this.txs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Data txs. + * @member {Array.} txs + * @memberof tendermint.types.Data + * @instance + */ + Data.prototype.txs = $util.emptyArray; + + /** + * Creates a new Data instance using the specified properties. + * @function create + * @memberof tendermint.types.Data + * @static + * @param {tendermint.types.IData=} [properties] Properties to set + * @returns {tendermint.types.Data} Data instance + */ + Data.create = function create(properties) { + return new Data(properties); + }; + + /** + * Encodes the specified Data message. Does not implicitly {@link tendermint.types.Data.verify|verify} messages. + * @function encode + * @memberof tendermint.types.Data + * @static + * @param {tendermint.types.IData} message Data message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Data.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.txs != null && message.txs.length) + for (var i = 0; i < message.txs.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.txs[i]); + return writer; + }; + + /** + * Encodes the specified Data message, length delimited. Does not implicitly {@link tendermint.types.Data.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.Data + * @static + * @param {tendermint.types.IData} message Data message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Data.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Data message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.Data + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.Data} Data + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Data.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Data(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.txs && message.txs.length)) + message.txs = []; + message.txs.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Data message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.Data + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.Data} Data + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Data.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Data message. + * @function verify + * @memberof tendermint.types.Data + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Data.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.txs != null && message.hasOwnProperty("txs")) { + if (!Array.isArray(message.txs)) + return "txs: array expected"; + for (var i = 0; i < message.txs.length; ++i) + if (!(message.txs[i] && typeof message.txs[i].length === "number" || $util.isString(message.txs[i]))) + return "txs: buffer[] expected"; + } + return null; + }; + + /** + * Creates a Data message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.Data + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.Data} Data + */ + Data.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.Data) + return object; + var message = new $root.tendermint.types.Data(); + if (object.txs) { + if (!Array.isArray(object.txs)) + throw TypeError(".tendermint.types.Data.txs: array expected"); + message.txs = []; + for (var i = 0; i < object.txs.length; ++i) + if (typeof object.txs[i] === "string") + $util.base64.decode(object.txs[i], message.txs[i] = $util.newBuffer($util.base64.length(object.txs[i])), 0); + else if (object.txs[i].length) + message.txs[i] = object.txs[i]; + } + return message; + }; + + /** + * Creates a plain object from a Data message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.Data + * @static + * @param {tendermint.types.Data} message Data + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Data.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.txs = []; + if (message.txs && message.txs.length) { + object.txs = []; + for (var j = 0; j < message.txs.length; ++j) + object.txs[j] = options.bytes === String ? $util.base64.encode(message.txs[j], 0, message.txs[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.txs[j]) : message.txs[j]; + } + return object; + }; + + /** + * Converts this Data to JSON. + * @function toJSON + * @memberof tendermint.types.Data + * @instance + * @returns {Object.} JSON object + */ + Data.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Data; + })(types.Data || {}); + + types.Vote = (function(Vote) { + + /** + * Properties of a Vote. + * @memberof tendermint.types + * @interface IVote + * @property {tendermint.types.SignedMsgType|null} [type] Vote type + * @property {number|Long|null} [height] Vote height + * @property {number|null} [round] Vote round + * @property {tendermint.types.IBlockID|null} [blockId] Vote blockId + * @property {google.protobuf.ITimestamp|null} [timestamp] Vote timestamp + * @property {Uint8Array|null} [validatorAddress] Vote validatorAddress + * @property {number|null} [validatorIndex] Vote validatorIndex + * @property {Uint8Array|null} [signature] Vote signature + */ + + /** + * Constructs a new Vote. + * @memberof tendermint.types + * @classdesc Represents a Vote. + * @implements IVote + * @constructor + * @param {tendermint.types.IVote=} [properties] Properties to set + */ + function Vote(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Vote type. + * @member {tendermint.types.SignedMsgType} type + * @memberof tendermint.types.Vote + * @instance + */ + Vote.prototype.type = 0; + + /** + * Vote height. + * @member {number|Long} height + * @memberof tendermint.types.Vote + * @instance + */ + Vote.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Vote round. + * @member {number} round + * @memberof tendermint.types.Vote + * @instance + */ + Vote.prototype.round = 0; + + /** + * Vote blockId. + * @member {tendermint.types.IBlockID|null|undefined} blockId + * @memberof tendermint.types.Vote + * @instance + */ + Vote.prototype.blockId = null; + + /** + * Vote timestamp. + * @member {google.protobuf.ITimestamp|null|undefined} timestamp + * @memberof tendermint.types.Vote + * @instance + */ + Vote.prototype.timestamp = null; + + /** + * Vote validatorAddress. + * @member {Uint8Array} validatorAddress + * @memberof tendermint.types.Vote + * @instance + */ + Vote.prototype.validatorAddress = $util.newBuffer([]); + + /** + * Vote validatorIndex. + * @member {number} validatorIndex + * @memberof tendermint.types.Vote + * @instance + */ + Vote.prototype.validatorIndex = 0; + + /** + * Vote signature. + * @member {Uint8Array} signature + * @memberof tendermint.types.Vote + * @instance + */ + Vote.prototype.signature = $util.newBuffer([]); + + /** + * Creates a new Vote instance using the specified properties. + * @function create + * @memberof tendermint.types.Vote + * @static + * @param {tendermint.types.IVote=} [properties] Properties to set + * @returns {tendermint.types.Vote} Vote instance + */ + Vote.create = function create(properties) { + return new Vote(properties); + }; + + /** + * Encodes the specified Vote message. Does not implicitly {@link tendermint.types.Vote.verify|verify} messages. + * @function encode + * @memberof tendermint.types.Vote + * @static + * @param {tendermint.types.IVote} message Vote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vote.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.height); + if (message.round != null && Object.hasOwnProperty.call(message, "round")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.round); + if (message.blockId != null && Object.hasOwnProperty.call(message, "blockId")) + $root.tendermint.types.BlockID.encode(message.blockId, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.validatorAddress); + if (message.validatorIndex != null && Object.hasOwnProperty.call(message, "validatorIndex")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.validatorIndex); + if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) + writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.signature); + return writer; + }; + + /** + * Encodes the specified Vote message, length delimited. Does not implicitly {@link tendermint.types.Vote.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.Vote + * @static + * @param {tendermint.types.IVote} message Vote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vote.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Vote message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.Vote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.Vote} Vote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vote.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Vote(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32(); + break; + case 2: + message.height = reader.int64(); + break; + case 3: + message.round = reader.int32(); + break; + case 4: + message.blockId = $root.tendermint.types.BlockID.decode(reader, reader.uint32()); + break; + case 5: + message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.validatorAddress = reader.bytes(); + break; + case 7: + message.validatorIndex = reader.int32(); + break; + case 8: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Vote message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.Vote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.Vote} Vote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vote.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Vote message. + * @function verify + * @memberof tendermint.types.Vote + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Vote.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 32: + break; + } + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.round != null && message.hasOwnProperty("round")) + if (!$util.isInteger(message.round)) + return "round: integer expected"; + if (message.blockId != null && message.hasOwnProperty("blockId")) { + var error = $root.tendermint.types.BlockID.verify(message.blockId); + if (error) + return "blockId." + error; + } + if (message.timestamp != null && message.hasOwnProperty("timestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.timestamp); + if (error) + return "timestamp." + error; + } + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!(message.validatorAddress && typeof message.validatorAddress.length === "number" || $util.isString(message.validatorAddress))) + return "validatorAddress: buffer expected"; + if (message.validatorIndex != null && message.hasOwnProperty("validatorIndex")) + if (!$util.isInteger(message.validatorIndex)) + return "validatorIndex: integer expected"; + if (message.signature != null && message.hasOwnProperty("signature")) + if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) + return "signature: buffer expected"; + return null; + }; + + /** + * Creates a Vote message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.Vote + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.Vote} Vote + */ + Vote.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.Vote) + return object; + var message = new $root.tendermint.types.Vote(); + switch (object.type) { + case "SIGNED_MSG_TYPE_UNKNOWN": + case 0: + message.type = 0; + break; + case "SIGNED_MSG_TYPE_PREVOTE": + case 1: + message.type = 1; + break; + case "SIGNED_MSG_TYPE_PRECOMMIT": + case 2: + message.type = 2; + break; + case "SIGNED_MSG_TYPE_PROPOSAL": + case 32: + message.type = 32; + break; + } + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + if (object.round != null) + message.round = object.round | 0; + if (object.blockId != null) { + if (typeof object.blockId !== "object") + throw TypeError(".tendermint.types.Vote.blockId: object expected"); + message.blockId = $root.tendermint.types.BlockID.fromObject(object.blockId); + } + if (object.timestamp != null) { + if (typeof object.timestamp !== "object") + throw TypeError(".tendermint.types.Vote.timestamp: object expected"); + message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); + } + if (object.validatorAddress != null) + if (typeof object.validatorAddress === "string") + $util.base64.decode(object.validatorAddress, message.validatorAddress = $util.newBuffer($util.base64.length(object.validatorAddress)), 0); + else if (object.validatorAddress.length) + message.validatorAddress = object.validatorAddress; + if (object.validatorIndex != null) + message.validatorIndex = object.validatorIndex | 0; + if (object.signature != null) + if (typeof object.signature === "string") + $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); + else if (object.signature.length) + message.signature = object.signature; + return message; + }; + + /** + * Creates a plain object from a Vote message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.Vote + * @static + * @param {tendermint.types.Vote} message Vote + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Vote.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "SIGNED_MSG_TYPE_UNKNOWN" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.round = 0; + object.blockId = null; + object.timestamp = null; + if (options.bytes === String) + object.validatorAddress = ""; + else { + object.validatorAddress = []; + if (options.bytes !== Array) + object.validatorAddress = $util.newBuffer(object.validatorAddress); + } + object.validatorIndex = 0; + if (options.bytes === String) + object.signature = ""; + else { + object.signature = []; + if (options.bytes !== Array) + object.signature = $util.newBuffer(object.signature); + } + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.tendermint.types.SignedMsgType[message.type] : message.type; + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + if (message.round != null && message.hasOwnProperty("round")) + object.round = message.round; + if (message.blockId != null && message.hasOwnProperty("blockId")) + object.blockId = $root.tendermint.types.BlockID.toObject(message.blockId, options); + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = options.bytes === String ? $util.base64.encode(message.validatorAddress, 0, message.validatorAddress.length) : options.bytes === Array ? Array.prototype.slice.call(message.validatorAddress) : message.validatorAddress; + if (message.validatorIndex != null && message.hasOwnProperty("validatorIndex")) + object.validatorIndex = message.validatorIndex; + if (message.signature != null && message.hasOwnProperty("signature")) + object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; + return object; + }; + + /** + * Converts this Vote to JSON. + * @function toJSON + * @memberof tendermint.types.Vote + * @instance + * @returns {Object.} JSON object + */ + Vote.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Vote; + })(types.Vote || {}); + + types.Commit = (function(Commit) { + + /** + * Properties of a Commit. + * @memberof tendermint.types + * @interface ICommit + * @property {number|Long|null} [height] Commit height + * @property {number|null} [round] Commit round + * @property {tendermint.types.IBlockID|null} [blockId] Commit blockId + * @property {Array.|null} [signatures] Commit signatures + */ + + /** + * Constructs a new Commit. + * @memberof tendermint.types + * @classdesc Represents a Commit. + * @implements ICommit + * @constructor + * @param {tendermint.types.ICommit=} [properties] Properties to set + */ + function Commit(properties) { + this.signatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Commit height. + * @member {number|Long} height + * @memberof tendermint.types.Commit + * @instance + */ + Commit.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Commit round. + * @member {number} round + * @memberof tendermint.types.Commit + * @instance + */ + Commit.prototype.round = 0; + + /** + * Commit blockId. + * @member {tendermint.types.IBlockID|null|undefined} blockId + * @memberof tendermint.types.Commit + * @instance + */ + Commit.prototype.blockId = null; + + /** + * Commit signatures. + * @member {Array.} signatures + * @memberof tendermint.types.Commit + * @instance + */ + Commit.prototype.signatures = $util.emptyArray; + + /** + * Creates a new Commit instance using the specified properties. + * @function create + * @memberof tendermint.types.Commit + * @static + * @param {tendermint.types.ICommit=} [properties] Properties to set + * @returns {tendermint.types.Commit} Commit instance + */ + Commit.create = function create(properties) { + return new Commit(properties); + }; + + /** + * Encodes the specified Commit message. Does not implicitly {@link tendermint.types.Commit.verify|verify} messages. + * @function encode + * @memberof tendermint.types.Commit + * @static + * @param {tendermint.types.ICommit} message Commit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Commit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.height); + if (message.round != null && Object.hasOwnProperty.call(message, "round")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.round); + if (message.blockId != null && Object.hasOwnProperty.call(message, "blockId")) + $root.tendermint.types.BlockID.encode(message.blockId, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.signatures != null && message.signatures.length) + for (var i = 0; i < message.signatures.length; ++i) + $root.tendermint.types.CommitSig.encode(message.signatures[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Commit message, length delimited. Does not implicitly {@link tendermint.types.Commit.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.Commit + * @static + * @param {tendermint.types.ICommit} message Commit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Commit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Commit message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.Commit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.Commit} Commit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Commit.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Commit(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + case 2: + message.round = reader.int32(); + break; + case 3: + message.blockId = $root.tendermint.types.BlockID.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.signatures && message.signatures.length)) + message.signatures = []; + message.signatures.push($root.tendermint.types.CommitSig.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Commit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.Commit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.Commit} Commit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Commit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Commit message. + * @function verify + * @memberof tendermint.types.Commit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Commit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.round != null && message.hasOwnProperty("round")) + if (!$util.isInteger(message.round)) + return "round: integer expected"; + if (message.blockId != null && message.hasOwnProperty("blockId")) { + var error = $root.tendermint.types.BlockID.verify(message.blockId); + if (error) + return "blockId." + error; + } + if (message.signatures != null && message.hasOwnProperty("signatures")) { + if (!Array.isArray(message.signatures)) + return "signatures: array expected"; + for (var i = 0; i < message.signatures.length; ++i) { + var error = $root.tendermint.types.CommitSig.verify(message.signatures[i]); + if (error) + return "signatures." + error; + } + } + return null; + }; + + /** + * Creates a Commit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.Commit + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.Commit} Commit + */ + Commit.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.Commit) + return object; + var message = new $root.tendermint.types.Commit(); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + if (object.round != null) + message.round = object.round | 0; + if (object.blockId != null) { + if (typeof object.blockId !== "object") + throw TypeError(".tendermint.types.Commit.blockId: object expected"); + message.blockId = $root.tendermint.types.BlockID.fromObject(object.blockId); + } + if (object.signatures) { + if (!Array.isArray(object.signatures)) + throw TypeError(".tendermint.types.Commit.signatures: array expected"); + message.signatures = []; + for (var i = 0; i < object.signatures.length; ++i) { + if (typeof object.signatures[i] !== "object") + throw TypeError(".tendermint.types.Commit.signatures: object expected"); + message.signatures[i] = $root.tendermint.types.CommitSig.fromObject(object.signatures[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Commit message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.Commit + * @static + * @param {tendermint.types.Commit} message Commit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Commit.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.signatures = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.round = 0; + object.blockId = null; + } + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + if (message.round != null && message.hasOwnProperty("round")) + object.round = message.round; + if (message.blockId != null && message.hasOwnProperty("blockId")) + object.blockId = $root.tendermint.types.BlockID.toObject(message.blockId, options); + if (message.signatures && message.signatures.length) { + object.signatures = []; + for (var j = 0; j < message.signatures.length; ++j) + object.signatures[j] = $root.tendermint.types.CommitSig.toObject(message.signatures[j], options); + } + return object; + }; + + /** + * Converts this Commit to JSON. + * @function toJSON + * @memberof tendermint.types.Commit + * @instance + * @returns {Object.} JSON object + */ + Commit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Commit; + })(types.Commit || {}); + + types.CommitSig = (function(CommitSig) { + + /** + * Properties of a CommitSig. + * @memberof tendermint.types + * @interface ICommitSig + * @property {tendermint.types.BlockIDFlag|null} [blockIdFlag] CommitSig blockIdFlag + * @property {Uint8Array|null} [validatorAddress] CommitSig validatorAddress + * @property {google.protobuf.ITimestamp|null} [timestamp] CommitSig timestamp + * @property {Uint8Array|null} [signature] CommitSig signature + */ + + /** + * Constructs a new CommitSig. + * @memberof tendermint.types + * @classdesc Represents a CommitSig. + * @implements ICommitSig + * @constructor + * @param {tendermint.types.ICommitSig=} [properties] Properties to set + */ + function CommitSig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommitSig blockIdFlag. + * @member {tendermint.types.BlockIDFlag} blockIdFlag + * @memberof tendermint.types.CommitSig + * @instance + */ + CommitSig.prototype.blockIdFlag = 0; + + /** + * CommitSig validatorAddress. + * @member {Uint8Array} validatorAddress + * @memberof tendermint.types.CommitSig + * @instance + */ + CommitSig.prototype.validatorAddress = $util.newBuffer([]); + + /** + * CommitSig timestamp. + * @member {google.protobuf.ITimestamp|null|undefined} timestamp + * @memberof tendermint.types.CommitSig + * @instance + */ + CommitSig.prototype.timestamp = null; + + /** + * CommitSig signature. + * @member {Uint8Array} signature + * @memberof tendermint.types.CommitSig + * @instance + */ + CommitSig.prototype.signature = $util.newBuffer([]); + + /** + * Creates a new CommitSig instance using the specified properties. + * @function create + * @memberof tendermint.types.CommitSig + * @static + * @param {tendermint.types.ICommitSig=} [properties] Properties to set + * @returns {tendermint.types.CommitSig} CommitSig instance + */ + CommitSig.create = function create(properties) { + return new CommitSig(properties); + }; + + /** + * Encodes the specified CommitSig message. Does not implicitly {@link tendermint.types.CommitSig.verify|verify} messages. + * @function encode + * @memberof tendermint.types.CommitSig + * @static + * @param {tendermint.types.ICommitSig} message CommitSig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitSig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.blockIdFlag != null && Object.hasOwnProperty.call(message, "blockIdFlag")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.blockIdFlag); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.validatorAddress); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.signature); + return writer; + }; + + /** + * Encodes the specified CommitSig message, length delimited. Does not implicitly {@link tendermint.types.CommitSig.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.CommitSig + * @static + * @param {tendermint.types.ICommitSig} message CommitSig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitSig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommitSig message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.CommitSig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.CommitSig} CommitSig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitSig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.CommitSig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockIdFlag = reader.int32(); + break; + case 2: + message.validatorAddress = reader.bytes(); + break; + case 3: + message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 4: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommitSig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.CommitSig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.CommitSig} CommitSig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitSig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommitSig message. + * @function verify + * @memberof tendermint.types.CommitSig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommitSig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.blockIdFlag != null && message.hasOwnProperty("blockIdFlag")) + switch (message.blockIdFlag) { + default: + return "blockIdFlag: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!(message.validatorAddress && typeof message.validatorAddress.length === "number" || $util.isString(message.validatorAddress))) + return "validatorAddress: buffer expected"; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.timestamp); + if (error) + return "timestamp." + error; + } + if (message.signature != null && message.hasOwnProperty("signature")) + if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) + return "signature: buffer expected"; + return null; + }; + + /** + * Creates a CommitSig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.CommitSig + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.CommitSig} CommitSig + */ + CommitSig.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.CommitSig) + return object; + var message = new $root.tendermint.types.CommitSig(); + switch (object.blockIdFlag) { + case "BLOCK_ID_FLAG_UNKNOWN": + case 0: + message.blockIdFlag = 0; + break; + case "BLOCK_ID_FLAG_ABSENT": + case 1: + message.blockIdFlag = 1; + break; + case "BLOCK_ID_FLAG_COMMIT": + case 2: + message.blockIdFlag = 2; + break; + case "BLOCK_ID_FLAG_NIL": + case 3: + message.blockIdFlag = 3; + break; + } + if (object.validatorAddress != null) + if (typeof object.validatorAddress === "string") + $util.base64.decode(object.validatorAddress, message.validatorAddress = $util.newBuffer($util.base64.length(object.validatorAddress)), 0); + else if (object.validatorAddress.length) + message.validatorAddress = object.validatorAddress; + if (object.timestamp != null) { + if (typeof object.timestamp !== "object") + throw TypeError(".tendermint.types.CommitSig.timestamp: object expected"); + message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); + } + if (object.signature != null) + if (typeof object.signature === "string") + $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); + else if (object.signature.length) + message.signature = object.signature; + return message; + }; + + /** + * Creates a plain object from a CommitSig message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.CommitSig + * @static + * @param {tendermint.types.CommitSig} message CommitSig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommitSig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.blockIdFlag = options.enums === String ? "BLOCK_ID_FLAG_UNKNOWN" : 0; + if (options.bytes === String) + object.validatorAddress = ""; + else { + object.validatorAddress = []; + if (options.bytes !== Array) + object.validatorAddress = $util.newBuffer(object.validatorAddress); + } + object.timestamp = null; + if (options.bytes === String) + object.signature = ""; + else { + object.signature = []; + if (options.bytes !== Array) + object.signature = $util.newBuffer(object.signature); + } + } + if (message.blockIdFlag != null && message.hasOwnProperty("blockIdFlag")) + object.blockIdFlag = options.enums === String ? $root.tendermint.types.BlockIDFlag[message.blockIdFlag] : message.blockIdFlag; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = options.bytes === String ? $util.base64.encode(message.validatorAddress, 0, message.validatorAddress.length) : options.bytes === Array ? Array.prototype.slice.call(message.validatorAddress) : message.validatorAddress; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); + if (message.signature != null && message.hasOwnProperty("signature")) + object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; + return object; + }; + + /** + * Converts this CommitSig to JSON. + * @function toJSON + * @memberof tendermint.types.CommitSig + * @instance + * @returns {Object.} JSON object + */ + CommitSig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CommitSig; + })(types.CommitSig || {}); + + types.Proposal = (function(Proposal) { + + /** + * Properties of a Proposal. + * @memberof tendermint.types + * @interface IProposal + * @property {tendermint.types.SignedMsgType|null} [type] Proposal type + * @property {number|Long|null} [height] Proposal height + * @property {number|null} [round] Proposal round + * @property {number|null} [polRound] Proposal polRound + * @property {tendermint.types.IBlockID|null} [blockId] Proposal blockId + * @property {google.protobuf.ITimestamp|null} [timestamp] Proposal timestamp + * @property {Uint8Array|null} [signature] Proposal signature + */ + + /** + * Constructs a new Proposal. + * @memberof tendermint.types + * @classdesc Represents a Proposal. + * @implements IProposal + * @constructor + * @param {tendermint.types.IProposal=} [properties] Properties to set + */ + function Proposal(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Proposal type. + * @member {tendermint.types.SignedMsgType} type + * @memberof tendermint.types.Proposal + * @instance + */ + Proposal.prototype.type = 0; + + /** + * Proposal height. + * @member {number|Long} height + * @memberof tendermint.types.Proposal + * @instance + */ + Proposal.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Proposal round. + * @member {number} round + * @memberof tendermint.types.Proposal + * @instance + */ + Proposal.prototype.round = 0; + + /** + * Proposal polRound. + * @member {number} polRound + * @memberof tendermint.types.Proposal + * @instance + */ + Proposal.prototype.polRound = 0; + + /** + * Proposal blockId. + * @member {tendermint.types.IBlockID|null|undefined} blockId + * @memberof tendermint.types.Proposal + * @instance + */ + Proposal.prototype.blockId = null; + + /** + * Proposal timestamp. + * @member {google.protobuf.ITimestamp|null|undefined} timestamp + * @memberof tendermint.types.Proposal + * @instance + */ + Proposal.prototype.timestamp = null; + + /** + * Proposal signature. + * @member {Uint8Array} signature + * @memberof tendermint.types.Proposal + * @instance + */ + Proposal.prototype.signature = $util.newBuffer([]); + + /** + * Creates a new Proposal instance using the specified properties. + * @function create + * @memberof tendermint.types.Proposal + * @static + * @param {tendermint.types.IProposal=} [properties] Properties to set + * @returns {tendermint.types.Proposal} Proposal instance + */ + Proposal.create = function create(properties) { + return new Proposal(properties); + }; + + /** + * Encodes the specified Proposal message. Does not implicitly {@link tendermint.types.Proposal.verify|verify} messages. + * @function encode + * @memberof tendermint.types.Proposal + * @static + * @param {tendermint.types.IProposal} message Proposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proposal.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.height); + if (message.round != null && Object.hasOwnProperty.call(message, "round")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.round); + if (message.polRound != null && Object.hasOwnProperty.call(message, "polRound")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.polRound); + if (message.blockId != null && Object.hasOwnProperty.call(message, "blockId")) + $root.tendermint.types.BlockID.encode(message.blockId, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.signature); + return writer; + }; + + /** + * Encodes the specified Proposal message, length delimited. Does not implicitly {@link tendermint.types.Proposal.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.Proposal + * @static + * @param {tendermint.types.IProposal} message Proposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proposal.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Proposal message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.Proposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.Proposal} Proposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proposal.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Proposal(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32(); + break; + case 2: + message.height = reader.int64(); + break; + case 3: + message.round = reader.int32(); + break; + case 4: + message.polRound = reader.int32(); + break; + case 5: + message.blockId = $root.tendermint.types.BlockID.decode(reader, reader.uint32()); + break; + case 6: + message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 7: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Proposal message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.Proposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.Proposal} Proposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proposal.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Proposal message. + * @function verify + * @memberof tendermint.types.Proposal + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Proposal.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 32: + break; + } + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.round != null && message.hasOwnProperty("round")) + if (!$util.isInteger(message.round)) + return "round: integer expected"; + if (message.polRound != null && message.hasOwnProperty("polRound")) + if (!$util.isInteger(message.polRound)) + return "polRound: integer expected"; + if (message.blockId != null && message.hasOwnProperty("blockId")) { + var error = $root.tendermint.types.BlockID.verify(message.blockId); + if (error) + return "blockId." + error; + } + if (message.timestamp != null && message.hasOwnProperty("timestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.timestamp); + if (error) + return "timestamp." + error; + } + if (message.signature != null && message.hasOwnProperty("signature")) + if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) + return "signature: buffer expected"; + return null; + }; + + /** + * Creates a Proposal message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.Proposal + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.Proposal} Proposal + */ + Proposal.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.Proposal) + return object; + var message = new $root.tendermint.types.Proposal(); + switch (object.type) { + case "SIGNED_MSG_TYPE_UNKNOWN": + case 0: + message.type = 0; + break; + case "SIGNED_MSG_TYPE_PREVOTE": + case 1: + message.type = 1; + break; + case "SIGNED_MSG_TYPE_PRECOMMIT": + case 2: + message.type = 2; + break; + case "SIGNED_MSG_TYPE_PROPOSAL": + case 32: + message.type = 32; + break; + } + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + if (object.round != null) + message.round = object.round | 0; + if (object.polRound != null) + message.polRound = object.polRound | 0; + if (object.blockId != null) { + if (typeof object.blockId !== "object") + throw TypeError(".tendermint.types.Proposal.blockId: object expected"); + message.blockId = $root.tendermint.types.BlockID.fromObject(object.blockId); + } + if (object.timestamp != null) { + if (typeof object.timestamp !== "object") + throw TypeError(".tendermint.types.Proposal.timestamp: object expected"); + message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); + } + if (object.signature != null) + if (typeof object.signature === "string") + $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); + else if (object.signature.length) + message.signature = object.signature; + return message; + }; + + /** + * Creates a plain object from a Proposal message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.Proposal + * @static + * @param {tendermint.types.Proposal} message Proposal + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Proposal.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "SIGNED_MSG_TYPE_UNKNOWN" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.round = 0; + object.polRound = 0; + object.blockId = null; + object.timestamp = null; + if (options.bytes === String) + object.signature = ""; + else { + object.signature = []; + if (options.bytes !== Array) + object.signature = $util.newBuffer(object.signature); + } + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.tendermint.types.SignedMsgType[message.type] : message.type; + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + if (message.round != null && message.hasOwnProperty("round")) + object.round = message.round; + if (message.polRound != null && message.hasOwnProperty("polRound")) + object.polRound = message.polRound; + if (message.blockId != null && message.hasOwnProperty("blockId")) + object.blockId = $root.tendermint.types.BlockID.toObject(message.blockId, options); + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); + if (message.signature != null && message.hasOwnProperty("signature")) + object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; + return object; + }; + + /** + * Converts this Proposal to JSON. + * @function toJSON + * @memberof tendermint.types.Proposal + * @instance + * @returns {Object.} JSON object + */ + Proposal.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Proposal; + })(types.Proposal || {}); + + types.SignedHeader = (function(SignedHeader) { + + /** + * Properties of a SignedHeader. + * @memberof tendermint.types + * @interface ISignedHeader + * @property {tendermint.types.IHeader|null} [header] SignedHeader header + * @property {tendermint.types.ICommit|null} [commit] SignedHeader commit + */ + + /** + * Constructs a new SignedHeader. + * @memberof tendermint.types + * @classdesc Represents a SignedHeader. + * @implements ISignedHeader + * @constructor + * @param {tendermint.types.ISignedHeader=} [properties] Properties to set + */ + function SignedHeader(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SignedHeader header. + * @member {tendermint.types.IHeader|null|undefined} header + * @memberof tendermint.types.SignedHeader + * @instance + */ + SignedHeader.prototype.header = null; + + /** + * SignedHeader commit. + * @member {tendermint.types.ICommit|null|undefined} commit + * @memberof tendermint.types.SignedHeader + * @instance + */ + SignedHeader.prototype.commit = null; + + /** + * Creates a new SignedHeader instance using the specified properties. + * @function create + * @memberof tendermint.types.SignedHeader + * @static + * @param {tendermint.types.ISignedHeader=} [properties] Properties to set + * @returns {tendermint.types.SignedHeader} SignedHeader instance + */ + SignedHeader.create = function create(properties) { + return new SignedHeader(properties); + }; + + /** + * Encodes the specified SignedHeader message. Does not implicitly {@link tendermint.types.SignedHeader.verify|verify} messages. + * @function encode + * @memberof tendermint.types.SignedHeader + * @static + * @param {tendermint.types.ISignedHeader} message SignedHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignedHeader.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + $root.tendermint.types.Header.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.commit != null && Object.hasOwnProperty.call(message, "commit")) + $root.tendermint.types.Commit.encode(message.commit, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SignedHeader message, length delimited. Does not implicitly {@link tendermint.types.SignedHeader.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.SignedHeader + * @static + * @param {tendermint.types.ISignedHeader} message SignedHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignedHeader.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SignedHeader message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.SignedHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.SignedHeader} SignedHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignedHeader.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.SignedHeader(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.header = $root.tendermint.types.Header.decode(reader, reader.uint32()); + break; + case 2: + message.commit = $root.tendermint.types.Commit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SignedHeader message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.SignedHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.SignedHeader} SignedHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignedHeader.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SignedHeader message. + * @function verify + * @memberof tendermint.types.SignedHeader + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SignedHeader.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.header != null && message.hasOwnProperty("header")) { + var error = $root.tendermint.types.Header.verify(message.header); + if (error) + return "header." + error; + } + if (message.commit != null && message.hasOwnProperty("commit")) { + var error = $root.tendermint.types.Commit.verify(message.commit); + if (error) + return "commit." + error; + } + return null; + }; + + /** + * Creates a SignedHeader message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.SignedHeader + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.SignedHeader} SignedHeader + */ + SignedHeader.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.SignedHeader) + return object; + var message = new $root.tendermint.types.SignedHeader(); + if (object.header != null) { + if (typeof object.header !== "object") + throw TypeError(".tendermint.types.SignedHeader.header: object expected"); + message.header = $root.tendermint.types.Header.fromObject(object.header); + } + if (object.commit != null) { + if (typeof object.commit !== "object") + throw TypeError(".tendermint.types.SignedHeader.commit: object expected"); + message.commit = $root.tendermint.types.Commit.fromObject(object.commit); + } + return message; + }; + + /** + * Creates a plain object from a SignedHeader message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.SignedHeader + * @static + * @param {tendermint.types.SignedHeader} message SignedHeader + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SignedHeader.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.header = null; + object.commit = null; + } + if (message.header != null && message.hasOwnProperty("header")) + object.header = $root.tendermint.types.Header.toObject(message.header, options); + if (message.commit != null && message.hasOwnProperty("commit")) + object.commit = $root.tendermint.types.Commit.toObject(message.commit, options); + return object; + }; + + /** + * Converts this SignedHeader to JSON. + * @function toJSON + * @memberof tendermint.types.SignedHeader + * @instance + * @returns {Object.} JSON object + */ + SignedHeader.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SignedHeader; + })(types.SignedHeader || {}); + + types.LightBlock = (function(LightBlock) { + + /** + * Properties of a LightBlock. + * @memberof tendermint.types + * @interface ILightBlock + * @property {tendermint.types.ISignedHeader|null} [signedHeader] LightBlock signedHeader + * @property {tendermint.types.IValidatorSet|null} [validatorSet] LightBlock validatorSet + */ + + /** + * Constructs a new LightBlock. + * @memberof tendermint.types + * @classdesc Represents a LightBlock. + * @implements ILightBlock + * @constructor + * @param {tendermint.types.ILightBlock=} [properties] Properties to set + */ + function LightBlock(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LightBlock signedHeader. + * @member {tendermint.types.ISignedHeader|null|undefined} signedHeader + * @memberof tendermint.types.LightBlock + * @instance + */ + LightBlock.prototype.signedHeader = null; + + /** + * LightBlock validatorSet. + * @member {tendermint.types.IValidatorSet|null|undefined} validatorSet + * @memberof tendermint.types.LightBlock + * @instance + */ + LightBlock.prototype.validatorSet = null; + + /** + * Creates a new LightBlock instance using the specified properties. + * @function create + * @memberof tendermint.types.LightBlock + * @static + * @param {tendermint.types.ILightBlock=} [properties] Properties to set + * @returns {tendermint.types.LightBlock} LightBlock instance + */ + LightBlock.create = function create(properties) { + return new LightBlock(properties); + }; + + /** + * Encodes the specified LightBlock message. Does not implicitly {@link tendermint.types.LightBlock.verify|verify} messages. + * @function encode + * @memberof tendermint.types.LightBlock + * @static + * @param {tendermint.types.ILightBlock} message LightBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LightBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.signedHeader != null && Object.hasOwnProperty.call(message, "signedHeader")) + $root.tendermint.types.SignedHeader.encode(message.signedHeader, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.validatorSet != null && Object.hasOwnProperty.call(message, "validatorSet")) + $root.tendermint.types.ValidatorSet.encode(message.validatorSet, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LightBlock message, length delimited. Does not implicitly {@link tendermint.types.LightBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.LightBlock + * @static + * @param {tendermint.types.ILightBlock} message LightBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LightBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LightBlock message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.LightBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.LightBlock} LightBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LightBlock.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.LightBlock(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signedHeader = $root.tendermint.types.SignedHeader.decode(reader, reader.uint32()); + break; + case 2: + message.validatorSet = $root.tendermint.types.ValidatorSet.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LightBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.LightBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.LightBlock} LightBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LightBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LightBlock message. + * @function verify + * @memberof tendermint.types.LightBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LightBlock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.signedHeader != null && message.hasOwnProperty("signedHeader")) { + var error = $root.tendermint.types.SignedHeader.verify(message.signedHeader); + if (error) + return "signedHeader." + error; + } + if (message.validatorSet != null && message.hasOwnProperty("validatorSet")) { + var error = $root.tendermint.types.ValidatorSet.verify(message.validatorSet); + if (error) + return "validatorSet." + error; + } + return null; + }; + + /** + * Creates a LightBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.LightBlock + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.LightBlock} LightBlock + */ + LightBlock.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.LightBlock) + return object; + var message = new $root.tendermint.types.LightBlock(); + if (object.signedHeader != null) { + if (typeof object.signedHeader !== "object") + throw TypeError(".tendermint.types.LightBlock.signedHeader: object expected"); + message.signedHeader = $root.tendermint.types.SignedHeader.fromObject(object.signedHeader); + } + if (object.validatorSet != null) { + if (typeof object.validatorSet !== "object") + throw TypeError(".tendermint.types.LightBlock.validatorSet: object expected"); + message.validatorSet = $root.tendermint.types.ValidatorSet.fromObject(object.validatorSet); + } + return message; + }; + + /** + * Creates a plain object from a LightBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.LightBlock + * @static + * @param {tendermint.types.LightBlock} message LightBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LightBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.signedHeader = null; + object.validatorSet = null; + } + if (message.signedHeader != null && message.hasOwnProperty("signedHeader")) + object.signedHeader = $root.tendermint.types.SignedHeader.toObject(message.signedHeader, options); + if (message.validatorSet != null && message.hasOwnProperty("validatorSet")) + object.validatorSet = $root.tendermint.types.ValidatorSet.toObject(message.validatorSet, options); + return object; + }; + + /** + * Converts this LightBlock to JSON. + * @function toJSON + * @memberof tendermint.types.LightBlock + * @instance + * @returns {Object.} JSON object + */ + LightBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LightBlock; + })(types.LightBlock || {}); + + types.BlockMeta = (function(BlockMeta) { + + /** + * Properties of a BlockMeta. + * @memberof tendermint.types + * @interface IBlockMeta + * @property {tendermint.types.IBlockID|null} [blockId] BlockMeta blockId + * @property {number|Long|null} [blockSize] BlockMeta blockSize + * @property {tendermint.types.IHeader|null} [header] BlockMeta header + * @property {number|Long|null} [numTxs] BlockMeta numTxs + */ + + /** + * Constructs a new BlockMeta. + * @memberof tendermint.types + * @classdesc Represents a BlockMeta. + * @implements IBlockMeta + * @constructor + * @param {tendermint.types.IBlockMeta=} [properties] Properties to set + */ + function BlockMeta(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BlockMeta blockId. + * @member {tendermint.types.IBlockID|null|undefined} blockId + * @memberof tendermint.types.BlockMeta + * @instance + */ + BlockMeta.prototype.blockId = null; + + /** + * BlockMeta blockSize. + * @member {number|Long} blockSize + * @memberof tendermint.types.BlockMeta + * @instance + */ + BlockMeta.prototype.blockSize = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BlockMeta header. + * @member {tendermint.types.IHeader|null|undefined} header + * @memberof tendermint.types.BlockMeta + * @instance + */ + BlockMeta.prototype.header = null; + + /** + * BlockMeta numTxs. + * @member {number|Long} numTxs + * @memberof tendermint.types.BlockMeta + * @instance + */ + BlockMeta.prototype.numTxs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new BlockMeta instance using the specified properties. + * @function create + * @memberof tendermint.types.BlockMeta + * @static + * @param {tendermint.types.IBlockMeta=} [properties] Properties to set + * @returns {tendermint.types.BlockMeta} BlockMeta instance + */ + BlockMeta.create = function create(properties) { + return new BlockMeta(properties); + }; + + /** + * Encodes the specified BlockMeta message. Does not implicitly {@link tendermint.types.BlockMeta.verify|verify} messages. + * @function encode + * @memberof tendermint.types.BlockMeta + * @static + * @param {tendermint.types.IBlockMeta} message BlockMeta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlockMeta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.blockId != null && Object.hasOwnProperty.call(message, "blockId")) + $root.tendermint.types.BlockID.encode(message.blockId, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.blockSize != null && Object.hasOwnProperty.call(message, "blockSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.blockSize); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + $root.tendermint.types.Header.encode(message.header, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.numTxs != null && Object.hasOwnProperty.call(message, "numTxs")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.numTxs); + return writer; + }; + + /** + * Encodes the specified BlockMeta message, length delimited. Does not implicitly {@link tendermint.types.BlockMeta.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.BlockMeta + * @static + * @param {tendermint.types.IBlockMeta} message BlockMeta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlockMeta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BlockMeta message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.BlockMeta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.BlockMeta} BlockMeta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlockMeta.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.BlockMeta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockId = $root.tendermint.types.BlockID.decode(reader, reader.uint32()); + break; + case 2: + message.blockSize = reader.int64(); + break; + case 3: + message.header = $root.tendermint.types.Header.decode(reader, reader.uint32()); + break; + case 4: + message.numTxs = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BlockMeta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.BlockMeta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.BlockMeta} BlockMeta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlockMeta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BlockMeta message. + * @function verify + * @memberof tendermint.types.BlockMeta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BlockMeta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.blockId != null && message.hasOwnProperty("blockId")) { + var error = $root.tendermint.types.BlockID.verify(message.blockId); + if (error) + return "blockId." + error; + } + if (message.blockSize != null && message.hasOwnProperty("blockSize")) + if (!$util.isInteger(message.blockSize) && !(message.blockSize && $util.isInteger(message.blockSize.low) && $util.isInteger(message.blockSize.high))) + return "blockSize: integer|Long expected"; + if (message.header != null && message.hasOwnProperty("header")) { + var error = $root.tendermint.types.Header.verify(message.header); + if (error) + return "header." + error; + } + if (message.numTxs != null && message.hasOwnProperty("numTxs")) + if (!$util.isInteger(message.numTxs) && !(message.numTxs && $util.isInteger(message.numTxs.low) && $util.isInteger(message.numTxs.high))) + return "numTxs: integer|Long expected"; + return null; + }; + + /** + * Creates a BlockMeta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.BlockMeta + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.BlockMeta} BlockMeta + */ + BlockMeta.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.BlockMeta) + return object; + var message = new $root.tendermint.types.BlockMeta(); + if (object.blockId != null) { + if (typeof object.blockId !== "object") + throw TypeError(".tendermint.types.BlockMeta.blockId: object expected"); + message.blockId = $root.tendermint.types.BlockID.fromObject(object.blockId); + } + if (object.blockSize != null) + if ($util.Long) + (message.blockSize = $util.Long.fromValue(object.blockSize)).unsigned = false; + else if (typeof object.blockSize === "string") + message.blockSize = parseInt(object.blockSize, 10); + else if (typeof object.blockSize === "number") + message.blockSize = object.blockSize; + else if (typeof object.blockSize === "object") + message.blockSize = new $util.LongBits(object.blockSize.low >>> 0, object.blockSize.high >>> 0).toNumber(); + if (object.header != null) { + if (typeof object.header !== "object") + throw TypeError(".tendermint.types.BlockMeta.header: object expected"); + message.header = $root.tendermint.types.Header.fromObject(object.header); + } + if (object.numTxs != null) + if ($util.Long) + (message.numTxs = $util.Long.fromValue(object.numTxs)).unsigned = false; + else if (typeof object.numTxs === "string") + message.numTxs = parseInt(object.numTxs, 10); + else if (typeof object.numTxs === "number") + message.numTxs = object.numTxs; + else if (typeof object.numTxs === "object") + message.numTxs = new $util.LongBits(object.numTxs.low >>> 0, object.numTxs.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a BlockMeta message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.BlockMeta + * @static + * @param {tendermint.types.BlockMeta} message BlockMeta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BlockMeta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.blockId = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.blockSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.blockSize = options.longs === String ? "0" : 0; + object.header = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.numTxs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.numTxs = options.longs === String ? "0" : 0; + } + if (message.blockId != null && message.hasOwnProperty("blockId")) + object.blockId = $root.tendermint.types.BlockID.toObject(message.blockId, options); + if (message.blockSize != null && message.hasOwnProperty("blockSize")) + if (typeof message.blockSize === "number") + object.blockSize = options.longs === String ? String(message.blockSize) : message.blockSize; + else + object.blockSize = options.longs === String ? $util.Long.prototype.toString.call(message.blockSize) : options.longs === Number ? new $util.LongBits(message.blockSize.low >>> 0, message.blockSize.high >>> 0).toNumber() : message.blockSize; + if (message.header != null && message.hasOwnProperty("header")) + object.header = $root.tendermint.types.Header.toObject(message.header, options); + if (message.numTxs != null && message.hasOwnProperty("numTxs")) + if (typeof message.numTxs === "number") + object.numTxs = options.longs === String ? String(message.numTxs) : message.numTxs; + else + object.numTxs = options.longs === String ? $util.Long.prototype.toString.call(message.numTxs) : options.longs === Number ? new $util.LongBits(message.numTxs.low >>> 0, message.numTxs.high >>> 0).toNumber() : message.numTxs; + return object; + }; + + /** + * Converts this BlockMeta to JSON. + * @function toJSON + * @memberof tendermint.types.BlockMeta + * @instance + * @returns {Object.} JSON object + */ + BlockMeta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BlockMeta; + })(types.BlockMeta || {}); + + types.TxProof = (function(TxProof) { + + /** + * Properties of a TxProof. + * @memberof tendermint.types + * @interface ITxProof + * @property {Uint8Array|null} [rootHash] TxProof rootHash + * @property {Uint8Array|null} [data] TxProof data + * @property {tendermint.crypto.IProof|null} [proof] TxProof proof + */ + + /** + * Constructs a new TxProof. + * @memberof tendermint.types + * @classdesc Represents a TxProof. + * @implements ITxProof + * @constructor + * @param {tendermint.types.ITxProof=} [properties] Properties to set + */ + function TxProof(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TxProof rootHash. + * @member {Uint8Array} rootHash + * @memberof tendermint.types.TxProof + * @instance + */ + TxProof.prototype.rootHash = $util.newBuffer([]); + + /** + * TxProof data. + * @member {Uint8Array} data + * @memberof tendermint.types.TxProof + * @instance + */ + TxProof.prototype.data = $util.newBuffer([]); + + /** + * TxProof proof. + * @member {tendermint.crypto.IProof|null|undefined} proof + * @memberof tendermint.types.TxProof + * @instance + */ + TxProof.prototype.proof = null; + + /** + * Creates a new TxProof instance using the specified properties. + * @function create + * @memberof tendermint.types.TxProof + * @static + * @param {tendermint.types.ITxProof=} [properties] Properties to set + * @returns {tendermint.types.TxProof} TxProof instance + */ + TxProof.create = function create(properties) { + return new TxProof(properties); + }; + + /** + * Encodes the specified TxProof message. Does not implicitly {@link tendermint.types.TxProof.verify|verify} messages. + * @function encode + * @memberof tendermint.types.TxProof + * @static + * @param {tendermint.types.ITxProof} message TxProof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TxProof.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rootHash != null && Object.hasOwnProperty.call(message, "rootHash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.rootHash); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.tendermint.crypto.Proof.encode(message.proof, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TxProof message, length delimited. Does not implicitly {@link tendermint.types.TxProof.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.TxProof + * @static + * @param {tendermint.types.ITxProof} message TxProof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TxProof.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TxProof message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.TxProof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.TxProof} TxProof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TxProof.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.TxProof(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rootHash = reader.bytes(); + break; + case 2: + message.data = reader.bytes(); + break; + case 3: + message.proof = $root.tendermint.crypto.Proof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TxProof message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.TxProof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.TxProof} TxProof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TxProof.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TxProof message. + * @function verify + * @memberof tendermint.types.TxProof + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TxProof.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rootHash != null && message.hasOwnProperty("rootHash")) + if (!(message.rootHash && typeof message.rootHash.length === "number" || $util.isString(message.rootHash))) + return "rootHash: buffer expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + if (message.proof != null && message.hasOwnProperty("proof")) { + var error = $root.tendermint.crypto.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + return null; + }; + + /** + * Creates a TxProof message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.TxProof + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.TxProof} TxProof + */ + TxProof.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.TxProof) + return object; + var message = new $root.tendermint.types.TxProof(); + if (object.rootHash != null) + if (typeof object.rootHash === "string") + $util.base64.decode(object.rootHash, message.rootHash = $util.newBuffer($util.base64.length(object.rootHash)), 0); + else if (object.rootHash.length) + message.rootHash = object.rootHash; + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length) + message.data = object.data; + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".tendermint.types.TxProof.proof: object expected"); + message.proof = $root.tendermint.crypto.Proof.fromObject(object.proof); + } + return message; + }; + + /** + * Creates a plain object from a TxProof message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.TxProof + * @static + * @param {tendermint.types.TxProof} message TxProof + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TxProof.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.rootHash = ""; + else { + object.rootHash = []; + if (options.bytes !== Array) + object.rootHash = $util.newBuffer(object.rootHash); + } + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + object.proof = null; + } + if (message.rootHash != null && message.hasOwnProperty("rootHash")) + object.rootHash = options.bytes === String ? $util.base64.encode(message.rootHash, 0, message.rootHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.rootHash) : message.rootHash; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + if (message.proof != null && message.hasOwnProperty("proof")) + object.proof = $root.tendermint.crypto.Proof.toObject(message.proof, options); + return object; + }; + + /** + * Converts this TxProof to JSON. + * @function toJSON + * @memberof tendermint.types.TxProof + * @instance + * @returns {Object.} JSON object + */ + TxProof.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TxProof; + })(types.TxProof || {}); + + types.ValidatorSet = (function(ValidatorSet) { + + /** + * Properties of a ValidatorSet. + * @memberof tendermint.types + * @interface IValidatorSet + * @property {Array.|null} [validators] ValidatorSet validators + * @property {tendermint.types.IValidator|null} [proposer] ValidatorSet proposer + * @property {number|Long|null} [totalVotingPower] ValidatorSet totalVotingPower + */ + + /** + * Constructs a new ValidatorSet. + * @memberof tendermint.types + * @classdesc Represents a ValidatorSet. + * @implements IValidatorSet + * @constructor + * @param {tendermint.types.IValidatorSet=} [properties] Properties to set + */ + function ValidatorSet(properties) { + this.validators = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidatorSet validators. + * @member {Array.} validators + * @memberof tendermint.types.ValidatorSet + * @instance + */ + ValidatorSet.prototype.validators = $util.emptyArray; + + /** + * ValidatorSet proposer. + * @member {tendermint.types.IValidator|null|undefined} proposer + * @memberof tendermint.types.ValidatorSet + * @instance + */ + ValidatorSet.prototype.proposer = null; + + /** + * ValidatorSet totalVotingPower. + * @member {number|Long} totalVotingPower + * @memberof tendermint.types.ValidatorSet + * @instance + */ + ValidatorSet.prototype.totalVotingPower = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ValidatorSet instance using the specified properties. + * @function create + * @memberof tendermint.types.ValidatorSet + * @static + * @param {tendermint.types.IValidatorSet=} [properties] Properties to set + * @returns {tendermint.types.ValidatorSet} ValidatorSet instance + */ + ValidatorSet.create = function create(properties) { + return new ValidatorSet(properties); + }; + + /** + * Encodes the specified ValidatorSet message. Does not implicitly {@link tendermint.types.ValidatorSet.verify|verify} messages. + * @function encode + * @memberof tendermint.types.ValidatorSet + * @static + * @param {tendermint.types.IValidatorSet} message ValidatorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validators != null && message.validators.length) + for (var i = 0; i < message.validators.length; ++i) + $root.tendermint.types.Validator.encode(message.validators[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proposer != null && Object.hasOwnProperty.call(message, "proposer")) + $root.tendermint.types.Validator.encode(message.proposer, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.totalVotingPower != null && Object.hasOwnProperty.call(message, "totalVotingPower")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.totalVotingPower); + return writer; + }; + + /** + * Encodes the specified ValidatorSet message, length delimited. Does not implicitly {@link tendermint.types.ValidatorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.ValidatorSet + * @static + * @param {tendermint.types.IValidatorSet} message ValidatorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidatorSet message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.ValidatorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.ValidatorSet} ValidatorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.ValidatorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.validators && message.validators.length)) + message.validators = []; + message.validators.push($root.tendermint.types.Validator.decode(reader, reader.uint32())); + break; + case 2: + message.proposer = $root.tendermint.types.Validator.decode(reader, reader.uint32()); + break; + case 3: + message.totalVotingPower = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidatorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.ValidatorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.ValidatorSet} ValidatorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidatorSet message. + * @function verify + * @memberof tendermint.types.ValidatorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidatorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validators != null && message.hasOwnProperty("validators")) { + if (!Array.isArray(message.validators)) + return "validators: array expected"; + for (var i = 0; i < message.validators.length; ++i) { + var error = $root.tendermint.types.Validator.verify(message.validators[i]); + if (error) + return "validators." + error; + } + } + if (message.proposer != null && message.hasOwnProperty("proposer")) { + var error = $root.tendermint.types.Validator.verify(message.proposer); + if (error) + return "proposer." + error; + } + if (message.totalVotingPower != null && message.hasOwnProperty("totalVotingPower")) + if (!$util.isInteger(message.totalVotingPower) && !(message.totalVotingPower && $util.isInteger(message.totalVotingPower.low) && $util.isInteger(message.totalVotingPower.high))) + return "totalVotingPower: integer|Long expected"; + return null; + }; + + /** + * Creates a ValidatorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.ValidatorSet + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.ValidatorSet} ValidatorSet + */ + ValidatorSet.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.ValidatorSet) + return object; + var message = new $root.tendermint.types.ValidatorSet(); + if (object.validators) { + if (!Array.isArray(object.validators)) + throw TypeError(".tendermint.types.ValidatorSet.validators: array expected"); + message.validators = []; + for (var i = 0; i < object.validators.length; ++i) { + if (typeof object.validators[i] !== "object") + throw TypeError(".tendermint.types.ValidatorSet.validators: object expected"); + message.validators[i] = $root.tendermint.types.Validator.fromObject(object.validators[i]); + } + } + if (object.proposer != null) { + if (typeof object.proposer !== "object") + throw TypeError(".tendermint.types.ValidatorSet.proposer: object expected"); + message.proposer = $root.tendermint.types.Validator.fromObject(object.proposer); + } + if (object.totalVotingPower != null) + if ($util.Long) + (message.totalVotingPower = $util.Long.fromValue(object.totalVotingPower)).unsigned = false; + else if (typeof object.totalVotingPower === "string") + message.totalVotingPower = parseInt(object.totalVotingPower, 10); + else if (typeof object.totalVotingPower === "number") + message.totalVotingPower = object.totalVotingPower; + else if (typeof object.totalVotingPower === "object") + message.totalVotingPower = new $util.LongBits(object.totalVotingPower.low >>> 0, object.totalVotingPower.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ValidatorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.ValidatorSet + * @static + * @param {tendermint.types.ValidatorSet} message ValidatorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidatorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.validators = []; + if (options.defaults) { + object.proposer = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalVotingPower = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalVotingPower = options.longs === String ? "0" : 0; + } + if (message.validators && message.validators.length) { + object.validators = []; + for (var j = 0; j < message.validators.length; ++j) + object.validators[j] = $root.tendermint.types.Validator.toObject(message.validators[j], options); + } + if (message.proposer != null && message.hasOwnProperty("proposer")) + object.proposer = $root.tendermint.types.Validator.toObject(message.proposer, options); + if (message.totalVotingPower != null && message.hasOwnProperty("totalVotingPower")) + if (typeof message.totalVotingPower === "number") + object.totalVotingPower = options.longs === String ? String(message.totalVotingPower) : message.totalVotingPower; + else + object.totalVotingPower = options.longs === String ? $util.Long.prototype.toString.call(message.totalVotingPower) : options.longs === Number ? new $util.LongBits(message.totalVotingPower.low >>> 0, message.totalVotingPower.high >>> 0).toNumber() : message.totalVotingPower; + return object; + }; + + /** + * Converts this ValidatorSet to JSON. + * @function toJSON + * @memberof tendermint.types.ValidatorSet + * @instance + * @returns {Object.} JSON object + */ + ValidatorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidatorSet; + })(types.ValidatorSet || {}); + + types.Validator = (function(Validator) { + + /** + * Properties of a Validator. + * @memberof tendermint.types + * @interface IValidator + * @property {Uint8Array|null} [address] Validator address + * @property {tendermint.crypto.IPublicKey|null} [pubKey] Validator pubKey + * @property {number|Long|null} [votingPower] Validator votingPower + * @property {number|Long|null} [proposerPriority] Validator proposerPriority + */ + + /** + * Constructs a new Validator. + * @memberof tendermint.types + * @classdesc Represents a Validator. + * @implements IValidator + * @constructor + * @param {tendermint.types.IValidator=} [properties] Properties to set + */ + function Validator(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Validator address. + * @member {Uint8Array} address + * @memberof tendermint.types.Validator + * @instance + */ + Validator.prototype.address = $util.newBuffer([]); + + /** + * Validator pubKey. + * @member {tendermint.crypto.IPublicKey|null|undefined} pubKey + * @memberof tendermint.types.Validator + * @instance + */ + Validator.prototype.pubKey = null; + + /** + * Validator votingPower. + * @member {number|Long} votingPower + * @memberof tendermint.types.Validator + * @instance + */ + Validator.prototype.votingPower = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Validator proposerPriority. + * @member {number|Long} proposerPriority + * @memberof tendermint.types.Validator + * @instance + */ + Validator.prototype.proposerPriority = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Validator instance using the specified properties. + * @function create + * @memberof tendermint.types.Validator + * @static + * @param {tendermint.types.IValidator=} [properties] Properties to set + * @returns {tendermint.types.Validator} Validator instance + */ + Validator.create = function create(properties) { + return new Validator(properties); + }; + + /** + * Encodes the specified Validator message. Does not implicitly {@link tendermint.types.Validator.verify|verify} messages. + * @function encode + * @memberof tendermint.types.Validator + * @static + * @param {tendermint.types.IValidator} message Validator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Validator.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.address); + if (message.pubKey != null && Object.hasOwnProperty.call(message, "pubKey")) + $root.tendermint.crypto.PublicKey.encode(message.pubKey, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.votingPower != null && Object.hasOwnProperty.call(message, "votingPower")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.votingPower); + if (message.proposerPriority != null && Object.hasOwnProperty.call(message, "proposerPriority")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.proposerPriority); + return writer; + }; + + /** + * Encodes the specified Validator message, length delimited. Does not implicitly {@link tendermint.types.Validator.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.Validator + * @static + * @param {tendermint.types.IValidator} message Validator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Validator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Validator message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.Validator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.Validator} Validator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Validator.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Validator(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.bytes(); + break; + case 2: + message.pubKey = $root.tendermint.crypto.PublicKey.decode(reader, reader.uint32()); + break; + case 3: + message.votingPower = reader.int64(); + break; + case 4: + message.proposerPriority = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Validator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.Validator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.Validator} Validator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Validator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Validator message. + * @function verify + * @memberof tendermint.types.Validator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Validator.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!(message.address && typeof message.address.length === "number" || $util.isString(message.address))) + return "address: buffer expected"; + if (message.pubKey != null && message.hasOwnProperty("pubKey")) { + var error = $root.tendermint.crypto.PublicKey.verify(message.pubKey); + if (error) + return "pubKey." + error; + } + if (message.votingPower != null && message.hasOwnProperty("votingPower")) + if (!$util.isInteger(message.votingPower) && !(message.votingPower && $util.isInteger(message.votingPower.low) && $util.isInteger(message.votingPower.high))) + return "votingPower: integer|Long expected"; + if (message.proposerPriority != null && message.hasOwnProperty("proposerPriority")) + if (!$util.isInteger(message.proposerPriority) && !(message.proposerPriority && $util.isInteger(message.proposerPriority.low) && $util.isInteger(message.proposerPriority.high))) + return "proposerPriority: integer|Long expected"; + return null; + }; + + /** + * Creates a Validator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.Validator + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.Validator} Validator + */ + Validator.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.Validator) + return object; + var message = new $root.tendermint.types.Validator(); + if (object.address != null) + if (typeof object.address === "string") + $util.base64.decode(object.address, message.address = $util.newBuffer($util.base64.length(object.address)), 0); + else if (object.address.length) + message.address = object.address; + if (object.pubKey != null) { + if (typeof object.pubKey !== "object") + throw TypeError(".tendermint.types.Validator.pubKey: object expected"); + message.pubKey = $root.tendermint.crypto.PublicKey.fromObject(object.pubKey); + } + if (object.votingPower != null) + if ($util.Long) + (message.votingPower = $util.Long.fromValue(object.votingPower)).unsigned = false; + else if (typeof object.votingPower === "string") + message.votingPower = parseInt(object.votingPower, 10); + else if (typeof object.votingPower === "number") + message.votingPower = object.votingPower; + else if (typeof object.votingPower === "object") + message.votingPower = new $util.LongBits(object.votingPower.low >>> 0, object.votingPower.high >>> 0).toNumber(); + if (object.proposerPriority != null) + if ($util.Long) + (message.proposerPriority = $util.Long.fromValue(object.proposerPriority)).unsigned = false; + else if (typeof object.proposerPriority === "string") + message.proposerPriority = parseInt(object.proposerPriority, 10); + else if (typeof object.proposerPriority === "number") + message.proposerPriority = object.proposerPriority; + else if (typeof object.proposerPriority === "object") + message.proposerPriority = new $util.LongBits(object.proposerPriority.low >>> 0, object.proposerPriority.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a Validator message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.Validator + * @static + * @param {tendermint.types.Validator} message Validator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Validator.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.address = ""; + else { + object.address = []; + if (options.bytes !== Array) + object.address = $util.newBuffer(object.address); + } + object.pubKey = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.votingPower = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.votingPower = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.proposerPriority = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.proposerPriority = options.longs === String ? "0" : 0; + } + if (message.address != null && message.hasOwnProperty("address")) + object.address = options.bytes === String ? $util.base64.encode(message.address, 0, message.address.length) : options.bytes === Array ? Array.prototype.slice.call(message.address) : message.address; + if (message.pubKey != null && message.hasOwnProperty("pubKey")) + object.pubKey = $root.tendermint.crypto.PublicKey.toObject(message.pubKey, options); + if (message.votingPower != null && message.hasOwnProperty("votingPower")) + if (typeof message.votingPower === "number") + object.votingPower = options.longs === String ? String(message.votingPower) : message.votingPower; + else + object.votingPower = options.longs === String ? $util.Long.prototype.toString.call(message.votingPower) : options.longs === Number ? new $util.LongBits(message.votingPower.low >>> 0, message.votingPower.high >>> 0).toNumber() : message.votingPower; + if (message.proposerPriority != null && message.hasOwnProperty("proposerPriority")) + if (typeof message.proposerPriority === "number") + object.proposerPriority = options.longs === String ? String(message.proposerPriority) : message.proposerPriority; + else + object.proposerPriority = options.longs === String ? $util.Long.prototype.toString.call(message.proposerPriority) : options.longs === Number ? new $util.LongBits(message.proposerPriority.low >>> 0, message.proposerPriority.high >>> 0).toNumber() : message.proposerPriority; + return object; + }; + + /** + * Converts this Validator to JSON. + * @function toJSON + * @memberof tendermint.types.Validator + * @instance + * @returns {Object.} JSON object + */ + Validator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Validator; + })(types.Validator || {}); + + types.SimpleValidator = (function(SimpleValidator) { + + /** + * Properties of a SimpleValidator. + * @memberof tendermint.types + * @interface ISimpleValidator + * @property {tendermint.crypto.IPublicKey|null} [pubKey] SimpleValidator pubKey + * @property {number|Long|null} [votingPower] SimpleValidator votingPower + */ + + /** + * Constructs a new SimpleValidator. + * @memberof tendermint.types + * @classdesc Represents a SimpleValidator. + * @implements ISimpleValidator + * @constructor + * @param {tendermint.types.ISimpleValidator=} [properties] Properties to set + */ + function SimpleValidator(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SimpleValidator pubKey. + * @member {tendermint.crypto.IPublicKey|null|undefined} pubKey + * @memberof tendermint.types.SimpleValidator + * @instance + */ + SimpleValidator.prototype.pubKey = null; + + /** + * SimpleValidator votingPower. + * @member {number|Long} votingPower + * @memberof tendermint.types.SimpleValidator + * @instance + */ + SimpleValidator.prototype.votingPower = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new SimpleValidator instance using the specified properties. + * @function create + * @memberof tendermint.types.SimpleValidator + * @static + * @param {tendermint.types.ISimpleValidator=} [properties] Properties to set + * @returns {tendermint.types.SimpleValidator} SimpleValidator instance + */ + SimpleValidator.create = function create(properties) { + return new SimpleValidator(properties); + }; + + /** + * Encodes the specified SimpleValidator message. Does not implicitly {@link tendermint.types.SimpleValidator.verify|verify} messages. + * @function encode + * @memberof tendermint.types.SimpleValidator + * @static + * @param {tendermint.types.ISimpleValidator} message SimpleValidator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SimpleValidator.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pubKey != null && Object.hasOwnProperty.call(message, "pubKey")) + $root.tendermint.crypto.PublicKey.encode(message.pubKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.votingPower != null && Object.hasOwnProperty.call(message, "votingPower")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.votingPower); + return writer; + }; + + /** + * Encodes the specified SimpleValidator message, length delimited. Does not implicitly {@link tendermint.types.SimpleValidator.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.SimpleValidator + * @static + * @param {tendermint.types.ISimpleValidator} message SimpleValidator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SimpleValidator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SimpleValidator message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.SimpleValidator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.SimpleValidator} SimpleValidator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SimpleValidator.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.SimpleValidator(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pubKey = $root.tendermint.crypto.PublicKey.decode(reader, reader.uint32()); + break; + case 2: + message.votingPower = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SimpleValidator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.SimpleValidator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.SimpleValidator} SimpleValidator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SimpleValidator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SimpleValidator message. + * @function verify + * @memberof tendermint.types.SimpleValidator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SimpleValidator.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pubKey != null && message.hasOwnProperty("pubKey")) { + var error = $root.tendermint.crypto.PublicKey.verify(message.pubKey); + if (error) + return "pubKey." + error; + } + if (message.votingPower != null && message.hasOwnProperty("votingPower")) + if (!$util.isInteger(message.votingPower) && !(message.votingPower && $util.isInteger(message.votingPower.low) && $util.isInteger(message.votingPower.high))) + return "votingPower: integer|Long expected"; + return null; + }; + + /** + * Creates a SimpleValidator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.SimpleValidator + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.SimpleValidator} SimpleValidator + */ + SimpleValidator.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.SimpleValidator) + return object; + var message = new $root.tendermint.types.SimpleValidator(); + if (object.pubKey != null) { + if (typeof object.pubKey !== "object") + throw TypeError(".tendermint.types.SimpleValidator.pubKey: object expected"); + message.pubKey = $root.tendermint.crypto.PublicKey.fromObject(object.pubKey); + } + if (object.votingPower != null) + if ($util.Long) + (message.votingPower = $util.Long.fromValue(object.votingPower)).unsigned = false; + else if (typeof object.votingPower === "string") + message.votingPower = parseInt(object.votingPower, 10); + else if (typeof object.votingPower === "number") + message.votingPower = object.votingPower; + else if (typeof object.votingPower === "object") + message.votingPower = new $util.LongBits(object.votingPower.low >>> 0, object.votingPower.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a SimpleValidator message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.SimpleValidator + * @static + * @param {tendermint.types.SimpleValidator} message SimpleValidator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SimpleValidator.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pubKey = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.votingPower = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.votingPower = options.longs === String ? "0" : 0; + } + if (message.pubKey != null && message.hasOwnProperty("pubKey")) + object.pubKey = $root.tendermint.crypto.PublicKey.toObject(message.pubKey, options); + if (message.votingPower != null && message.hasOwnProperty("votingPower")) + if (typeof message.votingPower === "number") + object.votingPower = options.longs === String ? String(message.votingPower) : message.votingPower; + else + object.votingPower = options.longs === String ? $util.Long.prototype.toString.call(message.votingPower) : options.longs === Number ? new $util.LongBits(message.votingPower.low >>> 0, message.votingPower.high >>> 0).toNumber() : message.votingPower; + return object; + }; + + /** + * Converts this SimpleValidator to JSON. + * @function toJSON + * @memberof tendermint.types.SimpleValidator + * @instance + * @returns {Object.} JSON object + */ + SimpleValidator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SimpleValidator; + })(types.SimpleValidator || {}); + + return types; + })(tendermint.types || {}); + + /** + * Namespace version. + * @memberof tendermint + * @namespace + */ + + tendermint.version = (function(version) { + + version.App = (function(App) { + + /** + * Properties of an App. + * @memberof tendermint.version + * @interface IApp + * @property {number|Long|null} [protocol] App protocol + * @property {string|null} [software] App software + */ + + /** + * Constructs a new App. + * @memberof tendermint.version + * @classdesc Represents an App. + * @implements IApp + * @constructor + * @param {tendermint.version.IApp=} [properties] Properties to set + */ + function App(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * App protocol. + * @member {number|Long} protocol + * @memberof tendermint.version.App + * @instance + */ + App.prototype.protocol = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * App software. + * @member {string} software + * @memberof tendermint.version.App + * @instance + */ + App.prototype.software = ""; + + /** + * Creates a new App instance using the specified properties. + * @function create + * @memberof tendermint.version.App + * @static + * @param {tendermint.version.IApp=} [properties] Properties to set + * @returns {tendermint.version.App} App instance + */ + App.create = function create(properties) { + return new App(properties); + }; + + /** + * Encodes the specified App message. Does not implicitly {@link tendermint.version.App.verify|verify} messages. + * @function encode + * @memberof tendermint.version.App + * @static + * @param {tendermint.version.IApp} message App message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + App.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.protocol != null && Object.hasOwnProperty.call(message, "protocol")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.protocol); + if (message.software != null && Object.hasOwnProperty.call(message, "software")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.software); + return writer; + }; + + /** + * Encodes the specified App message, length delimited. Does not implicitly {@link tendermint.version.App.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.version.App + * @static + * @param {tendermint.version.IApp} message App message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + App.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an App message from the specified reader or buffer. + * @function decode + * @memberof tendermint.version.App + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.version.App} App + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + App.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.version.App(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.protocol = reader.uint64(); + break; + case 2: + message.software = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an App message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.version.App + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.version.App} App + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + App.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an App message. + * @function verify + * @memberof tendermint.version.App + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + App.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.protocol != null && message.hasOwnProperty("protocol")) + if (!$util.isInteger(message.protocol) && !(message.protocol && $util.isInteger(message.protocol.low) && $util.isInteger(message.protocol.high))) + return "protocol: integer|Long expected"; + if (message.software != null && message.hasOwnProperty("software")) + if (!$util.isString(message.software)) + return "software: string expected"; + return null; + }; + + /** + * Creates an App message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.version.App + * @static + * @param {Object.} object Plain object + * @returns {tendermint.version.App} App + */ + App.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.version.App) + return object; + var message = new $root.tendermint.version.App(); + if (object.protocol != null) + if ($util.Long) + (message.protocol = $util.Long.fromValue(object.protocol)).unsigned = true; + else if (typeof object.protocol === "string") + message.protocol = parseInt(object.protocol, 10); + else if (typeof object.protocol === "number") + message.protocol = object.protocol; + else if (typeof object.protocol === "object") + message.protocol = new $util.LongBits(object.protocol.low >>> 0, object.protocol.high >>> 0).toNumber(true); + if (object.software != null) + message.software = String(object.software); + return message; + }; + + /** + * Creates a plain object from an App message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.version.App + * @static + * @param {tendermint.version.App} message App + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + App.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.protocol = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.protocol = options.longs === String ? "0" : 0; + object.software = ""; + } + if (message.protocol != null && message.hasOwnProperty("protocol")) + if (typeof message.protocol === "number") + object.protocol = options.longs === String ? String(message.protocol) : message.protocol; + else + object.protocol = options.longs === String ? $util.Long.prototype.toString.call(message.protocol) : options.longs === Number ? new $util.LongBits(message.protocol.low >>> 0, message.protocol.high >>> 0).toNumber(true) : message.protocol; + if (message.software != null && message.hasOwnProperty("software")) + object.software = message.software; + return object; + }; + + /** + * Converts this App to JSON. + * @function toJSON + * @memberof tendermint.version.App + * @instance + * @returns {Object.} JSON object + */ + App.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return App; + })(version.App || {}); + + version.Consensus = (function(Consensus) { + + /** + * Properties of a Consensus. + * @memberof tendermint.version + * @interface IConsensus + * @property {number|Long|null} [block] Consensus block + * @property {number|Long|null} [app] Consensus app + */ + + /** + * Constructs a new Consensus. + * @memberof tendermint.version + * @classdesc Represents a Consensus. + * @implements IConsensus + * @constructor + * @param {tendermint.version.IConsensus=} [properties] Properties to set + */ + function Consensus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Consensus block. + * @member {number|Long} block + * @memberof tendermint.version.Consensus + * @instance + */ + Consensus.prototype.block = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Consensus app. + * @member {number|Long} app + * @memberof tendermint.version.Consensus + * @instance + */ + Consensus.prototype.app = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new Consensus instance using the specified properties. + * @function create + * @memberof tendermint.version.Consensus + * @static + * @param {tendermint.version.IConsensus=} [properties] Properties to set + * @returns {tendermint.version.Consensus} Consensus instance + */ + Consensus.create = function create(properties) { + return new Consensus(properties); + }; + + /** + * Encodes the specified Consensus message. Does not implicitly {@link tendermint.version.Consensus.verify|verify} messages. + * @function encode + * @memberof tendermint.version.Consensus + * @static + * @param {tendermint.version.IConsensus} message Consensus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Consensus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.block != null && Object.hasOwnProperty.call(message, "block")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.block); + if (message.app != null && Object.hasOwnProperty.call(message, "app")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.app); + return writer; + }; + + /** + * Encodes the specified Consensus message, length delimited. Does not implicitly {@link tendermint.version.Consensus.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.version.Consensus + * @static + * @param {tendermint.version.IConsensus} message Consensus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Consensus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Consensus message from the specified reader or buffer. + * @function decode + * @memberof tendermint.version.Consensus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.version.Consensus} Consensus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Consensus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.version.Consensus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.block = reader.uint64(); + break; + case 2: + message.app = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Consensus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.version.Consensus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.version.Consensus} Consensus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Consensus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Consensus message. + * @function verify + * @memberof tendermint.version.Consensus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Consensus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.block != null && message.hasOwnProperty("block")) + if (!$util.isInteger(message.block) && !(message.block && $util.isInteger(message.block.low) && $util.isInteger(message.block.high))) + return "block: integer|Long expected"; + if (message.app != null && message.hasOwnProperty("app")) + if (!$util.isInteger(message.app) && !(message.app && $util.isInteger(message.app.low) && $util.isInteger(message.app.high))) + return "app: integer|Long expected"; + return null; + }; + + /** + * Creates a Consensus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.version.Consensus + * @static + * @param {Object.} object Plain object + * @returns {tendermint.version.Consensus} Consensus + */ + Consensus.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.version.Consensus) + return object; + var message = new $root.tendermint.version.Consensus(); + if (object.block != null) + if ($util.Long) + (message.block = $util.Long.fromValue(object.block)).unsigned = true; + else if (typeof object.block === "string") + message.block = parseInt(object.block, 10); + else if (typeof object.block === "number") + message.block = object.block; + else if (typeof object.block === "object") + message.block = new $util.LongBits(object.block.low >>> 0, object.block.high >>> 0).toNumber(true); + if (object.app != null) + if ($util.Long) + (message.app = $util.Long.fromValue(object.app)).unsigned = true; + else if (typeof object.app === "string") + message.app = parseInt(object.app, 10); + else if (typeof object.app === "number") + message.app = object.app; + else if (typeof object.app === "object") + message.app = new $util.LongBits(object.app.low >>> 0, object.app.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a Consensus message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.version.Consensus + * @static + * @param {tendermint.version.Consensus} message Consensus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Consensus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.block = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.block = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.app = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.app = options.longs === String ? "0" : 0; + } + if (message.block != null && message.hasOwnProperty("block")) + if (typeof message.block === "number") + object.block = options.longs === String ? String(message.block) : message.block; + else + object.block = options.longs === String ? $util.Long.prototype.toString.call(message.block) : options.longs === Number ? new $util.LongBits(message.block.low >>> 0, message.block.high >>> 0).toNumber(true) : message.block; + if (message.app != null && message.hasOwnProperty("app")) + if (typeof message.app === "number") + object.app = options.longs === String ? String(message.app) : message.app; + else + object.app = options.longs === String ? $util.Long.prototype.toString.call(message.app) : options.longs === Number ? new $util.LongBits(message.app.low >>> 0, message.app.high >>> 0).toNumber(true) : message.app; + return object; + }; + + /** + * Converts this Consensus to JSON. + * @function toJSON + * @memberof tendermint.version.Consensus + * @instance + * @returns {Object.} JSON object + */ + Consensus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Consensus; + })(version.Consensus || {}); + + return version; + })(tendermint.version || {}); + + return tendermint; +})($root.tendermint || {}); + +/** + * Namespace ibc. + * @exports ibc + * @namespace + */ + +$root.ibc = (function(ibc) { + + /** + * Namespace applications. + * @memberof ibc + * @namespace + */ + + ibc.applications = (function(applications) { + + /** + * Namespace transfer. + * @memberof ibc.applications + * @namespace + */ + + applications.transfer = (function(transfer) { + + /** + * Namespace v1. + * @memberof ibc.applications.transfer + * @namespace + */ + + transfer.v1 = (function(v1) { + + v1.Msg = (function(Msg) { + + /** + * Constructs a new Msg service. + * @memberof ibc.applications.transfer.v1 + * @classdesc Represents a Msg + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Msg(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; + + /** + * Creates new Msg service using the specified rpc implementation. + * @function create + * @memberof ibc.applications.transfer.v1.Msg + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Msg} RPC service. Useful where requests and/or responses are streamed. + */ + Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link ibc.applications.transfer.v1.Msg#transfer}. + * @memberof ibc.applications.transfer.v1.Msg + * @typedef TransferCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.applications.transfer.v1.IMsgTransferResponse} [response] MsgTransferResponse + */ + + /** + * Calls Transfer. + * @function transfer + * @memberof ibc.applications.transfer.v1.Msg + * @instance + * @param {ibc.applications.transfer.v1.IMsgTransfer} request MsgTransfer message or plain object + * @param {ibc.applications.transfer.v1.Msg.TransferCallback} callback Node-style callback called with the error, if any, and MsgTransferResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.transfer = function transfer(request, callback) { + return this.rpcCall(transfer, $root.ibc.applications.transfer.v1.MsgTransfer, $root.ibc.applications.transfer.v1.MsgTransferResponse, request, callback); + }, "name", { value: "Transfer" }); + + /** + * Calls Transfer. + * @function transfer + * @memberof ibc.applications.transfer.v1.Msg + * @instance + * @param {ibc.applications.transfer.v1.IMsgTransfer} request MsgTransfer message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Msg; + })(v1.Msg || {}); + + v1.MsgTransfer = (function(MsgTransfer) { + + /** + * Properties of a MsgTransfer. + * @memberof ibc.applications.transfer.v1 + * @interface IMsgTransfer + * @property {string|null} [sourcePort] MsgTransfer sourcePort + * @property {string|null} [sourceChannel] MsgTransfer sourceChannel + * @property {cosmos.base.v1beta1.ICoin|null} [token] MsgTransfer token + * @property {string|null} [sender] MsgTransfer sender + * @property {string|null} [receiver] MsgTransfer receiver + * @property {ibc.core.client.v1.IHeight|null} [timeoutHeight] MsgTransfer timeoutHeight + * @property {number|Long|null} [timeoutTimestamp] MsgTransfer timeoutTimestamp + */ + + /** + * Constructs a new MsgTransfer. + * @memberof ibc.applications.transfer.v1 + * @classdesc Represents a MsgTransfer. + * @implements IMsgTransfer + * @constructor + * @param {ibc.applications.transfer.v1.IMsgTransfer=} [properties] Properties to set + */ + function MsgTransfer(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgTransfer sourcePort. + * @member {string} sourcePort + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @instance + */ + MsgTransfer.prototype.sourcePort = ""; + + /** + * MsgTransfer sourceChannel. + * @member {string} sourceChannel + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @instance + */ + MsgTransfer.prototype.sourceChannel = ""; + + /** + * MsgTransfer token. + * @member {cosmos.base.v1beta1.ICoin|null|undefined} token + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @instance + */ + MsgTransfer.prototype.token = null; + + /** + * MsgTransfer sender. + * @member {string} sender + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @instance + */ + MsgTransfer.prototype.sender = ""; + + /** + * MsgTransfer receiver. + * @member {string} receiver + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @instance + */ + MsgTransfer.prototype.receiver = ""; + + /** + * MsgTransfer timeoutHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} timeoutHeight + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @instance + */ + MsgTransfer.prototype.timeoutHeight = null; + + /** + * MsgTransfer timeoutTimestamp. + * @member {number|Long} timeoutTimestamp + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @instance + */ + MsgTransfer.prototype.timeoutTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new MsgTransfer instance using the specified properties. + * @function create + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @static + * @param {ibc.applications.transfer.v1.IMsgTransfer=} [properties] Properties to set + * @returns {ibc.applications.transfer.v1.MsgTransfer} MsgTransfer instance + */ + MsgTransfer.create = function create(properties) { + return new MsgTransfer(properties); + }; + + /** + * Encodes the specified MsgTransfer message. Does not implicitly {@link ibc.applications.transfer.v1.MsgTransfer.verify|verify} messages. + * @function encode + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @static + * @param {ibc.applications.transfer.v1.IMsgTransfer} message MsgTransfer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgTransfer.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourcePort != null && Object.hasOwnProperty.call(message, "sourcePort")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourcePort); + if (message.sourceChannel != null && Object.hasOwnProperty.call(message, "sourceChannel")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceChannel); + if (message.token != null && Object.hasOwnProperty.call(message, "token")) + $root.cosmos.base.v1beta1.Coin.encode(message.token, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.sender != null && Object.hasOwnProperty.call(message, "sender")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.sender); + if (message.receiver != null && Object.hasOwnProperty.call(message, "receiver")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.receiver); + if (message.timeoutHeight != null && Object.hasOwnProperty.call(message, "timeoutHeight")) + $root.ibc.core.client.v1.Height.encode(message.timeoutHeight, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.timeoutTimestamp != null && Object.hasOwnProperty.call(message, "timeoutTimestamp")) + writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.timeoutTimestamp); + return writer; + }; + + /** + * Encodes the specified MsgTransfer message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.MsgTransfer.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @static + * @param {ibc.applications.transfer.v1.IMsgTransfer} message MsgTransfer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgTransfer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgTransfer message from the specified reader or buffer. + * @function decode + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.applications.transfer.v1.MsgTransfer} MsgTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgTransfer.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.MsgTransfer(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sourcePort = reader.string(); + break; + case 2: + message.sourceChannel = reader.string(); + break; + case 3: + message.token = $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()); + break; + case 4: + message.sender = reader.string(); + break; + case 5: + message.receiver = reader.string(); + break; + case 6: + message.timeoutHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + case 7: + message.timeoutTimestamp = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgTransfer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.applications.transfer.v1.MsgTransfer} MsgTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgTransfer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgTransfer message. + * @function verify + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgTransfer.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sourcePort != null && message.hasOwnProperty("sourcePort")) + if (!$util.isString(message.sourcePort)) + return "sourcePort: string expected"; + if (message.sourceChannel != null && message.hasOwnProperty("sourceChannel")) + if (!$util.isString(message.sourceChannel)) + return "sourceChannel: string expected"; + if (message.token != null && message.hasOwnProperty("token")) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.token); + if (error) + return "token." + error; + } + if (message.sender != null && message.hasOwnProperty("sender")) + if (!$util.isString(message.sender)) + return "sender: string expected"; + if (message.receiver != null && message.hasOwnProperty("receiver")) + if (!$util.isString(message.receiver)) + return "receiver: string expected"; + if (message.timeoutHeight != null && message.hasOwnProperty("timeoutHeight")) { + var error = $root.ibc.core.client.v1.Height.verify(message.timeoutHeight); + if (error) + return "timeoutHeight." + error; + } + if (message.timeoutTimestamp != null && message.hasOwnProperty("timeoutTimestamp")) + if (!$util.isInteger(message.timeoutTimestamp) && !(message.timeoutTimestamp && $util.isInteger(message.timeoutTimestamp.low) && $util.isInteger(message.timeoutTimestamp.high))) + return "timeoutTimestamp: integer|Long expected"; + return null; + }; + + /** + * Creates a MsgTransfer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @static + * @param {Object.} object Plain object + * @returns {ibc.applications.transfer.v1.MsgTransfer} MsgTransfer + */ + MsgTransfer.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.applications.transfer.v1.MsgTransfer) + return object; + var message = new $root.ibc.applications.transfer.v1.MsgTransfer(); + if (object.sourcePort != null) + message.sourcePort = String(object.sourcePort); + if (object.sourceChannel != null) + message.sourceChannel = String(object.sourceChannel); + if (object.token != null) { + if (typeof object.token !== "object") + throw TypeError(".ibc.applications.transfer.v1.MsgTransfer.token: object expected"); + message.token = $root.cosmos.base.v1beta1.Coin.fromObject(object.token); + } + if (object.sender != null) + message.sender = String(object.sender); + if (object.receiver != null) + message.receiver = String(object.receiver); + if (object.timeoutHeight != null) { + if (typeof object.timeoutHeight !== "object") + throw TypeError(".ibc.applications.transfer.v1.MsgTransfer.timeoutHeight: object expected"); + message.timeoutHeight = $root.ibc.core.client.v1.Height.fromObject(object.timeoutHeight); + } + if (object.timeoutTimestamp != null) + if ($util.Long) + (message.timeoutTimestamp = $util.Long.fromValue(object.timeoutTimestamp)).unsigned = true; + else if (typeof object.timeoutTimestamp === "string") + message.timeoutTimestamp = parseInt(object.timeoutTimestamp, 10); + else if (typeof object.timeoutTimestamp === "number") + message.timeoutTimestamp = object.timeoutTimestamp; + else if (typeof object.timeoutTimestamp === "object") + message.timeoutTimestamp = new $util.LongBits(object.timeoutTimestamp.low >>> 0, object.timeoutTimestamp.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a MsgTransfer message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @static + * @param {ibc.applications.transfer.v1.MsgTransfer} message MsgTransfer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgTransfer.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sourcePort = ""; + object.sourceChannel = ""; + object.token = null; + object.sender = ""; + object.receiver = ""; + object.timeoutHeight = null; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.timeoutTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timeoutTimestamp = options.longs === String ? "0" : 0; + } + if (message.sourcePort != null && message.hasOwnProperty("sourcePort")) + object.sourcePort = message.sourcePort; + if (message.sourceChannel != null && message.hasOwnProperty("sourceChannel")) + object.sourceChannel = message.sourceChannel; + if (message.token != null && message.hasOwnProperty("token")) + object.token = $root.cosmos.base.v1beta1.Coin.toObject(message.token, options); + if (message.sender != null && message.hasOwnProperty("sender")) + object.sender = message.sender; + if (message.receiver != null && message.hasOwnProperty("receiver")) + object.receiver = message.receiver; + if (message.timeoutHeight != null && message.hasOwnProperty("timeoutHeight")) + object.timeoutHeight = $root.ibc.core.client.v1.Height.toObject(message.timeoutHeight, options); + if (message.timeoutTimestamp != null && message.hasOwnProperty("timeoutTimestamp")) + if (typeof message.timeoutTimestamp === "number") + object.timeoutTimestamp = options.longs === String ? String(message.timeoutTimestamp) : message.timeoutTimestamp; + else + object.timeoutTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timeoutTimestamp) : options.longs === Number ? new $util.LongBits(message.timeoutTimestamp.low >>> 0, message.timeoutTimestamp.high >>> 0).toNumber(true) : message.timeoutTimestamp; + return object; + }; + + /** + * Converts this MsgTransfer to JSON. + * @function toJSON + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @instance + * @returns {Object.} JSON object + */ + MsgTransfer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgTransfer; + })(v1.MsgTransfer || {}); + + v1.MsgTransferResponse = (function(MsgTransferResponse) { + + /** + * Properties of a MsgTransferResponse. + * @memberof ibc.applications.transfer.v1 + * @interface IMsgTransferResponse + */ + + /** + * Constructs a new MsgTransferResponse. + * @memberof ibc.applications.transfer.v1 + * @classdesc Represents a MsgTransferResponse. + * @implements IMsgTransferResponse + * @constructor + * @param {ibc.applications.transfer.v1.IMsgTransferResponse=} [properties] Properties to set + */ + function MsgTransferResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgTransferResponse instance using the specified properties. + * @function create + * @memberof ibc.applications.transfer.v1.MsgTransferResponse + * @static + * @param {ibc.applications.transfer.v1.IMsgTransferResponse=} [properties] Properties to set + * @returns {ibc.applications.transfer.v1.MsgTransferResponse} MsgTransferResponse instance + */ + MsgTransferResponse.create = function create(properties) { + return new MsgTransferResponse(properties); + }; + + /** + * Encodes the specified MsgTransferResponse message. Does not implicitly {@link ibc.applications.transfer.v1.MsgTransferResponse.verify|verify} messages. + * @function encode + * @memberof ibc.applications.transfer.v1.MsgTransferResponse + * @static + * @param {ibc.applications.transfer.v1.IMsgTransferResponse} message MsgTransferResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgTransferResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgTransferResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.MsgTransferResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.applications.transfer.v1.MsgTransferResponse + * @static + * @param {ibc.applications.transfer.v1.IMsgTransferResponse} message MsgTransferResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgTransferResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgTransferResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.applications.transfer.v1.MsgTransferResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.applications.transfer.v1.MsgTransferResponse} MsgTransferResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgTransferResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.MsgTransferResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgTransferResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.applications.transfer.v1.MsgTransferResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.applications.transfer.v1.MsgTransferResponse} MsgTransferResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgTransferResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgTransferResponse message. + * @function verify + * @memberof ibc.applications.transfer.v1.MsgTransferResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgTransferResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgTransferResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.applications.transfer.v1.MsgTransferResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.applications.transfer.v1.MsgTransferResponse} MsgTransferResponse + */ + MsgTransferResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.applications.transfer.v1.MsgTransferResponse) + return object; + return new $root.ibc.applications.transfer.v1.MsgTransferResponse(); + }; + + /** + * Creates a plain object from a MsgTransferResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.applications.transfer.v1.MsgTransferResponse + * @static + * @param {ibc.applications.transfer.v1.MsgTransferResponse} message MsgTransferResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgTransferResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgTransferResponse to JSON. + * @function toJSON + * @memberof ibc.applications.transfer.v1.MsgTransferResponse + * @instance + * @returns {Object.} JSON object + */ + MsgTransferResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgTransferResponse; + })(v1.MsgTransferResponse || {}); + + return v1; + })(transfer.v1 || {}); + + return transfer; + })(applications.transfer || {}); + + return applications; + })(ibc.applications || {}); + + /** + * Namespace core. + * @memberof ibc + * @namespace + */ + + ibc.core = (function(core) { + + /** + * Namespace client. + * @memberof ibc.core + * @namespace + */ + + core.client = (function(client) { + + /** + * Namespace v1. + * @memberof ibc.core.client + * @namespace + */ + + client.v1 = (function(v1) { + + v1.IdentifiedClientState = (function(IdentifiedClientState) { + + /** + * Properties of an IdentifiedClientState. + * @memberof ibc.core.client.v1 + * @interface IIdentifiedClientState + * @property {string|null} [clientId] IdentifiedClientState clientId + * @property {google.protobuf.IAny|null} [clientState] IdentifiedClientState clientState + */ + + /** + * Constructs a new IdentifiedClientState. + * @memberof ibc.core.client.v1 + * @classdesc Represents an IdentifiedClientState. + * @implements IIdentifiedClientState + * @constructor + * @param {ibc.core.client.v1.IIdentifiedClientState=} [properties] Properties to set + */ + function IdentifiedClientState(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IdentifiedClientState clientId. + * @member {string} clientId + * @memberof ibc.core.client.v1.IdentifiedClientState + * @instance + */ + IdentifiedClientState.prototype.clientId = ""; + + /** + * IdentifiedClientState clientState. + * @member {google.protobuf.IAny|null|undefined} clientState + * @memberof ibc.core.client.v1.IdentifiedClientState + * @instance + */ + IdentifiedClientState.prototype.clientState = null; + + /** + * Creates a new IdentifiedClientState instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.IdentifiedClientState + * @static + * @param {ibc.core.client.v1.IIdentifiedClientState=} [properties] Properties to set + * @returns {ibc.core.client.v1.IdentifiedClientState} IdentifiedClientState instance + */ + IdentifiedClientState.create = function create(properties) { + return new IdentifiedClientState(properties); + }; + + /** + * Encodes the specified IdentifiedClientState message. Does not implicitly {@link ibc.core.client.v1.IdentifiedClientState.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.IdentifiedClientState + * @static + * @param {ibc.core.client.v1.IIdentifiedClientState} message IdentifiedClientState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentifiedClientState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.clientState != null && Object.hasOwnProperty.call(message, "clientState")) + $root.google.protobuf.Any.encode(message.clientState, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IdentifiedClientState message, length delimited. Does not implicitly {@link ibc.core.client.v1.IdentifiedClientState.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.IdentifiedClientState + * @static + * @param {ibc.core.client.v1.IIdentifiedClientState} message IdentifiedClientState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentifiedClientState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentifiedClientState message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.IdentifiedClientState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.IdentifiedClientState} IdentifiedClientState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentifiedClientState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.IdentifiedClientState(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.clientState = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentifiedClientState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.IdentifiedClientState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.IdentifiedClientState} IdentifiedClientState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentifiedClientState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentifiedClientState message. + * @function verify + * @memberof ibc.core.client.v1.IdentifiedClientState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentifiedClientState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.clientState != null && message.hasOwnProperty("clientState")) { + var error = $root.google.protobuf.Any.verify(message.clientState); + if (error) + return "clientState." + error; + } + return null; + }; + + /** + * Creates an IdentifiedClientState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.IdentifiedClientState + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.IdentifiedClientState} IdentifiedClientState + */ + IdentifiedClientState.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.IdentifiedClientState) + return object; + var message = new $root.ibc.core.client.v1.IdentifiedClientState(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.clientState != null) { + if (typeof object.clientState !== "object") + throw TypeError(".ibc.core.client.v1.IdentifiedClientState.clientState: object expected"); + message.clientState = $root.google.protobuf.Any.fromObject(object.clientState); + } + return message; + }; + + /** + * Creates a plain object from an IdentifiedClientState message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.IdentifiedClientState + * @static + * @param {ibc.core.client.v1.IdentifiedClientState} message IdentifiedClientState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentifiedClientState.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.clientId = ""; + object.clientState = null; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.clientState != null && message.hasOwnProperty("clientState")) + object.clientState = $root.google.protobuf.Any.toObject(message.clientState, options); + return object; + }; + + /** + * Converts this IdentifiedClientState to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.IdentifiedClientState + * @instance + * @returns {Object.} JSON object + */ + IdentifiedClientState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentifiedClientState; + })(v1.IdentifiedClientState || {}); + + v1.ConsensusStateWithHeight = (function(ConsensusStateWithHeight) { + + /** + * Properties of a ConsensusStateWithHeight. + * @memberof ibc.core.client.v1 + * @interface IConsensusStateWithHeight + * @property {ibc.core.client.v1.IHeight|null} [height] ConsensusStateWithHeight height + * @property {google.protobuf.IAny|null} [consensusState] ConsensusStateWithHeight consensusState + */ + + /** + * Constructs a new ConsensusStateWithHeight. + * @memberof ibc.core.client.v1 + * @classdesc Represents a ConsensusStateWithHeight. + * @implements IConsensusStateWithHeight + * @constructor + * @param {ibc.core.client.v1.IConsensusStateWithHeight=} [properties] Properties to set + */ + function ConsensusStateWithHeight(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConsensusStateWithHeight height. + * @member {ibc.core.client.v1.IHeight|null|undefined} height + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @instance + */ + ConsensusStateWithHeight.prototype.height = null; + + /** + * ConsensusStateWithHeight consensusState. + * @member {google.protobuf.IAny|null|undefined} consensusState + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @instance + */ + ConsensusStateWithHeight.prototype.consensusState = null; + + /** + * Creates a new ConsensusStateWithHeight instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @static + * @param {ibc.core.client.v1.IConsensusStateWithHeight=} [properties] Properties to set + * @returns {ibc.core.client.v1.ConsensusStateWithHeight} ConsensusStateWithHeight instance + */ + ConsensusStateWithHeight.create = function create(properties) { + return new ConsensusStateWithHeight(properties); + }; + + /** + * Encodes the specified ConsensusStateWithHeight message. Does not implicitly {@link ibc.core.client.v1.ConsensusStateWithHeight.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @static + * @param {ibc.core.client.v1.IConsensusStateWithHeight} message ConsensusStateWithHeight message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusStateWithHeight.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + $root.ibc.core.client.v1.Height.encode(message.height, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.consensusState != null && Object.hasOwnProperty.call(message, "consensusState")) + $root.google.protobuf.Any.encode(message.consensusState, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConsensusStateWithHeight message, length delimited. Does not implicitly {@link ibc.core.client.v1.ConsensusStateWithHeight.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @static + * @param {ibc.core.client.v1.IConsensusStateWithHeight} message ConsensusStateWithHeight message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusStateWithHeight.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConsensusStateWithHeight message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.ConsensusStateWithHeight} ConsensusStateWithHeight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusStateWithHeight.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.ConsensusStateWithHeight(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + case 2: + message.consensusState = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConsensusStateWithHeight message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.ConsensusStateWithHeight} ConsensusStateWithHeight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusStateWithHeight.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConsensusStateWithHeight message. + * @function verify + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConsensusStateWithHeight.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) { + var error = $root.ibc.core.client.v1.Height.verify(message.height); + if (error) + return "height." + error; + } + if (message.consensusState != null && message.hasOwnProperty("consensusState")) { + var error = $root.google.protobuf.Any.verify(message.consensusState); + if (error) + return "consensusState." + error; + } + return null; + }; + + /** + * Creates a ConsensusStateWithHeight message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.ConsensusStateWithHeight} ConsensusStateWithHeight + */ + ConsensusStateWithHeight.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.ConsensusStateWithHeight) + return object; + var message = new $root.ibc.core.client.v1.ConsensusStateWithHeight(); + if (object.height != null) { + if (typeof object.height !== "object") + throw TypeError(".ibc.core.client.v1.ConsensusStateWithHeight.height: object expected"); + message.height = $root.ibc.core.client.v1.Height.fromObject(object.height); + } + if (object.consensusState != null) { + if (typeof object.consensusState !== "object") + throw TypeError(".ibc.core.client.v1.ConsensusStateWithHeight.consensusState: object expected"); + message.consensusState = $root.google.protobuf.Any.fromObject(object.consensusState); + } + return message; + }; + + /** + * Creates a plain object from a ConsensusStateWithHeight message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @static + * @param {ibc.core.client.v1.ConsensusStateWithHeight} message ConsensusStateWithHeight + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConsensusStateWithHeight.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.height = null; + object.consensusState = null; + } + if (message.height != null && message.hasOwnProperty("height")) + object.height = $root.ibc.core.client.v1.Height.toObject(message.height, options); + if (message.consensusState != null && message.hasOwnProperty("consensusState")) + object.consensusState = $root.google.protobuf.Any.toObject(message.consensusState, options); + return object; + }; + + /** + * Converts this ConsensusStateWithHeight to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @instance + * @returns {Object.} JSON object + */ + ConsensusStateWithHeight.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ConsensusStateWithHeight; + })(v1.ConsensusStateWithHeight || {}); + + v1.ClientConsensusStates = (function(ClientConsensusStates) { + + /** + * Properties of a ClientConsensusStates. + * @memberof ibc.core.client.v1 + * @interface IClientConsensusStates + * @property {string|null} [clientId] ClientConsensusStates clientId + * @property {Array.|null} [consensusStates] ClientConsensusStates consensusStates + */ + + /** + * Constructs a new ClientConsensusStates. + * @memberof ibc.core.client.v1 + * @classdesc Represents a ClientConsensusStates. + * @implements IClientConsensusStates + * @constructor + * @param {ibc.core.client.v1.IClientConsensusStates=} [properties] Properties to set + */ + function ClientConsensusStates(properties) { + this.consensusStates = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientConsensusStates clientId. + * @member {string} clientId + * @memberof ibc.core.client.v1.ClientConsensusStates + * @instance + */ + ClientConsensusStates.prototype.clientId = ""; + + /** + * ClientConsensusStates consensusStates. + * @member {Array.} consensusStates + * @memberof ibc.core.client.v1.ClientConsensusStates + * @instance + */ + ClientConsensusStates.prototype.consensusStates = $util.emptyArray; + + /** + * Creates a new ClientConsensusStates instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.ClientConsensusStates + * @static + * @param {ibc.core.client.v1.IClientConsensusStates=} [properties] Properties to set + * @returns {ibc.core.client.v1.ClientConsensusStates} ClientConsensusStates instance + */ + ClientConsensusStates.create = function create(properties) { + return new ClientConsensusStates(properties); + }; + + /** + * Encodes the specified ClientConsensusStates message. Does not implicitly {@link ibc.core.client.v1.ClientConsensusStates.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.ClientConsensusStates + * @static + * @param {ibc.core.client.v1.IClientConsensusStates} message ClientConsensusStates message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientConsensusStates.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.consensusStates != null && message.consensusStates.length) + for (var i = 0; i < message.consensusStates.length; ++i) + $root.ibc.core.client.v1.ConsensusStateWithHeight.encode(message.consensusStates[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientConsensusStates message, length delimited. Does not implicitly {@link ibc.core.client.v1.ClientConsensusStates.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.ClientConsensusStates + * @static + * @param {ibc.core.client.v1.IClientConsensusStates} message ClientConsensusStates message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientConsensusStates.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientConsensusStates message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.ClientConsensusStates + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.ClientConsensusStates} ClientConsensusStates + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientConsensusStates.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.ClientConsensusStates(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + if (!(message.consensusStates && message.consensusStates.length)) + message.consensusStates = []; + message.consensusStates.push($root.ibc.core.client.v1.ConsensusStateWithHeight.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientConsensusStates message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.ClientConsensusStates + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.ClientConsensusStates} ClientConsensusStates + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientConsensusStates.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientConsensusStates message. + * @function verify + * @memberof ibc.core.client.v1.ClientConsensusStates + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientConsensusStates.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.consensusStates != null && message.hasOwnProperty("consensusStates")) { + if (!Array.isArray(message.consensusStates)) + return "consensusStates: array expected"; + for (var i = 0; i < message.consensusStates.length; ++i) { + var error = $root.ibc.core.client.v1.ConsensusStateWithHeight.verify(message.consensusStates[i]); + if (error) + return "consensusStates." + error; + } + } + return null; + }; + + /** + * Creates a ClientConsensusStates message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.ClientConsensusStates + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.ClientConsensusStates} ClientConsensusStates + */ + ClientConsensusStates.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.ClientConsensusStates) + return object; + var message = new $root.ibc.core.client.v1.ClientConsensusStates(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.consensusStates) { + if (!Array.isArray(object.consensusStates)) + throw TypeError(".ibc.core.client.v1.ClientConsensusStates.consensusStates: array expected"); + message.consensusStates = []; + for (var i = 0; i < object.consensusStates.length; ++i) { + if (typeof object.consensusStates[i] !== "object") + throw TypeError(".ibc.core.client.v1.ClientConsensusStates.consensusStates: object expected"); + message.consensusStates[i] = $root.ibc.core.client.v1.ConsensusStateWithHeight.fromObject(object.consensusStates[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ClientConsensusStates message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.ClientConsensusStates + * @static + * @param {ibc.core.client.v1.ClientConsensusStates} message ClientConsensusStates + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientConsensusStates.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.consensusStates = []; + if (options.defaults) + object.clientId = ""; + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.consensusStates && message.consensusStates.length) { + object.consensusStates = []; + for (var j = 0; j < message.consensusStates.length; ++j) + object.consensusStates[j] = $root.ibc.core.client.v1.ConsensusStateWithHeight.toObject(message.consensusStates[j], options); + } + return object; + }; + + /** + * Converts this ClientConsensusStates to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.ClientConsensusStates + * @instance + * @returns {Object.} JSON object + */ + ClientConsensusStates.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ClientConsensusStates; + })(v1.ClientConsensusStates || {}); + + v1.ClientUpdateProposal = (function(ClientUpdateProposal) { + + /** + * Properties of a ClientUpdateProposal. + * @memberof ibc.core.client.v1 + * @interface IClientUpdateProposal + * @property {string|null} [title] ClientUpdateProposal title + * @property {string|null} [description] ClientUpdateProposal description + * @property {string|null} [clientId] ClientUpdateProposal clientId + * @property {google.protobuf.IAny|null} [header] ClientUpdateProposal header + */ + + /** + * Constructs a new ClientUpdateProposal. + * @memberof ibc.core.client.v1 + * @classdesc Represents a ClientUpdateProposal. + * @implements IClientUpdateProposal + * @constructor + * @param {ibc.core.client.v1.IClientUpdateProposal=} [properties] Properties to set + */ + function ClientUpdateProposal(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientUpdateProposal title. + * @member {string} title + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @instance + */ + ClientUpdateProposal.prototype.title = ""; + + /** + * ClientUpdateProposal description. + * @member {string} description + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @instance + */ + ClientUpdateProposal.prototype.description = ""; + + /** + * ClientUpdateProposal clientId. + * @member {string} clientId + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @instance + */ + ClientUpdateProposal.prototype.clientId = ""; + + /** + * ClientUpdateProposal header. + * @member {google.protobuf.IAny|null|undefined} header + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @instance + */ + ClientUpdateProposal.prototype.header = null; + + /** + * Creates a new ClientUpdateProposal instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @static + * @param {ibc.core.client.v1.IClientUpdateProposal=} [properties] Properties to set + * @returns {ibc.core.client.v1.ClientUpdateProposal} ClientUpdateProposal instance + */ + ClientUpdateProposal.create = function create(properties) { + return new ClientUpdateProposal(properties); + }; + + /** + * Encodes the specified ClientUpdateProposal message. Does not implicitly {@link ibc.core.client.v1.ClientUpdateProposal.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @static + * @param {ibc.core.client.v1.IClientUpdateProposal} message ClientUpdateProposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientUpdateProposal.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.clientId); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + $root.google.protobuf.Any.encode(message.header, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientUpdateProposal message, length delimited. Does not implicitly {@link ibc.core.client.v1.ClientUpdateProposal.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @static + * @param {ibc.core.client.v1.IClientUpdateProposal} message ClientUpdateProposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientUpdateProposal.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientUpdateProposal message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.ClientUpdateProposal} ClientUpdateProposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientUpdateProposal.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.ClientUpdateProposal(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.clientId = reader.string(); + break; + case 4: + message.header = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientUpdateProposal message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.ClientUpdateProposal} ClientUpdateProposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientUpdateProposal.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientUpdateProposal message. + * @function verify + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientUpdateProposal.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.header != null && message.hasOwnProperty("header")) { + var error = $root.google.protobuf.Any.verify(message.header); + if (error) + return "header." + error; + } + return null; + }; + + /** + * Creates a ClientUpdateProposal message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.ClientUpdateProposal} ClientUpdateProposal + */ + ClientUpdateProposal.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.ClientUpdateProposal) + return object; + var message = new $root.ibc.core.client.v1.ClientUpdateProposal(); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.header != null) { + if (typeof object.header !== "object") + throw TypeError(".ibc.core.client.v1.ClientUpdateProposal.header: object expected"); + message.header = $root.google.protobuf.Any.fromObject(object.header); + } + return message; + }; + + /** + * Creates a plain object from a ClientUpdateProposal message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @static + * @param {ibc.core.client.v1.ClientUpdateProposal} message ClientUpdateProposal + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientUpdateProposal.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.title = ""; + object.description = ""; + object.clientId = ""; + object.header = null; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.header != null && message.hasOwnProperty("header")) + object.header = $root.google.protobuf.Any.toObject(message.header, options); + return object; + }; + + /** + * Converts this ClientUpdateProposal to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @instance + * @returns {Object.} JSON object + */ + ClientUpdateProposal.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ClientUpdateProposal; + })(v1.ClientUpdateProposal || {}); + + v1.Height = (function(Height) { + + /** + * Properties of an Height. + * @memberof ibc.core.client.v1 + * @interface IHeight + * @property {number|Long|null} [revisionNumber] Height revisionNumber + * @property {number|Long|null} [revisionHeight] Height revisionHeight + */ + + /** + * Constructs a new Height. + * @memberof ibc.core.client.v1 + * @classdesc Represents an Height. + * @implements IHeight + * @constructor + * @param {ibc.core.client.v1.IHeight=} [properties] Properties to set + */ + function Height(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Height revisionNumber. + * @member {number|Long} revisionNumber + * @memberof ibc.core.client.v1.Height + * @instance + */ + Height.prototype.revisionNumber = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Height revisionHeight. + * @member {number|Long} revisionHeight + * @memberof ibc.core.client.v1.Height + * @instance + */ + Height.prototype.revisionHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new Height instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.Height + * @static + * @param {ibc.core.client.v1.IHeight=} [properties] Properties to set + * @returns {ibc.core.client.v1.Height} Height instance + */ + Height.create = function create(properties) { + return new Height(properties); + }; + + /** + * Encodes the specified Height message. Does not implicitly {@link ibc.core.client.v1.Height.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.Height + * @static + * @param {ibc.core.client.v1.IHeight} message Height message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Height.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.revisionNumber != null && Object.hasOwnProperty.call(message, "revisionNumber")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.revisionNumber); + if (message.revisionHeight != null && Object.hasOwnProperty.call(message, "revisionHeight")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.revisionHeight); + return writer; + }; + + /** + * Encodes the specified Height message, length delimited. Does not implicitly {@link ibc.core.client.v1.Height.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.Height + * @static + * @param {ibc.core.client.v1.IHeight} message Height message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Height.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Height message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.Height + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.Height} Height + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Height.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.Height(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.revisionNumber = reader.uint64(); + break; + case 2: + message.revisionHeight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Height message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.Height + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.Height} Height + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Height.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Height message. + * @function verify + * @memberof ibc.core.client.v1.Height + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Height.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) + if (!$util.isInteger(message.revisionNumber) && !(message.revisionNumber && $util.isInteger(message.revisionNumber.low) && $util.isInteger(message.revisionNumber.high))) + return "revisionNumber: integer|Long expected"; + if (message.revisionHeight != null && message.hasOwnProperty("revisionHeight")) + if (!$util.isInteger(message.revisionHeight) && !(message.revisionHeight && $util.isInteger(message.revisionHeight.low) && $util.isInteger(message.revisionHeight.high))) + return "revisionHeight: integer|Long expected"; + return null; + }; + + /** + * Creates an Height message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.Height + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.Height} Height + */ + Height.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.Height) + return object; + var message = new $root.ibc.core.client.v1.Height(); + if (object.revisionNumber != null) + if ($util.Long) + (message.revisionNumber = $util.Long.fromValue(object.revisionNumber)).unsigned = true; + else if (typeof object.revisionNumber === "string") + message.revisionNumber = parseInt(object.revisionNumber, 10); + else if (typeof object.revisionNumber === "number") + message.revisionNumber = object.revisionNumber; + else if (typeof object.revisionNumber === "object") + message.revisionNumber = new $util.LongBits(object.revisionNumber.low >>> 0, object.revisionNumber.high >>> 0).toNumber(true); + if (object.revisionHeight != null) + if ($util.Long) + (message.revisionHeight = $util.Long.fromValue(object.revisionHeight)).unsigned = true; + else if (typeof object.revisionHeight === "string") + message.revisionHeight = parseInt(object.revisionHeight, 10); + else if (typeof object.revisionHeight === "number") + message.revisionHeight = object.revisionHeight; + else if (typeof object.revisionHeight === "object") + message.revisionHeight = new $util.LongBits(object.revisionHeight.low >>> 0, object.revisionHeight.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from an Height message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.Height + * @static + * @param {ibc.core.client.v1.Height} message Height + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Height.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.revisionNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.revisionNumber = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.revisionHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.revisionHeight = options.longs === String ? "0" : 0; + } + if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) + if (typeof message.revisionNumber === "number") + object.revisionNumber = options.longs === String ? String(message.revisionNumber) : message.revisionNumber; + else + object.revisionNumber = options.longs === String ? $util.Long.prototype.toString.call(message.revisionNumber) : options.longs === Number ? new $util.LongBits(message.revisionNumber.low >>> 0, message.revisionNumber.high >>> 0).toNumber(true) : message.revisionNumber; + if (message.revisionHeight != null && message.hasOwnProperty("revisionHeight")) + if (typeof message.revisionHeight === "number") + object.revisionHeight = options.longs === String ? String(message.revisionHeight) : message.revisionHeight; + else + object.revisionHeight = options.longs === String ? $util.Long.prototype.toString.call(message.revisionHeight) : options.longs === Number ? new $util.LongBits(message.revisionHeight.low >>> 0, message.revisionHeight.high >>> 0).toNumber(true) : message.revisionHeight; + return object; + }; + + /** + * Converts this Height to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.Height + * @instance + * @returns {Object.} JSON object + */ + Height.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Height; + })(v1.Height || {}); + + v1.Params = (function(Params) { + + /** + * Properties of a Params. + * @memberof ibc.core.client.v1 + * @interface IParams + * @property {Array.|null} [allowedClients] Params allowedClients + */ + + /** + * Constructs a new Params. + * @memberof ibc.core.client.v1 + * @classdesc Represents a Params. + * @implements IParams + * @constructor + * @param {ibc.core.client.v1.IParams=} [properties] Properties to set + */ + function Params(properties) { + this.allowedClients = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Params allowedClients. + * @member {Array.} allowedClients + * @memberof ibc.core.client.v1.Params + * @instance + */ + Params.prototype.allowedClients = $util.emptyArray; + + /** + * Creates a new Params instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.Params + * @static + * @param {ibc.core.client.v1.IParams=} [properties] Properties to set + * @returns {ibc.core.client.v1.Params} Params instance + */ + Params.create = function create(properties) { + return new Params(properties); + }; + + /** + * Encodes the specified Params message. Does not implicitly {@link ibc.core.client.v1.Params.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.Params + * @static + * @param {ibc.core.client.v1.IParams} message Params message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Params.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedClients != null && message.allowedClients.length) + for (var i = 0; i < message.allowedClients.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedClients[i]); + return writer; + }; + + /** + * Encodes the specified Params message, length delimited. Does not implicitly {@link ibc.core.client.v1.Params.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.Params + * @static + * @param {ibc.core.client.v1.IParams} message Params message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Params.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Params message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.Params + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.Params} Params + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Params.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.Params(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.allowedClients && message.allowedClients.length)) + message.allowedClients = []; + message.allowedClients.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Params message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.Params + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.Params} Params + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Params.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Params message. + * @function verify + * @memberof ibc.core.client.v1.Params + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Params.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedClients != null && message.hasOwnProperty("allowedClients")) { + if (!Array.isArray(message.allowedClients)) + return "allowedClients: array expected"; + for (var i = 0; i < message.allowedClients.length; ++i) + if (!$util.isString(message.allowedClients[i])) + return "allowedClients: string[] expected"; + } + return null; + }; + + /** + * Creates a Params message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.Params + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.Params} Params + */ + Params.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.Params) + return object; + var message = new $root.ibc.core.client.v1.Params(); + if (object.allowedClients) { + if (!Array.isArray(object.allowedClients)) + throw TypeError(".ibc.core.client.v1.Params.allowedClients: array expected"); + message.allowedClients = []; + for (var i = 0; i < object.allowedClients.length; ++i) + message.allowedClients[i] = String(object.allowedClients[i]); + } + return message; + }; + + /** + * Creates a plain object from a Params message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.Params + * @static + * @param {ibc.core.client.v1.Params} message Params + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Params.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedClients = []; + if (message.allowedClients && message.allowedClients.length) { + object.allowedClients = []; + for (var j = 0; j < message.allowedClients.length; ++j) + object.allowedClients[j] = message.allowedClients[j]; + } + return object; + }; + + /** + * Converts this Params to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.Params + * @instance + * @returns {Object.} JSON object + */ + Params.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Params; + })(v1.Params || {}); + + v1.GenesisState = (function(GenesisState) { + + /** + * Properties of a GenesisState. + * @memberof ibc.core.client.v1 + * @interface IGenesisState + * @property {Array.|null} [clients] GenesisState clients + * @property {Array.|null} [clientsConsensus] GenesisState clientsConsensus + * @property {Array.|null} [clientsMetadata] GenesisState clientsMetadata + * @property {ibc.core.client.v1.IParams|null} [params] GenesisState params + * @property {boolean|null} [createLocalhost] GenesisState createLocalhost + * @property {number|Long|null} [nextClientSequence] GenesisState nextClientSequence + */ + + /** + * Constructs a new GenesisState. + * @memberof ibc.core.client.v1 + * @classdesc Represents a GenesisState. + * @implements IGenesisState + * @constructor + * @param {ibc.core.client.v1.IGenesisState=} [properties] Properties to set + */ + function GenesisState(properties) { + this.clients = []; + this.clientsConsensus = []; + this.clientsMetadata = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenesisState clients. + * @member {Array.} clients + * @memberof ibc.core.client.v1.GenesisState + * @instance + */ + GenesisState.prototype.clients = $util.emptyArray; + + /** + * GenesisState clientsConsensus. + * @member {Array.} clientsConsensus + * @memberof ibc.core.client.v1.GenesisState + * @instance + */ + GenesisState.prototype.clientsConsensus = $util.emptyArray; + + /** + * GenesisState clientsMetadata. + * @member {Array.} clientsMetadata + * @memberof ibc.core.client.v1.GenesisState + * @instance + */ + GenesisState.prototype.clientsMetadata = $util.emptyArray; + + /** + * GenesisState params. + * @member {ibc.core.client.v1.IParams|null|undefined} params + * @memberof ibc.core.client.v1.GenesisState + * @instance + */ + GenesisState.prototype.params = null; + + /** + * GenesisState createLocalhost. + * @member {boolean} createLocalhost + * @memberof ibc.core.client.v1.GenesisState + * @instance + */ + GenesisState.prototype.createLocalhost = false; + + /** + * GenesisState nextClientSequence. + * @member {number|Long} nextClientSequence + * @memberof ibc.core.client.v1.GenesisState + * @instance + */ + GenesisState.prototype.nextClientSequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new GenesisState instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.GenesisState + * @static + * @param {ibc.core.client.v1.IGenesisState=} [properties] Properties to set + * @returns {ibc.core.client.v1.GenesisState} GenesisState instance + */ + GenesisState.create = function create(properties) { + return new GenesisState(properties); + }; + + /** + * Encodes the specified GenesisState message. Does not implicitly {@link ibc.core.client.v1.GenesisState.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.GenesisState + * @static + * @param {ibc.core.client.v1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clients != null && message.clients.length) + for (var i = 0; i < message.clients.length; ++i) + $root.ibc.core.client.v1.IdentifiedClientState.encode(message.clients[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.clientsConsensus != null && message.clientsConsensus.length) + for (var i = 0; i < message.clientsConsensus.length; ++i) + $root.ibc.core.client.v1.ClientConsensusStates.encode(message.clientsConsensus[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.clientsMetadata != null && message.clientsMetadata.length) + for (var i = 0; i < message.clientsMetadata.length; ++i) + $root.ibc.core.client.v1.IdentifiedGenesisMetadata.encode(message.clientsMetadata[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.ibc.core.client.v1.Params.encode(message.params, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.createLocalhost != null && Object.hasOwnProperty.call(message, "createLocalhost")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.createLocalhost); + if (message.nextClientSequence != null && Object.hasOwnProperty.call(message, "nextClientSequence")) + writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.nextClientSequence); + return writer; + }; + + /** + * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link ibc.core.client.v1.GenesisState.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.GenesisState + * @static + * @param {ibc.core.client.v1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.GenesisState(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.clients && message.clients.length)) + message.clients = []; + message.clients.push($root.ibc.core.client.v1.IdentifiedClientState.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.clientsConsensus && message.clientsConsensus.length)) + message.clientsConsensus = []; + message.clientsConsensus.push($root.ibc.core.client.v1.ClientConsensusStates.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.clientsMetadata && message.clientsMetadata.length)) + message.clientsMetadata = []; + message.clientsMetadata.push($root.ibc.core.client.v1.IdentifiedGenesisMetadata.decode(reader, reader.uint32())); + break; + case 4: + message.params = $root.ibc.core.client.v1.Params.decode(reader, reader.uint32()); + break; + case 5: + message.createLocalhost = reader.bool(); + break; + case 6: + message.nextClientSequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenesisState message. + * @function verify + * @memberof ibc.core.client.v1.GenesisState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenesisState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clients != null && message.hasOwnProperty("clients")) { + if (!Array.isArray(message.clients)) + return "clients: array expected"; + for (var i = 0; i < message.clients.length; ++i) { + var error = $root.ibc.core.client.v1.IdentifiedClientState.verify(message.clients[i]); + if (error) + return "clients." + error; + } + } + if (message.clientsConsensus != null && message.hasOwnProperty("clientsConsensus")) { + if (!Array.isArray(message.clientsConsensus)) + return "clientsConsensus: array expected"; + for (var i = 0; i < message.clientsConsensus.length; ++i) { + var error = $root.ibc.core.client.v1.ClientConsensusStates.verify(message.clientsConsensus[i]); + if (error) + return "clientsConsensus." + error; + } + } + if (message.clientsMetadata != null && message.hasOwnProperty("clientsMetadata")) { + if (!Array.isArray(message.clientsMetadata)) + return "clientsMetadata: array expected"; + for (var i = 0; i < message.clientsMetadata.length; ++i) { + var error = $root.ibc.core.client.v1.IdentifiedGenesisMetadata.verify(message.clientsMetadata[i]); + if (error) + return "clientsMetadata." + error; + } + } + if (message.params != null && message.hasOwnProperty("params")) { + var error = $root.ibc.core.client.v1.Params.verify(message.params); + if (error) + return "params." + error; + } + if (message.createLocalhost != null && message.hasOwnProperty("createLocalhost")) + if (typeof message.createLocalhost !== "boolean") + return "createLocalhost: boolean expected"; + if (message.nextClientSequence != null && message.hasOwnProperty("nextClientSequence")) + if (!$util.isInteger(message.nextClientSequence) && !(message.nextClientSequence && $util.isInteger(message.nextClientSequence.low) && $util.isInteger(message.nextClientSequence.high))) + return "nextClientSequence: integer|Long expected"; + return null; + }; + + /** + * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.GenesisState + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.GenesisState} GenesisState + */ + GenesisState.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.GenesisState) + return object; + var message = new $root.ibc.core.client.v1.GenesisState(); + if (object.clients) { + if (!Array.isArray(object.clients)) + throw TypeError(".ibc.core.client.v1.GenesisState.clients: array expected"); + message.clients = []; + for (var i = 0; i < object.clients.length; ++i) { + if (typeof object.clients[i] !== "object") + throw TypeError(".ibc.core.client.v1.GenesisState.clients: object expected"); + message.clients[i] = $root.ibc.core.client.v1.IdentifiedClientState.fromObject(object.clients[i]); + } + } + if (object.clientsConsensus) { + if (!Array.isArray(object.clientsConsensus)) + throw TypeError(".ibc.core.client.v1.GenesisState.clientsConsensus: array expected"); + message.clientsConsensus = []; + for (var i = 0; i < object.clientsConsensus.length; ++i) { + if (typeof object.clientsConsensus[i] !== "object") + throw TypeError(".ibc.core.client.v1.GenesisState.clientsConsensus: object expected"); + message.clientsConsensus[i] = $root.ibc.core.client.v1.ClientConsensusStates.fromObject(object.clientsConsensus[i]); + } + } + if (object.clientsMetadata) { + if (!Array.isArray(object.clientsMetadata)) + throw TypeError(".ibc.core.client.v1.GenesisState.clientsMetadata: array expected"); + message.clientsMetadata = []; + for (var i = 0; i < object.clientsMetadata.length; ++i) { + if (typeof object.clientsMetadata[i] !== "object") + throw TypeError(".ibc.core.client.v1.GenesisState.clientsMetadata: object expected"); + message.clientsMetadata[i] = $root.ibc.core.client.v1.IdentifiedGenesisMetadata.fromObject(object.clientsMetadata[i]); + } + } + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".ibc.core.client.v1.GenesisState.params: object expected"); + message.params = $root.ibc.core.client.v1.Params.fromObject(object.params); + } + if (object.createLocalhost != null) + message.createLocalhost = Boolean(object.createLocalhost); + if (object.nextClientSequence != null) + if ($util.Long) + (message.nextClientSequence = $util.Long.fromValue(object.nextClientSequence)).unsigned = true; + else if (typeof object.nextClientSequence === "string") + message.nextClientSequence = parseInt(object.nextClientSequence, 10); + else if (typeof object.nextClientSequence === "number") + message.nextClientSequence = object.nextClientSequence; + else if (typeof object.nextClientSequence === "object") + message.nextClientSequence = new $util.LongBits(object.nextClientSequence.low >>> 0, object.nextClientSequence.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a GenesisState message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.GenesisState + * @static + * @param {ibc.core.client.v1.GenesisState} message GenesisState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenesisState.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.clients = []; + object.clientsConsensus = []; + object.clientsMetadata = []; + } + if (options.defaults) { + object.params = null; + object.createLocalhost = false; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.nextClientSequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nextClientSequence = options.longs === String ? "0" : 0; + } + if (message.clients && message.clients.length) { + object.clients = []; + for (var j = 0; j < message.clients.length; ++j) + object.clients[j] = $root.ibc.core.client.v1.IdentifiedClientState.toObject(message.clients[j], options); + } + if (message.clientsConsensus && message.clientsConsensus.length) { + object.clientsConsensus = []; + for (var j = 0; j < message.clientsConsensus.length; ++j) + object.clientsConsensus[j] = $root.ibc.core.client.v1.ClientConsensusStates.toObject(message.clientsConsensus[j], options); + } + if (message.clientsMetadata && message.clientsMetadata.length) { + object.clientsMetadata = []; + for (var j = 0; j < message.clientsMetadata.length; ++j) + object.clientsMetadata[j] = $root.ibc.core.client.v1.IdentifiedGenesisMetadata.toObject(message.clientsMetadata[j], options); + } + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.ibc.core.client.v1.Params.toObject(message.params, options); + if (message.createLocalhost != null && message.hasOwnProperty("createLocalhost")) + object.createLocalhost = message.createLocalhost; + if (message.nextClientSequence != null && message.hasOwnProperty("nextClientSequence")) + if (typeof message.nextClientSequence === "number") + object.nextClientSequence = options.longs === String ? String(message.nextClientSequence) : message.nextClientSequence; + else + object.nextClientSequence = options.longs === String ? $util.Long.prototype.toString.call(message.nextClientSequence) : options.longs === Number ? new $util.LongBits(message.nextClientSequence.low >>> 0, message.nextClientSequence.high >>> 0).toNumber(true) : message.nextClientSequence; + return object; + }; + + /** + * Converts this GenesisState to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.GenesisState + * @instance + * @returns {Object.} JSON object + */ + GenesisState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GenesisState; + })(v1.GenesisState || {}); + + v1.GenesisMetadata = (function(GenesisMetadata) { + + /** + * Properties of a GenesisMetadata. + * @memberof ibc.core.client.v1 + * @interface IGenesisMetadata + * @property {Uint8Array|null} [key] GenesisMetadata key + * @property {Uint8Array|null} [value] GenesisMetadata value + */ + + /** + * Constructs a new GenesisMetadata. + * @memberof ibc.core.client.v1 + * @classdesc Represents a GenesisMetadata. + * @implements IGenesisMetadata + * @constructor + * @param {ibc.core.client.v1.IGenesisMetadata=} [properties] Properties to set + */ + function GenesisMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenesisMetadata key. + * @member {Uint8Array} key + * @memberof ibc.core.client.v1.GenesisMetadata + * @instance + */ + GenesisMetadata.prototype.key = $util.newBuffer([]); + + /** + * GenesisMetadata value. + * @member {Uint8Array} value + * @memberof ibc.core.client.v1.GenesisMetadata + * @instance + */ + GenesisMetadata.prototype.value = $util.newBuffer([]); + + /** + * Creates a new GenesisMetadata instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.GenesisMetadata + * @static + * @param {ibc.core.client.v1.IGenesisMetadata=} [properties] Properties to set + * @returns {ibc.core.client.v1.GenesisMetadata} GenesisMetadata instance + */ + GenesisMetadata.create = function create(properties) { + return new GenesisMetadata(properties); + }; + + /** + * Encodes the specified GenesisMetadata message. Does not implicitly {@link ibc.core.client.v1.GenesisMetadata.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.GenesisMetadata + * @static + * @param {ibc.core.client.v1.IGenesisMetadata} message GenesisMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified GenesisMetadata message, length delimited. Does not implicitly {@link ibc.core.client.v1.GenesisMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.GenesisMetadata + * @static + * @param {ibc.core.client.v1.IGenesisMetadata} message GenesisMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenesisMetadata message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.GenesisMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.GenesisMetadata} GenesisMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.GenesisMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenesisMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.GenesisMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.GenesisMetadata} GenesisMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenesisMetadata message. + * @function verify + * @memberof ibc.core.client.v1.GenesisMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenesisMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a GenesisMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.GenesisMetadata + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.GenesisMetadata} GenesisMetadata + */ + GenesisMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.GenesisMetadata) + return object; + var message = new $root.ibc.core.client.v1.GenesisMetadata(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length) + message.key = object.key; + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a GenesisMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.GenesisMetadata + * @static + * @param {ibc.core.client.v1.GenesisMetadata} message GenesisMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenesisMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this GenesisMetadata to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.GenesisMetadata + * @instance + * @returns {Object.} JSON object + */ + GenesisMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GenesisMetadata; + })(v1.GenesisMetadata || {}); + + v1.IdentifiedGenesisMetadata = (function(IdentifiedGenesisMetadata) { + + /** + * Properties of an IdentifiedGenesisMetadata. + * @memberof ibc.core.client.v1 + * @interface IIdentifiedGenesisMetadata + * @property {string|null} [clientId] IdentifiedGenesisMetadata clientId + * @property {Array.|null} [clientMetadata] IdentifiedGenesisMetadata clientMetadata + */ + + /** + * Constructs a new IdentifiedGenesisMetadata. + * @memberof ibc.core.client.v1 + * @classdesc Represents an IdentifiedGenesisMetadata. + * @implements IIdentifiedGenesisMetadata + * @constructor + * @param {ibc.core.client.v1.IIdentifiedGenesisMetadata=} [properties] Properties to set + */ + function IdentifiedGenesisMetadata(properties) { + this.clientMetadata = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IdentifiedGenesisMetadata clientId. + * @member {string} clientId + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @instance + */ + IdentifiedGenesisMetadata.prototype.clientId = ""; + + /** + * IdentifiedGenesisMetadata clientMetadata. + * @member {Array.} clientMetadata + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @instance + */ + IdentifiedGenesisMetadata.prototype.clientMetadata = $util.emptyArray; + + /** + * Creates a new IdentifiedGenesisMetadata instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @static + * @param {ibc.core.client.v1.IIdentifiedGenesisMetadata=} [properties] Properties to set + * @returns {ibc.core.client.v1.IdentifiedGenesisMetadata} IdentifiedGenesisMetadata instance + */ + IdentifiedGenesisMetadata.create = function create(properties) { + return new IdentifiedGenesisMetadata(properties); + }; + + /** + * Encodes the specified IdentifiedGenesisMetadata message. Does not implicitly {@link ibc.core.client.v1.IdentifiedGenesisMetadata.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @static + * @param {ibc.core.client.v1.IIdentifiedGenesisMetadata} message IdentifiedGenesisMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentifiedGenesisMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.clientMetadata != null && message.clientMetadata.length) + for (var i = 0; i < message.clientMetadata.length; ++i) + $root.ibc.core.client.v1.GenesisMetadata.encode(message.clientMetadata[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IdentifiedGenesisMetadata message, length delimited. Does not implicitly {@link ibc.core.client.v1.IdentifiedGenesisMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @static + * @param {ibc.core.client.v1.IIdentifiedGenesisMetadata} message IdentifiedGenesisMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentifiedGenesisMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentifiedGenesisMetadata message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.IdentifiedGenesisMetadata} IdentifiedGenesisMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentifiedGenesisMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.IdentifiedGenesisMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + if (!(message.clientMetadata && message.clientMetadata.length)) + message.clientMetadata = []; + message.clientMetadata.push($root.ibc.core.client.v1.GenesisMetadata.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentifiedGenesisMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.IdentifiedGenesisMetadata} IdentifiedGenesisMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentifiedGenesisMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentifiedGenesisMetadata message. + * @function verify + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentifiedGenesisMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.clientMetadata != null && message.hasOwnProperty("clientMetadata")) { + if (!Array.isArray(message.clientMetadata)) + return "clientMetadata: array expected"; + for (var i = 0; i < message.clientMetadata.length; ++i) { + var error = $root.ibc.core.client.v1.GenesisMetadata.verify(message.clientMetadata[i]); + if (error) + return "clientMetadata." + error; + } + } + return null; + }; + + /** + * Creates an IdentifiedGenesisMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.IdentifiedGenesisMetadata} IdentifiedGenesisMetadata + */ + IdentifiedGenesisMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.IdentifiedGenesisMetadata) + return object; + var message = new $root.ibc.core.client.v1.IdentifiedGenesisMetadata(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.clientMetadata) { + if (!Array.isArray(object.clientMetadata)) + throw TypeError(".ibc.core.client.v1.IdentifiedGenesisMetadata.clientMetadata: array expected"); + message.clientMetadata = []; + for (var i = 0; i < object.clientMetadata.length; ++i) { + if (typeof object.clientMetadata[i] !== "object") + throw TypeError(".ibc.core.client.v1.IdentifiedGenesisMetadata.clientMetadata: object expected"); + message.clientMetadata[i] = $root.ibc.core.client.v1.GenesisMetadata.fromObject(object.clientMetadata[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an IdentifiedGenesisMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @static + * @param {ibc.core.client.v1.IdentifiedGenesisMetadata} message IdentifiedGenesisMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentifiedGenesisMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.clientMetadata = []; + if (options.defaults) + object.clientId = ""; + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.clientMetadata && message.clientMetadata.length) { + object.clientMetadata = []; + for (var j = 0; j < message.clientMetadata.length; ++j) + object.clientMetadata[j] = $root.ibc.core.client.v1.GenesisMetadata.toObject(message.clientMetadata[j], options); + } + return object; + }; + + /** + * Converts this IdentifiedGenesisMetadata to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @instance + * @returns {Object.} JSON object + */ + IdentifiedGenesisMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentifiedGenesisMetadata; + })(v1.IdentifiedGenesisMetadata || {}); + + v1.Query = (function(Query) { + + /** + * Constructs a new Query service. + * @memberof ibc.core.client.v1 + * @classdesc Represents a Query + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Query(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; + + /** + * Creates new Query service using the specified rpc implementation. + * @function create + * @memberof ibc.core.client.v1.Query + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Query} RPC service. Useful where requests and/or responses are streamed. + */ + Query.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link ibc.core.client.v1.Query#clientState}. + * @memberof ibc.core.client.v1.Query + * @typedef ClientStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.client.v1.IQueryClientStateResponse} [response] QueryClientStateResponse + */ + + /** + * Calls ClientState. + * @function clientState + * @memberof ibc.core.client.v1.Query + * @instance + * @param {ibc.core.client.v1.IQueryClientStateRequest} request QueryClientStateRequest message or plain object + * @param {ibc.core.client.v1.Query.ClientStateCallback} callback Node-style callback called with the error, if any, and QueryClientStateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.clientState = function clientState(request, callback) { + return this.rpcCall(clientState, $root.ibc.core.client.v1.QueryClientStateRequest, $root.ibc.core.client.v1.QueryClientStateResponse, request, callback); + }, "name", { value: "ClientState" }); + + /** + * Calls ClientState. + * @function clientState + * @memberof ibc.core.client.v1.Query + * @instance + * @param {ibc.core.client.v1.IQueryClientStateRequest} request QueryClientStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.client.v1.Query#clientStates}. + * @memberof ibc.core.client.v1.Query + * @typedef ClientStatesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.client.v1.IQueryClientStatesResponse} [response] QueryClientStatesResponse + */ + + /** + * Calls ClientStates. + * @function clientStates + * @memberof ibc.core.client.v1.Query + * @instance + * @param {ibc.core.client.v1.IQueryClientStatesRequest} request QueryClientStatesRequest message or plain object + * @param {ibc.core.client.v1.Query.ClientStatesCallback} callback Node-style callback called with the error, if any, and QueryClientStatesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.clientStates = function clientStates(request, callback) { + return this.rpcCall(clientStates, $root.ibc.core.client.v1.QueryClientStatesRequest, $root.ibc.core.client.v1.QueryClientStatesResponse, request, callback); + }, "name", { value: "ClientStates" }); + + /** + * Calls ClientStates. + * @function clientStates + * @memberof ibc.core.client.v1.Query + * @instance + * @param {ibc.core.client.v1.IQueryClientStatesRequest} request QueryClientStatesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.client.v1.Query#consensusState}. + * @memberof ibc.core.client.v1.Query + * @typedef ConsensusStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.client.v1.IQueryConsensusStateResponse} [response] QueryConsensusStateResponse + */ + + /** + * Calls ConsensusState. + * @function consensusState + * @memberof ibc.core.client.v1.Query + * @instance + * @param {ibc.core.client.v1.IQueryConsensusStateRequest} request QueryConsensusStateRequest message or plain object + * @param {ibc.core.client.v1.Query.ConsensusStateCallback} callback Node-style callback called with the error, if any, and QueryConsensusStateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.consensusState = function consensusState(request, callback) { + return this.rpcCall(consensusState, $root.ibc.core.client.v1.QueryConsensusStateRequest, $root.ibc.core.client.v1.QueryConsensusStateResponse, request, callback); + }, "name", { value: "ConsensusState" }); + + /** + * Calls ConsensusState. + * @function consensusState + * @memberof ibc.core.client.v1.Query + * @instance + * @param {ibc.core.client.v1.IQueryConsensusStateRequest} request QueryConsensusStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.client.v1.Query#consensusStates}. + * @memberof ibc.core.client.v1.Query + * @typedef ConsensusStatesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.client.v1.IQueryConsensusStatesResponse} [response] QueryConsensusStatesResponse + */ + + /** + * Calls ConsensusStates. + * @function consensusStates + * @memberof ibc.core.client.v1.Query + * @instance + * @param {ibc.core.client.v1.IQueryConsensusStatesRequest} request QueryConsensusStatesRequest message or plain object + * @param {ibc.core.client.v1.Query.ConsensusStatesCallback} callback Node-style callback called with the error, if any, and QueryConsensusStatesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.consensusStates = function consensusStates(request, callback) { + return this.rpcCall(consensusStates, $root.ibc.core.client.v1.QueryConsensusStatesRequest, $root.ibc.core.client.v1.QueryConsensusStatesResponse, request, callback); + }, "name", { value: "ConsensusStates" }); + + /** + * Calls ConsensusStates. + * @function consensusStates + * @memberof ibc.core.client.v1.Query + * @instance + * @param {ibc.core.client.v1.IQueryConsensusStatesRequest} request QueryConsensusStatesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.client.v1.Query#clientParams}. + * @memberof ibc.core.client.v1.Query + * @typedef ClientParamsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.client.v1.IQueryClientParamsResponse} [response] QueryClientParamsResponse + */ + + /** + * Calls ClientParams. + * @function clientParams + * @memberof ibc.core.client.v1.Query + * @instance + * @param {ibc.core.client.v1.IQueryClientParamsRequest} request QueryClientParamsRequest message or plain object + * @param {ibc.core.client.v1.Query.ClientParamsCallback} callback Node-style callback called with the error, if any, and QueryClientParamsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.clientParams = function clientParams(request, callback) { + return this.rpcCall(clientParams, $root.ibc.core.client.v1.QueryClientParamsRequest, $root.ibc.core.client.v1.QueryClientParamsResponse, request, callback); + }, "name", { value: "ClientParams" }); + + /** + * Calls ClientParams. + * @function clientParams + * @memberof ibc.core.client.v1.Query + * @instance + * @param {ibc.core.client.v1.IQueryClientParamsRequest} request QueryClientParamsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Query; + })(v1.Query || {}); + + v1.QueryClientStateRequest = (function(QueryClientStateRequest) { + + /** + * Properties of a QueryClientStateRequest. + * @memberof ibc.core.client.v1 + * @interface IQueryClientStateRequest + * @property {string|null} [clientId] QueryClientStateRequest clientId + */ + + /** + * Constructs a new QueryClientStateRequest. + * @memberof ibc.core.client.v1 + * @classdesc Represents a QueryClientStateRequest. + * @implements IQueryClientStateRequest + * @constructor + * @param {ibc.core.client.v1.IQueryClientStateRequest=} [properties] Properties to set + */ + function QueryClientStateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryClientStateRequest clientId. + * @member {string} clientId + * @memberof ibc.core.client.v1.QueryClientStateRequest + * @instance + */ + QueryClientStateRequest.prototype.clientId = ""; + + /** + * Creates a new QueryClientStateRequest instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.QueryClientStateRequest + * @static + * @param {ibc.core.client.v1.IQueryClientStateRequest=} [properties] Properties to set + * @returns {ibc.core.client.v1.QueryClientStateRequest} QueryClientStateRequest instance + */ + QueryClientStateRequest.create = function create(properties) { + return new QueryClientStateRequest(properties); + }; + + /** + * Encodes the specified QueryClientStateRequest message. Does not implicitly {@link ibc.core.client.v1.QueryClientStateRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.QueryClientStateRequest + * @static + * @param {ibc.core.client.v1.IQueryClientStateRequest} message QueryClientStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientStateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + return writer; + }; + + /** + * Encodes the specified QueryClientStateRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.QueryClientStateRequest + * @static + * @param {ibc.core.client.v1.IQueryClientStateRequest} message QueryClientStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryClientStateRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.QueryClientStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.QueryClientStateRequest} QueryClientStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientStateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientStateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryClientStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.QueryClientStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.QueryClientStateRequest} QueryClientStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryClientStateRequest message. + * @function verify + * @memberof ibc.core.client.v1.QueryClientStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryClientStateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + return null; + }; + + /** + * Creates a QueryClientStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.QueryClientStateRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.QueryClientStateRequest} QueryClientStateRequest + */ + QueryClientStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.QueryClientStateRequest) + return object; + var message = new $root.ibc.core.client.v1.QueryClientStateRequest(); + if (object.clientId != null) + message.clientId = String(object.clientId); + return message; + }; + + /** + * Creates a plain object from a QueryClientStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.QueryClientStateRequest + * @static + * @param {ibc.core.client.v1.QueryClientStateRequest} message QueryClientStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryClientStateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.clientId = ""; + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + return object; + }; + + /** + * Converts this QueryClientStateRequest to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.QueryClientStateRequest + * @instance + * @returns {Object.} JSON object + */ + QueryClientStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryClientStateRequest; + })(v1.QueryClientStateRequest || {}); + + v1.QueryClientStateResponse = (function(QueryClientStateResponse) { + + /** + * Properties of a QueryClientStateResponse. + * @memberof ibc.core.client.v1 + * @interface IQueryClientStateResponse + * @property {google.protobuf.IAny|null} [clientState] QueryClientStateResponse clientState + * @property {Uint8Array|null} [proof] QueryClientStateResponse proof + * @property {ibc.core.client.v1.IHeight|null} [proofHeight] QueryClientStateResponse proofHeight + */ + + /** + * Constructs a new QueryClientStateResponse. + * @memberof ibc.core.client.v1 + * @classdesc Represents a QueryClientStateResponse. + * @implements IQueryClientStateResponse + * @constructor + * @param {ibc.core.client.v1.IQueryClientStateResponse=} [properties] Properties to set + */ + function QueryClientStateResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryClientStateResponse clientState. + * @member {google.protobuf.IAny|null|undefined} clientState + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @instance + */ + QueryClientStateResponse.prototype.clientState = null; + + /** + * QueryClientStateResponse proof. + * @member {Uint8Array} proof + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @instance + */ + QueryClientStateResponse.prototype.proof = $util.newBuffer([]); + + /** + * QueryClientStateResponse proofHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} proofHeight + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @instance + */ + QueryClientStateResponse.prototype.proofHeight = null; + + /** + * Creates a new QueryClientStateResponse instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @static + * @param {ibc.core.client.v1.IQueryClientStateResponse=} [properties] Properties to set + * @returns {ibc.core.client.v1.QueryClientStateResponse} QueryClientStateResponse instance + */ + QueryClientStateResponse.create = function create(properties) { + return new QueryClientStateResponse(properties); + }; + + /** + * Encodes the specified QueryClientStateResponse message. Does not implicitly {@link ibc.core.client.v1.QueryClientStateResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @static + * @param {ibc.core.client.v1.IQueryClientStateResponse} message QueryClientStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientStateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientState != null && Object.hasOwnProperty.call(message, "clientState")) + $root.google.protobuf.Any.encode(message.clientState, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); + if (message.proofHeight != null && Object.hasOwnProperty.call(message, "proofHeight")) + $root.ibc.core.client.v1.Height.encode(message.proofHeight, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryClientStateResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientStateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @static + * @param {ibc.core.client.v1.IQueryClientStateResponse} message QueryClientStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientStateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryClientStateResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.QueryClientStateResponse} QueryClientStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientStateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientStateResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientState = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryClientStateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.QueryClientStateResponse} QueryClientStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientStateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryClientStateResponse message. + * @function verify + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryClientStateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientState != null && message.hasOwnProperty("clientState")) { + var error = $root.google.protobuf.Any.verify(message.clientState); + if (error) + return "clientState." + error; + } + if (message.proof != null && message.hasOwnProperty("proof")) + if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) + return "proof: buffer expected"; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) { + var error = $root.ibc.core.client.v1.Height.verify(message.proofHeight); + if (error) + return "proofHeight." + error; + } + return null; + }; + + /** + * Creates a QueryClientStateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.QueryClientStateResponse} QueryClientStateResponse + */ + QueryClientStateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.QueryClientStateResponse) + return object; + var message = new $root.ibc.core.client.v1.QueryClientStateResponse(); + if (object.clientState != null) { + if (typeof object.clientState !== "object") + throw TypeError(".ibc.core.client.v1.QueryClientStateResponse.clientState: object expected"); + message.clientState = $root.google.protobuf.Any.fromObject(object.clientState); + } + if (object.proof != null) + if (typeof object.proof === "string") + $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); + else if (object.proof.length) + message.proof = object.proof; + if (object.proofHeight != null) { + if (typeof object.proofHeight !== "object") + throw TypeError(".ibc.core.client.v1.QueryClientStateResponse.proofHeight: object expected"); + message.proofHeight = $root.ibc.core.client.v1.Height.fromObject(object.proofHeight); + } + return message; + }; + + /** + * Creates a plain object from a QueryClientStateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @static + * @param {ibc.core.client.v1.QueryClientStateResponse} message QueryClientStateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryClientStateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.clientState = null; + if (options.bytes === String) + object.proof = ""; + else { + object.proof = []; + if (options.bytes !== Array) + object.proof = $util.newBuffer(object.proof); + } + object.proofHeight = null; + } + if (message.clientState != null && message.hasOwnProperty("clientState")) + object.clientState = $root.google.protobuf.Any.toObject(message.clientState, options); + if (message.proof != null && message.hasOwnProperty("proof")) + object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) + object.proofHeight = $root.ibc.core.client.v1.Height.toObject(message.proofHeight, options); + return object; + }; + + /** + * Converts this QueryClientStateResponse to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @instance + * @returns {Object.} JSON object + */ + QueryClientStateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryClientStateResponse; + })(v1.QueryClientStateResponse || {}); + + v1.QueryClientStatesRequest = (function(QueryClientStatesRequest) { + + /** + * Properties of a QueryClientStatesRequest. + * @memberof ibc.core.client.v1 + * @interface IQueryClientStatesRequest + * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryClientStatesRequest pagination + */ + + /** + * Constructs a new QueryClientStatesRequest. + * @memberof ibc.core.client.v1 + * @classdesc Represents a QueryClientStatesRequest. + * @implements IQueryClientStatesRequest + * @constructor + * @param {ibc.core.client.v1.IQueryClientStatesRequest=} [properties] Properties to set + */ + function QueryClientStatesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryClientStatesRequest pagination. + * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination + * @memberof ibc.core.client.v1.QueryClientStatesRequest + * @instance + */ + QueryClientStatesRequest.prototype.pagination = null; + + /** + * Creates a new QueryClientStatesRequest instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.QueryClientStatesRequest + * @static + * @param {ibc.core.client.v1.IQueryClientStatesRequest=} [properties] Properties to set + * @returns {ibc.core.client.v1.QueryClientStatesRequest} QueryClientStatesRequest instance + */ + QueryClientStatesRequest.create = function create(properties) { + return new QueryClientStatesRequest(properties); + }; + + /** + * Encodes the specified QueryClientStatesRequest message. Does not implicitly {@link ibc.core.client.v1.QueryClientStatesRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.QueryClientStatesRequest + * @static + * @param {ibc.core.client.v1.IQueryClientStatesRequest} message QueryClientStatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientStatesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryClientStatesRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientStatesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.QueryClientStatesRequest + * @static + * @param {ibc.core.client.v1.IQueryClientStatesRequest} message QueryClientStatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientStatesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryClientStatesRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.QueryClientStatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.QueryClientStatesRequest} QueryClientStatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientStatesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientStatesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryClientStatesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.QueryClientStatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.QueryClientStatesRequest} QueryClientStatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientStatesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryClientStatesRequest message. + * @function verify + * @memberof ibc.core.client.v1.QueryClientStatesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryClientStatesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pagination != null && message.hasOwnProperty("pagination")) { + var error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryClientStatesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.QueryClientStatesRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.QueryClientStatesRequest} QueryClientStatesRequest + */ + QueryClientStatesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.QueryClientStatesRequest) + return object; + var message = new $root.ibc.core.client.v1.QueryClientStatesRequest(); + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".ibc.core.client.v1.QueryClientStatesRequest.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryClientStatesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.QueryClientStatesRequest + * @static + * @param {ibc.core.client.v1.QueryClientStatesRequest} message QueryClientStatesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryClientStatesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.pagination = null; + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryClientStatesRequest to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.QueryClientStatesRequest + * @instance + * @returns {Object.} JSON object + */ + QueryClientStatesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryClientStatesRequest; + })(v1.QueryClientStatesRequest || {}); + + v1.QueryClientStatesResponse = (function(QueryClientStatesResponse) { + + /** + * Properties of a QueryClientStatesResponse. + * @memberof ibc.core.client.v1 + * @interface IQueryClientStatesResponse + * @property {Array.|null} [clientStates] QueryClientStatesResponse clientStates + * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryClientStatesResponse pagination + */ + + /** + * Constructs a new QueryClientStatesResponse. + * @memberof ibc.core.client.v1 + * @classdesc Represents a QueryClientStatesResponse. + * @implements IQueryClientStatesResponse + * @constructor + * @param {ibc.core.client.v1.IQueryClientStatesResponse=} [properties] Properties to set + */ + function QueryClientStatesResponse(properties) { + this.clientStates = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryClientStatesResponse clientStates. + * @member {Array.} clientStates + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @instance + */ + QueryClientStatesResponse.prototype.clientStates = $util.emptyArray; + + /** + * QueryClientStatesResponse pagination. + * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @instance + */ + QueryClientStatesResponse.prototype.pagination = null; + + /** + * Creates a new QueryClientStatesResponse instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @static + * @param {ibc.core.client.v1.IQueryClientStatesResponse=} [properties] Properties to set + * @returns {ibc.core.client.v1.QueryClientStatesResponse} QueryClientStatesResponse instance + */ + QueryClientStatesResponse.create = function create(properties) { + return new QueryClientStatesResponse(properties); + }; + + /** + * Encodes the specified QueryClientStatesResponse message. Does not implicitly {@link ibc.core.client.v1.QueryClientStatesResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @static + * @param {ibc.core.client.v1.IQueryClientStatesResponse} message QueryClientStatesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientStatesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientStates != null && message.clientStates.length) + for (var i = 0; i < message.clientStates.length; ++i) + $root.ibc.core.client.v1.IdentifiedClientState.encode(message.clientStates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryClientStatesResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientStatesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @static + * @param {ibc.core.client.v1.IQueryClientStatesResponse} message QueryClientStatesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientStatesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryClientStatesResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.QueryClientStatesResponse} QueryClientStatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientStatesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientStatesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.clientStates && message.clientStates.length)) + message.clientStates = []; + message.clientStates.push($root.ibc.core.client.v1.IdentifiedClientState.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryClientStatesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.QueryClientStatesResponse} QueryClientStatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientStatesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryClientStatesResponse message. + * @function verify + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryClientStatesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientStates != null && message.hasOwnProperty("clientStates")) { + if (!Array.isArray(message.clientStates)) + return "clientStates: array expected"; + for (var i = 0; i < message.clientStates.length; ++i) { + var error = $root.ibc.core.client.v1.IdentifiedClientState.verify(message.clientStates[i]); + if (error) + return "clientStates." + error; + } + } + if (message.pagination != null && message.hasOwnProperty("pagination")) { + var error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryClientStatesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.QueryClientStatesResponse} QueryClientStatesResponse + */ + QueryClientStatesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.QueryClientStatesResponse) + return object; + var message = new $root.ibc.core.client.v1.QueryClientStatesResponse(); + if (object.clientStates) { + if (!Array.isArray(object.clientStates)) + throw TypeError(".ibc.core.client.v1.QueryClientStatesResponse.clientStates: array expected"); + message.clientStates = []; + for (var i = 0; i < object.clientStates.length; ++i) { + if (typeof object.clientStates[i] !== "object") + throw TypeError(".ibc.core.client.v1.QueryClientStatesResponse.clientStates: object expected"); + message.clientStates[i] = $root.ibc.core.client.v1.IdentifiedClientState.fromObject(object.clientStates[i]); + } + } + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".ibc.core.client.v1.QueryClientStatesResponse.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryClientStatesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @static + * @param {ibc.core.client.v1.QueryClientStatesResponse} message QueryClientStatesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryClientStatesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.clientStates = []; + if (options.defaults) + object.pagination = null; + if (message.clientStates && message.clientStates.length) { + object.clientStates = []; + for (var j = 0; j < message.clientStates.length; ++j) + object.clientStates[j] = $root.ibc.core.client.v1.IdentifiedClientState.toObject(message.clientStates[j], options); + } + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryClientStatesResponse to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @instance + * @returns {Object.} JSON object + */ + QueryClientStatesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryClientStatesResponse; + })(v1.QueryClientStatesResponse || {}); + + v1.QueryConsensusStateRequest = (function(QueryConsensusStateRequest) { + + /** + * Properties of a QueryConsensusStateRequest. + * @memberof ibc.core.client.v1 + * @interface IQueryConsensusStateRequest + * @property {string|null} [clientId] QueryConsensusStateRequest clientId + * @property {number|Long|null} [revisionNumber] QueryConsensusStateRequest revisionNumber + * @property {number|Long|null} [revisionHeight] QueryConsensusStateRequest revisionHeight + * @property {boolean|null} [latestHeight] QueryConsensusStateRequest latestHeight + */ + + /** + * Constructs a new QueryConsensusStateRequest. + * @memberof ibc.core.client.v1 + * @classdesc Represents a QueryConsensusStateRequest. + * @implements IQueryConsensusStateRequest + * @constructor + * @param {ibc.core.client.v1.IQueryConsensusStateRequest=} [properties] Properties to set + */ + function QueryConsensusStateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryConsensusStateRequest clientId. + * @member {string} clientId + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @instance + */ + QueryConsensusStateRequest.prototype.clientId = ""; + + /** + * QueryConsensusStateRequest revisionNumber. + * @member {number|Long} revisionNumber + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @instance + */ + QueryConsensusStateRequest.prototype.revisionNumber = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * QueryConsensusStateRequest revisionHeight. + * @member {number|Long} revisionHeight + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @instance + */ + QueryConsensusStateRequest.prototype.revisionHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * QueryConsensusStateRequest latestHeight. + * @member {boolean} latestHeight + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @instance + */ + QueryConsensusStateRequest.prototype.latestHeight = false; + + /** + * Creates a new QueryConsensusStateRequest instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @static + * @param {ibc.core.client.v1.IQueryConsensusStateRequest=} [properties] Properties to set + * @returns {ibc.core.client.v1.QueryConsensusStateRequest} QueryConsensusStateRequest instance + */ + QueryConsensusStateRequest.create = function create(properties) { + return new QueryConsensusStateRequest(properties); + }; + + /** + * Encodes the specified QueryConsensusStateRequest message. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @static + * @param {ibc.core.client.v1.IQueryConsensusStateRequest} message QueryConsensusStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConsensusStateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.revisionNumber != null && Object.hasOwnProperty.call(message, "revisionNumber")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.revisionNumber); + if (message.revisionHeight != null && Object.hasOwnProperty.call(message, "revisionHeight")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.revisionHeight); + if (message.latestHeight != null && Object.hasOwnProperty.call(message, "latestHeight")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.latestHeight); + return writer; + }; + + /** + * Encodes the specified QueryConsensusStateRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @static + * @param {ibc.core.client.v1.IQueryConsensusStateRequest} message QueryConsensusStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConsensusStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryConsensusStateRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.QueryConsensusStateRequest} QueryConsensusStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConsensusStateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryConsensusStateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.revisionNumber = reader.uint64(); + break; + case 3: + message.revisionHeight = reader.uint64(); + break; + case 4: + message.latestHeight = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryConsensusStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.QueryConsensusStateRequest} QueryConsensusStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConsensusStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryConsensusStateRequest message. + * @function verify + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryConsensusStateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) + if (!$util.isInteger(message.revisionNumber) && !(message.revisionNumber && $util.isInteger(message.revisionNumber.low) && $util.isInteger(message.revisionNumber.high))) + return "revisionNumber: integer|Long expected"; + if (message.revisionHeight != null && message.hasOwnProperty("revisionHeight")) + if (!$util.isInteger(message.revisionHeight) && !(message.revisionHeight && $util.isInteger(message.revisionHeight.low) && $util.isInteger(message.revisionHeight.high))) + return "revisionHeight: integer|Long expected"; + if (message.latestHeight != null && message.hasOwnProperty("latestHeight")) + if (typeof message.latestHeight !== "boolean") + return "latestHeight: boolean expected"; + return null; + }; + + /** + * Creates a QueryConsensusStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.QueryConsensusStateRequest} QueryConsensusStateRequest + */ + QueryConsensusStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.QueryConsensusStateRequest) + return object; + var message = new $root.ibc.core.client.v1.QueryConsensusStateRequest(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.revisionNumber != null) + if ($util.Long) + (message.revisionNumber = $util.Long.fromValue(object.revisionNumber)).unsigned = true; + else if (typeof object.revisionNumber === "string") + message.revisionNumber = parseInt(object.revisionNumber, 10); + else if (typeof object.revisionNumber === "number") + message.revisionNumber = object.revisionNumber; + else if (typeof object.revisionNumber === "object") + message.revisionNumber = new $util.LongBits(object.revisionNumber.low >>> 0, object.revisionNumber.high >>> 0).toNumber(true); + if (object.revisionHeight != null) + if ($util.Long) + (message.revisionHeight = $util.Long.fromValue(object.revisionHeight)).unsigned = true; + else if (typeof object.revisionHeight === "string") + message.revisionHeight = parseInt(object.revisionHeight, 10); + else if (typeof object.revisionHeight === "number") + message.revisionHeight = object.revisionHeight; + else if (typeof object.revisionHeight === "object") + message.revisionHeight = new $util.LongBits(object.revisionHeight.low >>> 0, object.revisionHeight.high >>> 0).toNumber(true); + if (object.latestHeight != null) + message.latestHeight = Boolean(object.latestHeight); + return message; + }; + + /** + * Creates a plain object from a QueryConsensusStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @static + * @param {ibc.core.client.v1.QueryConsensusStateRequest} message QueryConsensusStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryConsensusStateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.clientId = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.revisionNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.revisionNumber = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.revisionHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.revisionHeight = options.longs === String ? "0" : 0; + object.latestHeight = false; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) + if (typeof message.revisionNumber === "number") + object.revisionNumber = options.longs === String ? String(message.revisionNumber) : message.revisionNumber; + else + object.revisionNumber = options.longs === String ? $util.Long.prototype.toString.call(message.revisionNumber) : options.longs === Number ? new $util.LongBits(message.revisionNumber.low >>> 0, message.revisionNumber.high >>> 0).toNumber(true) : message.revisionNumber; + if (message.revisionHeight != null && message.hasOwnProperty("revisionHeight")) + if (typeof message.revisionHeight === "number") + object.revisionHeight = options.longs === String ? String(message.revisionHeight) : message.revisionHeight; + else + object.revisionHeight = options.longs === String ? $util.Long.prototype.toString.call(message.revisionHeight) : options.longs === Number ? new $util.LongBits(message.revisionHeight.low >>> 0, message.revisionHeight.high >>> 0).toNumber(true) : message.revisionHeight; + if (message.latestHeight != null && message.hasOwnProperty("latestHeight")) + object.latestHeight = message.latestHeight; + return object; + }; + + /** + * Converts this QueryConsensusStateRequest to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @instance + * @returns {Object.} JSON object + */ + QueryConsensusStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryConsensusStateRequest; + })(v1.QueryConsensusStateRequest || {}); + + v1.QueryConsensusStateResponse = (function(QueryConsensusStateResponse) { + + /** + * Properties of a QueryConsensusStateResponse. + * @memberof ibc.core.client.v1 + * @interface IQueryConsensusStateResponse + * @property {google.protobuf.IAny|null} [consensusState] QueryConsensusStateResponse consensusState + * @property {Uint8Array|null} [proof] QueryConsensusStateResponse proof + * @property {ibc.core.client.v1.IHeight|null} [proofHeight] QueryConsensusStateResponse proofHeight + */ + + /** + * Constructs a new QueryConsensusStateResponse. + * @memberof ibc.core.client.v1 + * @classdesc Represents a QueryConsensusStateResponse. + * @implements IQueryConsensusStateResponse + * @constructor + * @param {ibc.core.client.v1.IQueryConsensusStateResponse=} [properties] Properties to set + */ + function QueryConsensusStateResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryConsensusStateResponse consensusState. + * @member {google.protobuf.IAny|null|undefined} consensusState + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @instance + */ + QueryConsensusStateResponse.prototype.consensusState = null; + + /** + * QueryConsensusStateResponse proof. + * @member {Uint8Array} proof + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @instance + */ + QueryConsensusStateResponse.prototype.proof = $util.newBuffer([]); + + /** + * QueryConsensusStateResponse proofHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} proofHeight + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @instance + */ + QueryConsensusStateResponse.prototype.proofHeight = null; + + /** + * Creates a new QueryConsensusStateResponse instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @static + * @param {ibc.core.client.v1.IQueryConsensusStateResponse=} [properties] Properties to set + * @returns {ibc.core.client.v1.QueryConsensusStateResponse} QueryConsensusStateResponse instance + */ + QueryConsensusStateResponse.create = function create(properties) { + return new QueryConsensusStateResponse(properties); + }; + + /** + * Encodes the specified QueryConsensusStateResponse message. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @static + * @param {ibc.core.client.v1.IQueryConsensusStateResponse} message QueryConsensusStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConsensusStateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.consensusState != null && Object.hasOwnProperty.call(message, "consensusState")) + $root.google.protobuf.Any.encode(message.consensusState, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); + if (message.proofHeight != null && Object.hasOwnProperty.call(message, "proofHeight")) + $root.ibc.core.client.v1.Height.encode(message.proofHeight, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryConsensusStateResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @static + * @param {ibc.core.client.v1.IQueryConsensusStateResponse} message QueryConsensusStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConsensusStateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryConsensusStateResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.QueryConsensusStateResponse} QueryConsensusStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConsensusStateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryConsensusStateResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consensusState = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryConsensusStateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.QueryConsensusStateResponse} QueryConsensusStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConsensusStateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryConsensusStateResponse message. + * @function verify + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryConsensusStateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.consensusState != null && message.hasOwnProperty("consensusState")) { + var error = $root.google.protobuf.Any.verify(message.consensusState); + if (error) + return "consensusState." + error; + } + if (message.proof != null && message.hasOwnProperty("proof")) + if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) + return "proof: buffer expected"; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) { + var error = $root.ibc.core.client.v1.Height.verify(message.proofHeight); + if (error) + return "proofHeight." + error; + } + return null; + }; + + /** + * Creates a QueryConsensusStateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.QueryConsensusStateResponse} QueryConsensusStateResponse + */ + QueryConsensusStateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.QueryConsensusStateResponse) + return object; + var message = new $root.ibc.core.client.v1.QueryConsensusStateResponse(); + if (object.consensusState != null) { + if (typeof object.consensusState !== "object") + throw TypeError(".ibc.core.client.v1.QueryConsensusStateResponse.consensusState: object expected"); + message.consensusState = $root.google.protobuf.Any.fromObject(object.consensusState); + } + if (object.proof != null) + if (typeof object.proof === "string") + $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); + else if (object.proof.length) + message.proof = object.proof; + if (object.proofHeight != null) { + if (typeof object.proofHeight !== "object") + throw TypeError(".ibc.core.client.v1.QueryConsensusStateResponse.proofHeight: object expected"); + message.proofHeight = $root.ibc.core.client.v1.Height.fromObject(object.proofHeight); + } + return message; + }; + + /** + * Creates a plain object from a QueryConsensusStateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @static + * @param {ibc.core.client.v1.QueryConsensusStateResponse} message QueryConsensusStateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryConsensusStateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.consensusState = null; + if (options.bytes === String) + object.proof = ""; + else { + object.proof = []; + if (options.bytes !== Array) + object.proof = $util.newBuffer(object.proof); + } + object.proofHeight = null; + } + if (message.consensusState != null && message.hasOwnProperty("consensusState")) + object.consensusState = $root.google.protobuf.Any.toObject(message.consensusState, options); + if (message.proof != null && message.hasOwnProperty("proof")) + object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) + object.proofHeight = $root.ibc.core.client.v1.Height.toObject(message.proofHeight, options); + return object; + }; + + /** + * Converts this QueryConsensusStateResponse to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @instance + * @returns {Object.} JSON object + */ + QueryConsensusStateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryConsensusStateResponse; + })(v1.QueryConsensusStateResponse || {}); + + v1.QueryConsensusStatesRequest = (function(QueryConsensusStatesRequest) { + + /** + * Properties of a QueryConsensusStatesRequest. + * @memberof ibc.core.client.v1 + * @interface IQueryConsensusStatesRequest + * @property {string|null} [clientId] QueryConsensusStatesRequest clientId + * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryConsensusStatesRequest pagination + */ + + /** + * Constructs a new QueryConsensusStatesRequest. + * @memberof ibc.core.client.v1 + * @classdesc Represents a QueryConsensusStatesRequest. + * @implements IQueryConsensusStatesRequest + * @constructor + * @param {ibc.core.client.v1.IQueryConsensusStatesRequest=} [properties] Properties to set + */ + function QueryConsensusStatesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryConsensusStatesRequest clientId. + * @member {string} clientId + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @instance + */ + QueryConsensusStatesRequest.prototype.clientId = ""; + + /** + * QueryConsensusStatesRequest pagination. + * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @instance + */ + QueryConsensusStatesRequest.prototype.pagination = null; + + /** + * Creates a new QueryConsensusStatesRequest instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @static + * @param {ibc.core.client.v1.IQueryConsensusStatesRequest=} [properties] Properties to set + * @returns {ibc.core.client.v1.QueryConsensusStatesRequest} QueryConsensusStatesRequest instance + */ + QueryConsensusStatesRequest.create = function create(properties) { + return new QueryConsensusStatesRequest(properties); + }; + + /** + * Encodes the specified QueryConsensusStatesRequest message. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStatesRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @static + * @param {ibc.core.client.v1.IQueryConsensusStatesRequest} message QueryConsensusStatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConsensusStatesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryConsensusStatesRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStatesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @static + * @param {ibc.core.client.v1.IQueryConsensusStatesRequest} message QueryConsensusStatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConsensusStatesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryConsensusStatesRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.QueryConsensusStatesRequest} QueryConsensusStatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConsensusStatesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryConsensusStatesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryConsensusStatesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.QueryConsensusStatesRequest} QueryConsensusStatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConsensusStatesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryConsensusStatesRequest message. + * @function verify + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryConsensusStatesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.pagination != null && message.hasOwnProperty("pagination")) { + var error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryConsensusStatesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.QueryConsensusStatesRequest} QueryConsensusStatesRequest + */ + QueryConsensusStatesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.QueryConsensusStatesRequest) + return object; + var message = new $root.ibc.core.client.v1.QueryConsensusStatesRequest(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".ibc.core.client.v1.QueryConsensusStatesRequest.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryConsensusStatesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @static + * @param {ibc.core.client.v1.QueryConsensusStatesRequest} message QueryConsensusStatesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryConsensusStatesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.clientId = ""; + object.pagination = null; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryConsensusStatesRequest to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @instance + * @returns {Object.} JSON object + */ + QueryConsensusStatesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryConsensusStatesRequest; + })(v1.QueryConsensusStatesRequest || {}); + + v1.QueryConsensusStatesResponse = (function(QueryConsensusStatesResponse) { + + /** + * Properties of a QueryConsensusStatesResponse. + * @memberof ibc.core.client.v1 + * @interface IQueryConsensusStatesResponse + * @property {Array.|null} [consensusStates] QueryConsensusStatesResponse consensusStates + * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryConsensusStatesResponse pagination + */ + + /** + * Constructs a new QueryConsensusStatesResponse. + * @memberof ibc.core.client.v1 + * @classdesc Represents a QueryConsensusStatesResponse. + * @implements IQueryConsensusStatesResponse + * @constructor + * @param {ibc.core.client.v1.IQueryConsensusStatesResponse=} [properties] Properties to set + */ + function QueryConsensusStatesResponse(properties) { + this.consensusStates = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryConsensusStatesResponse consensusStates. + * @member {Array.} consensusStates + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @instance + */ + QueryConsensusStatesResponse.prototype.consensusStates = $util.emptyArray; + + /** + * QueryConsensusStatesResponse pagination. + * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @instance + */ + QueryConsensusStatesResponse.prototype.pagination = null; + + /** + * Creates a new QueryConsensusStatesResponse instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @static + * @param {ibc.core.client.v1.IQueryConsensusStatesResponse=} [properties] Properties to set + * @returns {ibc.core.client.v1.QueryConsensusStatesResponse} QueryConsensusStatesResponse instance + */ + QueryConsensusStatesResponse.create = function create(properties) { + return new QueryConsensusStatesResponse(properties); + }; + + /** + * Encodes the specified QueryConsensusStatesResponse message. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStatesResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @static + * @param {ibc.core.client.v1.IQueryConsensusStatesResponse} message QueryConsensusStatesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConsensusStatesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.consensusStates != null && message.consensusStates.length) + for (var i = 0; i < message.consensusStates.length; ++i) + $root.ibc.core.client.v1.ConsensusStateWithHeight.encode(message.consensusStates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryConsensusStatesResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStatesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @static + * @param {ibc.core.client.v1.IQueryConsensusStatesResponse} message QueryConsensusStatesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConsensusStatesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryConsensusStatesResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.QueryConsensusStatesResponse} QueryConsensusStatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConsensusStatesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryConsensusStatesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.consensusStates && message.consensusStates.length)) + message.consensusStates = []; + message.consensusStates.push($root.ibc.core.client.v1.ConsensusStateWithHeight.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryConsensusStatesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.QueryConsensusStatesResponse} QueryConsensusStatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConsensusStatesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryConsensusStatesResponse message. + * @function verify + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryConsensusStatesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.consensusStates != null && message.hasOwnProperty("consensusStates")) { + if (!Array.isArray(message.consensusStates)) + return "consensusStates: array expected"; + for (var i = 0; i < message.consensusStates.length; ++i) { + var error = $root.ibc.core.client.v1.ConsensusStateWithHeight.verify(message.consensusStates[i]); + if (error) + return "consensusStates." + error; + } + } + if (message.pagination != null && message.hasOwnProperty("pagination")) { + var error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryConsensusStatesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.QueryConsensusStatesResponse} QueryConsensusStatesResponse + */ + QueryConsensusStatesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.QueryConsensusStatesResponse) + return object; + var message = new $root.ibc.core.client.v1.QueryConsensusStatesResponse(); + if (object.consensusStates) { + if (!Array.isArray(object.consensusStates)) + throw TypeError(".ibc.core.client.v1.QueryConsensusStatesResponse.consensusStates: array expected"); + message.consensusStates = []; + for (var i = 0; i < object.consensusStates.length; ++i) { + if (typeof object.consensusStates[i] !== "object") + throw TypeError(".ibc.core.client.v1.QueryConsensusStatesResponse.consensusStates: object expected"); + message.consensusStates[i] = $root.ibc.core.client.v1.ConsensusStateWithHeight.fromObject(object.consensusStates[i]); + } + } + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".ibc.core.client.v1.QueryConsensusStatesResponse.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryConsensusStatesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @static + * @param {ibc.core.client.v1.QueryConsensusStatesResponse} message QueryConsensusStatesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryConsensusStatesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.consensusStates = []; + if (options.defaults) + object.pagination = null; + if (message.consensusStates && message.consensusStates.length) { + object.consensusStates = []; + for (var j = 0; j < message.consensusStates.length; ++j) + object.consensusStates[j] = $root.ibc.core.client.v1.ConsensusStateWithHeight.toObject(message.consensusStates[j], options); + } + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryConsensusStatesResponse to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @instance + * @returns {Object.} JSON object + */ + QueryConsensusStatesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryConsensusStatesResponse; + })(v1.QueryConsensusStatesResponse || {}); + + v1.QueryClientParamsRequest = (function(QueryClientParamsRequest) { + + /** + * Properties of a QueryClientParamsRequest. + * @memberof ibc.core.client.v1 + * @interface IQueryClientParamsRequest + */ + + /** + * Constructs a new QueryClientParamsRequest. + * @memberof ibc.core.client.v1 + * @classdesc Represents a QueryClientParamsRequest. + * @implements IQueryClientParamsRequest + * @constructor + * @param {ibc.core.client.v1.IQueryClientParamsRequest=} [properties] Properties to set + */ + function QueryClientParamsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new QueryClientParamsRequest instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.QueryClientParamsRequest + * @static + * @param {ibc.core.client.v1.IQueryClientParamsRequest=} [properties] Properties to set + * @returns {ibc.core.client.v1.QueryClientParamsRequest} QueryClientParamsRequest instance + */ + QueryClientParamsRequest.create = function create(properties) { + return new QueryClientParamsRequest(properties); + }; + + /** + * Encodes the specified QueryClientParamsRequest message. Does not implicitly {@link ibc.core.client.v1.QueryClientParamsRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.QueryClientParamsRequest + * @static + * @param {ibc.core.client.v1.IQueryClientParamsRequest} message QueryClientParamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientParamsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified QueryClientParamsRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientParamsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.QueryClientParamsRequest + * @static + * @param {ibc.core.client.v1.IQueryClientParamsRequest} message QueryClientParamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryClientParamsRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.QueryClientParamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.QueryClientParamsRequest} QueryClientParamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientParamsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientParamsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryClientParamsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.QueryClientParamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.QueryClientParamsRequest} QueryClientParamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientParamsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryClientParamsRequest message. + * @function verify + * @memberof ibc.core.client.v1.QueryClientParamsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryClientParamsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a QueryClientParamsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.QueryClientParamsRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.QueryClientParamsRequest} QueryClientParamsRequest + */ + QueryClientParamsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.QueryClientParamsRequest) + return object; + return new $root.ibc.core.client.v1.QueryClientParamsRequest(); + }; + + /** + * Creates a plain object from a QueryClientParamsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.QueryClientParamsRequest + * @static + * @param {ibc.core.client.v1.QueryClientParamsRequest} message QueryClientParamsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryClientParamsRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this QueryClientParamsRequest to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.QueryClientParamsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryClientParamsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryClientParamsRequest; + })(v1.QueryClientParamsRequest || {}); + + v1.QueryClientParamsResponse = (function(QueryClientParamsResponse) { + + /** + * Properties of a QueryClientParamsResponse. + * @memberof ibc.core.client.v1 + * @interface IQueryClientParamsResponse + * @property {ibc.core.client.v1.IParams|null} [params] QueryClientParamsResponse params + */ + + /** + * Constructs a new QueryClientParamsResponse. + * @memberof ibc.core.client.v1 + * @classdesc Represents a QueryClientParamsResponse. + * @implements IQueryClientParamsResponse + * @constructor + * @param {ibc.core.client.v1.IQueryClientParamsResponse=} [properties] Properties to set + */ + function QueryClientParamsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryClientParamsResponse params. + * @member {ibc.core.client.v1.IParams|null|undefined} params + * @memberof ibc.core.client.v1.QueryClientParamsResponse + * @instance + */ + QueryClientParamsResponse.prototype.params = null; + + /** + * Creates a new QueryClientParamsResponse instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.QueryClientParamsResponse + * @static + * @param {ibc.core.client.v1.IQueryClientParamsResponse=} [properties] Properties to set + * @returns {ibc.core.client.v1.QueryClientParamsResponse} QueryClientParamsResponse instance + */ + QueryClientParamsResponse.create = function create(properties) { + return new QueryClientParamsResponse(properties); + }; + + /** + * Encodes the specified QueryClientParamsResponse message. Does not implicitly {@link ibc.core.client.v1.QueryClientParamsResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.QueryClientParamsResponse + * @static + * @param {ibc.core.client.v1.IQueryClientParamsResponse} message QueryClientParamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientParamsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.ibc.core.client.v1.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryClientParamsResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientParamsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.QueryClientParamsResponse + * @static + * @param {ibc.core.client.v1.IQueryClientParamsResponse} message QueryClientParamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryClientParamsResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.QueryClientParamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.QueryClientParamsResponse} QueryClientParamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientParamsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientParamsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = $root.ibc.core.client.v1.Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryClientParamsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.QueryClientParamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.QueryClientParamsResponse} QueryClientParamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientParamsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryClientParamsResponse message. + * @function verify + * @memberof ibc.core.client.v1.QueryClientParamsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryClientParamsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.params != null && message.hasOwnProperty("params")) { + var error = $root.ibc.core.client.v1.Params.verify(message.params); + if (error) + return "params." + error; + } + return null; + }; + + /** + * Creates a QueryClientParamsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.QueryClientParamsResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.QueryClientParamsResponse} QueryClientParamsResponse + */ + QueryClientParamsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.QueryClientParamsResponse) + return object; + var message = new $root.ibc.core.client.v1.QueryClientParamsResponse(); + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".ibc.core.client.v1.QueryClientParamsResponse.params: object expected"); + message.params = $root.ibc.core.client.v1.Params.fromObject(object.params); + } + return message; + }; + + /** + * Creates a plain object from a QueryClientParamsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.QueryClientParamsResponse + * @static + * @param {ibc.core.client.v1.QueryClientParamsResponse} message QueryClientParamsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryClientParamsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.params = null; + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.ibc.core.client.v1.Params.toObject(message.params, options); + return object; + }; + + /** + * Converts this QueryClientParamsResponse to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.QueryClientParamsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryClientParamsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryClientParamsResponse; + })(v1.QueryClientParamsResponse || {}); + + v1.Msg = (function(Msg) { + + /** + * Constructs a new Msg service. + * @memberof ibc.core.client.v1 + * @classdesc Represents a Msg + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Msg(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; + + /** + * Creates new Msg service using the specified rpc implementation. + * @function create + * @memberof ibc.core.client.v1.Msg + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Msg} RPC service. Useful where requests and/or responses are streamed. + */ + Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link ibc.core.client.v1.Msg#createClient}. + * @memberof ibc.core.client.v1.Msg + * @typedef CreateClientCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.client.v1.IMsgCreateClientResponse} [response] MsgCreateClientResponse + */ + + /** + * Calls CreateClient. + * @function createClient + * @memberof ibc.core.client.v1.Msg + * @instance + * @param {ibc.core.client.v1.IMsgCreateClient} request MsgCreateClient message or plain object + * @param {ibc.core.client.v1.Msg.CreateClientCallback} callback Node-style callback called with the error, if any, and MsgCreateClientResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.createClient = function createClient(request, callback) { + return this.rpcCall(createClient, $root.ibc.core.client.v1.MsgCreateClient, $root.ibc.core.client.v1.MsgCreateClientResponse, request, callback); + }, "name", { value: "CreateClient" }); + + /** + * Calls CreateClient. + * @function createClient + * @memberof ibc.core.client.v1.Msg + * @instance + * @param {ibc.core.client.v1.IMsgCreateClient} request MsgCreateClient message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.client.v1.Msg#updateClient}. + * @memberof ibc.core.client.v1.Msg + * @typedef UpdateClientCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.client.v1.IMsgUpdateClientResponse} [response] MsgUpdateClientResponse + */ + + /** + * Calls UpdateClient. + * @function updateClient + * @memberof ibc.core.client.v1.Msg + * @instance + * @param {ibc.core.client.v1.IMsgUpdateClient} request MsgUpdateClient message or plain object + * @param {ibc.core.client.v1.Msg.UpdateClientCallback} callback Node-style callback called with the error, if any, and MsgUpdateClientResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.updateClient = function updateClient(request, callback) { + return this.rpcCall(updateClient, $root.ibc.core.client.v1.MsgUpdateClient, $root.ibc.core.client.v1.MsgUpdateClientResponse, request, callback); + }, "name", { value: "UpdateClient" }); + + /** + * Calls UpdateClient. + * @function updateClient + * @memberof ibc.core.client.v1.Msg + * @instance + * @param {ibc.core.client.v1.IMsgUpdateClient} request MsgUpdateClient message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.client.v1.Msg#upgradeClient}. + * @memberof ibc.core.client.v1.Msg + * @typedef UpgradeClientCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.client.v1.IMsgUpgradeClientResponse} [response] MsgUpgradeClientResponse + */ + + /** + * Calls UpgradeClient. + * @function upgradeClient + * @memberof ibc.core.client.v1.Msg + * @instance + * @param {ibc.core.client.v1.IMsgUpgradeClient} request MsgUpgradeClient message or plain object + * @param {ibc.core.client.v1.Msg.UpgradeClientCallback} callback Node-style callback called with the error, if any, and MsgUpgradeClientResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.upgradeClient = function upgradeClient(request, callback) { + return this.rpcCall(upgradeClient, $root.ibc.core.client.v1.MsgUpgradeClient, $root.ibc.core.client.v1.MsgUpgradeClientResponse, request, callback); + }, "name", { value: "UpgradeClient" }); + + /** + * Calls UpgradeClient. + * @function upgradeClient + * @memberof ibc.core.client.v1.Msg + * @instance + * @param {ibc.core.client.v1.IMsgUpgradeClient} request MsgUpgradeClient message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.client.v1.Msg#submitMisbehaviour}. + * @memberof ibc.core.client.v1.Msg + * @typedef SubmitMisbehaviourCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviourResponse} [response] MsgSubmitMisbehaviourResponse + */ + + /** + * Calls SubmitMisbehaviour. + * @function submitMisbehaviour + * @memberof ibc.core.client.v1.Msg + * @instance + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviour} request MsgSubmitMisbehaviour message or plain object + * @param {ibc.core.client.v1.Msg.SubmitMisbehaviourCallback} callback Node-style callback called with the error, if any, and MsgSubmitMisbehaviourResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.submitMisbehaviour = function submitMisbehaviour(request, callback) { + return this.rpcCall(submitMisbehaviour, $root.ibc.core.client.v1.MsgSubmitMisbehaviour, $root.ibc.core.client.v1.MsgSubmitMisbehaviourResponse, request, callback); + }, "name", { value: "SubmitMisbehaviour" }); + + /** + * Calls SubmitMisbehaviour. + * @function submitMisbehaviour + * @memberof ibc.core.client.v1.Msg + * @instance + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviour} request MsgSubmitMisbehaviour message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Msg; + })(v1.Msg || {}); + + v1.MsgCreateClient = (function(MsgCreateClient) { + + /** + * Properties of a MsgCreateClient. + * @memberof ibc.core.client.v1 + * @interface IMsgCreateClient + * @property {google.protobuf.IAny|null} [clientState] MsgCreateClient clientState + * @property {google.protobuf.IAny|null} [consensusState] MsgCreateClient consensusState + * @property {string|null} [signer] MsgCreateClient signer + */ + + /** + * Constructs a new MsgCreateClient. + * @memberof ibc.core.client.v1 + * @classdesc Represents a MsgCreateClient. + * @implements IMsgCreateClient + * @constructor + * @param {ibc.core.client.v1.IMsgCreateClient=} [properties] Properties to set + */ + function MsgCreateClient(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgCreateClient clientState. + * @member {google.protobuf.IAny|null|undefined} clientState + * @memberof ibc.core.client.v1.MsgCreateClient + * @instance + */ + MsgCreateClient.prototype.clientState = null; + + /** + * MsgCreateClient consensusState. + * @member {google.protobuf.IAny|null|undefined} consensusState + * @memberof ibc.core.client.v1.MsgCreateClient + * @instance + */ + MsgCreateClient.prototype.consensusState = null; + + /** + * MsgCreateClient signer. + * @member {string} signer + * @memberof ibc.core.client.v1.MsgCreateClient + * @instance + */ + MsgCreateClient.prototype.signer = ""; + + /** + * Creates a new MsgCreateClient instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.MsgCreateClient + * @static + * @param {ibc.core.client.v1.IMsgCreateClient=} [properties] Properties to set + * @returns {ibc.core.client.v1.MsgCreateClient} MsgCreateClient instance + */ + MsgCreateClient.create = function create(properties) { + return new MsgCreateClient(properties); + }; + + /** + * Encodes the specified MsgCreateClient message. Does not implicitly {@link ibc.core.client.v1.MsgCreateClient.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.MsgCreateClient + * @static + * @param {ibc.core.client.v1.IMsgCreateClient} message MsgCreateClient message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateClient.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientState != null && Object.hasOwnProperty.call(message, "clientState")) + $root.google.protobuf.Any.encode(message.clientState, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.consensusState != null && Object.hasOwnProperty.call(message, "consensusState")) + $root.google.protobuf.Any.encode(message.consensusState, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.signer); + return writer; + }; + + /** + * Encodes the specified MsgCreateClient message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgCreateClient.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.MsgCreateClient + * @static + * @param {ibc.core.client.v1.IMsgCreateClient} message MsgCreateClient message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateClient.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgCreateClient message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.MsgCreateClient + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.MsgCreateClient} MsgCreateClient + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateClient.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgCreateClient(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientState = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 2: + message.consensusState = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgCreateClient message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.MsgCreateClient + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.MsgCreateClient} MsgCreateClient + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateClient.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgCreateClient message. + * @function verify + * @memberof ibc.core.client.v1.MsgCreateClient + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgCreateClient.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientState != null && message.hasOwnProperty("clientState")) { + var error = $root.google.protobuf.Any.verify(message.clientState); + if (error) + return "clientState." + error; + } + if (message.consensusState != null && message.hasOwnProperty("consensusState")) { + var error = $root.google.protobuf.Any.verify(message.consensusState); + if (error) + return "consensusState." + error; + } + if (message.signer != null && message.hasOwnProperty("signer")) + if (!$util.isString(message.signer)) + return "signer: string expected"; + return null; + }; + + /** + * Creates a MsgCreateClient message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.MsgCreateClient + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.MsgCreateClient} MsgCreateClient + */ + MsgCreateClient.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.MsgCreateClient) + return object; + var message = new $root.ibc.core.client.v1.MsgCreateClient(); + if (object.clientState != null) { + if (typeof object.clientState !== "object") + throw TypeError(".ibc.core.client.v1.MsgCreateClient.clientState: object expected"); + message.clientState = $root.google.protobuf.Any.fromObject(object.clientState); + } + if (object.consensusState != null) { + if (typeof object.consensusState !== "object") + throw TypeError(".ibc.core.client.v1.MsgCreateClient.consensusState: object expected"); + message.consensusState = $root.google.protobuf.Any.fromObject(object.consensusState); + } + if (object.signer != null) + message.signer = String(object.signer); + return message; + }; + + /** + * Creates a plain object from a MsgCreateClient message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.MsgCreateClient + * @static + * @param {ibc.core.client.v1.MsgCreateClient} message MsgCreateClient + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgCreateClient.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.clientState = null; + object.consensusState = null; + object.signer = ""; + } + if (message.clientState != null && message.hasOwnProperty("clientState")) + object.clientState = $root.google.protobuf.Any.toObject(message.clientState, options); + if (message.consensusState != null && message.hasOwnProperty("consensusState")) + object.consensusState = $root.google.protobuf.Any.toObject(message.consensusState, options); + if (message.signer != null && message.hasOwnProperty("signer")) + object.signer = message.signer; + return object; + }; + + /** + * Converts this MsgCreateClient to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.MsgCreateClient + * @instance + * @returns {Object.} JSON object + */ + MsgCreateClient.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgCreateClient; + })(v1.MsgCreateClient || {}); + + v1.MsgCreateClientResponse = (function(MsgCreateClientResponse) { + + /** + * Properties of a MsgCreateClientResponse. + * @memberof ibc.core.client.v1 + * @interface IMsgCreateClientResponse + */ + + /** + * Constructs a new MsgCreateClientResponse. + * @memberof ibc.core.client.v1 + * @classdesc Represents a MsgCreateClientResponse. + * @implements IMsgCreateClientResponse + * @constructor + * @param {ibc.core.client.v1.IMsgCreateClientResponse=} [properties] Properties to set + */ + function MsgCreateClientResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgCreateClientResponse instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.MsgCreateClientResponse + * @static + * @param {ibc.core.client.v1.IMsgCreateClientResponse=} [properties] Properties to set + * @returns {ibc.core.client.v1.MsgCreateClientResponse} MsgCreateClientResponse instance + */ + MsgCreateClientResponse.create = function create(properties) { + return new MsgCreateClientResponse(properties); + }; + + /** + * Encodes the specified MsgCreateClientResponse message. Does not implicitly {@link ibc.core.client.v1.MsgCreateClientResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.MsgCreateClientResponse + * @static + * @param {ibc.core.client.v1.IMsgCreateClientResponse} message MsgCreateClientResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateClientResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgCreateClientResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgCreateClientResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.MsgCreateClientResponse + * @static + * @param {ibc.core.client.v1.IMsgCreateClientResponse} message MsgCreateClientResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateClientResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgCreateClientResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.MsgCreateClientResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.MsgCreateClientResponse} MsgCreateClientResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateClientResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgCreateClientResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgCreateClientResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.MsgCreateClientResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.MsgCreateClientResponse} MsgCreateClientResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateClientResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgCreateClientResponse message. + * @function verify + * @memberof ibc.core.client.v1.MsgCreateClientResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgCreateClientResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgCreateClientResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.MsgCreateClientResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.MsgCreateClientResponse} MsgCreateClientResponse + */ + MsgCreateClientResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.MsgCreateClientResponse) + return object; + return new $root.ibc.core.client.v1.MsgCreateClientResponse(); + }; + + /** + * Creates a plain object from a MsgCreateClientResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.MsgCreateClientResponse + * @static + * @param {ibc.core.client.v1.MsgCreateClientResponse} message MsgCreateClientResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgCreateClientResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgCreateClientResponse to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.MsgCreateClientResponse + * @instance + * @returns {Object.} JSON object + */ + MsgCreateClientResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgCreateClientResponse; + })(v1.MsgCreateClientResponse || {}); + + v1.MsgUpdateClient = (function(MsgUpdateClient) { + + /** + * Properties of a MsgUpdateClient. + * @memberof ibc.core.client.v1 + * @interface IMsgUpdateClient + * @property {string|null} [clientId] MsgUpdateClient clientId + * @property {google.protobuf.IAny|null} [header] MsgUpdateClient header + * @property {string|null} [signer] MsgUpdateClient signer + */ + + /** + * Constructs a new MsgUpdateClient. + * @memberof ibc.core.client.v1 + * @classdesc Represents a MsgUpdateClient. + * @implements IMsgUpdateClient + * @constructor + * @param {ibc.core.client.v1.IMsgUpdateClient=} [properties] Properties to set + */ + function MsgUpdateClient(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgUpdateClient clientId. + * @member {string} clientId + * @memberof ibc.core.client.v1.MsgUpdateClient + * @instance + */ + MsgUpdateClient.prototype.clientId = ""; + + /** + * MsgUpdateClient header. + * @member {google.protobuf.IAny|null|undefined} header + * @memberof ibc.core.client.v1.MsgUpdateClient + * @instance + */ + MsgUpdateClient.prototype.header = null; + + /** + * MsgUpdateClient signer. + * @member {string} signer + * @memberof ibc.core.client.v1.MsgUpdateClient + * @instance + */ + MsgUpdateClient.prototype.signer = ""; + + /** + * Creates a new MsgUpdateClient instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.MsgUpdateClient + * @static + * @param {ibc.core.client.v1.IMsgUpdateClient=} [properties] Properties to set + * @returns {ibc.core.client.v1.MsgUpdateClient} MsgUpdateClient instance + */ + MsgUpdateClient.create = function create(properties) { + return new MsgUpdateClient(properties); + }; + + /** + * Encodes the specified MsgUpdateClient message. Does not implicitly {@link ibc.core.client.v1.MsgUpdateClient.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.MsgUpdateClient + * @static + * @param {ibc.core.client.v1.IMsgUpdateClient} message MsgUpdateClient message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUpdateClient.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + $root.google.protobuf.Any.encode(message.header, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.signer); + return writer; + }; + + /** + * Encodes the specified MsgUpdateClient message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgUpdateClient.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.MsgUpdateClient + * @static + * @param {ibc.core.client.v1.IMsgUpdateClient} message MsgUpdateClient message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUpdateClient.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgUpdateClient message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.MsgUpdateClient + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.MsgUpdateClient} MsgUpdateClient + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUpdateClient.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgUpdateClient(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.header = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgUpdateClient message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.MsgUpdateClient + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.MsgUpdateClient} MsgUpdateClient + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUpdateClient.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgUpdateClient message. + * @function verify + * @memberof ibc.core.client.v1.MsgUpdateClient + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgUpdateClient.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.header != null && message.hasOwnProperty("header")) { + var error = $root.google.protobuf.Any.verify(message.header); + if (error) + return "header." + error; + } + if (message.signer != null && message.hasOwnProperty("signer")) + if (!$util.isString(message.signer)) + return "signer: string expected"; + return null; + }; + + /** + * Creates a MsgUpdateClient message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.MsgUpdateClient + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.MsgUpdateClient} MsgUpdateClient + */ + MsgUpdateClient.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.MsgUpdateClient) + return object; + var message = new $root.ibc.core.client.v1.MsgUpdateClient(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.header != null) { + if (typeof object.header !== "object") + throw TypeError(".ibc.core.client.v1.MsgUpdateClient.header: object expected"); + message.header = $root.google.protobuf.Any.fromObject(object.header); + } + if (object.signer != null) + message.signer = String(object.signer); + return message; + }; + + /** + * Creates a plain object from a MsgUpdateClient message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.MsgUpdateClient + * @static + * @param {ibc.core.client.v1.MsgUpdateClient} message MsgUpdateClient + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgUpdateClient.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.clientId = ""; + object.header = null; + object.signer = ""; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.header != null && message.hasOwnProperty("header")) + object.header = $root.google.protobuf.Any.toObject(message.header, options); + if (message.signer != null && message.hasOwnProperty("signer")) + object.signer = message.signer; + return object; + }; + + /** + * Converts this MsgUpdateClient to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.MsgUpdateClient + * @instance + * @returns {Object.} JSON object + */ + MsgUpdateClient.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgUpdateClient; + })(v1.MsgUpdateClient || {}); + + v1.MsgUpdateClientResponse = (function(MsgUpdateClientResponse) { + + /** + * Properties of a MsgUpdateClientResponse. + * @memberof ibc.core.client.v1 + * @interface IMsgUpdateClientResponse + */ + + /** + * Constructs a new MsgUpdateClientResponse. + * @memberof ibc.core.client.v1 + * @classdesc Represents a MsgUpdateClientResponse. + * @implements IMsgUpdateClientResponse + * @constructor + * @param {ibc.core.client.v1.IMsgUpdateClientResponse=} [properties] Properties to set + */ + function MsgUpdateClientResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgUpdateClientResponse instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.MsgUpdateClientResponse + * @static + * @param {ibc.core.client.v1.IMsgUpdateClientResponse=} [properties] Properties to set + * @returns {ibc.core.client.v1.MsgUpdateClientResponse} MsgUpdateClientResponse instance + */ + MsgUpdateClientResponse.create = function create(properties) { + return new MsgUpdateClientResponse(properties); + }; + + /** + * Encodes the specified MsgUpdateClientResponse message. Does not implicitly {@link ibc.core.client.v1.MsgUpdateClientResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.MsgUpdateClientResponse + * @static + * @param {ibc.core.client.v1.IMsgUpdateClientResponse} message MsgUpdateClientResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUpdateClientResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgUpdateClientResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgUpdateClientResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.MsgUpdateClientResponse + * @static + * @param {ibc.core.client.v1.IMsgUpdateClientResponse} message MsgUpdateClientResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUpdateClientResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgUpdateClientResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.MsgUpdateClientResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.MsgUpdateClientResponse} MsgUpdateClientResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUpdateClientResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgUpdateClientResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgUpdateClientResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.MsgUpdateClientResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.MsgUpdateClientResponse} MsgUpdateClientResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUpdateClientResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgUpdateClientResponse message. + * @function verify + * @memberof ibc.core.client.v1.MsgUpdateClientResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgUpdateClientResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgUpdateClientResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.MsgUpdateClientResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.MsgUpdateClientResponse} MsgUpdateClientResponse + */ + MsgUpdateClientResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.MsgUpdateClientResponse) + return object; + return new $root.ibc.core.client.v1.MsgUpdateClientResponse(); + }; + + /** + * Creates a plain object from a MsgUpdateClientResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.MsgUpdateClientResponse + * @static + * @param {ibc.core.client.v1.MsgUpdateClientResponse} message MsgUpdateClientResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgUpdateClientResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgUpdateClientResponse to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.MsgUpdateClientResponse + * @instance + * @returns {Object.} JSON object + */ + MsgUpdateClientResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgUpdateClientResponse; + })(v1.MsgUpdateClientResponse || {}); + + v1.MsgUpgradeClient = (function(MsgUpgradeClient) { + + /** + * Properties of a MsgUpgradeClient. + * @memberof ibc.core.client.v1 + * @interface IMsgUpgradeClient + * @property {string|null} [clientId] MsgUpgradeClient clientId + * @property {google.protobuf.IAny|null} [clientState] MsgUpgradeClient clientState + * @property {google.protobuf.IAny|null} [consensusState] MsgUpgradeClient consensusState + * @property {Uint8Array|null} [proofUpgradeClient] MsgUpgradeClient proofUpgradeClient + * @property {Uint8Array|null} [proofUpgradeConsensusState] MsgUpgradeClient proofUpgradeConsensusState + * @property {string|null} [signer] MsgUpgradeClient signer + */ + + /** + * Constructs a new MsgUpgradeClient. + * @memberof ibc.core.client.v1 + * @classdesc Represents a MsgUpgradeClient. + * @implements IMsgUpgradeClient + * @constructor + * @param {ibc.core.client.v1.IMsgUpgradeClient=} [properties] Properties to set + */ + function MsgUpgradeClient(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgUpgradeClient clientId. + * @member {string} clientId + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @instance + */ + MsgUpgradeClient.prototype.clientId = ""; + + /** + * MsgUpgradeClient clientState. + * @member {google.protobuf.IAny|null|undefined} clientState + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @instance + */ + MsgUpgradeClient.prototype.clientState = null; + + /** + * MsgUpgradeClient consensusState. + * @member {google.protobuf.IAny|null|undefined} consensusState + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @instance + */ + MsgUpgradeClient.prototype.consensusState = null; + + /** + * MsgUpgradeClient proofUpgradeClient. + * @member {Uint8Array} proofUpgradeClient + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @instance + */ + MsgUpgradeClient.prototype.proofUpgradeClient = $util.newBuffer([]); + + /** + * MsgUpgradeClient proofUpgradeConsensusState. + * @member {Uint8Array} proofUpgradeConsensusState + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @instance + */ + MsgUpgradeClient.prototype.proofUpgradeConsensusState = $util.newBuffer([]); + + /** + * MsgUpgradeClient signer. + * @member {string} signer + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @instance + */ + MsgUpgradeClient.prototype.signer = ""; + + /** + * Creates a new MsgUpgradeClient instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @static + * @param {ibc.core.client.v1.IMsgUpgradeClient=} [properties] Properties to set + * @returns {ibc.core.client.v1.MsgUpgradeClient} MsgUpgradeClient instance + */ + MsgUpgradeClient.create = function create(properties) { + return new MsgUpgradeClient(properties); + }; + + /** + * Encodes the specified MsgUpgradeClient message. Does not implicitly {@link ibc.core.client.v1.MsgUpgradeClient.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @static + * @param {ibc.core.client.v1.IMsgUpgradeClient} message MsgUpgradeClient message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUpgradeClient.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.clientState != null && Object.hasOwnProperty.call(message, "clientState")) + $root.google.protobuf.Any.encode(message.clientState, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.consensusState != null && Object.hasOwnProperty.call(message, "consensusState")) + $root.google.protobuf.Any.encode(message.consensusState, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.proofUpgradeClient != null && Object.hasOwnProperty.call(message, "proofUpgradeClient")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.proofUpgradeClient); + if (message.proofUpgradeConsensusState != null && Object.hasOwnProperty.call(message, "proofUpgradeConsensusState")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.proofUpgradeConsensusState); + if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.signer); + return writer; + }; + + /** + * Encodes the specified MsgUpgradeClient message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgUpgradeClient.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @static + * @param {ibc.core.client.v1.IMsgUpgradeClient} message MsgUpgradeClient message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUpgradeClient.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgUpgradeClient message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.MsgUpgradeClient} MsgUpgradeClient + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUpgradeClient.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgUpgradeClient(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.clientState = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 3: + message.consensusState = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 4: + message.proofUpgradeClient = reader.bytes(); + break; + case 5: + message.proofUpgradeConsensusState = reader.bytes(); + break; + case 6: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgUpgradeClient message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.MsgUpgradeClient} MsgUpgradeClient + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUpgradeClient.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgUpgradeClient message. + * @function verify + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgUpgradeClient.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.clientState != null && message.hasOwnProperty("clientState")) { + var error = $root.google.protobuf.Any.verify(message.clientState); + if (error) + return "clientState." + error; + } + if (message.consensusState != null && message.hasOwnProperty("consensusState")) { + var error = $root.google.protobuf.Any.verify(message.consensusState); + if (error) + return "consensusState." + error; + } + if (message.proofUpgradeClient != null && message.hasOwnProperty("proofUpgradeClient")) + if (!(message.proofUpgradeClient && typeof message.proofUpgradeClient.length === "number" || $util.isString(message.proofUpgradeClient))) + return "proofUpgradeClient: buffer expected"; + if (message.proofUpgradeConsensusState != null && message.hasOwnProperty("proofUpgradeConsensusState")) + if (!(message.proofUpgradeConsensusState && typeof message.proofUpgradeConsensusState.length === "number" || $util.isString(message.proofUpgradeConsensusState))) + return "proofUpgradeConsensusState: buffer expected"; + if (message.signer != null && message.hasOwnProperty("signer")) + if (!$util.isString(message.signer)) + return "signer: string expected"; + return null; + }; + + /** + * Creates a MsgUpgradeClient message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.MsgUpgradeClient} MsgUpgradeClient + */ + MsgUpgradeClient.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.MsgUpgradeClient) + return object; + var message = new $root.ibc.core.client.v1.MsgUpgradeClient(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.clientState != null) { + if (typeof object.clientState !== "object") + throw TypeError(".ibc.core.client.v1.MsgUpgradeClient.clientState: object expected"); + message.clientState = $root.google.protobuf.Any.fromObject(object.clientState); + } + if (object.consensusState != null) { + if (typeof object.consensusState !== "object") + throw TypeError(".ibc.core.client.v1.MsgUpgradeClient.consensusState: object expected"); + message.consensusState = $root.google.protobuf.Any.fromObject(object.consensusState); + } + if (object.proofUpgradeClient != null) + if (typeof object.proofUpgradeClient === "string") + $util.base64.decode(object.proofUpgradeClient, message.proofUpgradeClient = $util.newBuffer($util.base64.length(object.proofUpgradeClient)), 0); + else if (object.proofUpgradeClient.length) + message.proofUpgradeClient = object.proofUpgradeClient; + if (object.proofUpgradeConsensusState != null) + if (typeof object.proofUpgradeConsensusState === "string") + $util.base64.decode(object.proofUpgradeConsensusState, message.proofUpgradeConsensusState = $util.newBuffer($util.base64.length(object.proofUpgradeConsensusState)), 0); + else if (object.proofUpgradeConsensusState.length) + message.proofUpgradeConsensusState = object.proofUpgradeConsensusState; + if (object.signer != null) + message.signer = String(object.signer); + return message; + }; + + /** + * Creates a plain object from a MsgUpgradeClient message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @static + * @param {ibc.core.client.v1.MsgUpgradeClient} message MsgUpgradeClient + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgUpgradeClient.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.clientId = ""; + object.clientState = null; + object.consensusState = null; + if (options.bytes === String) + object.proofUpgradeClient = ""; + else { + object.proofUpgradeClient = []; + if (options.bytes !== Array) + object.proofUpgradeClient = $util.newBuffer(object.proofUpgradeClient); + } + if (options.bytes === String) + object.proofUpgradeConsensusState = ""; + else { + object.proofUpgradeConsensusState = []; + if (options.bytes !== Array) + object.proofUpgradeConsensusState = $util.newBuffer(object.proofUpgradeConsensusState); + } + object.signer = ""; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.clientState != null && message.hasOwnProperty("clientState")) + object.clientState = $root.google.protobuf.Any.toObject(message.clientState, options); + if (message.consensusState != null && message.hasOwnProperty("consensusState")) + object.consensusState = $root.google.protobuf.Any.toObject(message.consensusState, options); + if (message.proofUpgradeClient != null && message.hasOwnProperty("proofUpgradeClient")) + object.proofUpgradeClient = options.bytes === String ? $util.base64.encode(message.proofUpgradeClient, 0, message.proofUpgradeClient.length) : options.bytes === Array ? Array.prototype.slice.call(message.proofUpgradeClient) : message.proofUpgradeClient; + if (message.proofUpgradeConsensusState != null && message.hasOwnProperty("proofUpgradeConsensusState")) + object.proofUpgradeConsensusState = options.bytes === String ? $util.base64.encode(message.proofUpgradeConsensusState, 0, message.proofUpgradeConsensusState.length) : options.bytes === Array ? Array.prototype.slice.call(message.proofUpgradeConsensusState) : message.proofUpgradeConsensusState; + if (message.signer != null && message.hasOwnProperty("signer")) + object.signer = message.signer; + return object; + }; + + /** + * Converts this MsgUpgradeClient to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @instance + * @returns {Object.} JSON object + */ + MsgUpgradeClient.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgUpgradeClient; + })(v1.MsgUpgradeClient || {}); + + v1.MsgUpgradeClientResponse = (function(MsgUpgradeClientResponse) { + + /** + * Properties of a MsgUpgradeClientResponse. + * @memberof ibc.core.client.v1 + * @interface IMsgUpgradeClientResponse + */ + + /** + * Constructs a new MsgUpgradeClientResponse. + * @memberof ibc.core.client.v1 + * @classdesc Represents a MsgUpgradeClientResponse. + * @implements IMsgUpgradeClientResponse + * @constructor + * @param {ibc.core.client.v1.IMsgUpgradeClientResponse=} [properties] Properties to set + */ + function MsgUpgradeClientResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgUpgradeClientResponse instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.MsgUpgradeClientResponse + * @static + * @param {ibc.core.client.v1.IMsgUpgradeClientResponse=} [properties] Properties to set + * @returns {ibc.core.client.v1.MsgUpgradeClientResponse} MsgUpgradeClientResponse instance + */ + MsgUpgradeClientResponse.create = function create(properties) { + return new MsgUpgradeClientResponse(properties); + }; + + /** + * Encodes the specified MsgUpgradeClientResponse message. Does not implicitly {@link ibc.core.client.v1.MsgUpgradeClientResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.MsgUpgradeClientResponse + * @static + * @param {ibc.core.client.v1.IMsgUpgradeClientResponse} message MsgUpgradeClientResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUpgradeClientResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgUpgradeClientResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgUpgradeClientResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.MsgUpgradeClientResponse + * @static + * @param {ibc.core.client.v1.IMsgUpgradeClientResponse} message MsgUpgradeClientResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUpgradeClientResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgUpgradeClientResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.MsgUpgradeClientResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.MsgUpgradeClientResponse} MsgUpgradeClientResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUpgradeClientResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgUpgradeClientResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgUpgradeClientResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.MsgUpgradeClientResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.MsgUpgradeClientResponse} MsgUpgradeClientResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUpgradeClientResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgUpgradeClientResponse message. + * @function verify + * @memberof ibc.core.client.v1.MsgUpgradeClientResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgUpgradeClientResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgUpgradeClientResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.MsgUpgradeClientResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.MsgUpgradeClientResponse} MsgUpgradeClientResponse + */ + MsgUpgradeClientResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.MsgUpgradeClientResponse) + return object; + return new $root.ibc.core.client.v1.MsgUpgradeClientResponse(); + }; + + /** + * Creates a plain object from a MsgUpgradeClientResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.MsgUpgradeClientResponse + * @static + * @param {ibc.core.client.v1.MsgUpgradeClientResponse} message MsgUpgradeClientResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgUpgradeClientResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgUpgradeClientResponse to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.MsgUpgradeClientResponse + * @instance + * @returns {Object.} JSON object + */ + MsgUpgradeClientResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgUpgradeClientResponse; + })(v1.MsgUpgradeClientResponse || {}); + + v1.MsgSubmitMisbehaviour = (function(MsgSubmitMisbehaviour) { + + /** + * Properties of a MsgSubmitMisbehaviour. + * @memberof ibc.core.client.v1 + * @interface IMsgSubmitMisbehaviour + * @property {string|null} [clientId] MsgSubmitMisbehaviour clientId + * @property {google.protobuf.IAny|null} [misbehaviour] MsgSubmitMisbehaviour misbehaviour + * @property {string|null} [signer] MsgSubmitMisbehaviour signer + */ + + /** + * Constructs a new MsgSubmitMisbehaviour. + * @memberof ibc.core.client.v1 + * @classdesc Represents a MsgSubmitMisbehaviour. + * @implements IMsgSubmitMisbehaviour + * @constructor + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviour=} [properties] Properties to set + */ + function MsgSubmitMisbehaviour(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgSubmitMisbehaviour clientId. + * @member {string} clientId + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @instance + */ + MsgSubmitMisbehaviour.prototype.clientId = ""; + + /** + * MsgSubmitMisbehaviour misbehaviour. + * @member {google.protobuf.IAny|null|undefined} misbehaviour + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @instance + */ + MsgSubmitMisbehaviour.prototype.misbehaviour = null; + + /** + * MsgSubmitMisbehaviour signer. + * @member {string} signer + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @instance + */ + MsgSubmitMisbehaviour.prototype.signer = ""; + + /** + * Creates a new MsgSubmitMisbehaviour instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @static + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviour=} [properties] Properties to set + * @returns {ibc.core.client.v1.MsgSubmitMisbehaviour} MsgSubmitMisbehaviour instance + */ + MsgSubmitMisbehaviour.create = function create(properties) { + return new MsgSubmitMisbehaviour(properties); + }; + + /** + * Encodes the specified MsgSubmitMisbehaviour message. Does not implicitly {@link ibc.core.client.v1.MsgSubmitMisbehaviour.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @static + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviour} message MsgSubmitMisbehaviour message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitMisbehaviour.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.misbehaviour != null && Object.hasOwnProperty.call(message, "misbehaviour")) + $root.google.protobuf.Any.encode(message.misbehaviour, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.signer); + return writer; + }; + + /** + * Encodes the specified MsgSubmitMisbehaviour message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgSubmitMisbehaviour.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @static + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviour} message MsgSubmitMisbehaviour message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitMisbehaviour.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgSubmitMisbehaviour message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.MsgSubmitMisbehaviour} MsgSubmitMisbehaviour + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitMisbehaviour.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgSubmitMisbehaviour(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.misbehaviour = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgSubmitMisbehaviour message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.MsgSubmitMisbehaviour} MsgSubmitMisbehaviour + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitMisbehaviour.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgSubmitMisbehaviour message. + * @function verify + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgSubmitMisbehaviour.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.misbehaviour != null && message.hasOwnProperty("misbehaviour")) { + var error = $root.google.protobuf.Any.verify(message.misbehaviour); + if (error) + return "misbehaviour." + error; + } + if (message.signer != null && message.hasOwnProperty("signer")) + if (!$util.isString(message.signer)) + return "signer: string expected"; + return null; + }; + + /** + * Creates a MsgSubmitMisbehaviour message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.MsgSubmitMisbehaviour} MsgSubmitMisbehaviour + */ + MsgSubmitMisbehaviour.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.MsgSubmitMisbehaviour) + return object; + var message = new $root.ibc.core.client.v1.MsgSubmitMisbehaviour(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.misbehaviour != null) { + if (typeof object.misbehaviour !== "object") + throw TypeError(".ibc.core.client.v1.MsgSubmitMisbehaviour.misbehaviour: object expected"); + message.misbehaviour = $root.google.protobuf.Any.fromObject(object.misbehaviour); + } + if (object.signer != null) + message.signer = String(object.signer); + return message; + }; + + /** + * Creates a plain object from a MsgSubmitMisbehaviour message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @static + * @param {ibc.core.client.v1.MsgSubmitMisbehaviour} message MsgSubmitMisbehaviour + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSubmitMisbehaviour.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.clientId = ""; + object.misbehaviour = null; + object.signer = ""; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.misbehaviour != null && message.hasOwnProperty("misbehaviour")) + object.misbehaviour = $root.google.protobuf.Any.toObject(message.misbehaviour, options); + if (message.signer != null && message.hasOwnProperty("signer")) + object.signer = message.signer; + return object; + }; + + /** + * Converts this MsgSubmitMisbehaviour to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @instance + * @returns {Object.} JSON object + */ + MsgSubmitMisbehaviour.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgSubmitMisbehaviour; + })(v1.MsgSubmitMisbehaviour || {}); + + v1.MsgSubmitMisbehaviourResponse = (function(MsgSubmitMisbehaviourResponse) { + + /** + * Properties of a MsgSubmitMisbehaviourResponse. + * @memberof ibc.core.client.v1 + * @interface IMsgSubmitMisbehaviourResponse + */ + + /** + * Constructs a new MsgSubmitMisbehaviourResponse. + * @memberof ibc.core.client.v1 + * @classdesc Represents a MsgSubmitMisbehaviourResponse. + * @implements IMsgSubmitMisbehaviourResponse + * @constructor + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviourResponse=} [properties] Properties to set + */ + function MsgSubmitMisbehaviourResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgSubmitMisbehaviourResponse instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse + * @static + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviourResponse=} [properties] Properties to set + * @returns {ibc.core.client.v1.MsgSubmitMisbehaviourResponse} MsgSubmitMisbehaviourResponse instance + */ + MsgSubmitMisbehaviourResponse.create = function create(properties) { + return new MsgSubmitMisbehaviourResponse(properties); + }; + + /** + * Encodes the specified MsgSubmitMisbehaviourResponse message. Does not implicitly {@link ibc.core.client.v1.MsgSubmitMisbehaviourResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse + * @static + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviourResponse} message MsgSubmitMisbehaviourResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitMisbehaviourResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgSubmitMisbehaviourResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgSubmitMisbehaviourResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse + * @static + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviourResponse} message MsgSubmitMisbehaviourResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitMisbehaviourResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgSubmitMisbehaviourResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.MsgSubmitMisbehaviourResponse} MsgSubmitMisbehaviourResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitMisbehaviourResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgSubmitMisbehaviourResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgSubmitMisbehaviourResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.MsgSubmitMisbehaviourResponse} MsgSubmitMisbehaviourResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitMisbehaviourResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgSubmitMisbehaviourResponse message. + * @function verify + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgSubmitMisbehaviourResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgSubmitMisbehaviourResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.MsgSubmitMisbehaviourResponse} MsgSubmitMisbehaviourResponse + */ + MsgSubmitMisbehaviourResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.MsgSubmitMisbehaviourResponse) + return object; + return new $root.ibc.core.client.v1.MsgSubmitMisbehaviourResponse(); + }; + + /** + * Creates a plain object from a MsgSubmitMisbehaviourResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse + * @static + * @param {ibc.core.client.v1.MsgSubmitMisbehaviourResponse} message MsgSubmitMisbehaviourResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSubmitMisbehaviourResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgSubmitMisbehaviourResponse to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse + * @instance + * @returns {Object.} JSON object + */ + MsgSubmitMisbehaviourResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgSubmitMisbehaviourResponse; + })(v1.MsgSubmitMisbehaviourResponse || {}); + + return v1; + })(client.v1 || {}); + + return client; + })(core.client || {}); + + return core; + })(ibc.core || {}); + + return ibc; +})($root.ibc || {}); + +module.exports = $root; diff --git a/src/libs/bundle.js b/src/libs/bundle.js new file mode 100644 index 00000000..1f4545a9 --- /dev/null +++ b/src/libs/bundle.js @@ -0,0 +1,46223 @@ +/* eslint-disable */ +"use strict"; + +var $protobuf = require("protobufjs-dbx/minimal"); + +// Common aliases +var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); + +/** + * Namespace cosmos. + * @exports cosmos + * @namespace + */ + +$root.cosmos = (function(cosmos) { + + /** + * Namespace base. + * @memberof cosmos + * @namespace + */ + + cosmos.base = (function(base) { + + /** + * Namespace v1beta1. + * @memberof cosmos.base + * @namespace + */ + + base.v1beta1 = (function(v1beta1) { + + v1beta1.Coin = (function(Coin) { + + /** + * Properties of a Coin. + * @memberof cosmos.base.v1beta1 + * @interface ICoin + * @property {string|null} [denom] Coin denom + * @property {string|null} [amount] Coin amount + */ + + /** + * Constructs a new Coin. + * @memberof cosmos.base.v1beta1 + * @classdesc Represents a Coin. + * @implements ICoin + * @constructor + * @param {cosmos.base.v1beta1.ICoin=} [properties] Properties to set + */ + function Coin(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Coin denom. + * @member {string} denom + * @memberof cosmos.base.v1beta1.Coin + * @instance + */ + Coin.prototype.denom = ""; + + /** + * Coin amount. + * @member {string} amount + * @memberof cosmos.base.v1beta1.Coin + * @instance + */ + Coin.prototype.amount = ""; + + /** + * Creates a new Coin instance using the specified properties. + * @function create + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {cosmos.base.v1beta1.ICoin=} [properties] Properties to set + * @returns {cosmos.base.v1beta1.Coin} Coin instance + */ + Coin.create = function create(properties) { + return new Coin(properties); + }; + + /** + * Encodes the specified Coin message. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. + * @function encode + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {cosmos.base.v1beta1.ICoin} message Coin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Coin.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.amount); + return writer; + }; + + /** + * Encodes the specified Coin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {cosmos.base.v1beta1.ICoin} message Coin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Coin.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Coin message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.v1beta1.Coin} Coin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Coin.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.Coin(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Coin message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.v1beta1.Coin} Coin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Coin.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Coin message. + * @function verify + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Coin.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.denom != null && message.hasOwnProperty("denom")) + if (!$util.isString(message.denom)) + return "denom: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) + if (!$util.isString(message.amount)) + return "amount: string expected"; + return null; + }; + + /** + * Creates a Coin message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.v1beta1.Coin} Coin + */ + Coin.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.v1beta1.Coin) + return object; + var message = new $root.cosmos.base.v1beta1.Coin(); + if (object.denom != null) + message.denom = String(object.denom); + if (object.amount != null) + message.amount = String(object.amount); + return message; + }; + + /** + * Creates a plain object from a Coin message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {cosmos.base.v1beta1.Coin} message Coin + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Coin.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.denom = ""; + object.amount = ""; + } + if (message.denom != null && message.hasOwnProperty("denom")) + object.denom = message.denom; + if (message.amount != null && message.hasOwnProperty("amount")) + object.amount = message.amount; + return object; + }; + + /** + * Converts this Coin to JSON. + * @function toJSON + * @memberof cosmos.base.v1beta1.Coin + * @instance + * @returns {Object.} JSON object + */ + Coin.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Coin; + })(v1beta1.Coin || {}); + + v1beta1.DecCoin = (function(DecCoin) { + + /** + * Properties of a DecCoin. + * @memberof cosmos.base.v1beta1 + * @interface IDecCoin + * @property {string|null} [denom] DecCoin denom + * @property {string|null} [amount] DecCoin amount + */ + + /** + * Constructs a new DecCoin. + * @memberof cosmos.base.v1beta1 + * @classdesc Represents a DecCoin. + * @implements IDecCoin + * @constructor + * @param {cosmos.base.v1beta1.IDecCoin=} [properties] Properties to set + */ + function DecCoin(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DecCoin denom. + * @member {string} denom + * @memberof cosmos.base.v1beta1.DecCoin + * @instance + */ + DecCoin.prototype.denom = ""; + + /** + * DecCoin amount. + * @member {string} amount + * @memberof cosmos.base.v1beta1.DecCoin + * @instance + */ + DecCoin.prototype.amount = ""; + + /** + * Creates a new DecCoin instance using the specified properties. + * @function create + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {cosmos.base.v1beta1.IDecCoin=} [properties] Properties to set + * @returns {cosmos.base.v1beta1.DecCoin} DecCoin instance + */ + DecCoin.create = function create(properties) { + return new DecCoin(properties); + }; + + /** + * Encodes the specified DecCoin message. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. + * @function encode + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {cosmos.base.v1beta1.IDecCoin} message DecCoin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecCoin.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.amount); + return writer; + }; + + /** + * Encodes the specified DecCoin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {cosmos.base.v1beta1.IDecCoin} message DecCoin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecCoin.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DecCoin message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.v1beta1.DecCoin} DecCoin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecCoin.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.DecCoin(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DecCoin message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.v1beta1.DecCoin} DecCoin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecCoin.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DecCoin message. + * @function verify + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DecCoin.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.denom != null && message.hasOwnProperty("denom")) + if (!$util.isString(message.denom)) + return "denom: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) + if (!$util.isString(message.amount)) + return "amount: string expected"; + return null; + }; + + /** + * Creates a DecCoin message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.v1beta1.DecCoin} DecCoin + */ + DecCoin.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.v1beta1.DecCoin) + return object; + var message = new $root.cosmos.base.v1beta1.DecCoin(); + if (object.denom != null) + message.denom = String(object.denom); + if (object.amount != null) + message.amount = String(object.amount); + return message; + }; + + /** + * Creates a plain object from a DecCoin message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {cosmos.base.v1beta1.DecCoin} message DecCoin + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DecCoin.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.denom = ""; + object.amount = ""; + } + if (message.denom != null && message.hasOwnProperty("denom")) + object.denom = message.denom; + if (message.amount != null && message.hasOwnProperty("amount")) + object.amount = message.amount; + return object; + }; + + /** + * Converts this DecCoin to JSON. + * @function toJSON + * @memberof cosmos.base.v1beta1.DecCoin + * @instance + * @returns {Object.} JSON object + */ + DecCoin.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DecCoin; + })(v1beta1.DecCoin || {}); + + v1beta1.IntProto = (function(IntProto) { + + /** + * Properties of an IntProto. + * @memberof cosmos.base.v1beta1 + * @interface IIntProto + * @property {string|null} [int] IntProto int + */ + + /** + * Constructs a new IntProto. + * @memberof cosmos.base.v1beta1 + * @classdesc Represents an IntProto. + * @implements IIntProto + * @constructor + * @param {cosmos.base.v1beta1.IIntProto=} [properties] Properties to set + */ + function IntProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IntProto int. + * @member {string} int + * @memberof cosmos.base.v1beta1.IntProto + * @instance + */ + IntProto.prototype.int = ""; + + /** + * Creates a new IntProto instance using the specified properties. + * @function create + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {cosmos.base.v1beta1.IIntProto=} [properties] Properties to set + * @returns {cosmos.base.v1beta1.IntProto} IntProto instance + */ + IntProto.create = function create(properties) { + return new IntProto(properties); + }; + + /** + * Encodes the specified IntProto message. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. + * @function encode + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {cosmos.base.v1beta1.IIntProto} message IntProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.int != null && Object.hasOwnProperty.call(message, "int")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.int); + return writer; + }; + + /** + * Encodes the specified IntProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {cosmos.base.v1beta1.IIntProto} message IntProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IntProto message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.v1beta1.IntProto} IntProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.IntProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.int = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IntProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.v1beta1.IntProto} IntProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntProto message. + * @function verify + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.int != null && message.hasOwnProperty("int")) + if (!$util.isString(message.int)) + return "int: string expected"; + return null; + }; + + /** + * Creates an IntProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.v1beta1.IntProto} IntProto + */ + IntProto.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.v1beta1.IntProto) + return object; + var message = new $root.cosmos.base.v1beta1.IntProto(); + if (object.int != null) + message.int = String(object.int); + return message; + }; + + /** + * Creates a plain object from an IntProto message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {cosmos.base.v1beta1.IntProto} message IntProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.int = ""; + if (message.int != null && message.hasOwnProperty("int")) + object.int = message.int; + return object; + }; + + /** + * Converts this IntProto to JSON. + * @function toJSON + * @memberof cosmos.base.v1beta1.IntProto + * @instance + * @returns {Object.} JSON object + */ + IntProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IntProto; + })(v1beta1.IntProto || {}); + + v1beta1.DecProto = (function(DecProto) { + + /** + * Properties of a DecProto. + * @memberof cosmos.base.v1beta1 + * @interface IDecProto + * @property {string|null} [dec] DecProto dec + */ + + /** + * Constructs a new DecProto. + * @memberof cosmos.base.v1beta1 + * @classdesc Represents a DecProto. + * @implements IDecProto + * @constructor + * @param {cosmos.base.v1beta1.IDecProto=} [properties] Properties to set + */ + function DecProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DecProto dec. + * @member {string} dec + * @memberof cosmos.base.v1beta1.DecProto + * @instance + */ + DecProto.prototype.dec = ""; + + /** + * Creates a new DecProto instance using the specified properties. + * @function create + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {cosmos.base.v1beta1.IDecProto=} [properties] Properties to set + * @returns {cosmos.base.v1beta1.DecProto} DecProto instance + */ + DecProto.create = function create(properties) { + return new DecProto(properties); + }; + + /** + * Encodes the specified DecProto message. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. + * @function encode + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {cosmos.base.v1beta1.IDecProto} message DecProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dec != null && Object.hasOwnProperty.call(message, "dec")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dec); + return writer; + }; + + /** + * Encodes the specified DecProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {cosmos.base.v1beta1.IDecProto} message DecProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DecProto message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.v1beta1.DecProto} DecProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.DecProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dec = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DecProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.v1beta1.DecProto} DecProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DecProto message. + * @function verify + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DecProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dec != null && message.hasOwnProperty("dec")) + if (!$util.isString(message.dec)) + return "dec: string expected"; + return null; + }; + + /** + * Creates a DecProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.v1beta1.DecProto} DecProto + */ + DecProto.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.v1beta1.DecProto) + return object; + var message = new $root.cosmos.base.v1beta1.DecProto(); + if (object.dec != null) + message.dec = String(object.dec); + return message; + }; + + /** + * Creates a plain object from a DecProto message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {cosmos.base.v1beta1.DecProto} message DecProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DecProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.dec = ""; + if (message.dec != null && message.hasOwnProperty("dec")) + object.dec = message.dec; + return object; + }; + + /** + * Converts this DecProto to JSON. + * @function toJSON + * @memberof cosmos.base.v1beta1.DecProto + * @instance + * @returns {Object.} JSON object + */ + DecProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DecProto; + })(v1beta1.DecProto || {}); + + return v1beta1; + })(base.v1beta1 || {}); + + return base; + })(cosmos.base || {}); + + /** + * Namespace bank. + * @memberof cosmos + * @namespace + */ + + cosmos.bank = (function(bank) { + + /** + * Namespace v1beta1. + * @memberof cosmos.bank + * @namespace + */ + + bank.v1beta1 = (function(v1beta1) { + + v1beta1.Params = (function(Params) { + + /** + * Properties of a Params. + * @memberof cosmos.bank.v1beta1 + * @interface IParams + * @property {Array.|null} [sendEnabled] Params sendEnabled + * @property {boolean|null} [defaultSendEnabled] Params defaultSendEnabled + */ + + /** + * Constructs a new Params. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a Params. + * @implements IParams + * @constructor + * @param {cosmos.bank.v1beta1.IParams=} [properties] Properties to set + */ + function Params(properties) { + this.sendEnabled = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Params sendEnabled. + * @member {Array.} sendEnabled + * @memberof cosmos.bank.v1beta1.Params + * @instance + */ + Params.prototype.sendEnabled = $util.emptyArray; + + /** + * Params defaultSendEnabled. + * @member {boolean} defaultSendEnabled + * @memberof cosmos.bank.v1beta1.Params + * @instance + */ + Params.prototype.defaultSendEnabled = false; + + /** + * Creates a new Params instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.Params + * @static + * @param {cosmos.bank.v1beta1.IParams=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.Params} Params instance + */ + Params.create = function create(properties) { + return new Params(properties); + }; + + /** + * Encodes the specified Params message. Does not implicitly {@link cosmos.bank.v1beta1.Params.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.Params + * @static + * @param {cosmos.bank.v1beta1.IParams} message Params message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Params.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sendEnabled != null && message.sendEnabled.length) + for (var i = 0; i < message.sendEnabled.length; ++i) + $root.cosmos.bank.v1beta1.SendEnabled.encode(message.sendEnabled[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.defaultSendEnabled != null && Object.hasOwnProperty.call(message, "defaultSendEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.defaultSendEnabled); + return writer; + }; + + /** + * Encodes the specified Params message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.Params.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.Params + * @static + * @param {cosmos.bank.v1beta1.IParams} message Params message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Params.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Params message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.Params + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.Params} Params + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Params.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.Params(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.sendEnabled && message.sendEnabled.length)) + message.sendEnabled = []; + message.sendEnabled.push($root.cosmos.bank.v1beta1.SendEnabled.decode(reader, reader.uint32())); + break; + case 2: + message.defaultSendEnabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Params message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.Params + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.Params} Params + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Params.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Params message. + * @function verify + * @memberof cosmos.bank.v1beta1.Params + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Params.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sendEnabled != null && message.hasOwnProperty("sendEnabled")) { + if (!Array.isArray(message.sendEnabled)) + return "sendEnabled: array expected"; + for (var i = 0; i < message.sendEnabled.length; ++i) { + var error = $root.cosmos.bank.v1beta1.SendEnabled.verify(message.sendEnabled[i]); + if (error) + return "sendEnabled." + error; + } + } + if (message.defaultSendEnabled != null && message.hasOwnProperty("defaultSendEnabled")) + if (typeof message.defaultSendEnabled !== "boolean") + return "defaultSendEnabled: boolean expected"; + return null; + }; + + /** + * Creates a Params message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.Params + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.Params} Params + */ + Params.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.Params) + return object; + var message = new $root.cosmos.bank.v1beta1.Params(); + if (object.sendEnabled) { + if (!Array.isArray(object.sendEnabled)) + throw TypeError(".cosmos.bank.v1beta1.Params.sendEnabled: array expected"); + message.sendEnabled = []; + for (var i = 0; i < object.sendEnabled.length; ++i) { + if (typeof object.sendEnabled[i] !== "object") + throw TypeError(".cosmos.bank.v1beta1.Params.sendEnabled: object expected"); + message.sendEnabled[i] = $root.cosmos.bank.v1beta1.SendEnabled.fromObject(object.sendEnabled[i]); + } + } + if (object.defaultSendEnabled != null) + message.defaultSendEnabled = Boolean(object.defaultSendEnabled); + return message; + }; + + /** + * Creates a plain object from a Params message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.Params + * @static + * @param {cosmos.bank.v1beta1.Params} message Params + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Params.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sendEnabled = []; + if (options.defaults) + object.defaultSendEnabled = false; + if (message.sendEnabled && message.sendEnabled.length) { + object.sendEnabled = []; + for (var j = 0; j < message.sendEnabled.length; ++j) + object.sendEnabled[j] = $root.cosmos.bank.v1beta1.SendEnabled.toObject(message.sendEnabled[j], options); + } + if (message.defaultSendEnabled != null && message.hasOwnProperty("defaultSendEnabled")) + object.defaultSendEnabled = message.defaultSendEnabled; + return object; + }; + + /** + * Converts this Params to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.Params + * @instance + * @returns {Object.} JSON object + */ + Params.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Params; + })(v1beta1.Params || {}); + + v1beta1.SendEnabled = (function(SendEnabled) { + + /** + * Properties of a SendEnabled. + * @memberof cosmos.bank.v1beta1 + * @interface ISendEnabled + * @property {string|null} [denom] SendEnabled denom + * @property {boolean|null} [enabled] SendEnabled enabled + */ + + /** + * Constructs a new SendEnabled. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a SendEnabled. + * @implements ISendEnabled + * @constructor + * @param {cosmos.bank.v1beta1.ISendEnabled=} [properties] Properties to set + */ + function SendEnabled(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SendEnabled denom. + * @member {string} denom + * @memberof cosmos.bank.v1beta1.SendEnabled + * @instance + */ + SendEnabled.prototype.denom = ""; + + /** + * SendEnabled enabled. + * @member {boolean} enabled + * @memberof cosmos.bank.v1beta1.SendEnabled + * @instance + */ + SendEnabled.prototype.enabled = false; + + /** + * Creates a new SendEnabled instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.SendEnabled + * @static + * @param {cosmos.bank.v1beta1.ISendEnabled=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.SendEnabled} SendEnabled instance + */ + SendEnabled.create = function create(properties) { + return new SendEnabled(properties); + }; + + /** + * Encodes the specified SendEnabled message. Does not implicitly {@link cosmos.bank.v1beta1.SendEnabled.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.SendEnabled + * @static + * @param {cosmos.bank.v1beta1.ISendEnabled} message SendEnabled message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SendEnabled.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enabled); + return writer; + }; + + /** + * Encodes the specified SendEnabled message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.SendEnabled.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.SendEnabled + * @static + * @param {cosmos.bank.v1beta1.ISendEnabled} message SendEnabled message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SendEnabled.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SendEnabled message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.SendEnabled + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.SendEnabled} SendEnabled + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SendEnabled.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.SendEnabled(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.enabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SendEnabled message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.SendEnabled + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.SendEnabled} SendEnabled + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SendEnabled.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SendEnabled message. + * @function verify + * @memberof cosmos.bank.v1beta1.SendEnabled + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SendEnabled.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.denom != null && message.hasOwnProperty("denom")) + if (!$util.isString(message.denom)) + return "denom: string expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + return null; + }; + + /** + * Creates a SendEnabled message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.SendEnabled + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.SendEnabled} SendEnabled + */ + SendEnabled.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.SendEnabled) + return object; + var message = new $root.cosmos.bank.v1beta1.SendEnabled(); + if (object.denom != null) + message.denom = String(object.denom); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + return message; + }; + + /** + * Creates a plain object from a SendEnabled message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.SendEnabled + * @static + * @param {cosmos.bank.v1beta1.SendEnabled} message SendEnabled + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SendEnabled.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.denom = ""; + object.enabled = false; + } + if (message.denom != null && message.hasOwnProperty("denom")) + object.denom = message.denom; + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + return object; + }; + + /** + * Converts this SendEnabled to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.SendEnabled + * @instance + * @returns {Object.} JSON object + */ + SendEnabled.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SendEnabled; + })(v1beta1.SendEnabled || {}); + + v1beta1.Input = (function(Input) { + + /** + * Properties of an Input. + * @memberof cosmos.bank.v1beta1 + * @interface IInput + * @property {string|null} [address] Input address + * @property {Array.|null} [coins] Input coins + */ + + /** + * Constructs a new Input. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents an Input. + * @implements IInput + * @constructor + * @param {cosmos.bank.v1beta1.IInput=} [properties] Properties to set + */ + function Input(properties) { + this.coins = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Input address. + * @member {string} address + * @memberof cosmos.bank.v1beta1.Input + * @instance + */ + Input.prototype.address = ""; + + /** + * Input coins. + * @member {Array.} coins + * @memberof cosmos.bank.v1beta1.Input + * @instance + */ + Input.prototype.coins = $util.emptyArray; + + /** + * Creates a new Input instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.Input + * @static + * @param {cosmos.bank.v1beta1.IInput=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.Input} Input instance + */ + Input.create = function create(properties) { + return new Input(properties); + }; + + /** + * Encodes the specified Input message. Does not implicitly {@link cosmos.bank.v1beta1.Input.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.Input + * @static + * @param {cosmos.bank.v1beta1.IInput} message Input message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Input.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.address); + if (message.coins != null && message.coins.length) + for (var i = 0; i < message.coins.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.coins[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Input message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.Input.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.Input + * @static + * @param {cosmos.bank.v1beta1.IInput} message Input message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Input.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Input message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.Input + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.Input} Input + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Input.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.Input(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + if (!(message.coins && message.coins.length)) + message.coins = []; + message.coins.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Input message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.Input + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.Input} Input + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Input.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Input message. + * @function verify + * @memberof cosmos.bank.v1beta1.Input + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Input.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.coins != null && message.hasOwnProperty("coins")) { + if (!Array.isArray(message.coins)) + return "coins: array expected"; + for (var i = 0; i < message.coins.length; ++i) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.coins[i]); + if (error) + return "coins." + error; + } + } + return null; + }; + + /** + * Creates an Input message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.Input + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.Input} Input + */ + Input.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.Input) + return object; + var message = new $root.cosmos.bank.v1beta1.Input(); + if (object.address != null) + message.address = String(object.address); + if (object.coins) { + if (!Array.isArray(object.coins)) + throw TypeError(".cosmos.bank.v1beta1.Input.coins: array expected"); + message.coins = []; + for (var i = 0; i < object.coins.length; ++i) { + if (typeof object.coins[i] !== "object") + throw TypeError(".cosmos.bank.v1beta1.Input.coins: object expected"); + message.coins[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.coins[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Input message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.Input + * @static + * @param {cosmos.bank.v1beta1.Input} message Input + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Input.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.coins = []; + if (options.defaults) + object.address = ""; + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + if (message.coins && message.coins.length) { + object.coins = []; + for (var j = 0; j < message.coins.length; ++j) + object.coins[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.coins[j], options); + } + return object; + }; + + /** + * Converts this Input to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.Input + * @instance + * @returns {Object.} JSON object + */ + Input.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Input; + })(v1beta1.Input || {}); + + v1beta1.Output = (function(Output) { + + /** + * Properties of an Output. + * @memberof cosmos.bank.v1beta1 + * @interface IOutput + * @property {string|null} [address] Output address + * @property {Array.|null} [coins] Output coins + */ + + /** + * Constructs a new Output. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents an Output. + * @implements IOutput + * @constructor + * @param {cosmos.bank.v1beta1.IOutput=} [properties] Properties to set + */ + function Output(properties) { + this.coins = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Output address. + * @member {string} address + * @memberof cosmos.bank.v1beta1.Output + * @instance + */ + Output.prototype.address = ""; + + /** + * Output coins. + * @member {Array.} coins + * @memberof cosmos.bank.v1beta1.Output + * @instance + */ + Output.prototype.coins = $util.emptyArray; + + /** + * Creates a new Output instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.Output + * @static + * @param {cosmos.bank.v1beta1.IOutput=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.Output} Output instance + */ + Output.create = function create(properties) { + return new Output(properties); + }; + + /** + * Encodes the specified Output message. Does not implicitly {@link cosmos.bank.v1beta1.Output.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.Output + * @static + * @param {cosmos.bank.v1beta1.IOutput} message Output message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Output.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.address); + if (message.coins != null && message.coins.length) + for (var i = 0; i < message.coins.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.coins[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Output message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.Output.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.Output + * @static + * @param {cosmos.bank.v1beta1.IOutput} message Output message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Output.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Output message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.Output + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.Output} Output + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Output.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.Output(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + if (!(message.coins && message.coins.length)) + message.coins = []; + message.coins.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Output message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.Output + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.Output} Output + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Output.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Output message. + * @function verify + * @memberof cosmos.bank.v1beta1.Output + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Output.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.coins != null && message.hasOwnProperty("coins")) { + if (!Array.isArray(message.coins)) + return "coins: array expected"; + for (var i = 0; i < message.coins.length; ++i) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.coins[i]); + if (error) + return "coins." + error; + } + } + return null; + }; + + /** + * Creates an Output message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.Output + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.Output} Output + */ + Output.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.Output) + return object; + var message = new $root.cosmos.bank.v1beta1.Output(); + if (object.address != null) + message.address = String(object.address); + if (object.coins) { + if (!Array.isArray(object.coins)) + throw TypeError(".cosmos.bank.v1beta1.Output.coins: array expected"); + message.coins = []; + for (var i = 0; i < object.coins.length; ++i) { + if (typeof object.coins[i] !== "object") + throw TypeError(".cosmos.bank.v1beta1.Output.coins: object expected"); + message.coins[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.coins[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Output message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.Output + * @static + * @param {cosmos.bank.v1beta1.Output} message Output + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Output.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.coins = []; + if (options.defaults) + object.address = ""; + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + if (message.coins && message.coins.length) { + object.coins = []; + for (var j = 0; j < message.coins.length; ++j) + object.coins[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.coins[j], options); + } + return object; + }; + + /** + * Converts this Output to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.Output + * @instance + * @returns {Object.} JSON object + */ + Output.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Output; + })(v1beta1.Output || {}); + + v1beta1.Supply = (function(Supply) { + + /** + * Properties of a Supply. + * @memberof cosmos.bank.v1beta1 + * @interface ISupply + * @property {Array.|null} [total] Supply total + */ + + /** + * Constructs a new Supply. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a Supply. + * @implements ISupply + * @constructor + * @param {cosmos.bank.v1beta1.ISupply=} [properties] Properties to set + */ + function Supply(properties) { + this.total = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Supply total. + * @member {Array.} total + * @memberof cosmos.bank.v1beta1.Supply + * @instance + */ + Supply.prototype.total = $util.emptyArray; + + /** + * Creates a new Supply instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.Supply + * @static + * @param {cosmos.bank.v1beta1.ISupply=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.Supply} Supply instance + */ + Supply.create = function create(properties) { + return new Supply(properties); + }; + + /** + * Encodes the specified Supply message. Does not implicitly {@link cosmos.bank.v1beta1.Supply.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.Supply + * @static + * @param {cosmos.bank.v1beta1.ISupply} message Supply message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Supply.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.total != null && message.total.length) + for (var i = 0; i < message.total.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.total[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Supply message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.Supply.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.Supply + * @static + * @param {cosmos.bank.v1beta1.ISupply} message Supply message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Supply.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Supply message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.Supply + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.Supply} Supply + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Supply.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.Supply(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.total && message.total.length)) + message.total = []; + message.total.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Supply message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.Supply + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.Supply} Supply + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Supply.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Supply message. + * @function verify + * @memberof cosmos.bank.v1beta1.Supply + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Supply.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.total != null && message.hasOwnProperty("total")) { + if (!Array.isArray(message.total)) + return "total: array expected"; + for (var i = 0; i < message.total.length; ++i) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.total[i]); + if (error) + return "total." + error; + } + } + return null; + }; + + /** + * Creates a Supply message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.Supply + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.Supply} Supply + */ + Supply.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.Supply) + return object; + var message = new $root.cosmos.bank.v1beta1.Supply(); + if (object.total) { + if (!Array.isArray(object.total)) + throw TypeError(".cosmos.bank.v1beta1.Supply.total: array expected"); + message.total = []; + for (var i = 0; i < object.total.length; ++i) { + if (typeof object.total[i] !== "object") + throw TypeError(".cosmos.bank.v1beta1.Supply.total: object expected"); + message.total[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.total[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Supply message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.Supply + * @static + * @param {cosmos.bank.v1beta1.Supply} message Supply + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Supply.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.total = []; + if (message.total && message.total.length) { + object.total = []; + for (var j = 0; j < message.total.length; ++j) + object.total[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.total[j], options); + } + return object; + }; + + /** + * Converts this Supply to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.Supply + * @instance + * @returns {Object.} JSON object + */ + Supply.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Supply; + })(v1beta1.Supply || {}); + + v1beta1.DenomUnit = (function(DenomUnit) { + + /** + * Properties of a DenomUnit. + * @memberof cosmos.bank.v1beta1 + * @interface IDenomUnit + * @property {string|null} [denom] DenomUnit denom + * @property {number|null} [exponent] DenomUnit exponent + * @property {Array.|null} [aliases] DenomUnit aliases + */ + + /** + * Constructs a new DenomUnit. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a DenomUnit. + * @implements IDenomUnit + * @constructor + * @param {cosmos.bank.v1beta1.IDenomUnit=} [properties] Properties to set + */ + function DenomUnit(properties) { + this.aliases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DenomUnit denom. + * @member {string} denom + * @memberof cosmos.bank.v1beta1.DenomUnit + * @instance + */ + DenomUnit.prototype.denom = ""; + + /** + * DenomUnit exponent. + * @member {number} exponent + * @memberof cosmos.bank.v1beta1.DenomUnit + * @instance + */ + DenomUnit.prototype.exponent = 0; + + /** + * DenomUnit aliases. + * @member {Array.} aliases + * @memberof cosmos.bank.v1beta1.DenomUnit + * @instance + */ + DenomUnit.prototype.aliases = $util.emptyArray; + + /** + * Creates a new DenomUnit instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.DenomUnit + * @static + * @param {cosmos.bank.v1beta1.IDenomUnit=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.DenomUnit} DenomUnit instance + */ + DenomUnit.create = function create(properties) { + return new DenomUnit(properties); + }; + + /** + * Encodes the specified DenomUnit message. Does not implicitly {@link cosmos.bank.v1beta1.DenomUnit.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.DenomUnit + * @static + * @param {cosmos.bank.v1beta1.IDenomUnit} message DenomUnit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DenomUnit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); + if (message.exponent != null && Object.hasOwnProperty.call(message, "exponent")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.exponent); + if (message.aliases != null && message.aliases.length) + for (var i = 0; i < message.aliases.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.aliases[i]); + return writer; + }; + + /** + * Encodes the specified DenomUnit message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.DenomUnit.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.DenomUnit + * @static + * @param {cosmos.bank.v1beta1.IDenomUnit} message DenomUnit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DenomUnit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DenomUnit message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.DenomUnit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.DenomUnit} DenomUnit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DenomUnit.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.DenomUnit(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.exponent = reader.uint32(); + break; + case 3: + if (!(message.aliases && message.aliases.length)) + message.aliases = []; + message.aliases.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DenomUnit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.DenomUnit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.DenomUnit} DenomUnit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DenomUnit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DenomUnit message. + * @function verify + * @memberof cosmos.bank.v1beta1.DenomUnit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DenomUnit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.denom != null && message.hasOwnProperty("denom")) + if (!$util.isString(message.denom)) + return "denom: string expected"; + if (message.exponent != null && message.hasOwnProperty("exponent")) + if (!$util.isInteger(message.exponent)) + return "exponent: integer expected"; + if (message.aliases != null && message.hasOwnProperty("aliases")) { + if (!Array.isArray(message.aliases)) + return "aliases: array expected"; + for (var i = 0; i < message.aliases.length; ++i) + if (!$util.isString(message.aliases[i])) + return "aliases: string[] expected"; + } + return null; + }; + + /** + * Creates a DenomUnit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.DenomUnit + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.DenomUnit} DenomUnit + */ + DenomUnit.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.DenomUnit) + return object; + var message = new $root.cosmos.bank.v1beta1.DenomUnit(); + if (object.denom != null) + message.denom = String(object.denom); + if (object.exponent != null) + message.exponent = object.exponent >>> 0; + if (object.aliases) { + if (!Array.isArray(object.aliases)) + throw TypeError(".cosmos.bank.v1beta1.DenomUnit.aliases: array expected"); + message.aliases = []; + for (var i = 0; i < object.aliases.length; ++i) + message.aliases[i] = String(object.aliases[i]); + } + return message; + }; + + /** + * Creates a plain object from a DenomUnit message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.DenomUnit + * @static + * @param {cosmos.bank.v1beta1.DenomUnit} message DenomUnit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DenomUnit.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.aliases = []; + if (options.defaults) { + object.denom = ""; + object.exponent = 0; + } + if (message.denom != null && message.hasOwnProperty("denom")) + object.denom = message.denom; + if (message.exponent != null && message.hasOwnProperty("exponent")) + object.exponent = message.exponent; + if (message.aliases && message.aliases.length) { + object.aliases = []; + for (var j = 0; j < message.aliases.length; ++j) + object.aliases[j] = message.aliases[j]; + } + return object; + }; + + /** + * Converts this DenomUnit to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.DenomUnit + * @instance + * @returns {Object.} JSON object + */ + DenomUnit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DenomUnit; + })(v1beta1.DenomUnit || {}); + + v1beta1.Metadata = (function(Metadata) { + + /** + * Properties of a Metadata. + * @memberof cosmos.bank.v1beta1 + * @interface IMetadata + * @property {string|null} [description] Metadata description + * @property {Array.|null} [denomUnits] Metadata denomUnits + * @property {string|null} [base] Metadata base + * @property {string|null} [display] Metadata display + */ + + /** + * Constructs a new Metadata. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a Metadata. + * @implements IMetadata + * @constructor + * @param {cosmos.bank.v1beta1.IMetadata=} [properties] Properties to set + */ + function Metadata(properties) { + this.denomUnits = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Metadata description. + * @member {string} description + * @memberof cosmos.bank.v1beta1.Metadata + * @instance + */ + Metadata.prototype.description = ""; + + /** + * Metadata denomUnits. + * @member {Array.} denomUnits + * @memberof cosmos.bank.v1beta1.Metadata + * @instance + */ + Metadata.prototype.denomUnits = $util.emptyArray; + + /** + * Metadata base. + * @member {string} base + * @memberof cosmos.bank.v1beta1.Metadata + * @instance + */ + Metadata.prototype.base = ""; + + /** + * Metadata display. + * @member {string} display + * @memberof cosmos.bank.v1beta1.Metadata + * @instance + */ + Metadata.prototype.display = ""; + + /** + * Creates a new Metadata instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.Metadata + * @static + * @param {cosmos.bank.v1beta1.IMetadata=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.Metadata} Metadata instance + */ + Metadata.create = function create(properties) { + return new Metadata(properties); + }; + + /** + * Encodes the specified Metadata message. Does not implicitly {@link cosmos.bank.v1beta1.Metadata.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.Metadata + * @static + * @param {cosmos.bank.v1beta1.IMetadata} message Metadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); + if (message.denomUnits != null && message.denomUnits.length) + for (var i = 0; i < message.denomUnits.length; ++i) + $root.cosmos.bank.v1beta1.DenomUnit.encode(message.denomUnits[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.base != null && Object.hasOwnProperty.call(message, "base")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.base); + if (message.display != null && Object.hasOwnProperty.call(message, "display")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.display); + return writer; + }; + + /** + * Encodes the specified Metadata message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.Metadata.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.Metadata + * @static + * @param {cosmos.bank.v1beta1.IMetadata} message Metadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Metadata message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.Metadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.description = reader.string(); + break; + case 2: + if (!(message.denomUnits && message.denomUnits.length)) + message.denomUnits = []; + message.denomUnits.push($root.cosmos.bank.v1beta1.DenomUnit.decode(reader, reader.uint32())); + break; + case 3: + message.base = reader.string(); + break; + case 4: + message.display = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Metadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Metadata message. + * @function verify + * @memberof cosmos.bank.v1beta1.Metadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Metadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.denomUnits != null && message.hasOwnProperty("denomUnits")) { + if (!Array.isArray(message.denomUnits)) + return "denomUnits: array expected"; + for (var i = 0; i < message.denomUnits.length; ++i) { + var error = $root.cosmos.bank.v1beta1.DenomUnit.verify(message.denomUnits[i]); + if (error) + return "denomUnits." + error; + } + } + if (message.base != null && message.hasOwnProperty("base")) + if (!$util.isString(message.base)) + return "base: string expected"; + if (message.display != null && message.hasOwnProperty("display")) + if (!$util.isString(message.display)) + return "display: string expected"; + return null; + }; + + /** + * Creates a Metadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.Metadata + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.Metadata} Metadata + */ + Metadata.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.Metadata) + return object; + var message = new $root.cosmos.bank.v1beta1.Metadata(); + if (object.description != null) + message.description = String(object.description); + if (object.denomUnits) { + if (!Array.isArray(object.denomUnits)) + throw TypeError(".cosmos.bank.v1beta1.Metadata.denomUnits: array expected"); + message.denomUnits = []; + for (var i = 0; i < object.denomUnits.length; ++i) { + if (typeof object.denomUnits[i] !== "object") + throw TypeError(".cosmos.bank.v1beta1.Metadata.denomUnits: object expected"); + message.denomUnits[i] = $root.cosmos.bank.v1beta1.DenomUnit.fromObject(object.denomUnits[i]); + } + } + if (object.base != null) + message.base = String(object.base); + if (object.display != null) + message.display = String(object.display); + return message; + }; + + /** + * Creates a plain object from a Metadata message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.Metadata + * @static + * @param {cosmos.bank.v1beta1.Metadata} message Metadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Metadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.denomUnits = []; + if (options.defaults) { + object.description = ""; + object.base = ""; + object.display = ""; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.denomUnits && message.denomUnits.length) { + object.denomUnits = []; + for (var j = 0; j < message.denomUnits.length; ++j) + object.denomUnits[j] = $root.cosmos.bank.v1beta1.DenomUnit.toObject(message.denomUnits[j], options); + } + if (message.base != null && message.hasOwnProperty("base")) + object.base = message.base; + if (message.display != null && message.hasOwnProperty("display")) + object.display = message.display; + return object; + }; + + /** + * Converts this Metadata to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.Metadata + * @instance + * @returns {Object.} JSON object + */ + Metadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Metadata; + })(v1beta1.Metadata || {}); + + v1beta1.Msg = (function(Msg) { + + /** + * Constructs a new Msg service. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a Msg + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Msg(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; + + /** + * Creates new Msg service using the specified rpc implementation. + * @function create + * @memberof cosmos.bank.v1beta1.Msg + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Msg} RPC service. Useful where requests and/or responses are streamed. + */ + Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.bank.v1beta1.Msg#send}. + * @memberof cosmos.bank.v1beta1.Msg + * @typedef SendCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.bank.v1beta1.IMsgSendResponse} [response] MsgSendResponse + */ + + /** + * Calls Send. + * @function send + * @memberof cosmos.bank.v1beta1.Msg + * @instance + * @param {cosmos.bank.v1beta1.IMsgSend} request MsgSend message or plain object + * @param {cosmos.bank.v1beta1.Msg.SendCallback} callback Node-style callback called with the error, if any, and MsgSendResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.send = function send(request, callback) { + return this.rpcCall(send, $root.cosmos.bank.v1beta1.MsgSend, $root.cosmos.bank.v1beta1.MsgSendResponse, request, callback); + }, "name", { value: "Send" }); + + /** + * Calls Send. + * @function send + * @memberof cosmos.bank.v1beta1.Msg + * @instance + * @param {cosmos.bank.v1beta1.IMsgSend} request MsgSend message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.bank.v1beta1.Msg#multiSend}. + * @memberof cosmos.bank.v1beta1.Msg + * @typedef MultiSendCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.bank.v1beta1.IMsgMultiSendResponse} [response] MsgMultiSendResponse + */ + + /** + * Calls MultiSend. + * @function multiSend + * @memberof cosmos.bank.v1beta1.Msg + * @instance + * @param {cosmos.bank.v1beta1.IMsgMultiSend} request MsgMultiSend message or plain object + * @param {cosmos.bank.v1beta1.Msg.MultiSendCallback} callback Node-style callback called with the error, if any, and MsgMultiSendResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.multiSend = function multiSend(request, callback) { + return this.rpcCall(multiSend, $root.cosmos.bank.v1beta1.MsgMultiSend, $root.cosmos.bank.v1beta1.MsgMultiSendResponse, request, callback); + }, "name", { value: "MultiSend" }); + + /** + * Calls MultiSend. + * @function multiSend + * @memberof cosmos.bank.v1beta1.Msg + * @instance + * @param {cosmos.bank.v1beta1.IMsgMultiSend} request MsgMultiSend message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Msg; + })(v1beta1.Msg || {}); + + v1beta1.MsgSend = (function(MsgSend) { + + /** + * Properties of a MsgSend. + * @memberof cosmos.bank.v1beta1 + * @interface IMsgSend + * @property {string|null} [fromAddress] MsgSend fromAddress + * @property {string|null} [toAddress] MsgSend toAddress + * @property {Array.|null} [amount] MsgSend amount + */ + + /** + * Constructs a new MsgSend. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a MsgSend. + * @implements IMsgSend + * @constructor + * @param {cosmos.bank.v1beta1.IMsgSend=} [properties] Properties to set + */ + function MsgSend(properties) { + this.amount = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgSend fromAddress. + * @member {string} fromAddress + * @memberof cosmos.bank.v1beta1.MsgSend + * @instance + */ + MsgSend.prototype.fromAddress = ""; + + /** + * MsgSend toAddress. + * @member {string} toAddress + * @memberof cosmos.bank.v1beta1.MsgSend + * @instance + */ + MsgSend.prototype.toAddress = ""; + + /** + * MsgSend amount. + * @member {Array.} amount + * @memberof cosmos.bank.v1beta1.MsgSend + * @instance + */ + MsgSend.prototype.amount = $util.emptyArray; + + /** + * Creates a new MsgSend instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.MsgSend + * @static + * @param {cosmos.bank.v1beta1.IMsgSend=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.MsgSend} MsgSend instance + */ + MsgSend.create = function create(properties) { + return new MsgSend(properties); + }; + + /** + * Encodes the specified MsgSend message. Does not implicitly {@link cosmos.bank.v1beta1.MsgSend.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.MsgSend + * @static + * @param {cosmos.bank.v1beta1.IMsgSend} message MsgSend message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSend.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fromAddress != null && Object.hasOwnProperty.call(message, "fromAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fromAddress); + if (message.toAddress != null && Object.hasOwnProperty.call(message, "toAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.toAddress); + if (message.amount != null && message.amount.length) + for (var i = 0; i < message.amount.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.amount[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MsgSend message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.MsgSend.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.MsgSend + * @static + * @param {cosmos.bank.v1beta1.IMsgSend} message MsgSend message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSend.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgSend message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.MsgSend + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.MsgSend} MsgSend + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSend.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.MsgSend(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fromAddress = reader.string(); + break; + case 2: + message.toAddress = reader.string(); + break; + case 3: + if (!(message.amount && message.amount.length)) + message.amount = []; + message.amount.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgSend message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.MsgSend + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.MsgSend} MsgSend + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSend.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgSend message. + * @function verify + * @memberof cosmos.bank.v1beta1.MsgSend + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgSend.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fromAddress != null && message.hasOwnProperty("fromAddress")) + if (!$util.isString(message.fromAddress)) + return "fromAddress: string expected"; + if (message.toAddress != null && message.hasOwnProperty("toAddress")) + if (!$util.isString(message.toAddress)) + return "toAddress: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + if (!Array.isArray(message.amount)) + return "amount: array expected"; + for (var i = 0; i < message.amount.length; ++i) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.amount[i]); + if (error) + return "amount." + error; + } + } + return null; + }; + + /** + * Creates a MsgSend message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.MsgSend + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.MsgSend} MsgSend + */ + MsgSend.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.MsgSend) + return object; + var message = new $root.cosmos.bank.v1beta1.MsgSend(); + if (object.fromAddress != null) + message.fromAddress = String(object.fromAddress); + if (object.toAddress != null) + message.toAddress = String(object.toAddress); + if (object.amount) { + if (!Array.isArray(object.amount)) + throw TypeError(".cosmos.bank.v1beta1.MsgSend.amount: array expected"); + message.amount = []; + for (var i = 0; i < object.amount.length; ++i) { + if (typeof object.amount[i] !== "object") + throw TypeError(".cosmos.bank.v1beta1.MsgSend.amount: object expected"); + message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MsgSend message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.MsgSend + * @static + * @param {cosmos.bank.v1beta1.MsgSend} message MsgSend + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSend.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.amount = []; + if (options.defaults) { + object.fromAddress = ""; + object.toAddress = ""; + } + if (message.fromAddress != null && message.hasOwnProperty("fromAddress")) + object.fromAddress = message.fromAddress; + if (message.toAddress != null && message.hasOwnProperty("toAddress")) + object.toAddress = message.toAddress; + if (message.amount && message.amount.length) { + object.amount = []; + for (var j = 0; j < message.amount.length; ++j) + object.amount[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.amount[j], options); + } + return object; + }; + + /** + * Converts this MsgSend to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.MsgSend + * @instance + * @returns {Object.} JSON object + */ + MsgSend.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgSend; + })(v1beta1.MsgSend || {}); + + v1beta1.MsgSendResponse = (function(MsgSendResponse) { + + /** + * Properties of a MsgSendResponse. + * @memberof cosmos.bank.v1beta1 + * @interface IMsgSendResponse + */ + + /** + * Constructs a new MsgSendResponse. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a MsgSendResponse. + * @implements IMsgSendResponse + * @constructor + * @param {cosmos.bank.v1beta1.IMsgSendResponse=} [properties] Properties to set + */ + function MsgSendResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgSendResponse instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.MsgSendResponse + * @static + * @param {cosmos.bank.v1beta1.IMsgSendResponse=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.MsgSendResponse} MsgSendResponse instance + */ + MsgSendResponse.create = function create(properties) { + return new MsgSendResponse(properties); + }; + + /** + * Encodes the specified MsgSendResponse message. Does not implicitly {@link cosmos.bank.v1beta1.MsgSendResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.MsgSendResponse + * @static + * @param {cosmos.bank.v1beta1.IMsgSendResponse} message MsgSendResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSendResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgSendResponse message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.MsgSendResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.MsgSendResponse + * @static + * @param {cosmos.bank.v1beta1.IMsgSendResponse} message MsgSendResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSendResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgSendResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.MsgSendResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.MsgSendResponse} MsgSendResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSendResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.MsgSendResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgSendResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.MsgSendResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.MsgSendResponse} MsgSendResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSendResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgSendResponse message. + * @function verify + * @memberof cosmos.bank.v1beta1.MsgSendResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgSendResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgSendResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.MsgSendResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.MsgSendResponse} MsgSendResponse + */ + MsgSendResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.MsgSendResponse) + return object; + return new $root.cosmos.bank.v1beta1.MsgSendResponse(); + }; + + /** + * Creates a plain object from a MsgSendResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.MsgSendResponse + * @static + * @param {cosmos.bank.v1beta1.MsgSendResponse} message MsgSendResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSendResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgSendResponse to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.MsgSendResponse + * @instance + * @returns {Object.} JSON object + */ + MsgSendResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgSendResponse; + })(v1beta1.MsgSendResponse || {}); + + v1beta1.MsgMultiSend = (function(MsgMultiSend) { + + /** + * Properties of a MsgMultiSend. + * @memberof cosmos.bank.v1beta1 + * @interface IMsgMultiSend + * @property {Array.|null} [inputs] MsgMultiSend inputs + * @property {Array.|null} [outputs] MsgMultiSend outputs + */ + + /** + * Constructs a new MsgMultiSend. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a MsgMultiSend. + * @implements IMsgMultiSend + * @constructor + * @param {cosmos.bank.v1beta1.IMsgMultiSend=} [properties] Properties to set + */ + function MsgMultiSend(properties) { + this.inputs = []; + this.outputs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgMultiSend inputs. + * @member {Array.} inputs + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @instance + */ + MsgMultiSend.prototype.inputs = $util.emptyArray; + + /** + * MsgMultiSend outputs. + * @member {Array.} outputs + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @instance + */ + MsgMultiSend.prototype.outputs = $util.emptyArray; + + /** + * Creates a new MsgMultiSend instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @static + * @param {cosmos.bank.v1beta1.IMsgMultiSend=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.MsgMultiSend} MsgMultiSend instance + */ + MsgMultiSend.create = function create(properties) { + return new MsgMultiSend(properties); + }; + + /** + * Encodes the specified MsgMultiSend message. Does not implicitly {@link cosmos.bank.v1beta1.MsgMultiSend.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @static + * @param {cosmos.bank.v1beta1.IMsgMultiSend} message MsgMultiSend message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgMultiSend.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputs != null && message.inputs.length) + for (var i = 0; i < message.inputs.length; ++i) + $root.cosmos.bank.v1beta1.Input.encode(message.inputs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.outputs != null && message.outputs.length) + for (var i = 0; i < message.outputs.length; ++i) + $root.cosmos.bank.v1beta1.Output.encode(message.outputs[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MsgMultiSend message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.MsgMultiSend.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @static + * @param {cosmos.bank.v1beta1.IMsgMultiSend} message MsgMultiSend message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgMultiSend.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgMultiSend message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.MsgMultiSend} MsgMultiSend + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgMultiSend.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.MsgMultiSend(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.inputs && message.inputs.length)) + message.inputs = []; + message.inputs.push($root.cosmos.bank.v1beta1.Input.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.outputs && message.outputs.length)) + message.outputs = []; + message.outputs.push($root.cosmos.bank.v1beta1.Output.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgMultiSend message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.MsgMultiSend} MsgMultiSend + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgMultiSend.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgMultiSend message. + * @function verify + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgMultiSend.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputs != null && message.hasOwnProperty("inputs")) { + if (!Array.isArray(message.inputs)) + return "inputs: array expected"; + for (var i = 0; i < message.inputs.length; ++i) { + var error = $root.cosmos.bank.v1beta1.Input.verify(message.inputs[i]); + if (error) + return "inputs." + error; + } + } + if (message.outputs != null && message.hasOwnProperty("outputs")) { + if (!Array.isArray(message.outputs)) + return "outputs: array expected"; + for (var i = 0; i < message.outputs.length; ++i) { + var error = $root.cosmos.bank.v1beta1.Output.verify(message.outputs[i]); + if (error) + return "outputs." + error; + } + } + return null; + }; + + /** + * Creates a MsgMultiSend message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.MsgMultiSend} MsgMultiSend + */ + MsgMultiSend.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.MsgMultiSend) + return object; + var message = new $root.cosmos.bank.v1beta1.MsgMultiSend(); + if (object.inputs) { + if (!Array.isArray(object.inputs)) + throw TypeError(".cosmos.bank.v1beta1.MsgMultiSend.inputs: array expected"); + message.inputs = []; + for (var i = 0; i < object.inputs.length; ++i) { + if (typeof object.inputs[i] !== "object") + throw TypeError(".cosmos.bank.v1beta1.MsgMultiSend.inputs: object expected"); + message.inputs[i] = $root.cosmos.bank.v1beta1.Input.fromObject(object.inputs[i]); + } + } + if (object.outputs) { + if (!Array.isArray(object.outputs)) + throw TypeError(".cosmos.bank.v1beta1.MsgMultiSend.outputs: array expected"); + message.outputs = []; + for (var i = 0; i < object.outputs.length; ++i) { + if (typeof object.outputs[i] !== "object") + throw TypeError(".cosmos.bank.v1beta1.MsgMultiSend.outputs: object expected"); + message.outputs[i] = $root.cosmos.bank.v1beta1.Output.fromObject(object.outputs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MsgMultiSend message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @static + * @param {cosmos.bank.v1beta1.MsgMultiSend} message MsgMultiSend + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgMultiSend.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.inputs = []; + object.outputs = []; + } + if (message.inputs && message.inputs.length) { + object.inputs = []; + for (var j = 0; j < message.inputs.length; ++j) + object.inputs[j] = $root.cosmos.bank.v1beta1.Input.toObject(message.inputs[j], options); + } + if (message.outputs && message.outputs.length) { + object.outputs = []; + for (var j = 0; j < message.outputs.length; ++j) + object.outputs[j] = $root.cosmos.bank.v1beta1.Output.toObject(message.outputs[j], options); + } + return object; + }; + + /** + * Converts this MsgMultiSend to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @instance + * @returns {Object.} JSON object + */ + MsgMultiSend.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgMultiSend; + })(v1beta1.MsgMultiSend || {}); + + v1beta1.MsgMultiSendResponse = (function(MsgMultiSendResponse) { + + /** + * Properties of a MsgMultiSendResponse. + * @memberof cosmos.bank.v1beta1 + * @interface IMsgMultiSendResponse + */ + + /** + * Constructs a new MsgMultiSendResponse. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a MsgMultiSendResponse. + * @implements IMsgMultiSendResponse + * @constructor + * @param {cosmos.bank.v1beta1.IMsgMultiSendResponse=} [properties] Properties to set + */ + function MsgMultiSendResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgMultiSendResponse instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.MsgMultiSendResponse + * @static + * @param {cosmos.bank.v1beta1.IMsgMultiSendResponse=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.MsgMultiSendResponse} MsgMultiSendResponse instance + */ + MsgMultiSendResponse.create = function create(properties) { + return new MsgMultiSendResponse(properties); + }; + + /** + * Encodes the specified MsgMultiSendResponse message. Does not implicitly {@link cosmos.bank.v1beta1.MsgMultiSendResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.MsgMultiSendResponse + * @static + * @param {cosmos.bank.v1beta1.IMsgMultiSendResponse} message MsgMultiSendResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgMultiSendResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgMultiSendResponse message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.MsgMultiSendResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.MsgMultiSendResponse + * @static + * @param {cosmos.bank.v1beta1.IMsgMultiSendResponse} message MsgMultiSendResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgMultiSendResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgMultiSendResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.MsgMultiSendResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.MsgMultiSendResponse} MsgMultiSendResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgMultiSendResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.MsgMultiSendResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgMultiSendResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.MsgMultiSendResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.MsgMultiSendResponse} MsgMultiSendResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgMultiSendResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgMultiSendResponse message. + * @function verify + * @memberof cosmos.bank.v1beta1.MsgMultiSendResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgMultiSendResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgMultiSendResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.MsgMultiSendResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.MsgMultiSendResponse} MsgMultiSendResponse + */ + MsgMultiSendResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.MsgMultiSendResponse) + return object; + return new $root.cosmos.bank.v1beta1.MsgMultiSendResponse(); + }; + + /** + * Creates a plain object from a MsgMultiSendResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.MsgMultiSendResponse + * @static + * @param {cosmos.bank.v1beta1.MsgMultiSendResponse} message MsgMultiSendResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgMultiSendResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgMultiSendResponse to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.MsgMultiSendResponse + * @instance + * @returns {Object.} JSON object + */ + MsgMultiSendResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgMultiSendResponse; + })(v1beta1.MsgMultiSendResponse || {}); + + return v1beta1; + })(bank.v1beta1 || {}); + + return bank; + })(cosmos.bank || {}); + + /** + * Namespace gov. + * @memberof cosmos + * @namespace + */ + + cosmos.gov = (function(gov) { + + /** + * Namespace v1beta1. + * @memberof cosmos.gov + * @namespace + */ + + gov.v1beta1 = (function(v1beta1) { + + /** + * VoteOption enum. + * @name cosmos.gov.v1beta1.VoteOption + * @enum {string} + * @property {number} VOTE_OPTION_UNSPECIFIED=0 VOTE_OPTION_UNSPECIFIED value + * @property {number} VOTE_OPTION_YES=1 VOTE_OPTION_YES value + * @property {number} VOTE_OPTION_ABSTAIN=2 VOTE_OPTION_ABSTAIN value + * @property {number} VOTE_OPTION_NO=3 VOTE_OPTION_NO value + * @property {number} VOTE_OPTION_NO_WITH_VETO=4 VOTE_OPTION_NO_WITH_VETO value + */ + v1beta1.VoteOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VOTE_OPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "VOTE_OPTION_YES"] = 1; + values[valuesById[2] = "VOTE_OPTION_ABSTAIN"] = 2; + values[valuesById[3] = "VOTE_OPTION_NO"] = 3; + values[valuesById[4] = "VOTE_OPTION_NO_WITH_VETO"] = 4; + return values; + })(); + + v1beta1.TextProposal = (function(TextProposal) { + + /** + * Properties of a TextProposal. + * @memberof cosmos.gov.v1beta1 + * @interface ITextProposal + * @property {string|null} [title] TextProposal title + * @property {string|null} [description] TextProposal description + */ + + /** + * Constructs a new TextProposal. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a TextProposal. + * @implements ITextProposal + * @constructor + * @param {cosmos.gov.v1beta1.ITextProposal=} [properties] Properties to set + */ + function TextProposal(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextProposal title. + * @member {string} title + * @memberof cosmos.gov.v1beta1.TextProposal + * @instance + */ + TextProposal.prototype.title = ""; + + /** + * TextProposal description. + * @member {string} description + * @memberof cosmos.gov.v1beta1.TextProposal + * @instance + */ + TextProposal.prototype.description = ""; + + /** + * Creates a new TextProposal instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.TextProposal + * @static + * @param {cosmos.gov.v1beta1.ITextProposal=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.TextProposal} TextProposal instance + */ + TextProposal.create = function create(properties) { + return new TextProposal(properties); + }; + + /** + * Encodes the specified TextProposal message. Does not implicitly {@link cosmos.gov.v1beta1.TextProposal.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.TextProposal + * @static + * @param {cosmos.gov.v1beta1.ITextProposal} message TextProposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextProposal.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + return writer; + }; + + /** + * Encodes the specified TextProposal message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.TextProposal.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.TextProposal + * @static + * @param {cosmos.gov.v1beta1.ITextProposal} message TextProposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextProposal.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextProposal message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.TextProposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.TextProposal} TextProposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextProposal.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.TextProposal(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextProposal message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.TextProposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.TextProposal} TextProposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextProposal.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextProposal message. + * @function verify + * @memberof cosmos.gov.v1beta1.TextProposal + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextProposal.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a TextProposal message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.TextProposal + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.TextProposal} TextProposal + */ + TextProposal.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.TextProposal) + return object; + var message = new $root.cosmos.gov.v1beta1.TextProposal(); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a TextProposal message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.TextProposal + * @static + * @param {cosmos.gov.v1beta1.TextProposal} message TextProposal + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextProposal.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.title = ""; + object.description = ""; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this TextProposal to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.TextProposal + * @instance + * @returns {Object.} JSON object + */ + TextProposal.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TextProposal; + })(v1beta1.TextProposal || {}); + + v1beta1.Deposit = (function(Deposit) { + + /** + * Properties of a Deposit. + * @memberof cosmos.gov.v1beta1 + * @interface IDeposit + * @property {number|Long|null} [proposalId] Deposit proposalId + * @property {string|null} [depositor] Deposit depositor + * @property {Array.|null} [amount] Deposit amount + */ + + /** + * Constructs a new Deposit. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a Deposit. + * @implements IDeposit + * @constructor + * @param {cosmos.gov.v1beta1.IDeposit=} [properties] Properties to set + */ + function Deposit(properties) { + this.amount = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Deposit proposalId. + * @member {number|Long} proposalId + * @memberof cosmos.gov.v1beta1.Deposit + * @instance + */ + Deposit.prototype.proposalId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Deposit depositor. + * @member {string} depositor + * @memberof cosmos.gov.v1beta1.Deposit + * @instance + */ + Deposit.prototype.depositor = ""; + + /** + * Deposit amount. + * @member {Array.} amount + * @memberof cosmos.gov.v1beta1.Deposit + * @instance + */ + Deposit.prototype.amount = $util.emptyArray; + + /** + * Creates a new Deposit instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.Deposit + * @static + * @param {cosmos.gov.v1beta1.IDeposit=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.Deposit} Deposit instance + */ + Deposit.create = function create(properties) { + return new Deposit(properties); + }; + + /** + * Encodes the specified Deposit message. Does not implicitly {@link cosmos.gov.v1beta1.Deposit.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.Deposit + * @static + * @param {cosmos.gov.v1beta1.IDeposit} message Deposit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deposit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proposalId != null && Object.hasOwnProperty.call(message, "proposalId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposalId); + if (message.depositor != null && Object.hasOwnProperty.call(message, "depositor")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.depositor); + if (message.amount != null && message.amount.length) + for (var i = 0; i < message.amount.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.amount[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Deposit message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.Deposit.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.Deposit + * @static + * @param {cosmos.gov.v1beta1.IDeposit} message Deposit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deposit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Deposit message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.Deposit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.Deposit} Deposit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deposit.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.Deposit(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.depositor = reader.string(); + break; + case 3: + if (!(message.amount && message.amount.length)) + message.amount = []; + message.amount.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Deposit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.Deposit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.Deposit} Deposit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deposit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Deposit message. + * @function verify + * @memberof cosmos.gov.v1beta1.Deposit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Deposit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (!$util.isInteger(message.proposalId) && !(message.proposalId && $util.isInteger(message.proposalId.low) && $util.isInteger(message.proposalId.high))) + return "proposalId: integer|Long expected"; + if (message.depositor != null && message.hasOwnProperty("depositor")) + if (!$util.isString(message.depositor)) + return "depositor: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + if (!Array.isArray(message.amount)) + return "amount: array expected"; + for (var i = 0; i < message.amount.length; ++i) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.amount[i]); + if (error) + return "amount." + error; + } + } + return null; + }; + + /** + * Creates a Deposit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.Deposit + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.Deposit} Deposit + */ + Deposit.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.Deposit) + return object; + var message = new $root.cosmos.gov.v1beta1.Deposit(); + if (object.proposalId != null) + if ($util.Long) + (message.proposalId = $util.Long.fromValue(object.proposalId)).unsigned = true; + else if (typeof object.proposalId === "string") + message.proposalId = parseInt(object.proposalId, 10); + else if (typeof object.proposalId === "number") + message.proposalId = object.proposalId; + else if (typeof object.proposalId === "object") + message.proposalId = new $util.LongBits(object.proposalId.low >>> 0, object.proposalId.high >>> 0).toNumber(true); + if (object.depositor != null) + message.depositor = String(object.depositor); + if (object.amount) { + if (!Array.isArray(object.amount)) + throw TypeError(".cosmos.gov.v1beta1.Deposit.amount: array expected"); + message.amount = []; + for (var i = 0; i < object.amount.length; ++i) { + if (typeof object.amount[i] !== "object") + throw TypeError(".cosmos.gov.v1beta1.Deposit.amount: object expected"); + message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Deposit message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.Deposit + * @static + * @param {cosmos.gov.v1beta1.Deposit} message Deposit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Deposit.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.amount = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.proposalId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.proposalId = options.longs === String ? "0" : 0; + object.depositor = ""; + } + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (typeof message.proposalId === "number") + object.proposalId = options.longs === String ? String(message.proposalId) : message.proposalId; + else + object.proposalId = options.longs === String ? $util.Long.prototype.toString.call(message.proposalId) : options.longs === Number ? new $util.LongBits(message.proposalId.low >>> 0, message.proposalId.high >>> 0).toNumber(true) : message.proposalId; + if (message.depositor != null && message.hasOwnProperty("depositor")) + object.depositor = message.depositor; + if (message.amount && message.amount.length) { + object.amount = []; + for (var j = 0; j < message.amount.length; ++j) + object.amount[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.amount[j], options); + } + return object; + }; + + /** + * Converts this Deposit to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.Deposit + * @instance + * @returns {Object.} JSON object + */ + Deposit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Deposit; + })(v1beta1.Deposit || {}); + + v1beta1.Proposal = (function(Proposal) { + + /** + * Properties of a Proposal. + * @memberof cosmos.gov.v1beta1 + * @interface IProposal + * @property {number|Long|null} [proposalId] Proposal proposalId + * @property {google.protobuf.IAny|null} [content] Proposal content + * @property {cosmos.gov.v1beta1.ProposalStatus|null} [status] Proposal status + * @property {cosmos.gov.v1beta1.ITallyResult|null} [finalTallyResult] Proposal finalTallyResult + * @property {google.protobuf.ITimestamp|null} [submitTime] Proposal submitTime + * @property {google.protobuf.ITimestamp|null} [depositEndTime] Proposal depositEndTime + * @property {Array.|null} [totalDeposit] Proposal totalDeposit + * @property {google.protobuf.ITimestamp|null} [votingStartTime] Proposal votingStartTime + * @property {google.protobuf.ITimestamp|null} [votingEndTime] Proposal votingEndTime + */ + + /** + * Constructs a new Proposal. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a Proposal. + * @implements IProposal + * @constructor + * @param {cosmos.gov.v1beta1.IProposal=} [properties] Properties to set + */ + function Proposal(properties) { + this.totalDeposit = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Proposal proposalId. + * @member {number|Long} proposalId + * @memberof cosmos.gov.v1beta1.Proposal + * @instance + */ + Proposal.prototype.proposalId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Proposal content. + * @member {google.protobuf.IAny|null|undefined} content + * @memberof cosmos.gov.v1beta1.Proposal + * @instance + */ + Proposal.prototype.content = null; + + /** + * Proposal status. + * @member {cosmos.gov.v1beta1.ProposalStatus} status + * @memberof cosmos.gov.v1beta1.Proposal + * @instance + */ + Proposal.prototype.status = 0; + + /** + * Proposal finalTallyResult. + * @member {cosmos.gov.v1beta1.ITallyResult|null|undefined} finalTallyResult + * @memberof cosmos.gov.v1beta1.Proposal + * @instance + */ + Proposal.prototype.finalTallyResult = null; + + /** + * Proposal submitTime. + * @member {google.protobuf.ITimestamp|null|undefined} submitTime + * @memberof cosmos.gov.v1beta1.Proposal + * @instance + */ + Proposal.prototype.submitTime = null; + + /** + * Proposal depositEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} depositEndTime + * @memberof cosmos.gov.v1beta1.Proposal + * @instance + */ + Proposal.prototype.depositEndTime = null; + + /** + * Proposal totalDeposit. + * @member {Array.} totalDeposit + * @memberof cosmos.gov.v1beta1.Proposal + * @instance + */ + Proposal.prototype.totalDeposit = $util.emptyArray; + + /** + * Proposal votingStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} votingStartTime + * @memberof cosmos.gov.v1beta1.Proposal + * @instance + */ + Proposal.prototype.votingStartTime = null; + + /** + * Proposal votingEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} votingEndTime + * @memberof cosmos.gov.v1beta1.Proposal + * @instance + */ + Proposal.prototype.votingEndTime = null; + + /** + * Creates a new Proposal instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.Proposal + * @static + * @param {cosmos.gov.v1beta1.IProposal=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.Proposal} Proposal instance + */ + Proposal.create = function create(properties) { + return new Proposal(properties); + }; + + /** + * Encodes the specified Proposal message. Does not implicitly {@link cosmos.gov.v1beta1.Proposal.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.Proposal + * @static + * @param {cosmos.gov.v1beta1.IProposal} message Proposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proposal.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proposalId != null && Object.hasOwnProperty.call(message, "proposalId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposalId); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + $root.google.protobuf.Any.encode(message.content, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.status); + if (message.finalTallyResult != null && Object.hasOwnProperty.call(message, "finalTallyResult")) + $root.cosmos.gov.v1beta1.TallyResult.encode(message.finalTallyResult, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.depositEndTime != null && Object.hasOwnProperty.call(message, "depositEndTime")) + $root.google.protobuf.Timestamp.encode(message.depositEndTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.totalDeposit != null && message.totalDeposit.length) + for (var i = 0; i < message.totalDeposit.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.totalDeposit[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.votingStartTime != null && Object.hasOwnProperty.call(message, "votingStartTime")) + $root.google.protobuf.Timestamp.encode(message.votingStartTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.votingEndTime != null && Object.hasOwnProperty.call(message, "votingEndTime")) + $root.google.protobuf.Timestamp.encode(message.votingEndTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Proposal message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.Proposal.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.Proposal + * @static + * @param {cosmos.gov.v1beta1.IProposal} message Proposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proposal.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Proposal message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.Proposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.Proposal} Proposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proposal.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.Proposal(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.content = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 3: + message.status = reader.int32(); + break; + case 4: + message.finalTallyResult = $root.cosmos.gov.v1beta1.TallyResult.decode(reader, reader.uint32()); + break; + case 5: + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.depositEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 7: + if (!(message.totalDeposit && message.totalDeposit.length)) + message.totalDeposit = []; + message.totalDeposit.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + case 8: + message.votingStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 9: + message.votingEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Proposal message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.Proposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.Proposal} Proposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proposal.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Proposal message. + * @function verify + * @memberof cosmos.gov.v1beta1.Proposal + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Proposal.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (!$util.isInteger(message.proposalId) && !(message.proposalId && $util.isInteger(message.proposalId.low) && $util.isInteger(message.proposalId.high))) + return "proposalId: integer|Long expected"; + if (message.content != null && message.hasOwnProperty("content")) { + var error = $root.google.protobuf.Any.verify(message.content); + if (error) + return "content." + error; + } + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.finalTallyResult != null && message.hasOwnProperty("finalTallyResult")) { + var error = $root.cosmos.gov.v1beta1.TallyResult.verify(message.finalTallyResult); + if (error) + return "finalTallyResult." + error; + } + if (message.submitTime != null && message.hasOwnProperty("submitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.submitTime); + if (error) + return "submitTime." + error; + } + if (message.depositEndTime != null && message.hasOwnProperty("depositEndTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.depositEndTime); + if (error) + return "depositEndTime." + error; + } + if (message.totalDeposit != null && message.hasOwnProperty("totalDeposit")) { + if (!Array.isArray(message.totalDeposit)) + return "totalDeposit: array expected"; + for (var i = 0; i < message.totalDeposit.length; ++i) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.totalDeposit[i]); + if (error) + return "totalDeposit." + error; + } + } + if (message.votingStartTime != null && message.hasOwnProperty("votingStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.votingStartTime); + if (error) + return "votingStartTime." + error; + } + if (message.votingEndTime != null && message.hasOwnProperty("votingEndTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.votingEndTime); + if (error) + return "votingEndTime." + error; + } + return null; + }; + + /** + * Creates a Proposal message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.Proposal + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.Proposal} Proposal + */ + Proposal.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.Proposal) + return object; + var message = new $root.cosmos.gov.v1beta1.Proposal(); + if (object.proposalId != null) + if ($util.Long) + (message.proposalId = $util.Long.fromValue(object.proposalId)).unsigned = true; + else if (typeof object.proposalId === "string") + message.proposalId = parseInt(object.proposalId, 10); + else if (typeof object.proposalId === "number") + message.proposalId = object.proposalId; + else if (typeof object.proposalId === "object") + message.proposalId = new $util.LongBits(object.proposalId.low >>> 0, object.proposalId.high >>> 0).toNumber(true); + if (object.content != null) { + if (typeof object.content !== "object") + throw TypeError(".cosmos.gov.v1beta1.Proposal.content: object expected"); + message.content = $root.google.protobuf.Any.fromObject(object.content); + } + switch (object.status) { + case "PROPOSAL_STATUS_UNSPECIFIED": + case 0: + message.status = 0; + break; + case "PROPOSAL_STATUS_DEPOSIT_PERIOD": + case 1: + message.status = 1; + break; + case "PROPOSAL_STATUS_VOTING_PERIOD": + case 2: + message.status = 2; + break; + case "PROPOSAL_STATUS_PASSED": + case 3: + message.status = 3; + break; + case "PROPOSAL_STATUS_REJECTED": + case 4: + message.status = 4; + break; + case "PROPOSAL_STATUS_FAILED": + case 5: + message.status = 5; + break; + } + if (object.finalTallyResult != null) { + if (typeof object.finalTallyResult !== "object") + throw TypeError(".cosmos.gov.v1beta1.Proposal.finalTallyResult: object expected"); + message.finalTallyResult = $root.cosmos.gov.v1beta1.TallyResult.fromObject(object.finalTallyResult); + } + if (object.submitTime != null) { + if (typeof object.submitTime !== "object") + throw TypeError(".cosmos.gov.v1beta1.Proposal.submitTime: object expected"); + message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + } + if (object.depositEndTime != null) { + if (typeof object.depositEndTime !== "object") + throw TypeError(".cosmos.gov.v1beta1.Proposal.depositEndTime: object expected"); + message.depositEndTime = $root.google.protobuf.Timestamp.fromObject(object.depositEndTime); + } + if (object.totalDeposit) { + if (!Array.isArray(object.totalDeposit)) + throw TypeError(".cosmos.gov.v1beta1.Proposal.totalDeposit: array expected"); + message.totalDeposit = []; + for (var i = 0; i < object.totalDeposit.length; ++i) { + if (typeof object.totalDeposit[i] !== "object") + throw TypeError(".cosmos.gov.v1beta1.Proposal.totalDeposit: object expected"); + message.totalDeposit[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.totalDeposit[i]); + } + } + if (object.votingStartTime != null) { + if (typeof object.votingStartTime !== "object") + throw TypeError(".cosmos.gov.v1beta1.Proposal.votingStartTime: object expected"); + message.votingStartTime = $root.google.protobuf.Timestamp.fromObject(object.votingStartTime); + } + if (object.votingEndTime != null) { + if (typeof object.votingEndTime !== "object") + throw TypeError(".cosmos.gov.v1beta1.Proposal.votingEndTime: object expected"); + message.votingEndTime = $root.google.protobuf.Timestamp.fromObject(object.votingEndTime); + } + return message; + }; + + /** + * Creates a plain object from a Proposal message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.Proposal + * @static + * @param {cosmos.gov.v1beta1.Proposal} message Proposal + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Proposal.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.totalDeposit = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.proposalId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.proposalId = options.longs === String ? "0" : 0; + object.content = null; + object.status = options.enums === String ? "PROPOSAL_STATUS_UNSPECIFIED" : 0; + object.finalTallyResult = null; + object.submitTime = null; + object.depositEndTime = null; + object.votingStartTime = null; + object.votingEndTime = null; + } + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (typeof message.proposalId === "number") + object.proposalId = options.longs === String ? String(message.proposalId) : message.proposalId; + else + object.proposalId = options.longs === String ? $util.Long.prototype.toString.call(message.proposalId) : options.longs === Number ? new $util.LongBits(message.proposalId.low >>> 0, message.proposalId.high >>> 0).toNumber(true) : message.proposalId; + if (message.content != null && message.hasOwnProperty("content")) + object.content = $root.google.protobuf.Any.toObject(message.content, options); + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.cosmos.gov.v1beta1.ProposalStatus[message.status] : message.status; + if (message.finalTallyResult != null && message.hasOwnProperty("finalTallyResult")) + object.finalTallyResult = $root.cosmos.gov.v1beta1.TallyResult.toObject(message.finalTallyResult, options); + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); + if (message.depositEndTime != null && message.hasOwnProperty("depositEndTime")) + object.depositEndTime = $root.google.protobuf.Timestamp.toObject(message.depositEndTime, options); + if (message.totalDeposit && message.totalDeposit.length) { + object.totalDeposit = []; + for (var j = 0; j < message.totalDeposit.length; ++j) + object.totalDeposit[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.totalDeposit[j], options); + } + if (message.votingStartTime != null && message.hasOwnProperty("votingStartTime")) + object.votingStartTime = $root.google.protobuf.Timestamp.toObject(message.votingStartTime, options); + if (message.votingEndTime != null && message.hasOwnProperty("votingEndTime")) + object.votingEndTime = $root.google.protobuf.Timestamp.toObject(message.votingEndTime, options); + return object; + }; + + /** + * Converts this Proposal to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.Proposal + * @instance + * @returns {Object.} JSON object + */ + Proposal.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Proposal; + })(v1beta1.Proposal || {}); + + /** + * ProposalStatus enum. + * @name cosmos.gov.v1beta1.ProposalStatus + * @enum {string} + * @property {number} PROPOSAL_STATUS_UNSPECIFIED=0 PROPOSAL_STATUS_UNSPECIFIED value + * @property {number} PROPOSAL_STATUS_DEPOSIT_PERIOD=1 PROPOSAL_STATUS_DEPOSIT_PERIOD value + * @property {number} PROPOSAL_STATUS_VOTING_PERIOD=2 PROPOSAL_STATUS_VOTING_PERIOD value + * @property {number} PROPOSAL_STATUS_PASSED=3 PROPOSAL_STATUS_PASSED value + * @property {number} PROPOSAL_STATUS_REJECTED=4 PROPOSAL_STATUS_REJECTED value + * @property {number} PROPOSAL_STATUS_FAILED=5 PROPOSAL_STATUS_FAILED value + */ + v1beta1.ProposalStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROPOSAL_STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "PROPOSAL_STATUS_DEPOSIT_PERIOD"] = 1; + values[valuesById[2] = "PROPOSAL_STATUS_VOTING_PERIOD"] = 2; + values[valuesById[3] = "PROPOSAL_STATUS_PASSED"] = 3; + values[valuesById[4] = "PROPOSAL_STATUS_REJECTED"] = 4; + values[valuesById[5] = "PROPOSAL_STATUS_FAILED"] = 5; + return values; + })(); + + v1beta1.TallyResult = (function(TallyResult) { + + /** + * Properties of a TallyResult. + * @memberof cosmos.gov.v1beta1 + * @interface ITallyResult + * @property {string|null} [yes] TallyResult yes + * @property {string|null} [abstain] TallyResult abstain + * @property {string|null} [no] TallyResult no + * @property {string|null} [noWithVeto] TallyResult noWithVeto + */ + + /** + * Constructs a new TallyResult. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a TallyResult. + * @implements ITallyResult + * @constructor + * @param {cosmos.gov.v1beta1.ITallyResult=} [properties] Properties to set + */ + function TallyResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TallyResult yes. + * @member {string} yes + * @memberof cosmos.gov.v1beta1.TallyResult + * @instance + */ + TallyResult.prototype.yes = ""; + + /** + * TallyResult abstain. + * @member {string} abstain + * @memberof cosmos.gov.v1beta1.TallyResult + * @instance + */ + TallyResult.prototype.abstain = ""; + + /** + * TallyResult no. + * @member {string} no + * @memberof cosmos.gov.v1beta1.TallyResult + * @instance + */ + TallyResult.prototype.no = ""; + + /** + * TallyResult noWithVeto. + * @member {string} noWithVeto + * @memberof cosmos.gov.v1beta1.TallyResult + * @instance + */ + TallyResult.prototype.noWithVeto = ""; + + /** + * Creates a new TallyResult instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.TallyResult + * @static + * @param {cosmos.gov.v1beta1.ITallyResult=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.TallyResult} TallyResult instance + */ + TallyResult.create = function create(properties) { + return new TallyResult(properties); + }; + + /** + * Encodes the specified TallyResult message. Does not implicitly {@link cosmos.gov.v1beta1.TallyResult.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.TallyResult + * @static + * @param {cosmos.gov.v1beta1.ITallyResult} message TallyResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TallyResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.yes != null && Object.hasOwnProperty.call(message, "yes")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.yes); + if (message.abstain != null && Object.hasOwnProperty.call(message, "abstain")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.abstain); + if (message.no != null && Object.hasOwnProperty.call(message, "no")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.no); + if (message.noWithVeto != null && Object.hasOwnProperty.call(message, "noWithVeto")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.noWithVeto); + return writer; + }; + + /** + * Encodes the specified TallyResult message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.TallyResult.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.TallyResult + * @static + * @param {cosmos.gov.v1beta1.ITallyResult} message TallyResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TallyResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TallyResult message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.TallyResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.TallyResult} TallyResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TallyResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.TallyResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.yes = reader.string(); + break; + case 2: + message.abstain = reader.string(); + break; + case 3: + message.no = reader.string(); + break; + case 4: + message.noWithVeto = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TallyResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.TallyResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.TallyResult} TallyResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TallyResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TallyResult message. + * @function verify + * @memberof cosmos.gov.v1beta1.TallyResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TallyResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.yes != null && message.hasOwnProperty("yes")) + if (!$util.isString(message.yes)) + return "yes: string expected"; + if (message.abstain != null && message.hasOwnProperty("abstain")) + if (!$util.isString(message.abstain)) + return "abstain: string expected"; + if (message.no != null && message.hasOwnProperty("no")) + if (!$util.isString(message.no)) + return "no: string expected"; + if (message.noWithVeto != null && message.hasOwnProperty("noWithVeto")) + if (!$util.isString(message.noWithVeto)) + return "noWithVeto: string expected"; + return null; + }; + + /** + * Creates a TallyResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.TallyResult + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.TallyResult} TallyResult + */ + TallyResult.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.TallyResult) + return object; + var message = new $root.cosmos.gov.v1beta1.TallyResult(); + if (object.yes != null) + message.yes = String(object.yes); + if (object.abstain != null) + message.abstain = String(object.abstain); + if (object.no != null) + message.no = String(object.no); + if (object.noWithVeto != null) + message.noWithVeto = String(object.noWithVeto); + return message; + }; + + /** + * Creates a plain object from a TallyResult message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.TallyResult + * @static + * @param {cosmos.gov.v1beta1.TallyResult} message TallyResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TallyResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.yes = ""; + object.abstain = ""; + object.no = ""; + object.noWithVeto = ""; + } + if (message.yes != null && message.hasOwnProperty("yes")) + object.yes = message.yes; + if (message.abstain != null && message.hasOwnProperty("abstain")) + object.abstain = message.abstain; + if (message.no != null && message.hasOwnProperty("no")) + object.no = message.no; + if (message.noWithVeto != null && message.hasOwnProperty("noWithVeto")) + object.noWithVeto = message.noWithVeto; + return object; + }; + + /** + * Converts this TallyResult to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.TallyResult + * @instance + * @returns {Object.} JSON object + */ + TallyResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TallyResult; + })(v1beta1.TallyResult || {}); + + v1beta1.Vote = (function(Vote) { + + /** + * Properties of a Vote. + * @memberof cosmos.gov.v1beta1 + * @interface IVote + * @property {number|Long|null} [proposalId] Vote proposalId + * @property {string|null} [voter] Vote voter + * @property {cosmos.gov.v1beta1.VoteOption|null} [option] Vote option + */ + + /** + * Constructs a new Vote. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a Vote. + * @implements IVote + * @constructor + * @param {cosmos.gov.v1beta1.IVote=} [properties] Properties to set + */ + function Vote(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Vote proposalId. + * @member {number|Long} proposalId + * @memberof cosmos.gov.v1beta1.Vote + * @instance + */ + Vote.prototype.proposalId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Vote voter. + * @member {string} voter + * @memberof cosmos.gov.v1beta1.Vote + * @instance + */ + Vote.prototype.voter = ""; + + /** + * Vote option. + * @member {cosmos.gov.v1beta1.VoteOption} option + * @memberof cosmos.gov.v1beta1.Vote + * @instance + */ + Vote.prototype.option = 0; + + /** + * Creates a new Vote instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.Vote + * @static + * @param {cosmos.gov.v1beta1.IVote=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.Vote} Vote instance + */ + Vote.create = function create(properties) { + return new Vote(properties); + }; + + /** + * Encodes the specified Vote message. Does not implicitly {@link cosmos.gov.v1beta1.Vote.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.Vote + * @static + * @param {cosmos.gov.v1beta1.IVote} message Vote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vote.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proposalId != null && Object.hasOwnProperty.call(message, "proposalId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposalId); + if (message.voter != null && Object.hasOwnProperty.call(message, "voter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.voter); + if (message.option != null && Object.hasOwnProperty.call(message, "option")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.option); + return writer; + }; + + /** + * Encodes the specified Vote message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.Vote.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.Vote + * @static + * @param {cosmos.gov.v1beta1.IVote} message Vote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vote.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Vote message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.Vote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.Vote} Vote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vote.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.Vote(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.voter = reader.string(); + break; + case 3: + message.option = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Vote message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.Vote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.Vote} Vote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vote.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Vote message. + * @function verify + * @memberof cosmos.gov.v1beta1.Vote + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Vote.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (!$util.isInteger(message.proposalId) && !(message.proposalId && $util.isInteger(message.proposalId.low) && $util.isInteger(message.proposalId.high))) + return "proposalId: integer|Long expected"; + if (message.voter != null && message.hasOwnProperty("voter")) + if (!$util.isString(message.voter)) + return "voter: string expected"; + if (message.option != null && message.hasOwnProperty("option")) + switch (message.option) { + default: + return "option: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a Vote message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.Vote + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.Vote} Vote + */ + Vote.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.Vote) + return object; + var message = new $root.cosmos.gov.v1beta1.Vote(); + if (object.proposalId != null) + if ($util.Long) + (message.proposalId = $util.Long.fromValue(object.proposalId)).unsigned = true; + else if (typeof object.proposalId === "string") + message.proposalId = parseInt(object.proposalId, 10); + else if (typeof object.proposalId === "number") + message.proposalId = object.proposalId; + else if (typeof object.proposalId === "object") + message.proposalId = new $util.LongBits(object.proposalId.low >>> 0, object.proposalId.high >>> 0).toNumber(true); + if (object.voter != null) + message.voter = String(object.voter); + switch (object.option) { + case "VOTE_OPTION_UNSPECIFIED": + case 0: + message.option = 0; + break; + case "VOTE_OPTION_YES": + case 1: + message.option = 1; + break; + case "VOTE_OPTION_ABSTAIN": + case 2: + message.option = 2; + break; + case "VOTE_OPTION_NO": + case 3: + message.option = 3; + break; + case "VOTE_OPTION_NO_WITH_VETO": + case 4: + message.option = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a Vote message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.Vote + * @static + * @param {cosmos.gov.v1beta1.Vote} message Vote + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Vote.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.proposalId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.proposalId = options.longs === String ? "0" : 0; + object.voter = ""; + object.option = options.enums === String ? "VOTE_OPTION_UNSPECIFIED" : 0; + } + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (typeof message.proposalId === "number") + object.proposalId = options.longs === String ? String(message.proposalId) : message.proposalId; + else + object.proposalId = options.longs === String ? $util.Long.prototype.toString.call(message.proposalId) : options.longs === Number ? new $util.LongBits(message.proposalId.low >>> 0, message.proposalId.high >>> 0).toNumber(true) : message.proposalId; + if (message.voter != null && message.hasOwnProperty("voter")) + object.voter = message.voter; + if (message.option != null && message.hasOwnProperty("option")) + object.option = options.enums === String ? $root.cosmos.gov.v1beta1.VoteOption[message.option] : message.option; + return object; + }; + + /** + * Converts this Vote to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.Vote + * @instance + * @returns {Object.} JSON object + */ + Vote.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Vote; + })(v1beta1.Vote || {}); + + v1beta1.DepositParams = (function(DepositParams) { + + /** + * Properties of a DepositParams. + * @memberof cosmos.gov.v1beta1 + * @interface IDepositParams + * @property {Array.|null} [minDeposit] DepositParams minDeposit + * @property {google.protobuf.IDuration|null} [maxDepositPeriod] DepositParams maxDepositPeriod + */ + + /** + * Constructs a new DepositParams. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a DepositParams. + * @implements IDepositParams + * @constructor + * @param {cosmos.gov.v1beta1.IDepositParams=} [properties] Properties to set + */ + function DepositParams(properties) { + this.minDeposit = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DepositParams minDeposit. + * @member {Array.} minDeposit + * @memberof cosmos.gov.v1beta1.DepositParams + * @instance + */ + DepositParams.prototype.minDeposit = $util.emptyArray; + + /** + * DepositParams maxDepositPeriod. + * @member {google.protobuf.IDuration|null|undefined} maxDepositPeriod + * @memberof cosmos.gov.v1beta1.DepositParams + * @instance + */ + DepositParams.prototype.maxDepositPeriod = null; + + /** + * Creates a new DepositParams instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.DepositParams + * @static + * @param {cosmos.gov.v1beta1.IDepositParams=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.DepositParams} DepositParams instance + */ + DepositParams.create = function create(properties) { + return new DepositParams(properties); + }; + + /** + * Encodes the specified DepositParams message. Does not implicitly {@link cosmos.gov.v1beta1.DepositParams.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.DepositParams + * @static + * @param {cosmos.gov.v1beta1.IDepositParams} message DepositParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DepositParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minDeposit != null && message.minDeposit.length) + for (var i = 0; i < message.minDeposit.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.minDeposit[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.maxDepositPeriod != null && Object.hasOwnProperty.call(message, "maxDepositPeriod")) + $root.google.protobuf.Duration.encode(message.maxDepositPeriod, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DepositParams message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.DepositParams.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.DepositParams + * @static + * @param {cosmos.gov.v1beta1.IDepositParams} message DepositParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DepositParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DepositParams message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.DepositParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.DepositParams} DepositParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DepositParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.DepositParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.minDeposit && message.minDeposit.length)) + message.minDeposit = []; + message.minDeposit.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + case 2: + message.maxDepositPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DepositParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.DepositParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.DepositParams} DepositParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DepositParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DepositParams message. + * @function verify + * @memberof cosmos.gov.v1beta1.DepositParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DepositParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.minDeposit != null && message.hasOwnProperty("minDeposit")) { + if (!Array.isArray(message.minDeposit)) + return "minDeposit: array expected"; + for (var i = 0; i < message.minDeposit.length; ++i) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.minDeposit[i]); + if (error) + return "minDeposit." + error; + } + } + if (message.maxDepositPeriod != null && message.hasOwnProperty("maxDepositPeriod")) { + var error = $root.google.protobuf.Duration.verify(message.maxDepositPeriod); + if (error) + return "maxDepositPeriod." + error; + } + return null; + }; + + /** + * Creates a DepositParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.DepositParams + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.DepositParams} DepositParams + */ + DepositParams.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.DepositParams) + return object; + var message = new $root.cosmos.gov.v1beta1.DepositParams(); + if (object.minDeposit) { + if (!Array.isArray(object.minDeposit)) + throw TypeError(".cosmos.gov.v1beta1.DepositParams.minDeposit: array expected"); + message.minDeposit = []; + for (var i = 0; i < object.minDeposit.length; ++i) { + if (typeof object.minDeposit[i] !== "object") + throw TypeError(".cosmos.gov.v1beta1.DepositParams.minDeposit: object expected"); + message.minDeposit[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.minDeposit[i]); + } + } + if (object.maxDepositPeriod != null) { + if (typeof object.maxDepositPeriod !== "object") + throw TypeError(".cosmos.gov.v1beta1.DepositParams.maxDepositPeriod: object expected"); + message.maxDepositPeriod = $root.google.protobuf.Duration.fromObject(object.maxDepositPeriod); + } + return message; + }; + + /** + * Creates a plain object from a DepositParams message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.DepositParams + * @static + * @param {cosmos.gov.v1beta1.DepositParams} message DepositParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DepositParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.minDeposit = []; + if (options.defaults) + object.maxDepositPeriod = null; + if (message.minDeposit && message.minDeposit.length) { + object.minDeposit = []; + for (var j = 0; j < message.minDeposit.length; ++j) + object.minDeposit[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.minDeposit[j], options); + } + if (message.maxDepositPeriod != null && message.hasOwnProperty("maxDepositPeriod")) + object.maxDepositPeriod = $root.google.protobuf.Duration.toObject(message.maxDepositPeriod, options); + return object; + }; + + /** + * Converts this DepositParams to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.DepositParams + * @instance + * @returns {Object.} JSON object + */ + DepositParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DepositParams; + })(v1beta1.DepositParams || {}); + + v1beta1.VotingParams = (function(VotingParams) { + + /** + * Properties of a VotingParams. + * @memberof cosmos.gov.v1beta1 + * @interface IVotingParams + * @property {google.protobuf.IDuration|null} [votingPeriod] VotingParams votingPeriod + */ + + /** + * Constructs a new VotingParams. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a VotingParams. + * @implements IVotingParams + * @constructor + * @param {cosmos.gov.v1beta1.IVotingParams=} [properties] Properties to set + */ + function VotingParams(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VotingParams votingPeriod. + * @member {google.protobuf.IDuration|null|undefined} votingPeriod + * @memberof cosmos.gov.v1beta1.VotingParams + * @instance + */ + VotingParams.prototype.votingPeriod = null; + + /** + * Creates a new VotingParams instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.VotingParams + * @static + * @param {cosmos.gov.v1beta1.IVotingParams=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.VotingParams} VotingParams instance + */ + VotingParams.create = function create(properties) { + return new VotingParams(properties); + }; + + /** + * Encodes the specified VotingParams message. Does not implicitly {@link cosmos.gov.v1beta1.VotingParams.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.VotingParams + * @static + * @param {cosmos.gov.v1beta1.IVotingParams} message VotingParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VotingParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.votingPeriod != null && Object.hasOwnProperty.call(message, "votingPeriod")) + $root.google.protobuf.Duration.encode(message.votingPeriod, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VotingParams message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.VotingParams.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.VotingParams + * @static + * @param {cosmos.gov.v1beta1.IVotingParams} message VotingParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VotingParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VotingParams message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.VotingParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.VotingParams} VotingParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VotingParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.VotingParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votingPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VotingParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.VotingParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.VotingParams} VotingParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VotingParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VotingParams message. + * @function verify + * @memberof cosmos.gov.v1beta1.VotingParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VotingParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.votingPeriod != null && message.hasOwnProperty("votingPeriod")) { + var error = $root.google.protobuf.Duration.verify(message.votingPeriod); + if (error) + return "votingPeriod." + error; + } + return null; + }; + + /** + * Creates a VotingParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.VotingParams + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.VotingParams} VotingParams + */ + VotingParams.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.VotingParams) + return object; + var message = new $root.cosmos.gov.v1beta1.VotingParams(); + if (object.votingPeriod != null) { + if (typeof object.votingPeriod !== "object") + throw TypeError(".cosmos.gov.v1beta1.VotingParams.votingPeriod: object expected"); + message.votingPeriod = $root.google.protobuf.Duration.fromObject(object.votingPeriod); + } + return message; + }; + + /** + * Creates a plain object from a VotingParams message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.VotingParams + * @static + * @param {cosmos.gov.v1beta1.VotingParams} message VotingParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VotingParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.votingPeriod = null; + if (message.votingPeriod != null && message.hasOwnProperty("votingPeriod")) + object.votingPeriod = $root.google.protobuf.Duration.toObject(message.votingPeriod, options); + return object; + }; + + /** + * Converts this VotingParams to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.VotingParams + * @instance + * @returns {Object.} JSON object + */ + VotingParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VotingParams; + })(v1beta1.VotingParams || {}); + + v1beta1.TallyParams = (function(TallyParams) { + + /** + * Properties of a TallyParams. + * @memberof cosmos.gov.v1beta1 + * @interface ITallyParams + * @property {Uint8Array|null} [quorum] TallyParams quorum + * @property {Uint8Array|null} [threshold] TallyParams threshold + * @property {Uint8Array|null} [vetoThreshold] TallyParams vetoThreshold + */ + + /** + * Constructs a new TallyParams. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a TallyParams. + * @implements ITallyParams + * @constructor + * @param {cosmos.gov.v1beta1.ITallyParams=} [properties] Properties to set + */ + function TallyParams(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TallyParams quorum. + * @member {Uint8Array} quorum + * @memberof cosmos.gov.v1beta1.TallyParams + * @instance + */ + TallyParams.prototype.quorum = $util.newBuffer([]); + + /** + * TallyParams threshold. + * @member {Uint8Array} threshold + * @memberof cosmos.gov.v1beta1.TallyParams + * @instance + */ + TallyParams.prototype.threshold = $util.newBuffer([]); + + /** + * TallyParams vetoThreshold. + * @member {Uint8Array} vetoThreshold + * @memberof cosmos.gov.v1beta1.TallyParams + * @instance + */ + TallyParams.prototype.vetoThreshold = $util.newBuffer([]); + + /** + * Creates a new TallyParams instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.TallyParams + * @static + * @param {cosmos.gov.v1beta1.ITallyParams=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.TallyParams} TallyParams instance + */ + TallyParams.create = function create(properties) { + return new TallyParams(properties); + }; + + /** + * Encodes the specified TallyParams message. Does not implicitly {@link cosmos.gov.v1beta1.TallyParams.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.TallyParams + * @static + * @param {cosmos.gov.v1beta1.ITallyParams} message TallyParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TallyParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quorum != null && Object.hasOwnProperty.call(message, "quorum")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.quorum); + if (message.threshold != null && Object.hasOwnProperty.call(message, "threshold")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.threshold); + if (message.vetoThreshold != null && Object.hasOwnProperty.call(message, "vetoThreshold")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.vetoThreshold); + return writer; + }; + + /** + * Encodes the specified TallyParams message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.TallyParams.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.TallyParams + * @static + * @param {cosmos.gov.v1beta1.ITallyParams} message TallyParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TallyParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TallyParams message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.TallyParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.TallyParams} TallyParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TallyParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.TallyParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.quorum = reader.bytes(); + break; + case 2: + message.threshold = reader.bytes(); + break; + case 3: + message.vetoThreshold = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TallyParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.TallyParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.TallyParams} TallyParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TallyParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TallyParams message. + * @function verify + * @memberof cosmos.gov.v1beta1.TallyParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TallyParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quorum != null && message.hasOwnProperty("quorum")) + if (!(message.quorum && typeof message.quorum.length === "number" || $util.isString(message.quorum))) + return "quorum: buffer expected"; + if (message.threshold != null && message.hasOwnProperty("threshold")) + if (!(message.threshold && typeof message.threshold.length === "number" || $util.isString(message.threshold))) + return "threshold: buffer expected"; + if (message.vetoThreshold != null && message.hasOwnProperty("vetoThreshold")) + if (!(message.vetoThreshold && typeof message.vetoThreshold.length === "number" || $util.isString(message.vetoThreshold))) + return "vetoThreshold: buffer expected"; + return null; + }; + + /** + * Creates a TallyParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.TallyParams + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.TallyParams} TallyParams + */ + TallyParams.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.TallyParams) + return object; + var message = new $root.cosmos.gov.v1beta1.TallyParams(); + if (object.quorum != null) + if (typeof object.quorum === "string") + $util.base64.decode(object.quorum, message.quorum = $util.newBuffer($util.base64.length(object.quorum)), 0); + else if (object.quorum.length) + message.quorum = object.quorum; + if (object.threshold != null) + if (typeof object.threshold === "string") + $util.base64.decode(object.threshold, message.threshold = $util.newBuffer($util.base64.length(object.threshold)), 0); + else if (object.threshold.length) + message.threshold = object.threshold; + if (object.vetoThreshold != null) + if (typeof object.vetoThreshold === "string") + $util.base64.decode(object.vetoThreshold, message.vetoThreshold = $util.newBuffer($util.base64.length(object.vetoThreshold)), 0); + else if (object.vetoThreshold.length) + message.vetoThreshold = object.vetoThreshold; + return message; + }; + + /** + * Creates a plain object from a TallyParams message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.TallyParams + * @static + * @param {cosmos.gov.v1beta1.TallyParams} message TallyParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TallyParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.quorum = ""; + else { + object.quorum = []; + if (options.bytes !== Array) + object.quorum = $util.newBuffer(object.quorum); + } + if (options.bytes === String) + object.threshold = ""; + else { + object.threshold = []; + if (options.bytes !== Array) + object.threshold = $util.newBuffer(object.threshold); + } + if (options.bytes === String) + object.vetoThreshold = ""; + else { + object.vetoThreshold = []; + if (options.bytes !== Array) + object.vetoThreshold = $util.newBuffer(object.vetoThreshold); + } + } + if (message.quorum != null && message.hasOwnProperty("quorum")) + object.quorum = options.bytes === String ? $util.base64.encode(message.quorum, 0, message.quorum.length) : options.bytes === Array ? Array.prototype.slice.call(message.quorum) : message.quorum; + if (message.threshold != null && message.hasOwnProperty("threshold")) + object.threshold = options.bytes === String ? $util.base64.encode(message.threshold, 0, message.threshold.length) : options.bytes === Array ? Array.prototype.slice.call(message.threshold) : message.threshold; + if (message.vetoThreshold != null && message.hasOwnProperty("vetoThreshold")) + object.vetoThreshold = options.bytes === String ? $util.base64.encode(message.vetoThreshold, 0, message.vetoThreshold.length) : options.bytes === Array ? Array.prototype.slice.call(message.vetoThreshold) : message.vetoThreshold; + return object; + }; + + /** + * Converts this TallyParams to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.TallyParams + * @instance + * @returns {Object.} JSON object + */ + TallyParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TallyParams; + })(v1beta1.TallyParams || {}); + + v1beta1.Msg = (function(Msg) { + + /** + * Constructs a new Msg service. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a Msg + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Msg(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; + + /** + * Creates new Msg service using the specified rpc implementation. + * @function create + * @memberof cosmos.gov.v1beta1.Msg + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Msg} RPC service. Useful where requests and/or responses are streamed. + */ + Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.gov.v1beta1.Msg#submitProposal}. + * @memberof cosmos.gov.v1beta1.Msg + * @typedef SubmitProposalCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.gov.v1beta1.IMsgSubmitProposalResponse} [response] MsgSubmitProposalResponse + */ + + /** + * Calls SubmitProposal. + * @function submitProposal + * @memberof cosmos.gov.v1beta1.Msg + * @instance + * @param {cosmos.gov.v1beta1.IMsgSubmitProposal} request MsgSubmitProposal message or plain object + * @param {cosmos.gov.v1beta1.Msg.SubmitProposalCallback} callback Node-style callback called with the error, if any, and MsgSubmitProposalResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.submitProposal = function submitProposal(request, callback) { + return this.rpcCall(submitProposal, $root.cosmos.gov.v1beta1.MsgSubmitProposal, $root.cosmos.gov.v1beta1.MsgSubmitProposalResponse, request, callback); + }, "name", { value: "SubmitProposal" }); + + /** + * Calls SubmitProposal. + * @function submitProposal + * @memberof cosmos.gov.v1beta1.Msg + * @instance + * @param {cosmos.gov.v1beta1.IMsgSubmitProposal} request MsgSubmitProposal message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.gov.v1beta1.Msg#vote}. + * @memberof cosmos.gov.v1beta1.Msg + * @typedef VoteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.gov.v1beta1.IMsgVoteResponse} [response] MsgVoteResponse + */ + + /** + * Calls Vote. + * @function vote + * @memberof cosmos.gov.v1beta1.Msg + * @instance + * @param {cosmos.gov.v1beta1.IMsgVote} request MsgVote message or plain object + * @param {cosmos.gov.v1beta1.Msg.VoteCallback} callback Node-style callback called with the error, if any, and MsgVoteResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.vote = function vote(request, callback) { + return this.rpcCall(vote, $root.cosmos.gov.v1beta1.MsgVote, $root.cosmos.gov.v1beta1.MsgVoteResponse, request, callback); + }, "name", { value: "Vote" }); + + /** + * Calls Vote. + * @function vote + * @memberof cosmos.gov.v1beta1.Msg + * @instance + * @param {cosmos.gov.v1beta1.IMsgVote} request MsgVote message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.gov.v1beta1.Msg#deposit}. + * @memberof cosmos.gov.v1beta1.Msg + * @typedef DepositCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.gov.v1beta1.IMsgDepositResponse} [response] MsgDepositResponse + */ + + /** + * Calls Deposit. + * @function deposit + * @memberof cosmos.gov.v1beta1.Msg + * @instance + * @param {cosmos.gov.v1beta1.IMsgDeposit} request MsgDeposit message or plain object + * @param {cosmos.gov.v1beta1.Msg.DepositCallback} callback Node-style callback called with the error, if any, and MsgDepositResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.deposit = function deposit(request, callback) { + return this.rpcCall(deposit, $root.cosmos.gov.v1beta1.MsgDeposit, $root.cosmos.gov.v1beta1.MsgDepositResponse, request, callback); + }, "name", { value: "Deposit" }); + + /** + * Calls Deposit. + * @function deposit + * @memberof cosmos.gov.v1beta1.Msg + * @instance + * @param {cosmos.gov.v1beta1.IMsgDeposit} request MsgDeposit message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Msg; + })(v1beta1.Msg || {}); + + v1beta1.MsgSubmitProposal = (function(MsgSubmitProposal) { + + /** + * Properties of a MsgSubmitProposal. + * @memberof cosmos.gov.v1beta1 + * @interface IMsgSubmitProposal + * @property {google.protobuf.IAny|null} [content] MsgSubmitProposal content + * @property {Array.|null} [initialDeposit] MsgSubmitProposal initialDeposit + * @property {string|null} [proposer] MsgSubmitProposal proposer + */ + + /** + * Constructs a new MsgSubmitProposal. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a MsgSubmitProposal. + * @implements IMsgSubmitProposal + * @constructor + * @param {cosmos.gov.v1beta1.IMsgSubmitProposal=} [properties] Properties to set + */ + function MsgSubmitProposal(properties) { + this.initialDeposit = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgSubmitProposal content. + * @member {google.protobuf.IAny|null|undefined} content + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @instance + */ + MsgSubmitProposal.prototype.content = null; + + /** + * MsgSubmitProposal initialDeposit. + * @member {Array.} initialDeposit + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @instance + */ + MsgSubmitProposal.prototype.initialDeposit = $util.emptyArray; + + /** + * MsgSubmitProposal proposer. + * @member {string} proposer + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @instance + */ + MsgSubmitProposal.prototype.proposer = ""; + + /** + * Creates a new MsgSubmitProposal instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @static + * @param {cosmos.gov.v1beta1.IMsgSubmitProposal=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.MsgSubmitProposal} MsgSubmitProposal instance + */ + MsgSubmitProposal.create = function create(properties) { + return new MsgSubmitProposal(properties); + }; + + /** + * Encodes the specified MsgSubmitProposal message. Does not implicitly {@link cosmos.gov.v1beta1.MsgSubmitProposal.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @static + * @param {cosmos.gov.v1beta1.IMsgSubmitProposal} message MsgSubmitProposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitProposal.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + $root.google.protobuf.Any.encode(message.content, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.initialDeposit != null && message.initialDeposit.length) + for (var i = 0; i < message.initialDeposit.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.initialDeposit[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.proposer != null && Object.hasOwnProperty.call(message, "proposer")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.proposer); + return writer; + }; + + /** + * Encodes the specified MsgSubmitProposal message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.MsgSubmitProposal.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @static + * @param {cosmos.gov.v1beta1.IMsgSubmitProposal} message MsgSubmitProposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitProposal.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgSubmitProposal message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.MsgSubmitProposal} MsgSubmitProposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitProposal.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.MsgSubmitProposal(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.content = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.initialDeposit && message.initialDeposit.length)) + message.initialDeposit = []; + message.initialDeposit.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + case 3: + message.proposer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgSubmitProposal message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.MsgSubmitProposal} MsgSubmitProposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitProposal.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgSubmitProposal message. + * @function verify + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgSubmitProposal.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) { + var error = $root.google.protobuf.Any.verify(message.content); + if (error) + return "content." + error; + } + if (message.initialDeposit != null && message.hasOwnProperty("initialDeposit")) { + if (!Array.isArray(message.initialDeposit)) + return "initialDeposit: array expected"; + for (var i = 0; i < message.initialDeposit.length; ++i) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.initialDeposit[i]); + if (error) + return "initialDeposit." + error; + } + } + if (message.proposer != null && message.hasOwnProperty("proposer")) + if (!$util.isString(message.proposer)) + return "proposer: string expected"; + return null; + }; + + /** + * Creates a MsgSubmitProposal message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.MsgSubmitProposal} MsgSubmitProposal + */ + MsgSubmitProposal.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.MsgSubmitProposal) + return object; + var message = new $root.cosmos.gov.v1beta1.MsgSubmitProposal(); + if (object.content != null) { + if (typeof object.content !== "object") + throw TypeError(".cosmos.gov.v1beta1.MsgSubmitProposal.content: object expected"); + message.content = $root.google.protobuf.Any.fromObject(object.content); + } + if (object.initialDeposit) { + if (!Array.isArray(object.initialDeposit)) + throw TypeError(".cosmos.gov.v1beta1.MsgSubmitProposal.initialDeposit: array expected"); + message.initialDeposit = []; + for (var i = 0; i < object.initialDeposit.length; ++i) { + if (typeof object.initialDeposit[i] !== "object") + throw TypeError(".cosmos.gov.v1beta1.MsgSubmitProposal.initialDeposit: object expected"); + message.initialDeposit[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.initialDeposit[i]); + } + } + if (object.proposer != null) + message.proposer = String(object.proposer); + return message; + }; + + /** + * Creates a plain object from a MsgSubmitProposal message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @static + * @param {cosmos.gov.v1beta1.MsgSubmitProposal} message MsgSubmitProposal + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSubmitProposal.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.initialDeposit = []; + if (options.defaults) { + object.content = null; + object.proposer = ""; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = $root.google.protobuf.Any.toObject(message.content, options); + if (message.initialDeposit && message.initialDeposit.length) { + object.initialDeposit = []; + for (var j = 0; j < message.initialDeposit.length; ++j) + object.initialDeposit[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.initialDeposit[j], options); + } + if (message.proposer != null && message.hasOwnProperty("proposer")) + object.proposer = message.proposer; + return object; + }; + + /** + * Converts this MsgSubmitProposal to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @instance + * @returns {Object.} JSON object + */ + MsgSubmitProposal.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgSubmitProposal; + })(v1beta1.MsgSubmitProposal || {}); + + v1beta1.MsgSubmitProposalResponse = (function(MsgSubmitProposalResponse) { + + /** + * Properties of a MsgSubmitProposalResponse. + * @memberof cosmos.gov.v1beta1 + * @interface IMsgSubmitProposalResponse + * @property {number|Long|null} [proposalId] MsgSubmitProposalResponse proposalId + */ + + /** + * Constructs a new MsgSubmitProposalResponse. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a MsgSubmitProposalResponse. + * @implements IMsgSubmitProposalResponse + * @constructor + * @param {cosmos.gov.v1beta1.IMsgSubmitProposalResponse=} [properties] Properties to set + */ + function MsgSubmitProposalResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgSubmitProposalResponse proposalId. + * @member {number|Long} proposalId + * @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse + * @instance + */ + MsgSubmitProposalResponse.prototype.proposalId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new MsgSubmitProposalResponse instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse + * @static + * @param {cosmos.gov.v1beta1.IMsgSubmitProposalResponse=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.MsgSubmitProposalResponse} MsgSubmitProposalResponse instance + */ + MsgSubmitProposalResponse.create = function create(properties) { + return new MsgSubmitProposalResponse(properties); + }; + + /** + * Encodes the specified MsgSubmitProposalResponse message. Does not implicitly {@link cosmos.gov.v1beta1.MsgSubmitProposalResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse + * @static + * @param {cosmos.gov.v1beta1.IMsgSubmitProposalResponse} message MsgSubmitProposalResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitProposalResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proposalId != null && Object.hasOwnProperty.call(message, "proposalId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposalId); + return writer; + }; + + /** + * Encodes the specified MsgSubmitProposalResponse message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.MsgSubmitProposalResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse + * @static + * @param {cosmos.gov.v1beta1.IMsgSubmitProposalResponse} message MsgSubmitProposalResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitProposalResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgSubmitProposalResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.MsgSubmitProposalResponse} MsgSubmitProposalResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitProposalResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.MsgSubmitProposalResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgSubmitProposalResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.MsgSubmitProposalResponse} MsgSubmitProposalResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitProposalResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgSubmitProposalResponse message. + * @function verify + * @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgSubmitProposalResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (!$util.isInteger(message.proposalId) && !(message.proposalId && $util.isInteger(message.proposalId.low) && $util.isInteger(message.proposalId.high))) + return "proposalId: integer|Long expected"; + return null; + }; + + /** + * Creates a MsgSubmitProposalResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.MsgSubmitProposalResponse} MsgSubmitProposalResponse + */ + MsgSubmitProposalResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.MsgSubmitProposalResponse) + return object; + var message = new $root.cosmos.gov.v1beta1.MsgSubmitProposalResponse(); + if (object.proposalId != null) + if ($util.Long) + (message.proposalId = $util.Long.fromValue(object.proposalId)).unsigned = true; + else if (typeof object.proposalId === "string") + message.proposalId = parseInt(object.proposalId, 10); + else if (typeof object.proposalId === "number") + message.proposalId = object.proposalId; + else if (typeof object.proposalId === "object") + message.proposalId = new $util.LongBits(object.proposalId.low >>> 0, object.proposalId.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a MsgSubmitProposalResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse + * @static + * @param {cosmos.gov.v1beta1.MsgSubmitProposalResponse} message MsgSubmitProposalResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSubmitProposalResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.proposalId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.proposalId = options.longs === String ? "0" : 0; + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (typeof message.proposalId === "number") + object.proposalId = options.longs === String ? String(message.proposalId) : message.proposalId; + else + object.proposalId = options.longs === String ? $util.Long.prototype.toString.call(message.proposalId) : options.longs === Number ? new $util.LongBits(message.proposalId.low >>> 0, message.proposalId.high >>> 0).toNumber(true) : message.proposalId; + return object; + }; + + /** + * Converts this MsgSubmitProposalResponse to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse + * @instance + * @returns {Object.} JSON object + */ + MsgSubmitProposalResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgSubmitProposalResponse; + })(v1beta1.MsgSubmitProposalResponse || {}); + + v1beta1.MsgVote = (function(MsgVote) { + + /** + * Properties of a MsgVote. + * @memberof cosmos.gov.v1beta1 + * @interface IMsgVote + * @property {number|Long|null} [proposalId] MsgVote proposalId + * @property {string|null} [voter] MsgVote voter + * @property {cosmos.gov.v1beta1.VoteOption|null} [option] MsgVote option + */ + + /** + * Constructs a new MsgVote. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a MsgVote. + * @implements IMsgVote + * @constructor + * @param {cosmos.gov.v1beta1.IMsgVote=} [properties] Properties to set + */ + function MsgVote(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgVote proposalId. + * @member {number|Long} proposalId + * @memberof cosmos.gov.v1beta1.MsgVote + * @instance + */ + MsgVote.prototype.proposalId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * MsgVote voter. + * @member {string} voter + * @memberof cosmos.gov.v1beta1.MsgVote + * @instance + */ + MsgVote.prototype.voter = ""; + + /** + * MsgVote option. + * @member {cosmos.gov.v1beta1.VoteOption} option + * @memberof cosmos.gov.v1beta1.MsgVote + * @instance + */ + MsgVote.prototype.option = 0; + + /** + * Creates a new MsgVote instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.MsgVote + * @static + * @param {cosmos.gov.v1beta1.IMsgVote=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.MsgVote} MsgVote instance + */ + MsgVote.create = function create(properties) { + return new MsgVote(properties); + }; + + /** + * Encodes the specified MsgVote message. Does not implicitly {@link cosmos.gov.v1beta1.MsgVote.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.MsgVote + * @static + * @param {cosmos.gov.v1beta1.IMsgVote} message MsgVote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgVote.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proposalId != null && Object.hasOwnProperty.call(message, "proposalId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposalId); + if (message.voter != null && Object.hasOwnProperty.call(message, "voter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.voter); + if (message.option != null && Object.hasOwnProperty.call(message, "option")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.option); + return writer; + }; + + /** + * Encodes the specified MsgVote message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.MsgVote.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.MsgVote + * @static + * @param {cosmos.gov.v1beta1.IMsgVote} message MsgVote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgVote.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgVote message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.MsgVote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.MsgVote} MsgVote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgVote.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.MsgVote(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.voter = reader.string(); + break; + case 3: + message.option = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgVote message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.MsgVote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.MsgVote} MsgVote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgVote.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgVote message. + * @function verify + * @memberof cosmos.gov.v1beta1.MsgVote + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgVote.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (!$util.isInteger(message.proposalId) && !(message.proposalId && $util.isInteger(message.proposalId.low) && $util.isInteger(message.proposalId.high))) + return "proposalId: integer|Long expected"; + if (message.voter != null && message.hasOwnProperty("voter")) + if (!$util.isString(message.voter)) + return "voter: string expected"; + if (message.option != null && message.hasOwnProperty("option")) + switch (message.option) { + default: + return "option: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a MsgVote message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.MsgVote + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.MsgVote} MsgVote + */ + MsgVote.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.MsgVote) + return object; + var message = new $root.cosmos.gov.v1beta1.MsgVote(); + if (object.proposalId != null) + if ($util.Long) + (message.proposalId = $util.Long.fromValue(object.proposalId)).unsigned = true; + else if (typeof object.proposalId === "string") + message.proposalId = parseInt(object.proposalId, 10); + else if (typeof object.proposalId === "number") + message.proposalId = object.proposalId; + else if (typeof object.proposalId === "object") + message.proposalId = new $util.LongBits(object.proposalId.low >>> 0, object.proposalId.high >>> 0).toNumber(true); + if (object.voter != null) + message.voter = String(object.voter); + switch (object.option) { + case "VOTE_OPTION_UNSPECIFIED": + case 0: + message.option = 0; + break; + case "VOTE_OPTION_YES": + case 1: + message.option = 1; + break; + case "VOTE_OPTION_ABSTAIN": + case 2: + message.option = 2; + break; + case "VOTE_OPTION_NO": + case 3: + message.option = 3; + break; + case "VOTE_OPTION_NO_WITH_VETO": + case 4: + message.option = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a MsgVote message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.MsgVote + * @static + * @param {cosmos.gov.v1beta1.MsgVote} message MsgVote + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgVote.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.proposalId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.proposalId = options.longs === String ? "0" : 0; + object.voter = ""; + object.option = options.enums === String ? "VOTE_OPTION_UNSPECIFIED" : 0; + } + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (typeof message.proposalId === "number") + object.proposalId = options.longs === String ? String(message.proposalId) : message.proposalId; + else + object.proposalId = options.longs === String ? $util.Long.prototype.toString.call(message.proposalId) : options.longs === Number ? new $util.LongBits(message.proposalId.low >>> 0, message.proposalId.high >>> 0).toNumber(true) : message.proposalId; + if (message.voter != null && message.hasOwnProperty("voter")) + object.voter = message.voter; + if (message.option != null && message.hasOwnProperty("option")) + object.option = options.enums === String ? $root.cosmos.gov.v1beta1.VoteOption[message.option] : message.option; + return object; + }; + + /** + * Converts this MsgVote to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.MsgVote + * @instance + * @returns {Object.} JSON object + */ + MsgVote.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgVote; + })(v1beta1.MsgVote || {}); + + v1beta1.MsgVoteResponse = (function(MsgVoteResponse) { + + /** + * Properties of a MsgVoteResponse. + * @memberof cosmos.gov.v1beta1 + * @interface IMsgVoteResponse + */ + + /** + * Constructs a new MsgVoteResponse. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a MsgVoteResponse. + * @implements IMsgVoteResponse + * @constructor + * @param {cosmos.gov.v1beta1.IMsgVoteResponse=} [properties] Properties to set + */ + function MsgVoteResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgVoteResponse instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.MsgVoteResponse + * @static + * @param {cosmos.gov.v1beta1.IMsgVoteResponse=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.MsgVoteResponse} MsgVoteResponse instance + */ + MsgVoteResponse.create = function create(properties) { + return new MsgVoteResponse(properties); + }; + + /** + * Encodes the specified MsgVoteResponse message. Does not implicitly {@link cosmos.gov.v1beta1.MsgVoteResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.MsgVoteResponse + * @static + * @param {cosmos.gov.v1beta1.IMsgVoteResponse} message MsgVoteResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgVoteResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgVoteResponse message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.MsgVoteResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.MsgVoteResponse + * @static + * @param {cosmos.gov.v1beta1.IMsgVoteResponse} message MsgVoteResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgVoteResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgVoteResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.MsgVoteResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.MsgVoteResponse} MsgVoteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgVoteResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.MsgVoteResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgVoteResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.MsgVoteResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.MsgVoteResponse} MsgVoteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgVoteResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgVoteResponse message. + * @function verify + * @memberof cosmos.gov.v1beta1.MsgVoteResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgVoteResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgVoteResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.MsgVoteResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.MsgVoteResponse} MsgVoteResponse + */ + MsgVoteResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.MsgVoteResponse) + return object; + return new $root.cosmos.gov.v1beta1.MsgVoteResponse(); + }; + + /** + * Creates a plain object from a MsgVoteResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.MsgVoteResponse + * @static + * @param {cosmos.gov.v1beta1.MsgVoteResponse} message MsgVoteResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgVoteResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgVoteResponse to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.MsgVoteResponse + * @instance + * @returns {Object.} JSON object + */ + MsgVoteResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgVoteResponse; + })(v1beta1.MsgVoteResponse || {}); + + v1beta1.MsgDeposit = (function(MsgDeposit) { + + /** + * Properties of a MsgDeposit. + * @memberof cosmos.gov.v1beta1 + * @interface IMsgDeposit + * @property {number|Long|null} [proposalId] MsgDeposit proposalId + * @property {string|null} [depositor] MsgDeposit depositor + * @property {Array.|null} [amount] MsgDeposit amount + */ + + /** + * Constructs a new MsgDeposit. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a MsgDeposit. + * @implements IMsgDeposit + * @constructor + * @param {cosmos.gov.v1beta1.IMsgDeposit=} [properties] Properties to set + */ + function MsgDeposit(properties) { + this.amount = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgDeposit proposalId. + * @member {number|Long} proposalId + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @instance + */ + MsgDeposit.prototype.proposalId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * MsgDeposit depositor. + * @member {string} depositor + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @instance + */ + MsgDeposit.prototype.depositor = ""; + + /** + * MsgDeposit amount. + * @member {Array.} amount + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @instance + */ + MsgDeposit.prototype.amount = $util.emptyArray; + + /** + * Creates a new MsgDeposit instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @static + * @param {cosmos.gov.v1beta1.IMsgDeposit=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.MsgDeposit} MsgDeposit instance + */ + MsgDeposit.create = function create(properties) { + return new MsgDeposit(properties); + }; + + /** + * Encodes the specified MsgDeposit message. Does not implicitly {@link cosmos.gov.v1beta1.MsgDeposit.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @static + * @param {cosmos.gov.v1beta1.IMsgDeposit} message MsgDeposit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgDeposit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proposalId != null && Object.hasOwnProperty.call(message, "proposalId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposalId); + if (message.depositor != null && Object.hasOwnProperty.call(message, "depositor")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.depositor); + if (message.amount != null && message.amount.length) + for (var i = 0; i < message.amount.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.amount[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MsgDeposit message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.MsgDeposit.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @static + * @param {cosmos.gov.v1beta1.IMsgDeposit} message MsgDeposit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgDeposit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgDeposit message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.MsgDeposit} MsgDeposit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgDeposit.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.MsgDeposit(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.depositor = reader.string(); + break; + case 3: + if (!(message.amount && message.amount.length)) + message.amount = []; + message.amount.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgDeposit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.MsgDeposit} MsgDeposit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgDeposit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgDeposit message. + * @function verify + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgDeposit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (!$util.isInteger(message.proposalId) && !(message.proposalId && $util.isInteger(message.proposalId.low) && $util.isInteger(message.proposalId.high))) + return "proposalId: integer|Long expected"; + if (message.depositor != null && message.hasOwnProperty("depositor")) + if (!$util.isString(message.depositor)) + return "depositor: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + if (!Array.isArray(message.amount)) + return "amount: array expected"; + for (var i = 0; i < message.amount.length; ++i) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.amount[i]); + if (error) + return "amount." + error; + } + } + return null; + }; + + /** + * Creates a MsgDeposit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.MsgDeposit} MsgDeposit + */ + MsgDeposit.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.MsgDeposit) + return object; + var message = new $root.cosmos.gov.v1beta1.MsgDeposit(); + if (object.proposalId != null) + if ($util.Long) + (message.proposalId = $util.Long.fromValue(object.proposalId)).unsigned = true; + else if (typeof object.proposalId === "string") + message.proposalId = parseInt(object.proposalId, 10); + else if (typeof object.proposalId === "number") + message.proposalId = object.proposalId; + else if (typeof object.proposalId === "object") + message.proposalId = new $util.LongBits(object.proposalId.low >>> 0, object.proposalId.high >>> 0).toNumber(true); + if (object.depositor != null) + message.depositor = String(object.depositor); + if (object.amount) { + if (!Array.isArray(object.amount)) + throw TypeError(".cosmos.gov.v1beta1.MsgDeposit.amount: array expected"); + message.amount = []; + for (var i = 0; i < object.amount.length; ++i) { + if (typeof object.amount[i] !== "object") + throw TypeError(".cosmos.gov.v1beta1.MsgDeposit.amount: object expected"); + message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MsgDeposit message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @static + * @param {cosmos.gov.v1beta1.MsgDeposit} message MsgDeposit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgDeposit.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.amount = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.proposalId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.proposalId = options.longs === String ? "0" : 0; + object.depositor = ""; + } + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (typeof message.proposalId === "number") + object.proposalId = options.longs === String ? String(message.proposalId) : message.proposalId; + else + object.proposalId = options.longs === String ? $util.Long.prototype.toString.call(message.proposalId) : options.longs === Number ? new $util.LongBits(message.proposalId.low >>> 0, message.proposalId.high >>> 0).toNumber(true) : message.proposalId; + if (message.depositor != null && message.hasOwnProperty("depositor")) + object.depositor = message.depositor; + if (message.amount && message.amount.length) { + object.amount = []; + for (var j = 0; j < message.amount.length; ++j) + object.amount[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.amount[j], options); + } + return object; + }; + + /** + * Converts this MsgDeposit to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @instance + * @returns {Object.} JSON object + */ + MsgDeposit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgDeposit; + })(v1beta1.MsgDeposit || {}); + + v1beta1.MsgDepositResponse = (function(MsgDepositResponse) { + + /** + * Properties of a MsgDepositResponse. + * @memberof cosmos.gov.v1beta1 + * @interface IMsgDepositResponse + */ + + /** + * Constructs a new MsgDepositResponse. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a MsgDepositResponse. + * @implements IMsgDepositResponse + * @constructor + * @param {cosmos.gov.v1beta1.IMsgDepositResponse=} [properties] Properties to set + */ + function MsgDepositResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgDepositResponse instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.MsgDepositResponse + * @static + * @param {cosmos.gov.v1beta1.IMsgDepositResponse=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.MsgDepositResponse} MsgDepositResponse instance + */ + MsgDepositResponse.create = function create(properties) { + return new MsgDepositResponse(properties); + }; + + /** + * Encodes the specified MsgDepositResponse message. Does not implicitly {@link cosmos.gov.v1beta1.MsgDepositResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.MsgDepositResponse + * @static + * @param {cosmos.gov.v1beta1.IMsgDepositResponse} message MsgDepositResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgDepositResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgDepositResponse message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.MsgDepositResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.MsgDepositResponse + * @static + * @param {cosmos.gov.v1beta1.IMsgDepositResponse} message MsgDepositResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgDepositResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgDepositResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.MsgDepositResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.MsgDepositResponse} MsgDepositResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgDepositResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.MsgDepositResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgDepositResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.MsgDepositResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.MsgDepositResponse} MsgDepositResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgDepositResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgDepositResponse message. + * @function verify + * @memberof cosmos.gov.v1beta1.MsgDepositResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgDepositResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgDepositResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.MsgDepositResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.MsgDepositResponse} MsgDepositResponse + */ + MsgDepositResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.MsgDepositResponse) + return object; + return new $root.cosmos.gov.v1beta1.MsgDepositResponse(); + }; + + /** + * Creates a plain object from a MsgDepositResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.MsgDepositResponse + * @static + * @param {cosmos.gov.v1beta1.MsgDepositResponse} message MsgDepositResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgDepositResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgDepositResponse to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.MsgDepositResponse + * @instance + * @returns {Object.} JSON object + */ + MsgDepositResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgDepositResponse; + })(v1beta1.MsgDepositResponse || {}); + + return v1beta1; + })(gov.v1beta1 || {}); + + return gov; + })(cosmos.gov || {}); + + /** + * Namespace staking. + * @memberof cosmos + * @namespace + */ + + cosmos.staking = (function(staking) { + + /** + * Namespace v1beta1. + * @memberof cosmos.staking + * @namespace + */ + + staking.v1beta1 = (function(v1beta1) { + + v1beta1.HistoricalInfo = (function(HistoricalInfo) { + + /** + * Properties of a HistoricalInfo. + * @memberof cosmos.staking.v1beta1 + * @interface IHistoricalInfo + * @property {tendermint.types.IHeader|null} [header] HistoricalInfo header + * @property {Array.|null} [valset] HistoricalInfo valset + */ + + /** + * Constructs a new HistoricalInfo. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a HistoricalInfo. + * @implements IHistoricalInfo + * @constructor + * @param {cosmos.staking.v1beta1.IHistoricalInfo=} [properties] Properties to set + */ + function HistoricalInfo(properties) { + this.valset = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HistoricalInfo header. + * @member {tendermint.types.IHeader|null|undefined} header + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @instance + */ + HistoricalInfo.prototype.header = null; + + /** + * HistoricalInfo valset. + * @member {Array.} valset + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @instance + */ + HistoricalInfo.prototype.valset = $util.emptyArray; + + /** + * Creates a new HistoricalInfo instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @static + * @param {cosmos.staking.v1beta1.IHistoricalInfo=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.HistoricalInfo} HistoricalInfo instance + */ + HistoricalInfo.create = function create(properties) { + return new HistoricalInfo(properties); + }; + + /** + * Encodes the specified HistoricalInfo message. Does not implicitly {@link cosmos.staking.v1beta1.HistoricalInfo.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @static + * @param {cosmos.staking.v1beta1.IHistoricalInfo} message HistoricalInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HistoricalInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + $root.tendermint.types.Header.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.valset != null && message.valset.length) + for (var i = 0; i < message.valset.length; ++i) + $root.cosmos.staking.v1beta1.Validator.encode(message.valset[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HistoricalInfo message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.HistoricalInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @static + * @param {cosmos.staking.v1beta1.IHistoricalInfo} message HistoricalInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HistoricalInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HistoricalInfo message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.HistoricalInfo} HistoricalInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HistoricalInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.HistoricalInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.header = $root.tendermint.types.Header.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.valset && message.valset.length)) + message.valset = []; + message.valset.push($root.cosmos.staking.v1beta1.Validator.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HistoricalInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.HistoricalInfo} HistoricalInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HistoricalInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HistoricalInfo message. + * @function verify + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HistoricalInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.header != null && message.hasOwnProperty("header")) { + var error = $root.tendermint.types.Header.verify(message.header); + if (error) + return "header." + error; + } + if (message.valset != null && message.hasOwnProperty("valset")) { + if (!Array.isArray(message.valset)) + return "valset: array expected"; + for (var i = 0; i < message.valset.length; ++i) { + var error = $root.cosmos.staking.v1beta1.Validator.verify(message.valset[i]); + if (error) + return "valset." + error; + } + } + return null; + }; + + /** + * Creates a HistoricalInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.HistoricalInfo} HistoricalInfo + */ + HistoricalInfo.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.HistoricalInfo) + return object; + var message = new $root.cosmos.staking.v1beta1.HistoricalInfo(); + if (object.header != null) { + if (typeof object.header !== "object") + throw TypeError(".cosmos.staking.v1beta1.HistoricalInfo.header: object expected"); + message.header = $root.tendermint.types.Header.fromObject(object.header); + } + if (object.valset) { + if (!Array.isArray(object.valset)) + throw TypeError(".cosmos.staking.v1beta1.HistoricalInfo.valset: array expected"); + message.valset = []; + for (var i = 0; i < object.valset.length; ++i) { + if (typeof object.valset[i] !== "object") + throw TypeError(".cosmos.staking.v1beta1.HistoricalInfo.valset: object expected"); + message.valset[i] = $root.cosmos.staking.v1beta1.Validator.fromObject(object.valset[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HistoricalInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @static + * @param {cosmos.staking.v1beta1.HistoricalInfo} message HistoricalInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HistoricalInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.valset = []; + if (options.defaults) + object.header = null; + if (message.header != null && message.hasOwnProperty("header")) + object.header = $root.tendermint.types.Header.toObject(message.header, options); + if (message.valset && message.valset.length) { + object.valset = []; + for (var j = 0; j < message.valset.length; ++j) + object.valset[j] = $root.cosmos.staking.v1beta1.Validator.toObject(message.valset[j], options); + } + return object; + }; + + /** + * Converts this HistoricalInfo to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @instance + * @returns {Object.} JSON object + */ + HistoricalInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HistoricalInfo; + })(v1beta1.HistoricalInfo || {}); + + v1beta1.CommissionRates = (function(CommissionRates) { + + /** + * Properties of a CommissionRates. + * @memberof cosmos.staking.v1beta1 + * @interface ICommissionRates + * @property {string|null} [rate] CommissionRates rate + * @property {string|null} [maxRate] CommissionRates maxRate + * @property {string|null} [maxChangeRate] CommissionRates maxChangeRate + */ + + /** + * Constructs a new CommissionRates. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a CommissionRates. + * @implements ICommissionRates + * @constructor + * @param {cosmos.staking.v1beta1.ICommissionRates=} [properties] Properties to set + */ + function CommissionRates(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommissionRates rate. + * @member {string} rate + * @memberof cosmos.staking.v1beta1.CommissionRates + * @instance + */ + CommissionRates.prototype.rate = ""; + + /** + * CommissionRates maxRate. + * @member {string} maxRate + * @memberof cosmos.staking.v1beta1.CommissionRates + * @instance + */ + CommissionRates.prototype.maxRate = ""; + + /** + * CommissionRates maxChangeRate. + * @member {string} maxChangeRate + * @memberof cosmos.staking.v1beta1.CommissionRates + * @instance + */ + CommissionRates.prototype.maxChangeRate = ""; + + /** + * Creates a new CommissionRates instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.CommissionRates + * @static + * @param {cosmos.staking.v1beta1.ICommissionRates=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.CommissionRates} CommissionRates instance + */ + CommissionRates.create = function create(properties) { + return new CommissionRates(properties); + }; + + /** + * Encodes the specified CommissionRates message. Does not implicitly {@link cosmos.staking.v1beta1.CommissionRates.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.CommissionRates + * @static + * @param {cosmos.staking.v1beta1.ICommissionRates} message CommissionRates message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommissionRates.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rate != null && Object.hasOwnProperty.call(message, "rate")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.rate); + if (message.maxRate != null && Object.hasOwnProperty.call(message, "maxRate")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.maxRate); + if (message.maxChangeRate != null && Object.hasOwnProperty.call(message, "maxChangeRate")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.maxChangeRate); + return writer; + }; + + /** + * Encodes the specified CommissionRates message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.CommissionRates.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.CommissionRates + * @static + * @param {cosmos.staking.v1beta1.ICommissionRates} message CommissionRates message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommissionRates.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommissionRates message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.CommissionRates + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.CommissionRates} CommissionRates + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommissionRates.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.CommissionRates(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rate = reader.string(); + break; + case 2: + message.maxRate = reader.string(); + break; + case 3: + message.maxChangeRate = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommissionRates message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.CommissionRates + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.CommissionRates} CommissionRates + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommissionRates.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommissionRates message. + * @function verify + * @memberof cosmos.staking.v1beta1.CommissionRates + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommissionRates.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rate != null && message.hasOwnProperty("rate")) + if (!$util.isString(message.rate)) + return "rate: string expected"; + if (message.maxRate != null && message.hasOwnProperty("maxRate")) + if (!$util.isString(message.maxRate)) + return "maxRate: string expected"; + if (message.maxChangeRate != null && message.hasOwnProperty("maxChangeRate")) + if (!$util.isString(message.maxChangeRate)) + return "maxChangeRate: string expected"; + return null; + }; + + /** + * Creates a CommissionRates message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.CommissionRates + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.CommissionRates} CommissionRates + */ + CommissionRates.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.CommissionRates) + return object; + var message = new $root.cosmos.staking.v1beta1.CommissionRates(); + if (object.rate != null) + message.rate = String(object.rate); + if (object.maxRate != null) + message.maxRate = String(object.maxRate); + if (object.maxChangeRate != null) + message.maxChangeRate = String(object.maxChangeRate); + return message; + }; + + /** + * Creates a plain object from a CommissionRates message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.CommissionRates + * @static + * @param {cosmos.staking.v1beta1.CommissionRates} message CommissionRates + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommissionRates.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rate = ""; + object.maxRate = ""; + object.maxChangeRate = ""; + } + if (message.rate != null && message.hasOwnProperty("rate")) + object.rate = message.rate; + if (message.maxRate != null && message.hasOwnProperty("maxRate")) + object.maxRate = message.maxRate; + if (message.maxChangeRate != null && message.hasOwnProperty("maxChangeRate")) + object.maxChangeRate = message.maxChangeRate; + return object; + }; + + /** + * Converts this CommissionRates to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.CommissionRates + * @instance + * @returns {Object.} JSON object + */ + CommissionRates.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CommissionRates; + })(v1beta1.CommissionRates || {}); + + v1beta1.Commission = (function(Commission) { + + /** + * Properties of a Commission. + * @memberof cosmos.staking.v1beta1 + * @interface ICommission + * @property {cosmos.staking.v1beta1.ICommissionRates|null} [commissionRates] Commission commissionRates + * @property {google.protobuf.ITimestamp|null} [updateTime] Commission updateTime + */ + + /** + * Constructs a new Commission. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a Commission. + * @implements ICommission + * @constructor + * @param {cosmos.staking.v1beta1.ICommission=} [properties] Properties to set + */ + function Commission(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Commission commissionRates. + * @member {cosmos.staking.v1beta1.ICommissionRates|null|undefined} commissionRates + * @memberof cosmos.staking.v1beta1.Commission + * @instance + */ + Commission.prototype.commissionRates = null; + + /** + * Commission updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof cosmos.staking.v1beta1.Commission + * @instance + */ + Commission.prototype.updateTime = null; + + /** + * Creates a new Commission instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.Commission + * @static + * @param {cosmos.staking.v1beta1.ICommission=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.Commission} Commission instance + */ + Commission.create = function create(properties) { + return new Commission(properties); + }; + + /** + * Encodes the specified Commission message. Does not implicitly {@link cosmos.staking.v1beta1.Commission.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.Commission + * @static + * @param {cosmos.staking.v1beta1.ICommission} message Commission message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Commission.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commissionRates != null && Object.hasOwnProperty.call(message, "commissionRates")) + $root.cosmos.staking.v1beta1.CommissionRates.encode(message.commissionRates, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Commission message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.Commission.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.Commission + * @static + * @param {cosmos.staking.v1beta1.ICommission} message Commission message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Commission.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Commission message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.Commission + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.Commission} Commission + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Commission.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.Commission(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.commissionRates = $root.cosmos.staking.v1beta1.CommissionRates.decode(reader, reader.uint32()); + break; + case 2: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Commission message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.Commission + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.Commission} Commission + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Commission.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Commission message. + * @function verify + * @memberof cosmos.staking.v1beta1.Commission + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Commission.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commissionRates != null && message.hasOwnProperty("commissionRates")) { + var error = $root.cosmos.staking.v1beta1.CommissionRates.verify(message.commissionRates); + if (error) + return "commissionRates." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a Commission message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.Commission + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.Commission} Commission + */ + Commission.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.Commission) + return object; + var message = new $root.cosmos.staking.v1beta1.Commission(); + if (object.commissionRates != null) { + if (typeof object.commissionRates !== "object") + throw TypeError(".cosmos.staking.v1beta1.Commission.commissionRates: object expected"); + message.commissionRates = $root.cosmos.staking.v1beta1.CommissionRates.fromObject(object.commissionRates); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".cosmos.staking.v1beta1.Commission.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a Commission message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.Commission + * @static + * @param {cosmos.staking.v1beta1.Commission} message Commission + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Commission.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.commissionRates = null; + object.updateTime = null; + } + if (message.commissionRates != null && message.hasOwnProperty("commissionRates")) + object.commissionRates = $root.cosmos.staking.v1beta1.CommissionRates.toObject(message.commissionRates, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this Commission to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.Commission + * @instance + * @returns {Object.} JSON object + */ + Commission.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Commission; + })(v1beta1.Commission || {}); + + v1beta1.Description = (function(Description) { + + /** + * Properties of a Description. + * @memberof cosmos.staking.v1beta1 + * @interface IDescription + * @property {string|null} [moniker] Description moniker + * @property {string|null} [identity] Description identity + * @property {string|null} [website] Description website + * @property {string|null} [securityContact] Description securityContact + * @property {string|null} [details] Description details + */ + + /** + * Constructs a new Description. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a Description. + * @implements IDescription + * @constructor + * @param {cosmos.staking.v1beta1.IDescription=} [properties] Properties to set + */ + function Description(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Description moniker. + * @member {string} moniker + * @memberof cosmos.staking.v1beta1.Description + * @instance + */ + Description.prototype.moniker = ""; + + /** + * Description identity. + * @member {string} identity + * @memberof cosmos.staking.v1beta1.Description + * @instance + */ + Description.prototype.identity = ""; + + /** + * Description website. + * @member {string} website + * @memberof cosmos.staking.v1beta1.Description + * @instance + */ + Description.prototype.website = ""; + + /** + * Description securityContact. + * @member {string} securityContact + * @memberof cosmos.staking.v1beta1.Description + * @instance + */ + Description.prototype.securityContact = ""; + + /** + * Description details. + * @member {string} details + * @memberof cosmos.staking.v1beta1.Description + * @instance + */ + Description.prototype.details = ""; + + /** + * Creates a new Description instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.Description + * @static + * @param {cosmos.staking.v1beta1.IDescription=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.Description} Description instance + */ + Description.create = function create(properties) { + return new Description(properties); + }; + + /** + * Encodes the specified Description message. Does not implicitly {@link cosmos.staking.v1beta1.Description.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.Description + * @static + * @param {cosmos.staking.v1beta1.IDescription} message Description message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Description.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.moniker != null && Object.hasOwnProperty.call(message, "moniker")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.moniker); + if (message.identity != null && Object.hasOwnProperty.call(message, "identity")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.identity); + if (message.website != null && Object.hasOwnProperty.call(message, "website")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.website); + if (message.securityContact != null && Object.hasOwnProperty.call(message, "securityContact")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.securityContact); + if (message.details != null && Object.hasOwnProperty.call(message, "details")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.details); + return writer; + }; + + /** + * Encodes the specified Description message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.Description.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.Description + * @static + * @param {cosmos.staking.v1beta1.IDescription} message Description message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Description.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Description message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.Description + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.Description} Description + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Description.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.Description(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.moniker = reader.string(); + break; + case 2: + message.identity = reader.string(); + break; + case 3: + message.website = reader.string(); + break; + case 4: + message.securityContact = reader.string(); + break; + case 5: + message.details = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Description message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.Description + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.Description} Description + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Description.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Description message. + * @function verify + * @memberof cosmos.staking.v1beta1.Description + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Description.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.moniker != null && message.hasOwnProperty("moniker")) + if (!$util.isString(message.moniker)) + return "moniker: string expected"; + if (message.identity != null && message.hasOwnProperty("identity")) + if (!$util.isString(message.identity)) + return "identity: string expected"; + if (message.website != null && message.hasOwnProperty("website")) + if (!$util.isString(message.website)) + return "website: string expected"; + if (message.securityContact != null && message.hasOwnProperty("securityContact")) + if (!$util.isString(message.securityContact)) + return "securityContact: string expected"; + if (message.details != null && message.hasOwnProperty("details")) + if (!$util.isString(message.details)) + return "details: string expected"; + return null; + }; + + /** + * Creates a Description message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.Description + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.Description} Description + */ + Description.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.Description) + return object; + var message = new $root.cosmos.staking.v1beta1.Description(); + if (object.moniker != null) + message.moniker = String(object.moniker); + if (object.identity != null) + message.identity = String(object.identity); + if (object.website != null) + message.website = String(object.website); + if (object.securityContact != null) + message.securityContact = String(object.securityContact); + if (object.details != null) + message.details = String(object.details); + return message; + }; + + /** + * Creates a plain object from a Description message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.Description + * @static + * @param {cosmos.staking.v1beta1.Description} message Description + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Description.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.moniker = ""; + object.identity = ""; + object.website = ""; + object.securityContact = ""; + object.details = ""; + } + if (message.moniker != null && message.hasOwnProperty("moniker")) + object.moniker = message.moniker; + if (message.identity != null && message.hasOwnProperty("identity")) + object.identity = message.identity; + if (message.website != null && message.hasOwnProperty("website")) + object.website = message.website; + if (message.securityContact != null && message.hasOwnProperty("securityContact")) + object.securityContact = message.securityContact; + if (message.details != null && message.hasOwnProperty("details")) + object.details = message.details; + return object; + }; + + /** + * Converts this Description to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.Description + * @instance + * @returns {Object.} JSON object + */ + Description.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Description; + })(v1beta1.Description || {}); + + v1beta1.Validator = (function(Validator) { + + /** + * Properties of a Validator. + * @memberof cosmos.staking.v1beta1 + * @interface IValidator + * @property {string|null} [operatorAddress] Validator operatorAddress + * @property {google.protobuf.IAny|null} [consensusPubkey] Validator consensusPubkey + * @property {boolean|null} [jailed] Validator jailed + * @property {cosmos.staking.v1beta1.BondStatus|null} [status] Validator status + * @property {string|null} [tokens] Validator tokens + * @property {string|null} [delegatorShares] Validator delegatorShares + * @property {cosmos.staking.v1beta1.IDescription|null} [description] Validator description + * @property {number|Long|null} [unbondingHeight] Validator unbondingHeight + * @property {google.protobuf.ITimestamp|null} [unbondingTime] Validator unbondingTime + * @property {cosmos.staking.v1beta1.ICommission|null} [commission] Validator commission + * @property {string|null} [minSelfDelegation] Validator minSelfDelegation + */ + + /** + * Constructs a new Validator. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a Validator. + * @implements IValidator + * @constructor + * @param {cosmos.staking.v1beta1.IValidator=} [properties] Properties to set + */ + function Validator(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Validator operatorAddress. + * @member {string} operatorAddress + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.operatorAddress = ""; + + /** + * Validator consensusPubkey. + * @member {google.protobuf.IAny|null|undefined} consensusPubkey + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.consensusPubkey = null; + + /** + * Validator jailed. + * @member {boolean} jailed + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.jailed = false; + + /** + * Validator status. + * @member {cosmos.staking.v1beta1.BondStatus} status + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.status = 0; + + /** + * Validator tokens. + * @member {string} tokens + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.tokens = ""; + + /** + * Validator delegatorShares. + * @member {string} delegatorShares + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.delegatorShares = ""; + + /** + * Validator description. + * @member {cosmos.staking.v1beta1.IDescription|null|undefined} description + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.description = null; + + /** + * Validator unbondingHeight. + * @member {number|Long} unbondingHeight + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.unbondingHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Validator unbondingTime. + * @member {google.protobuf.ITimestamp|null|undefined} unbondingTime + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.unbondingTime = null; + + /** + * Validator commission. + * @member {cosmos.staking.v1beta1.ICommission|null|undefined} commission + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.commission = null; + + /** + * Validator minSelfDelegation. + * @member {string} minSelfDelegation + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.minSelfDelegation = ""; + + /** + * Creates a new Validator instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.Validator + * @static + * @param {cosmos.staking.v1beta1.IValidator=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.Validator} Validator instance + */ + Validator.create = function create(properties) { + return new Validator(properties); + }; + + /** + * Encodes the specified Validator message. Does not implicitly {@link cosmos.staking.v1beta1.Validator.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.Validator + * @static + * @param {cosmos.staking.v1beta1.IValidator} message Validator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Validator.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operatorAddress != null && Object.hasOwnProperty.call(message, "operatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.operatorAddress); + if (message.consensusPubkey != null && Object.hasOwnProperty.call(message, "consensusPubkey")) + $root.google.protobuf.Any.encode(message.consensusPubkey, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.jailed != null && Object.hasOwnProperty.call(message, "jailed")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.jailed); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.status); + if (message.tokens != null && Object.hasOwnProperty.call(message, "tokens")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.tokens); + if (message.delegatorShares != null && Object.hasOwnProperty.call(message, "delegatorShares")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.delegatorShares); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + $root.cosmos.staking.v1beta1.Description.encode(message.description, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.unbondingHeight != null && Object.hasOwnProperty.call(message, "unbondingHeight")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.unbondingHeight); + if (message.unbondingTime != null && Object.hasOwnProperty.call(message, "unbondingTime")) + $root.google.protobuf.Timestamp.encode(message.unbondingTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.commission != null && Object.hasOwnProperty.call(message, "commission")) + $root.cosmos.staking.v1beta1.Commission.encode(message.commission, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.minSelfDelegation != null && Object.hasOwnProperty.call(message, "minSelfDelegation")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.minSelfDelegation); + return writer; + }; + + /** + * Encodes the specified Validator message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.Validator.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.Validator + * @static + * @param {cosmos.staking.v1beta1.IValidator} message Validator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Validator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Validator message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.Validator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.Validator} Validator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Validator.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.Validator(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operatorAddress = reader.string(); + break; + case 2: + message.consensusPubkey = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 3: + message.jailed = reader.bool(); + break; + case 4: + message.status = reader.int32(); + break; + case 5: + message.tokens = reader.string(); + break; + case 6: + message.delegatorShares = reader.string(); + break; + case 7: + message.description = $root.cosmos.staking.v1beta1.Description.decode(reader, reader.uint32()); + break; + case 8: + message.unbondingHeight = reader.int64(); + break; + case 9: + message.unbondingTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 10: + message.commission = $root.cosmos.staking.v1beta1.Commission.decode(reader, reader.uint32()); + break; + case 11: + message.minSelfDelegation = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Validator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.Validator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.Validator} Validator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Validator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Validator message. + * @function verify + * @memberof cosmos.staking.v1beta1.Validator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Validator.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operatorAddress != null && message.hasOwnProperty("operatorAddress")) + if (!$util.isString(message.operatorAddress)) + return "operatorAddress: string expected"; + if (message.consensusPubkey != null && message.hasOwnProperty("consensusPubkey")) { + var error = $root.google.protobuf.Any.verify(message.consensusPubkey); + if (error) + return "consensusPubkey." + error; + } + if (message.jailed != null && message.hasOwnProperty("jailed")) + if (typeof message.jailed !== "boolean") + return "jailed: boolean expected"; + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.tokens != null && message.hasOwnProperty("tokens")) + if (!$util.isString(message.tokens)) + return "tokens: string expected"; + if (message.delegatorShares != null && message.hasOwnProperty("delegatorShares")) + if (!$util.isString(message.delegatorShares)) + return "delegatorShares: string expected"; + if (message.description != null && message.hasOwnProperty("description")) { + var error = $root.cosmos.staking.v1beta1.Description.verify(message.description); + if (error) + return "description." + error; + } + if (message.unbondingHeight != null && message.hasOwnProperty("unbondingHeight")) + if (!$util.isInteger(message.unbondingHeight) && !(message.unbondingHeight && $util.isInteger(message.unbondingHeight.low) && $util.isInteger(message.unbondingHeight.high))) + return "unbondingHeight: integer|Long expected"; + if (message.unbondingTime != null && message.hasOwnProperty("unbondingTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.unbondingTime); + if (error) + return "unbondingTime." + error; + } + if (message.commission != null && message.hasOwnProperty("commission")) { + var error = $root.cosmos.staking.v1beta1.Commission.verify(message.commission); + if (error) + return "commission." + error; + } + if (message.minSelfDelegation != null && message.hasOwnProperty("minSelfDelegation")) + if (!$util.isString(message.minSelfDelegation)) + return "minSelfDelegation: string expected"; + return null; + }; + + /** + * Creates a Validator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.Validator + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.Validator} Validator + */ + Validator.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.Validator) + return object; + var message = new $root.cosmos.staking.v1beta1.Validator(); + if (object.operatorAddress != null) + message.operatorAddress = String(object.operatorAddress); + if (object.consensusPubkey != null) { + if (typeof object.consensusPubkey !== "object") + throw TypeError(".cosmos.staking.v1beta1.Validator.consensusPubkey: object expected"); + message.consensusPubkey = $root.google.protobuf.Any.fromObject(object.consensusPubkey); + } + if (object.jailed != null) + message.jailed = Boolean(object.jailed); + switch (object.status) { + case "BOND_STATUS_UNSPECIFIED": + case 0: + message.status = 0; + break; + case "BOND_STATUS_UNBONDED": + case 1: + message.status = 1; + break; + case "BOND_STATUS_UNBONDING": + case 2: + message.status = 2; + break; + case "BOND_STATUS_BONDED": + case 3: + message.status = 3; + break; + } + if (object.tokens != null) + message.tokens = String(object.tokens); + if (object.delegatorShares != null) + message.delegatorShares = String(object.delegatorShares); + if (object.description != null) { + if (typeof object.description !== "object") + throw TypeError(".cosmos.staking.v1beta1.Validator.description: object expected"); + message.description = $root.cosmos.staking.v1beta1.Description.fromObject(object.description); + } + if (object.unbondingHeight != null) + if ($util.Long) + (message.unbondingHeight = $util.Long.fromValue(object.unbondingHeight)).unsigned = false; + else if (typeof object.unbondingHeight === "string") + message.unbondingHeight = parseInt(object.unbondingHeight, 10); + else if (typeof object.unbondingHeight === "number") + message.unbondingHeight = object.unbondingHeight; + else if (typeof object.unbondingHeight === "object") + message.unbondingHeight = new $util.LongBits(object.unbondingHeight.low >>> 0, object.unbondingHeight.high >>> 0).toNumber(); + if (object.unbondingTime != null) { + if (typeof object.unbondingTime !== "object") + throw TypeError(".cosmos.staking.v1beta1.Validator.unbondingTime: object expected"); + message.unbondingTime = $root.google.protobuf.Timestamp.fromObject(object.unbondingTime); + } + if (object.commission != null) { + if (typeof object.commission !== "object") + throw TypeError(".cosmos.staking.v1beta1.Validator.commission: object expected"); + message.commission = $root.cosmos.staking.v1beta1.Commission.fromObject(object.commission); + } + if (object.minSelfDelegation != null) + message.minSelfDelegation = String(object.minSelfDelegation); + return message; + }; + + /** + * Creates a plain object from a Validator message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.Validator + * @static + * @param {cosmos.staking.v1beta1.Validator} message Validator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Validator.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.operatorAddress = ""; + object.consensusPubkey = null; + object.jailed = false; + object.status = options.enums === String ? "BOND_STATUS_UNSPECIFIED" : 0; + object.tokens = ""; + object.delegatorShares = ""; + object.description = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.unbondingHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.unbondingHeight = options.longs === String ? "0" : 0; + object.unbondingTime = null; + object.commission = null; + object.minSelfDelegation = ""; + } + if (message.operatorAddress != null && message.hasOwnProperty("operatorAddress")) + object.operatorAddress = message.operatorAddress; + if (message.consensusPubkey != null && message.hasOwnProperty("consensusPubkey")) + object.consensusPubkey = $root.google.protobuf.Any.toObject(message.consensusPubkey, options); + if (message.jailed != null && message.hasOwnProperty("jailed")) + object.jailed = message.jailed; + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.cosmos.staking.v1beta1.BondStatus[message.status] : message.status; + if (message.tokens != null && message.hasOwnProperty("tokens")) + object.tokens = message.tokens; + if (message.delegatorShares != null && message.hasOwnProperty("delegatorShares")) + object.delegatorShares = message.delegatorShares; + if (message.description != null && message.hasOwnProperty("description")) + object.description = $root.cosmos.staking.v1beta1.Description.toObject(message.description, options); + if (message.unbondingHeight != null && message.hasOwnProperty("unbondingHeight")) + if (typeof message.unbondingHeight === "number") + object.unbondingHeight = options.longs === String ? String(message.unbondingHeight) : message.unbondingHeight; + else + object.unbondingHeight = options.longs === String ? $util.Long.prototype.toString.call(message.unbondingHeight) : options.longs === Number ? new $util.LongBits(message.unbondingHeight.low >>> 0, message.unbondingHeight.high >>> 0).toNumber() : message.unbondingHeight; + if (message.unbondingTime != null && message.hasOwnProperty("unbondingTime")) + object.unbondingTime = $root.google.protobuf.Timestamp.toObject(message.unbondingTime, options); + if (message.commission != null && message.hasOwnProperty("commission")) + object.commission = $root.cosmos.staking.v1beta1.Commission.toObject(message.commission, options); + if (message.minSelfDelegation != null && message.hasOwnProperty("minSelfDelegation")) + object.minSelfDelegation = message.minSelfDelegation; + return object; + }; + + /** + * Converts this Validator to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.Validator + * @instance + * @returns {Object.} JSON object + */ + Validator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Validator; + })(v1beta1.Validator || {}); + + /** + * BondStatus enum. + * @name cosmos.staking.v1beta1.BondStatus + * @enum {string} + * @property {number} BOND_STATUS_UNSPECIFIED=0 BOND_STATUS_UNSPECIFIED value + * @property {number} BOND_STATUS_UNBONDED=1 BOND_STATUS_UNBONDED value + * @property {number} BOND_STATUS_UNBONDING=2 BOND_STATUS_UNBONDING value + * @property {number} BOND_STATUS_BONDED=3 BOND_STATUS_BONDED value + */ + v1beta1.BondStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BOND_STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "BOND_STATUS_UNBONDED"] = 1; + values[valuesById[2] = "BOND_STATUS_UNBONDING"] = 2; + values[valuesById[3] = "BOND_STATUS_BONDED"] = 3; + return values; + })(); + + v1beta1.ValAddresses = (function(ValAddresses) { + + /** + * Properties of a ValAddresses. + * @memberof cosmos.staking.v1beta1 + * @interface IValAddresses + * @property {Array.|null} [addresses] ValAddresses addresses + */ + + /** + * Constructs a new ValAddresses. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a ValAddresses. + * @implements IValAddresses + * @constructor + * @param {cosmos.staking.v1beta1.IValAddresses=} [properties] Properties to set + */ + function ValAddresses(properties) { + this.addresses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValAddresses addresses. + * @member {Array.} addresses + * @memberof cosmos.staking.v1beta1.ValAddresses + * @instance + */ + ValAddresses.prototype.addresses = $util.emptyArray; + + /** + * Creates a new ValAddresses instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.ValAddresses + * @static + * @param {cosmos.staking.v1beta1.IValAddresses=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.ValAddresses} ValAddresses instance + */ + ValAddresses.create = function create(properties) { + return new ValAddresses(properties); + }; + + /** + * Encodes the specified ValAddresses message. Does not implicitly {@link cosmos.staking.v1beta1.ValAddresses.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.ValAddresses + * @static + * @param {cosmos.staking.v1beta1.IValAddresses} message ValAddresses message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValAddresses.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.addresses != null && message.addresses.length) + for (var i = 0; i < message.addresses.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.addresses[i]); + return writer; + }; + + /** + * Encodes the specified ValAddresses message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.ValAddresses.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.ValAddresses + * @static + * @param {cosmos.staking.v1beta1.IValAddresses} message ValAddresses message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValAddresses.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValAddresses message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.ValAddresses + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.ValAddresses} ValAddresses + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValAddresses.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.ValAddresses(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.addresses && message.addresses.length)) + message.addresses = []; + message.addresses.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValAddresses message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.ValAddresses + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.ValAddresses} ValAddresses + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValAddresses.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValAddresses message. + * @function verify + * @memberof cosmos.staking.v1beta1.ValAddresses + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValAddresses.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.addresses != null && message.hasOwnProperty("addresses")) { + if (!Array.isArray(message.addresses)) + return "addresses: array expected"; + for (var i = 0; i < message.addresses.length; ++i) + if (!$util.isString(message.addresses[i])) + return "addresses: string[] expected"; + } + return null; + }; + + /** + * Creates a ValAddresses message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.ValAddresses + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.ValAddresses} ValAddresses + */ + ValAddresses.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.ValAddresses) + return object; + var message = new $root.cosmos.staking.v1beta1.ValAddresses(); + if (object.addresses) { + if (!Array.isArray(object.addresses)) + throw TypeError(".cosmos.staking.v1beta1.ValAddresses.addresses: array expected"); + message.addresses = []; + for (var i = 0; i < object.addresses.length; ++i) + message.addresses[i] = String(object.addresses[i]); + } + return message; + }; + + /** + * Creates a plain object from a ValAddresses message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.ValAddresses + * @static + * @param {cosmos.staking.v1beta1.ValAddresses} message ValAddresses + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValAddresses.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.addresses = []; + if (message.addresses && message.addresses.length) { + object.addresses = []; + for (var j = 0; j < message.addresses.length; ++j) + object.addresses[j] = message.addresses[j]; + } + return object; + }; + + /** + * Converts this ValAddresses to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.ValAddresses + * @instance + * @returns {Object.} JSON object + */ + ValAddresses.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValAddresses; + })(v1beta1.ValAddresses || {}); + + v1beta1.DVPair = (function(DVPair) { + + /** + * Properties of a DVPair. + * @memberof cosmos.staking.v1beta1 + * @interface IDVPair + * @property {string|null} [delegatorAddress] DVPair delegatorAddress + * @property {string|null} [validatorAddress] DVPair validatorAddress + */ + + /** + * Constructs a new DVPair. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a DVPair. + * @implements IDVPair + * @constructor + * @param {cosmos.staking.v1beta1.IDVPair=} [properties] Properties to set + */ + function DVPair(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DVPair delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.staking.v1beta1.DVPair + * @instance + */ + DVPair.prototype.delegatorAddress = ""; + + /** + * DVPair validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.staking.v1beta1.DVPair + * @instance + */ + DVPair.prototype.validatorAddress = ""; + + /** + * Creates a new DVPair instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.DVPair + * @static + * @param {cosmos.staking.v1beta1.IDVPair=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.DVPair} DVPair instance + */ + DVPair.create = function create(properties) { + return new DVPair(properties); + }; + + /** + * Encodes the specified DVPair message. Does not implicitly {@link cosmos.staking.v1beta1.DVPair.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.DVPair + * @static + * @param {cosmos.staking.v1beta1.IDVPair} message DVPair message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DVPair.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddress); + return writer; + }; + + /** + * Encodes the specified DVPair message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.DVPair.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.DVPair + * @static + * @param {cosmos.staking.v1beta1.IDVPair} message DVPair message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DVPair.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DVPair message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.DVPair + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.DVPair} DVPair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DVPair.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.DVPair(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DVPair message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.DVPair + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.DVPair} DVPair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DVPair.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DVPair message. + * @function verify + * @memberof cosmos.staking.v1beta1.DVPair + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DVPair.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + return null; + }; + + /** + * Creates a DVPair message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.DVPair + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.DVPair} DVPair + */ + DVPair.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.DVPair) + return object; + var message = new $root.cosmos.staking.v1beta1.DVPair(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + return message; + }; + + /** + * Creates a plain object from a DVPair message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.DVPair + * @static + * @param {cosmos.staking.v1beta1.DVPair} message DVPair + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DVPair.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.delegatorAddress = ""; + object.validatorAddress = ""; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + return object; + }; + + /** + * Converts this DVPair to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.DVPair + * @instance + * @returns {Object.} JSON object + */ + DVPair.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DVPair; + })(v1beta1.DVPair || {}); + + v1beta1.DVPairs = (function(DVPairs) { + + /** + * Properties of a DVPairs. + * @memberof cosmos.staking.v1beta1 + * @interface IDVPairs + * @property {Array.|null} [pairs] DVPairs pairs + */ + + /** + * Constructs a new DVPairs. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a DVPairs. + * @implements IDVPairs + * @constructor + * @param {cosmos.staking.v1beta1.IDVPairs=} [properties] Properties to set + */ + function DVPairs(properties) { + this.pairs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DVPairs pairs. + * @member {Array.} pairs + * @memberof cosmos.staking.v1beta1.DVPairs + * @instance + */ + DVPairs.prototype.pairs = $util.emptyArray; + + /** + * Creates a new DVPairs instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.DVPairs + * @static + * @param {cosmos.staking.v1beta1.IDVPairs=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.DVPairs} DVPairs instance + */ + DVPairs.create = function create(properties) { + return new DVPairs(properties); + }; + + /** + * Encodes the specified DVPairs message. Does not implicitly {@link cosmos.staking.v1beta1.DVPairs.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.DVPairs + * @static + * @param {cosmos.staking.v1beta1.IDVPairs} message DVPairs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DVPairs.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pairs != null && message.pairs.length) + for (var i = 0; i < message.pairs.length; ++i) + $root.cosmos.staking.v1beta1.DVPair.encode(message.pairs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DVPairs message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.DVPairs.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.DVPairs + * @static + * @param {cosmos.staking.v1beta1.IDVPairs} message DVPairs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DVPairs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DVPairs message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.DVPairs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.DVPairs} DVPairs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DVPairs.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.DVPairs(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.pairs && message.pairs.length)) + message.pairs = []; + message.pairs.push($root.cosmos.staking.v1beta1.DVPair.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DVPairs message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.DVPairs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.DVPairs} DVPairs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DVPairs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DVPairs message. + * @function verify + * @memberof cosmos.staking.v1beta1.DVPairs + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DVPairs.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pairs != null && message.hasOwnProperty("pairs")) { + if (!Array.isArray(message.pairs)) + return "pairs: array expected"; + for (var i = 0; i < message.pairs.length; ++i) { + var error = $root.cosmos.staking.v1beta1.DVPair.verify(message.pairs[i]); + if (error) + return "pairs." + error; + } + } + return null; + }; + + /** + * Creates a DVPairs message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.DVPairs + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.DVPairs} DVPairs + */ + DVPairs.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.DVPairs) + return object; + var message = new $root.cosmos.staking.v1beta1.DVPairs(); + if (object.pairs) { + if (!Array.isArray(object.pairs)) + throw TypeError(".cosmos.staking.v1beta1.DVPairs.pairs: array expected"); + message.pairs = []; + for (var i = 0; i < object.pairs.length; ++i) { + if (typeof object.pairs[i] !== "object") + throw TypeError(".cosmos.staking.v1beta1.DVPairs.pairs: object expected"); + message.pairs[i] = $root.cosmos.staking.v1beta1.DVPair.fromObject(object.pairs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DVPairs message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.DVPairs + * @static + * @param {cosmos.staking.v1beta1.DVPairs} message DVPairs + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DVPairs.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pairs = []; + if (message.pairs && message.pairs.length) { + object.pairs = []; + for (var j = 0; j < message.pairs.length; ++j) + object.pairs[j] = $root.cosmos.staking.v1beta1.DVPair.toObject(message.pairs[j], options); + } + return object; + }; + + /** + * Converts this DVPairs to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.DVPairs + * @instance + * @returns {Object.} JSON object + */ + DVPairs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DVPairs; + })(v1beta1.DVPairs || {}); + + v1beta1.DVVTriplet = (function(DVVTriplet) { + + /** + * Properties of a DVVTriplet. + * @memberof cosmos.staking.v1beta1 + * @interface IDVVTriplet + * @property {string|null} [delegatorAddress] DVVTriplet delegatorAddress + * @property {string|null} [validatorSrcAddress] DVVTriplet validatorSrcAddress + * @property {string|null} [validatorDstAddress] DVVTriplet validatorDstAddress + */ + + /** + * Constructs a new DVVTriplet. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a DVVTriplet. + * @implements IDVVTriplet + * @constructor + * @param {cosmos.staking.v1beta1.IDVVTriplet=} [properties] Properties to set + */ + function DVVTriplet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DVVTriplet delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @instance + */ + DVVTriplet.prototype.delegatorAddress = ""; + + /** + * DVVTriplet validatorSrcAddress. + * @member {string} validatorSrcAddress + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @instance + */ + DVVTriplet.prototype.validatorSrcAddress = ""; + + /** + * DVVTriplet validatorDstAddress. + * @member {string} validatorDstAddress + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @instance + */ + DVVTriplet.prototype.validatorDstAddress = ""; + + /** + * Creates a new DVVTriplet instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @static + * @param {cosmos.staking.v1beta1.IDVVTriplet=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.DVVTriplet} DVVTriplet instance + */ + DVVTriplet.create = function create(properties) { + return new DVVTriplet(properties); + }; + + /** + * Encodes the specified DVVTriplet message. Does not implicitly {@link cosmos.staking.v1beta1.DVVTriplet.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @static + * @param {cosmos.staking.v1beta1.IDVVTriplet} message DVVTriplet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DVVTriplet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.validatorSrcAddress != null && Object.hasOwnProperty.call(message, "validatorSrcAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorSrcAddress); + if (message.validatorDstAddress != null && Object.hasOwnProperty.call(message, "validatorDstAddress")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.validatorDstAddress); + return writer; + }; + + /** + * Encodes the specified DVVTriplet message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.DVVTriplet.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @static + * @param {cosmos.staking.v1beta1.IDVVTriplet} message DVVTriplet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DVVTriplet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DVVTriplet message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.DVVTriplet} DVVTriplet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DVVTriplet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.DVVTriplet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorSrcAddress = reader.string(); + break; + case 3: + message.validatorDstAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DVVTriplet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.DVVTriplet} DVVTriplet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DVVTriplet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DVVTriplet message. + * @function verify + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DVVTriplet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.validatorSrcAddress != null && message.hasOwnProperty("validatorSrcAddress")) + if (!$util.isString(message.validatorSrcAddress)) + return "validatorSrcAddress: string expected"; + if (message.validatorDstAddress != null && message.hasOwnProperty("validatorDstAddress")) + if (!$util.isString(message.validatorDstAddress)) + return "validatorDstAddress: string expected"; + return null; + }; + + /** + * Creates a DVVTriplet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.DVVTriplet} DVVTriplet + */ + DVVTriplet.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.DVVTriplet) + return object; + var message = new $root.cosmos.staking.v1beta1.DVVTriplet(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.validatorSrcAddress != null) + message.validatorSrcAddress = String(object.validatorSrcAddress); + if (object.validatorDstAddress != null) + message.validatorDstAddress = String(object.validatorDstAddress); + return message; + }; + + /** + * Creates a plain object from a DVVTriplet message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @static + * @param {cosmos.staking.v1beta1.DVVTriplet} message DVVTriplet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DVVTriplet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.delegatorAddress = ""; + object.validatorSrcAddress = ""; + object.validatorDstAddress = ""; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.validatorSrcAddress != null && message.hasOwnProperty("validatorSrcAddress")) + object.validatorSrcAddress = message.validatorSrcAddress; + if (message.validatorDstAddress != null && message.hasOwnProperty("validatorDstAddress")) + object.validatorDstAddress = message.validatorDstAddress; + return object; + }; + + /** + * Converts this DVVTriplet to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @instance + * @returns {Object.} JSON object + */ + DVVTriplet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DVVTriplet; + })(v1beta1.DVVTriplet || {}); + + v1beta1.DVVTriplets = (function(DVVTriplets) { + + /** + * Properties of a DVVTriplets. + * @memberof cosmos.staking.v1beta1 + * @interface IDVVTriplets + * @property {Array.|null} [triplets] DVVTriplets triplets + */ + + /** + * Constructs a new DVVTriplets. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a DVVTriplets. + * @implements IDVVTriplets + * @constructor + * @param {cosmos.staking.v1beta1.IDVVTriplets=} [properties] Properties to set + */ + function DVVTriplets(properties) { + this.triplets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DVVTriplets triplets. + * @member {Array.} triplets + * @memberof cosmos.staking.v1beta1.DVVTriplets + * @instance + */ + DVVTriplets.prototype.triplets = $util.emptyArray; + + /** + * Creates a new DVVTriplets instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.DVVTriplets + * @static + * @param {cosmos.staking.v1beta1.IDVVTriplets=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.DVVTriplets} DVVTriplets instance + */ + DVVTriplets.create = function create(properties) { + return new DVVTriplets(properties); + }; + + /** + * Encodes the specified DVVTriplets message. Does not implicitly {@link cosmos.staking.v1beta1.DVVTriplets.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.DVVTriplets + * @static + * @param {cosmos.staking.v1beta1.IDVVTriplets} message DVVTriplets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DVVTriplets.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.triplets != null && message.triplets.length) + for (var i = 0; i < message.triplets.length; ++i) + $root.cosmos.staking.v1beta1.DVVTriplet.encode(message.triplets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DVVTriplets message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.DVVTriplets.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.DVVTriplets + * @static + * @param {cosmos.staking.v1beta1.IDVVTriplets} message DVVTriplets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DVVTriplets.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DVVTriplets message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.DVVTriplets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.DVVTriplets} DVVTriplets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DVVTriplets.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.DVVTriplets(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.triplets && message.triplets.length)) + message.triplets = []; + message.triplets.push($root.cosmos.staking.v1beta1.DVVTriplet.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DVVTriplets message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.DVVTriplets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.DVVTriplets} DVVTriplets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DVVTriplets.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DVVTriplets message. + * @function verify + * @memberof cosmos.staking.v1beta1.DVVTriplets + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DVVTriplets.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.triplets != null && message.hasOwnProperty("triplets")) { + if (!Array.isArray(message.triplets)) + return "triplets: array expected"; + for (var i = 0; i < message.triplets.length; ++i) { + var error = $root.cosmos.staking.v1beta1.DVVTriplet.verify(message.triplets[i]); + if (error) + return "triplets." + error; + } + } + return null; + }; + + /** + * Creates a DVVTriplets message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.DVVTriplets + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.DVVTriplets} DVVTriplets + */ + DVVTriplets.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.DVVTriplets) + return object; + var message = new $root.cosmos.staking.v1beta1.DVVTriplets(); + if (object.triplets) { + if (!Array.isArray(object.triplets)) + throw TypeError(".cosmos.staking.v1beta1.DVVTriplets.triplets: array expected"); + message.triplets = []; + for (var i = 0; i < object.triplets.length; ++i) { + if (typeof object.triplets[i] !== "object") + throw TypeError(".cosmos.staking.v1beta1.DVVTriplets.triplets: object expected"); + message.triplets[i] = $root.cosmos.staking.v1beta1.DVVTriplet.fromObject(object.triplets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DVVTriplets message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.DVVTriplets + * @static + * @param {cosmos.staking.v1beta1.DVVTriplets} message DVVTriplets + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DVVTriplets.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.triplets = []; + if (message.triplets && message.triplets.length) { + object.triplets = []; + for (var j = 0; j < message.triplets.length; ++j) + object.triplets[j] = $root.cosmos.staking.v1beta1.DVVTriplet.toObject(message.triplets[j], options); + } + return object; + }; + + /** + * Converts this DVVTriplets to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.DVVTriplets + * @instance + * @returns {Object.} JSON object + */ + DVVTriplets.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DVVTriplets; + })(v1beta1.DVVTriplets || {}); + + v1beta1.Delegation = (function(Delegation) { + + /** + * Properties of a Delegation. + * @memberof cosmos.staking.v1beta1 + * @interface IDelegation + * @property {string|null} [delegatorAddress] Delegation delegatorAddress + * @property {string|null} [validatorAddress] Delegation validatorAddress + * @property {string|null} [shares] Delegation shares + */ + + /** + * Constructs a new Delegation. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a Delegation. + * @implements IDelegation + * @constructor + * @param {cosmos.staking.v1beta1.IDelegation=} [properties] Properties to set + */ + function Delegation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Delegation delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.staking.v1beta1.Delegation + * @instance + */ + Delegation.prototype.delegatorAddress = ""; + + /** + * Delegation validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.staking.v1beta1.Delegation + * @instance + */ + Delegation.prototype.validatorAddress = ""; + + /** + * Delegation shares. + * @member {string} shares + * @memberof cosmos.staking.v1beta1.Delegation + * @instance + */ + Delegation.prototype.shares = ""; + + /** + * Creates a new Delegation instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.Delegation + * @static + * @param {cosmos.staking.v1beta1.IDelegation=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.Delegation} Delegation instance + */ + Delegation.create = function create(properties) { + return new Delegation(properties); + }; + + /** + * Encodes the specified Delegation message. Does not implicitly {@link cosmos.staking.v1beta1.Delegation.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.Delegation + * @static + * @param {cosmos.staking.v1beta1.IDelegation} message Delegation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Delegation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddress); + if (message.shares != null && Object.hasOwnProperty.call(message, "shares")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.shares); + return writer; + }; + + /** + * Encodes the specified Delegation message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.Delegation.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.Delegation + * @static + * @param {cosmos.staking.v1beta1.IDelegation} message Delegation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Delegation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Delegation message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.Delegation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.Delegation} Delegation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Delegation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.Delegation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.shares = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Delegation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.Delegation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.Delegation} Delegation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Delegation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Delegation message. + * @function verify + * @memberof cosmos.staking.v1beta1.Delegation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Delegation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + if (message.shares != null && message.hasOwnProperty("shares")) + if (!$util.isString(message.shares)) + return "shares: string expected"; + return null; + }; + + /** + * Creates a Delegation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.Delegation + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.Delegation} Delegation + */ + Delegation.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.Delegation) + return object; + var message = new $root.cosmos.staking.v1beta1.Delegation(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + if (object.shares != null) + message.shares = String(object.shares); + return message; + }; + + /** + * Creates a plain object from a Delegation message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.Delegation + * @static + * @param {cosmos.staking.v1beta1.Delegation} message Delegation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Delegation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.delegatorAddress = ""; + object.validatorAddress = ""; + object.shares = ""; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + if (message.shares != null && message.hasOwnProperty("shares")) + object.shares = message.shares; + return object; + }; + + /** + * Converts this Delegation to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.Delegation + * @instance + * @returns {Object.} JSON object + */ + Delegation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Delegation; + })(v1beta1.Delegation || {}); + + v1beta1.UnbondingDelegation = (function(UnbondingDelegation) { + + /** + * Properties of an UnbondingDelegation. + * @memberof cosmos.staking.v1beta1 + * @interface IUnbondingDelegation + * @property {string|null} [delegatorAddress] UnbondingDelegation delegatorAddress + * @property {string|null} [validatorAddress] UnbondingDelegation validatorAddress + * @property {Array.|null} [entries] UnbondingDelegation entries + */ + + /** + * Constructs a new UnbondingDelegation. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents an UnbondingDelegation. + * @implements IUnbondingDelegation + * @constructor + * @param {cosmos.staking.v1beta1.IUnbondingDelegation=} [properties] Properties to set + */ + function UnbondingDelegation(properties) { + this.entries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UnbondingDelegation delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @instance + */ + UnbondingDelegation.prototype.delegatorAddress = ""; + + /** + * UnbondingDelegation validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @instance + */ + UnbondingDelegation.prototype.validatorAddress = ""; + + /** + * UnbondingDelegation entries. + * @member {Array.} entries + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @instance + */ + UnbondingDelegation.prototype.entries = $util.emptyArray; + + /** + * Creates a new UnbondingDelegation instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @static + * @param {cosmos.staking.v1beta1.IUnbondingDelegation=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.UnbondingDelegation} UnbondingDelegation instance + */ + UnbondingDelegation.create = function create(properties) { + return new UnbondingDelegation(properties); + }; + + /** + * Encodes the specified UnbondingDelegation message. Does not implicitly {@link cosmos.staking.v1beta1.UnbondingDelegation.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @static + * @param {cosmos.staking.v1beta1.IUnbondingDelegation} message UnbondingDelegation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnbondingDelegation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddress); + if (message.entries != null && message.entries.length) + for (var i = 0; i < message.entries.length; ++i) + $root.cosmos.staking.v1beta1.UnbondingDelegationEntry.encode(message.entries[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UnbondingDelegation message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.UnbondingDelegation.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @static + * @param {cosmos.staking.v1beta1.IUnbondingDelegation} message UnbondingDelegation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnbondingDelegation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UnbondingDelegation message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.UnbondingDelegation} UnbondingDelegation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnbondingDelegation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.UnbondingDelegation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.cosmos.staking.v1beta1.UnbondingDelegationEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UnbondingDelegation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.UnbondingDelegation} UnbondingDelegation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnbondingDelegation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UnbondingDelegation message. + * @function verify + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UnbondingDelegation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (var i = 0; i < message.entries.length; ++i) { + var error = $root.cosmos.staking.v1beta1.UnbondingDelegationEntry.verify(message.entries[i]); + if (error) + return "entries." + error; + } + } + return null; + }; + + /** + * Creates an UnbondingDelegation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.UnbondingDelegation} UnbondingDelegation + */ + UnbondingDelegation.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.UnbondingDelegation) + return object; + var message = new $root.cosmos.staking.v1beta1.UnbondingDelegation(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".cosmos.staking.v1beta1.UnbondingDelegation.entries: array expected"); + message.entries = []; + for (var i = 0; i < object.entries.length; ++i) { + if (typeof object.entries[i] !== "object") + throw TypeError(".cosmos.staking.v1beta1.UnbondingDelegation.entries: object expected"); + message.entries[i] = $root.cosmos.staking.v1beta1.UnbondingDelegationEntry.fromObject(object.entries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an UnbondingDelegation message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @static + * @param {cosmos.staking.v1beta1.UnbondingDelegation} message UnbondingDelegation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UnbondingDelegation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (options.defaults) { + object.delegatorAddress = ""; + object.validatorAddress = ""; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + if (message.entries && message.entries.length) { + object.entries = []; + for (var j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.cosmos.staking.v1beta1.UnbondingDelegationEntry.toObject(message.entries[j], options); + } + return object; + }; + + /** + * Converts this UnbondingDelegation to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @instance + * @returns {Object.} JSON object + */ + UnbondingDelegation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UnbondingDelegation; + })(v1beta1.UnbondingDelegation || {}); + + v1beta1.UnbondingDelegationEntry = (function(UnbondingDelegationEntry) { + + /** + * Properties of an UnbondingDelegationEntry. + * @memberof cosmos.staking.v1beta1 + * @interface IUnbondingDelegationEntry + * @property {number|Long|null} [creationHeight] UnbondingDelegationEntry creationHeight + * @property {google.protobuf.ITimestamp|null} [completionTime] UnbondingDelegationEntry completionTime + * @property {string|null} [initialBalance] UnbondingDelegationEntry initialBalance + * @property {string|null} [balance] UnbondingDelegationEntry balance + */ + + /** + * Constructs a new UnbondingDelegationEntry. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents an UnbondingDelegationEntry. + * @implements IUnbondingDelegationEntry + * @constructor + * @param {cosmos.staking.v1beta1.IUnbondingDelegationEntry=} [properties] Properties to set + */ + function UnbondingDelegationEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UnbondingDelegationEntry creationHeight. + * @member {number|Long} creationHeight + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @instance + */ + UnbondingDelegationEntry.prototype.creationHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UnbondingDelegationEntry completionTime. + * @member {google.protobuf.ITimestamp|null|undefined} completionTime + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @instance + */ + UnbondingDelegationEntry.prototype.completionTime = null; + + /** + * UnbondingDelegationEntry initialBalance. + * @member {string} initialBalance + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @instance + */ + UnbondingDelegationEntry.prototype.initialBalance = ""; + + /** + * UnbondingDelegationEntry balance. + * @member {string} balance + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @instance + */ + UnbondingDelegationEntry.prototype.balance = ""; + + /** + * Creates a new UnbondingDelegationEntry instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @static + * @param {cosmos.staking.v1beta1.IUnbondingDelegationEntry=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.UnbondingDelegationEntry} UnbondingDelegationEntry instance + */ + UnbondingDelegationEntry.create = function create(properties) { + return new UnbondingDelegationEntry(properties); + }; + + /** + * Encodes the specified UnbondingDelegationEntry message. Does not implicitly {@link cosmos.staking.v1beta1.UnbondingDelegationEntry.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @static + * @param {cosmos.staking.v1beta1.IUnbondingDelegationEntry} message UnbondingDelegationEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnbondingDelegationEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.creationHeight != null && Object.hasOwnProperty.call(message, "creationHeight")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.creationHeight); + if (message.completionTime != null && Object.hasOwnProperty.call(message, "completionTime")) + $root.google.protobuf.Timestamp.encode(message.completionTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.initialBalance != null && Object.hasOwnProperty.call(message, "initialBalance")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.initialBalance); + if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.balance); + return writer; + }; + + /** + * Encodes the specified UnbondingDelegationEntry message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.UnbondingDelegationEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @static + * @param {cosmos.staking.v1beta1.IUnbondingDelegationEntry} message UnbondingDelegationEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnbondingDelegationEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UnbondingDelegationEntry message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.UnbondingDelegationEntry} UnbondingDelegationEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnbondingDelegationEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.UnbondingDelegationEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creationHeight = reader.int64(); + break; + case 2: + message.completionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.initialBalance = reader.string(); + break; + case 4: + message.balance = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UnbondingDelegationEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.UnbondingDelegationEntry} UnbondingDelegationEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnbondingDelegationEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UnbondingDelegationEntry message. + * @function verify + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UnbondingDelegationEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.creationHeight != null && message.hasOwnProperty("creationHeight")) + if (!$util.isInteger(message.creationHeight) && !(message.creationHeight && $util.isInteger(message.creationHeight.low) && $util.isInteger(message.creationHeight.high))) + return "creationHeight: integer|Long expected"; + if (message.completionTime != null && message.hasOwnProperty("completionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.completionTime); + if (error) + return "completionTime." + error; + } + if (message.initialBalance != null && message.hasOwnProperty("initialBalance")) + if (!$util.isString(message.initialBalance)) + return "initialBalance: string expected"; + if (message.balance != null && message.hasOwnProperty("balance")) + if (!$util.isString(message.balance)) + return "balance: string expected"; + return null; + }; + + /** + * Creates an UnbondingDelegationEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.UnbondingDelegationEntry} UnbondingDelegationEntry + */ + UnbondingDelegationEntry.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.UnbondingDelegationEntry) + return object; + var message = new $root.cosmos.staking.v1beta1.UnbondingDelegationEntry(); + if (object.creationHeight != null) + if ($util.Long) + (message.creationHeight = $util.Long.fromValue(object.creationHeight)).unsigned = false; + else if (typeof object.creationHeight === "string") + message.creationHeight = parseInt(object.creationHeight, 10); + else if (typeof object.creationHeight === "number") + message.creationHeight = object.creationHeight; + else if (typeof object.creationHeight === "object") + message.creationHeight = new $util.LongBits(object.creationHeight.low >>> 0, object.creationHeight.high >>> 0).toNumber(); + if (object.completionTime != null) { + if (typeof object.completionTime !== "object") + throw TypeError(".cosmos.staking.v1beta1.UnbondingDelegationEntry.completionTime: object expected"); + message.completionTime = $root.google.protobuf.Timestamp.fromObject(object.completionTime); + } + if (object.initialBalance != null) + message.initialBalance = String(object.initialBalance); + if (object.balance != null) + message.balance = String(object.balance); + return message; + }; + + /** + * Creates a plain object from an UnbondingDelegationEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @static + * @param {cosmos.staking.v1beta1.UnbondingDelegationEntry} message UnbondingDelegationEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UnbondingDelegationEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.creationHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.creationHeight = options.longs === String ? "0" : 0; + object.completionTime = null; + object.initialBalance = ""; + object.balance = ""; + } + if (message.creationHeight != null && message.hasOwnProperty("creationHeight")) + if (typeof message.creationHeight === "number") + object.creationHeight = options.longs === String ? String(message.creationHeight) : message.creationHeight; + else + object.creationHeight = options.longs === String ? $util.Long.prototype.toString.call(message.creationHeight) : options.longs === Number ? new $util.LongBits(message.creationHeight.low >>> 0, message.creationHeight.high >>> 0).toNumber() : message.creationHeight; + if (message.completionTime != null && message.hasOwnProperty("completionTime")) + object.completionTime = $root.google.protobuf.Timestamp.toObject(message.completionTime, options); + if (message.initialBalance != null && message.hasOwnProperty("initialBalance")) + object.initialBalance = message.initialBalance; + if (message.balance != null && message.hasOwnProperty("balance")) + object.balance = message.balance; + return object; + }; + + /** + * Converts this UnbondingDelegationEntry to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @instance + * @returns {Object.} JSON object + */ + UnbondingDelegationEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UnbondingDelegationEntry; + })(v1beta1.UnbondingDelegationEntry || {}); + + v1beta1.RedelegationEntry = (function(RedelegationEntry) { + + /** + * Properties of a RedelegationEntry. + * @memberof cosmos.staking.v1beta1 + * @interface IRedelegationEntry + * @property {number|Long|null} [creationHeight] RedelegationEntry creationHeight + * @property {google.protobuf.ITimestamp|null} [completionTime] RedelegationEntry completionTime + * @property {string|null} [initialBalance] RedelegationEntry initialBalance + * @property {string|null} [sharesDst] RedelegationEntry sharesDst + */ + + /** + * Constructs a new RedelegationEntry. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a RedelegationEntry. + * @implements IRedelegationEntry + * @constructor + * @param {cosmos.staking.v1beta1.IRedelegationEntry=} [properties] Properties to set + */ + function RedelegationEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RedelegationEntry creationHeight. + * @member {number|Long} creationHeight + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @instance + */ + RedelegationEntry.prototype.creationHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * RedelegationEntry completionTime. + * @member {google.protobuf.ITimestamp|null|undefined} completionTime + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @instance + */ + RedelegationEntry.prototype.completionTime = null; + + /** + * RedelegationEntry initialBalance. + * @member {string} initialBalance + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @instance + */ + RedelegationEntry.prototype.initialBalance = ""; + + /** + * RedelegationEntry sharesDst. + * @member {string} sharesDst + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @instance + */ + RedelegationEntry.prototype.sharesDst = ""; + + /** + * Creates a new RedelegationEntry instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @static + * @param {cosmos.staking.v1beta1.IRedelegationEntry=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.RedelegationEntry} RedelegationEntry instance + */ + RedelegationEntry.create = function create(properties) { + return new RedelegationEntry(properties); + }; + + /** + * Encodes the specified RedelegationEntry message. Does not implicitly {@link cosmos.staking.v1beta1.RedelegationEntry.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @static + * @param {cosmos.staking.v1beta1.IRedelegationEntry} message RedelegationEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedelegationEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.creationHeight != null && Object.hasOwnProperty.call(message, "creationHeight")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.creationHeight); + if (message.completionTime != null && Object.hasOwnProperty.call(message, "completionTime")) + $root.google.protobuf.Timestamp.encode(message.completionTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.initialBalance != null && Object.hasOwnProperty.call(message, "initialBalance")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.initialBalance); + if (message.sharesDst != null && Object.hasOwnProperty.call(message, "sharesDst")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.sharesDst); + return writer; + }; + + /** + * Encodes the specified RedelegationEntry message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.RedelegationEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @static + * @param {cosmos.staking.v1beta1.IRedelegationEntry} message RedelegationEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedelegationEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RedelegationEntry message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.RedelegationEntry} RedelegationEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedelegationEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.RedelegationEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creationHeight = reader.int64(); + break; + case 2: + message.completionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.initialBalance = reader.string(); + break; + case 4: + message.sharesDst = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RedelegationEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.RedelegationEntry} RedelegationEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedelegationEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RedelegationEntry message. + * @function verify + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RedelegationEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.creationHeight != null && message.hasOwnProperty("creationHeight")) + if (!$util.isInteger(message.creationHeight) && !(message.creationHeight && $util.isInteger(message.creationHeight.low) && $util.isInteger(message.creationHeight.high))) + return "creationHeight: integer|Long expected"; + if (message.completionTime != null && message.hasOwnProperty("completionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.completionTime); + if (error) + return "completionTime." + error; + } + if (message.initialBalance != null && message.hasOwnProperty("initialBalance")) + if (!$util.isString(message.initialBalance)) + return "initialBalance: string expected"; + if (message.sharesDst != null && message.hasOwnProperty("sharesDst")) + if (!$util.isString(message.sharesDst)) + return "sharesDst: string expected"; + return null; + }; + + /** + * Creates a RedelegationEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.RedelegationEntry} RedelegationEntry + */ + RedelegationEntry.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.RedelegationEntry) + return object; + var message = new $root.cosmos.staking.v1beta1.RedelegationEntry(); + if (object.creationHeight != null) + if ($util.Long) + (message.creationHeight = $util.Long.fromValue(object.creationHeight)).unsigned = false; + else if (typeof object.creationHeight === "string") + message.creationHeight = parseInt(object.creationHeight, 10); + else if (typeof object.creationHeight === "number") + message.creationHeight = object.creationHeight; + else if (typeof object.creationHeight === "object") + message.creationHeight = new $util.LongBits(object.creationHeight.low >>> 0, object.creationHeight.high >>> 0).toNumber(); + if (object.completionTime != null) { + if (typeof object.completionTime !== "object") + throw TypeError(".cosmos.staking.v1beta1.RedelegationEntry.completionTime: object expected"); + message.completionTime = $root.google.protobuf.Timestamp.fromObject(object.completionTime); + } + if (object.initialBalance != null) + message.initialBalance = String(object.initialBalance); + if (object.sharesDst != null) + message.sharesDst = String(object.sharesDst); + return message; + }; + + /** + * Creates a plain object from a RedelegationEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @static + * @param {cosmos.staking.v1beta1.RedelegationEntry} message RedelegationEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RedelegationEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.creationHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.creationHeight = options.longs === String ? "0" : 0; + object.completionTime = null; + object.initialBalance = ""; + object.sharesDst = ""; + } + if (message.creationHeight != null && message.hasOwnProperty("creationHeight")) + if (typeof message.creationHeight === "number") + object.creationHeight = options.longs === String ? String(message.creationHeight) : message.creationHeight; + else + object.creationHeight = options.longs === String ? $util.Long.prototype.toString.call(message.creationHeight) : options.longs === Number ? new $util.LongBits(message.creationHeight.low >>> 0, message.creationHeight.high >>> 0).toNumber() : message.creationHeight; + if (message.completionTime != null && message.hasOwnProperty("completionTime")) + object.completionTime = $root.google.protobuf.Timestamp.toObject(message.completionTime, options); + if (message.initialBalance != null && message.hasOwnProperty("initialBalance")) + object.initialBalance = message.initialBalance; + if (message.sharesDst != null && message.hasOwnProperty("sharesDst")) + object.sharesDst = message.sharesDst; + return object; + }; + + /** + * Converts this RedelegationEntry to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @instance + * @returns {Object.} JSON object + */ + RedelegationEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RedelegationEntry; + })(v1beta1.RedelegationEntry || {}); + + v1beta1.Redelegation = (function(Redelegation) { + + /** + * Properties of a Redelegation. + * @memberof cosmos.staking.v1beta1 + * @interface IRedelegation + * @property {string|null} [delegatorAddress] Redelegation delegatorAddress + * @property {string|null} [validatorSrcAddress] Redelegation validatorSrcAddress + * @property {string|null} [validatorDstAddress] Redelegation validatorDstAddress + * @property {Array.|null} [entries] Redelegation entries + */ + + /** + * Constructs a new Redelegation. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a Redelegation. + * @implements IRedelegation + * @constructor + * @param {cosmos.staking.v1beta1.IRedelegation=} [properties] Properties to set + */ + function Redelegation(properties) { + this.entries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Redelegation delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.staking.v1beta1.Redelegation + * @instance + */ + Redelegation.prototype.delegatorAddress = ""; + + /** + * Redelegation validatorSrcAddress. + * @member {string} validatorSrcAddress + * @memberof cosmos.staking.v1beta1.Redelegation + * @instance + */ + Redelegation.prototype.validatorSrcAddress = ""; + + /** + * Redelegation validatorDstAddress. + * @member {string} validatorDstAddress + * @memberof cosmos.staking.v1beta1.Redelegation + * @instance + */ + Redelegation.prototype.validatorDstAddress = ""; + + /** + * Redelegation entries. + * @member {Array.} entries + * @memberof cosmos.staking.v1beta1.Redelegation + * @instance + */ + Redelegation.prototype.entries = $util.emptyArray; + + /** + * Creates a new Redelegation instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.Redelegation + * @static + * @param {cosmos.staking.v1beta1.IRedelegation=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.Redelegation} Redelegation instance + */ + Redelegation.create = function create(properties) { + return new Redelegation(properties); + }; + + /** + * Encodes the specified Redelegation message. Does not implicitly {@link cosmos.staking.v1beta1.Redelegation.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.Redelegation + * @static + * @param {cosmos.staking.v1beta1.IRedelegation} message Redelegation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Redelegation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.validatorSrcAddress != null && Object.hasOwnProperty.call(message, "validatorSrcAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorSrcAddress); + if (message.validatorDstAddress != null && Object.hasOwnProperty.call(message, "validatorDstAddress")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.validatorDstAddress); + if (message.entries != null && message.entries.length) + for (var i = 0; i < message.entries.length; ++i) + $root.cosmos.staking.v1beta1.RedelegationEntry.encode(message.entries[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Redelegation message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.Redelegation.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.Redelegation + * @static + * @param {cosmos.staking.v1beta1.IRedelegation} message Redelegation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Redelegation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Redelegation message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.Redelegation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.Redelegation} Redelegation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Redelegation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.Redelegation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorSrcAddress = reader.string(); + break; + case 3: + message.validatorDstAddress = reader.string(); + break; + case 4: + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.cosmos.staking.v1beta1.RedelegationEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Redelegation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.Redelegation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.Redelegation} Redelegation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Redelegation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Redelegation message. + * @function verify + * @memberof cosmos.staking.v1beta1.Redelegation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Redelegation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.validatorSrcAddress != null && message.hasOwnProperty("validatorSrcAddress")) + if (!$util.isString(message.validatorSrcAddress)) + return "validatorSrcAddress: string expected"; + if (message.validatorDstAddress != null && message.hasOwnProperty("validatorDstAddress")) + if (!$util.isString(message.validatorDstAddress)) + return "validatorDstAddress: string expected"; + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (var i = 0; i < message.entries.length; ++i) { + var error = $root.cosmos.staking.v1beta1.RedelegationEntry.verify(message.entries[i]); + if (error) + return "entries." + error; + } + } + return null; + }; + + /** + * Creates a Redelegation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.Redelegation + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.Redelegation} Redelegation + */ + Redelegation.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.Redelegation) + return object; + var message = new $root.cosmos.staking.v1beta1.Redelegation(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.validatorSrcAddress != null) + message.validatorSrcAddress = String(object.validatorSrcAddress); + if (object.validatorDstAddress != null) + message.validatorDstAddress = String(object.validatorDstAddress); + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".cosmos.staking.v1beta1.Redelegation.entries: array expected"); + message.entries = []; + for (var i = 0; i < object.entries.length; ++i) { + if (typeof object.entries[i] !== "object") + throw TypeError(".cosmos.staking.v1beta1.Redelegation.entries: object expected"); + message.entries[i] = $root.cosmos.staking.v1beta1.RedelegationEntry.fromObject(object.entries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Redelegation message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.Redelegation + * @static + * @param {cosmos.staking.v1beta1.Redelegation} message Redelegation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Redelegation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (options.defaults) { + object.delegatorAddress = ""; + object.validatorSrcAddress = ""; + object.validatorDstAddress = ""; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.validatorSrcAddress != null && message.hasOwnProperty("validatorSrcAddress")) + object.validatorSrcAddress = message.validatorSrcAddress; + if (message.validatorDstAddress != null && message.hasOwnProperty("validatorDstAddress")) + object.validatorDstAddress = message.validatorDstAddress; + if (message.entries && message.entries.length) { + object.entries = []; + for (var j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.cosmos.staking.v1beta1.RedelegationEntry.toObject(message.entries[j], options); + } + return object; + }; + + /** + * Converts this Redelegation to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.Redelegation + * @instance + * @returns {Object.} JSON object + */ + Redelegation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Redelegation; + })(v1beta1.Redelegation || {}); + + v1beta1.Params = (function(Params) { + + /** + * Properties of a Params. + * @memberof cosmos.staking.v1beta1 + * @interface IParams + * @property {google.protobuf.IDuration|null} [unbondingTime] Params unbondingTime + * @property {number|null} [maxValidators] Params maxValidators + * @property {number|null} [maxEntries] Params maxEntries + * @property {number|null} [historicalEntries] Params historicalEntries + * @property {string|null} [bondDenom] Params bondDenom + */ + + /** + * Constructs a new Params. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a Params. + * @implements IParams + * @constructor + * @param {cosmos.staking.v1beta1.IParams=} [properties] Properties to set + */ + function Params(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Params unbondingTime. + * @member {google.protobuf.IDuration|null|undefined} unbondingTime + * @memberof cosmos.staking.v1beta1.Params + * @instance + */ + Params.prototype.unbondingTime = null; + + /** + * Params maxValidators. + * @member {number} maxValidators + * @memberof cosmos.staking.v1beta1.Params + * @instance + */ + Params.prototype.maxValidators = 0; + + /** + * Params maxEntries. + * @member {number} maxEntries + * @memberof cosmos.staking.v1beta1.Params + * @instance + */ + Params.prototype.maxEntries = 0; + + /** + * Params historicalEntries. + * @member {number} historicalEntries + * @memberof cosmos.staking.v1beta1.Params + * @instance + */ + Params.prototype.historicalEntries = 0; + + /** + * Params bondDenom. + * @member {string} bondDenom + * @memberof cosmos.staking.v1beta1.Params + * @instance + */ + Params.prototype.bondDenom = ""; + + /** + * Creates a new Params instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.Params + * @static + * @param {cosmos.staking.v1beta1.IParams=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.Params} Params instance + */ + Params.create = function create(properties) { + return new Params(properties); + }; + + /** + * Encodes the specified Params message. Does not implicitly {@link cosmos.staking.v1beta1.Params.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.Params + * @static + * @param {cosmos.staking.v1beta1.IParams} message Params message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Params.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.unbondingTime != null && Object.hasOwnProperty.call(message, "unbondingTime")) + $root.google.protobuf.Duration.encode(message.unbondingTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.maxValidators != null && Object.hasOwnProperty.call(message, "maxValidators")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.maxValidators); + if (message.maxEntries != null && Object.hasOwnProperty.call(message, "maxEntries")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.maxEntries); + if (message.historicalEntries != null && Object.hasOwnProperty.call(message, "historicalEntries")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.historicalEntries); + if (message.bondDenom != null && Object.hasOwnProperty.call(message, "bondDenom")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.bondDenom); + return writer; + }; + + /** + * Encodes the specified Params message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.Params.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.Params + * @static + * @param {cosmos.staking.v1beta1.IParams} message Params message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Params.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Params message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.Params + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.Params} Params + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Params.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.Params(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.unbondingTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 2: + message.maxValidators = reader.uint32(); + break; + case 3: + message.maxEntries = reader.uint32(); + break; + case 4: + message.historicalEntries = reader.uint32(); + break; + case 5: + message.bondDenom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Params message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.Params + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.Params} Params + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Params.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Params message. + * @function verify + * @memberof cosmos.staking.v1beta1.Params + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Params.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.unbondingTime != null && message.hasOwnProperty("unbondingTime")) { + var error = $root.google.protobuf.Duration.verify(message.unbondingTime); + if (error) + return "unbondingTime." + error; + } + if (message.maxValidators != null && message.hasOwnProperty("maxValidators")) + if (!$util.isInteger(message.maxValidators)) + return "maxValidators: integer expected"; + if (message.maxEntries != null && message.hasOwnProperty("maxEntries")) + if (!$util.isInteger(message.maxEntries)) + return "maxEntries: integer expected"; + if (message.historicalEntries != null && message.hasOwnProperty("historicalEntries")) + if (!$util.isInteger(message.historicalEntries)) + return "historicalEntries: integer expected"; + if (message.bondDenom != null && message.hasOwnProperty("bondDenom")) + if (!$util.isString(message.bondDenom)) + return "bondDenom: string expected"; + return null; + }; + + /** + * Creates a Params message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.Params + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.Params} Params + */ + Params.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.Params) + return object; + var message = new $root.cosmos.staking.v1beta1.Params(); + if (object.unbondingTime != null) { + if (typeof object.unbondingTime !== "object") + throw TypeError(".cosmos.staking.v1beta1.Params.unbondingTime: object expected"); + message.unbondingTime = $root.google.protobuf.Duration.fromObject(object.unbondingTime); + } + if (object.maxValidators != null) + message.maxValidators = object.maxValidators >>> 0; + if (object.maxEntries != null) + message.maxEntries = object.maxEntries >>> 0; + if (object.historicalEntries != null) + message.historicalEntries = object.historicalEntries >>> 0; + if (object.bondDenom != null) + message.bondDenom = String(object.bondDenom); + return message; + }; + + /** + * Creates a plain object from a Params message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.Params + * @static + * @param {cosmos.staking.v1beta1.Params} message Params + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Params.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.unbondingTime = null; + object.maxValidators = 0; + object.maxEntries = 0; + object.historicalEntries = 0; + object.bondDenom = ""; + } + if (message.unbondingTime != null && message.hasOwnProperty("unbondingTime")) + object.unbondingTime = $root.google.protobuf.Duration.toObject(message.unbondingTime, options); + if (message.maxValidators != null && message.hasOwnProperty("maxValidators")) + object.maxValidators = message.maxValidators; + if (message.maxEntries != null && message.hasOwnProperty("maxEntries")) + object.maxEntries = message.maxEntries; + if (message.historicalEntries != null && message.hasOwnProperty("historicalEntries")) + object.historicalEntries = message.historicalEntries; + if (message.bondDenom != null && message.hasOwnProperty("bondDenom")) + object.bondDenom = message.bondDenom; + return object; + }; + + /** + * Converts this Params to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.Params + * @instance + * @returns {Object.} JSON object + */ + Params.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Params; + })(v1beta1.Params || {}); + + v1beta1.DelegationResponse = (function(DelegationResponse) { + + /** + * Properties of a DelegationResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IDelegationResponse + * @property {cosmos.staking.v1beta1.IDelegation|null} [delegation] DelegationResponse delegation + * @property {cosmos.base.v1beta1.ICoin|null} [balance] DelegationResponse balance + */ + + /** + * Constructs a new DelegationResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a DelegationResponse. + * @implements IDelegationResponse + * @constructor + * @param {cosmos.staking.v1beta1.IDelegationResponse=} [properties] Properties to set + */ + function DelegationResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DelegationResponse delegation. + * @member {cosmos.staking.v1beta1.IDelegation|null|undefined} delegation + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @instance + */ + DelegationResponse.prototype.delegation = null; + + /** + * DelegationResponse balance. + * @member {cosmos.base.v1beta1.ICoin|null|undefined} balance + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @instance + */ + DelegationResponse.prototype.balance = null; + + /** + * Creates a new DelegationResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @static + * @param {cosmos.staking.v1beta1.IDelegationResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.DelegationResponse} DelegationResponse instance + */ + DelegationResponse.create = function create(properties) { + return new DelegationResponse(properties); + }; + + /** + * Encodes the specified DelegationResponse message. Does not implicitly {@link cosmos.staking.v1beta1.DelegationResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @static + * @param {cosmos.staking.v1beta1.IDelegationResponse} message DelegationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DelegationResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegation != null && Object.hasOwnProperty.call(message, "delegation")) + $root.cosmos.staking.v1beta1.Delegation.encode(message.delegation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) + $root.cosmos.base.v1beta1.Coin.encode(message.balance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DelegationResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.DelegationResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @static + * @param {cosmos.staking.v1beta1.IDelegationResponse} message DelegationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DelegationResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DelegationResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.DelegationResponse} DelegationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DelegationResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.DelegationResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegation = $root.cosmos.staking.v1beta1.Delegation.decode(reader, reader.uint32()); + break; + case 2: + message.balance = $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DelegationResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.DelegationResponse} DelegationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DelegationResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DelegationResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DelegationResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegation != null && message.hasOwnProperty("delegation")) { + var error = $root.cosmos.staking.v1beta1.Delegation.verify(message.delegation); + if (error) + return "delegation." + error; + } + if (message.balance != null && message.hasOwnProperty("balance")) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.balance); + if (error) + return "balance." + error; + } + return null; + }; + + /** + * Creates a DelegationResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.DelegationResponse} DelegationResponse + */ + DelegationResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.DelegationResponse) + return object; + var message = new $root.cosmos.staking.v1beta1.DelegationResponse(); + if (object.delegation != null) { + if (typeof object.delegation !== "object") + throw TypeError(".cosmos.staking.v1beta1.DelegationResponse.delegation: object expected"); + message.delegation = $root.cosmos.staking.v1beta1.Delegation.fromObject(object.delegation); + } + if (object.balance != null) { + if (typeof object.balance !== "object") + throw TypeError(".cosmos.staking.v1beta1.DelegationResponse.balance: object expected"); + message.balance = $root.cosmos.base.v1beta1.Coin.fromObject(object.balance); + } + return message; + }; + + /** + * Creates a plain object from a DelegationResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @static + * @param {cosmos.staking.v1beta1.DelegationResponse} message DelegationResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DelegationResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.delegation = null; + object.balance = null; + } + if (message.delegation != null && message.hasOwnProperty("delegation")) + object.delegation = $root.cosmos.staking.v1beta1.Delegation.toObject(message.delegation, options); + if (message.balance != null && message.hasOwnProperty("balance")) + object.balance = $root.cosmos.base.v1beta1.Coin.toObject(message.balance, options); + return object; + }; + + /** + * Converts this DelegationResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @instance + * @returns {Object.} JSON object + */ + DelegationResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DelegationResponse; + })(v1beta1.DelegationResponse || {}); + + v1beta1.RedelegationEntryResponse = (function(RedelegationEntryResponse) { + + /** + * Properties of a RedelegationEntryResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IRedelegationEntryResponse + * @property {cosmos.staking.v1beta1.IRedelegationEntry|null} [redelegationEntry] RedelegationEntryResponse redelegationEntry + * @property {string|null} [balance] RedelegationEntryResponse balance + */ + + /** + * Constructs a new RedelegationEntryResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a RedelegationEntryResponse. + * @implements IRedelegationEntryResponse + * @constructor + * @param {cosmos.staking.v1beta1.IRedelegationEntryResponse=} [properties] Properties to set + */ + function RedelegationEntryResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RedelegationEntryResponse redelegationEntry. + * @member {cosmos.staking.v1beta1.IRedelegationEntry|null|undefined} redelegationEntry + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @instance + */ + RedelegationEntryResponse.prototype.redelegationEntry = null; + + /** + * RedelegationEntryResponse balance. + * @member {string} balance + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @instance + */ + RedelegationEntryResponse.prototype.balance = ""; + + /** + * Creates a new RedelegationEntryResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @static + * @param {cosmos.staking.v1beta1.IRedelegationEntryResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.RedelegationEntryResponse} RedelegationEntryResponse instance + */ + RedelegationEntryResponse.create = function create(properties) { + return new RedelegationEntryResponse(properties); + }; + + /** + * Encodes the specified RedelegationEntryResponse message. Does not implicitly {@link cosmos.staking.v1beta1.RedelegationEntryResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @static + * @param {cosmos.staking.v1beta1.IRedelegationEntryResponse} message RedelegationEntryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedelegationEntryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.redelegationEntry != null && Object.hasOwnProperty.call(message, "redelegationEntry")) + $root.cosmos.staking.v1beta1.RedelegationEntry.encode(message.redelegationEntry, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.balance); + return writer; + }; + + /** + * Encodes the specified RedelegationEntryResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.RedelegationEntryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @static + * @param {cosmos.staking.v1beta1.IRedelegationEntryResponse} message RedelegationEntryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedelegationEntryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RedelegationEntryResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.RedelegationEntryResponse} RedelegationEntryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedelegationEntryResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.RedelegationEntryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.redelegationEntry = $root.cosmos.staking.v1beta1.RedelegationEntry.decode(reader, reader.uint32()); + break; + case 4: + message.balance = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RedelegationEntryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.RedelegationEntryResponse} RedelegationEntryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedelegationEntryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RedelegationEntryResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RedelegationEntryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.redelegationEntry != null && message.hasOwnProperty("redelegationEntry")) { + var error = $root.cosmos.staking.v1beta1.RedelegationEntry.verify(message.redelegationEntry); + if (error) + return "redelegationEntry." + error; + } + if (message.balance != null && message.hasOwnProperty("balance")) + if (!$util.isString(message.balance)) + return "balance: string expected"; + return null; + }; + + /** + * Creates a RedelegationEntryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.RedelegationEntryResponse} RedelegationEntryResponse + */ + RedelegationEntryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.RedelegationEntryResponse) + return object; + var message = new $root.cosmos.staking.v1beta1.RedelegationEntryResponse(); + if (object.redelegationEntry != null) { + if (typeof object.redelegationEntry !== "object") + throw TypeError(".cosmos.staking.v1beta1.RedelegationEntryResponse.redelegationEntry: object expected"); + message.redelegationEntry = $root.cosmos.staking.v1beta1.RedelegationEntry.fromObject(object.redelegationEntry); + } + if (object.balance != null) + message.balance = String(object.balance); + return message; + }; + + /** + * Creates a plain object from a RedelegationEntryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @static + * @param {cosmos.staking.v1beta1.RedelegationEntryResponse} message RedelegationEntryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RedelegationEntryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.redelegationEntry = null; + object.balance = ""; + } + if (message.redelegationEntry != null && message.hasOwnProperty("redelegationEntry")) + object.redelegationEntry = $root.cosmos.staking.v1beta1.RedelegationEntry.toObject(message.redelegationEntry, options); + if (message.balance != null && message.hasOwnProperty("balance")) + object.balance = message.balance; + return object; + }; + + /** + * Converts this RedelegationEntryResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @instance + * @returns {Object.} JSON object + */ + RedelegationEntryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RedelegationEntryResponse; + })(v1beta1.RedelegationEntryResponse || {}); + + v1beta1.RedelegationResponse = (function(RedelegationResponse) { + + /** + * Properties of a RedelegationResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IRedelegationResponse + * @property {cosmos.staking.v1beta1.IRedelegation|null} [redelegation] RedelegationResponse redelegation + * @property {Array.|null} [entries] RedelegationResponse entries + */ + + /** + * Constructs a new RedelegationResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a RedelegationResponse. + * @implements IRedelegationResponse + * @constructor + * @param {cosmos.staking.v1beta1.IRedelegationResponse=} [properties] Properties to set + */ + function RedelegationResponse(properties) { + this.entries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RedelegationResponse redelegation. + * @member {cosmos.staking.v1beta1.IRedelegation|null|undefined} redelegation + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @instance + */ + RedelegationResponse.prototype.redelegation = null; + + /** + * RedelegationResponse entries. + * @member {Array.} entries + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @instance + */ + RedelegationResponse.prototype.entries = $util.emptyArray; + + /** + * Creates a new RedelegationResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @static + * @param {cosmos.staking.v1beta1.IRedelegationResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.RedelegationResponse} RedelegationResponse instance + */ + RedelegationResponse.create = function create(properties) { + return new RedelegationResponse(properties); + }; + + /** + * Encodes the specified RedelegationResponse message. Does not implicitly {@link cosmos.staking.v1beta1.RedelegationResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @static + * @param {cosmos.staking.v1beta1.IRedelegationResponse} message RedelegationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedelegationResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.redelegation != null && Object.hasOwnProperty.call(message, "redelegation")) + $root.cosmos.staking.v1beta1.Redelegation.encode(message.redelegation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.entries != null && message.entries.length) + for (var i = 0; i < message.entries.length; ++i) + $root.cosmos.staking.v1beta1.RedelegationEntryResponse.encode(message.entries[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RedelegationResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.RedelegationResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @static + * @param {cosmos.staking.v1beta1.IRedelegationResponse} message RedelegationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedelegationResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RedelegationResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.RedelegationResponse} RedelegationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedelegationResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.RedelegationResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.redelegation = $root.cosmos.staking.v1beta1.Redelegation.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.cosmos.staking.v1beta1.RedelegationEntryResponse.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RedelegationResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.RedelegationResponse} RedelegationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedelegationResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RedelegationResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RedelegationResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.redelegation != null && message.hasOwnProperty("redelegation")) { + var error = $root.cosmos.staking.v1beta1.Redelegation.verify(message.redelegation); + if (error) + return "redelegation." + error; + } + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (var i = 0; i < message.entries.length; ++i) { + var error = $root.cosmos.staking.v1beta1.RedelegationEntryResponse.verify(message.entries[i]); + if (error) + return "entries." + error; + } + } + return null; + }; + + /** + * Creates a RedelegationResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.RedelegationResponse} RedelegationResponse + */ + RedelegationResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.RedelegationResponse) + return object; + var message = new $root.cosmos.staking.v1beta1.RedelegationResponse(); + if (object.redelegation != null) { + if (typeof object.redelegation !== "object") + throw TypeError(".cosmos.staking.v1beta1.RedelegationResponse.redelegation: object expected"); + message.redelegation = $root.cosmos.staking.v1beta1.Redelegation.fromObject(object.redelegation); + } + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".cosmos.staking.v1beta1.RedelegationResponse.entries: array expected"); + message.entries = []; + for (var i = 0; i < object.entries.length; ++i) { + if (typeof object.entries[i] !== "object") + throw TypeError(".cosmos.staking.v1beta1.RedelegationResponse.entries: object expected"); + message.entries[i] = $root.cosmos.staking.v1beta1.RedelegationEntryResponse.fromObject(object.entries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RedelegationResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @static + * @param {cosmos.staking.v1beta1.RedelegationResponse} message RedelegationResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RedelegationResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (options.defaults) + object.redelegation = null; + if (message.redelegation != null && message.hasOwnProperty("redelegation")) + object.redelegation = $root.cosmos.staking.v1beta1.Redelegation.toObject(message.redelegation, options); + if (message.entries && message.entries.length) { + object.entries = []; + for (var j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.cosmos.staking.v1beta1.RedelegationEntryResponse.toObject(message.entries[j], options); + } + return object; + }; + + /** + * Converts this RedelegationResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @instance + * @returns {Object.} JSON object + */ + RedelegationResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RedelegationResponse; + })(v1beta1.RedelegationResponse || {}); + + v1beta1.Pool = (function(Pool) { + + /** + * Properties of a Pool. + * @memberof cosmos.staking.v1beta1 + * @interface IPool + * @property {string|null} [notBondedTokens] Pool notBondedTokens + * @property {string|null} [bondedTokens] Pool bondedTokens + */ + + /** + * Constructs a new Pool. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a Pool. + * @implements IPool + * @constructor + * @param {cosmos.staking.v1beta1.IPool=} [properties] Properties to set + */ + function Pool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Pool notBondedTokens. + * @member {string} notBondedTokens + * @memberof cosmos.staking.v1beta1.Pool + * @instance + */ + Pool.prototype.notBondedTokens = ""; + + /** + * Pool bondedTokens. + * @member {string} bondedTokens + * @memberof cosmos.staking.v1beta1.Pool + * @instance + */ + Pool.prototype.bondedTokens = ""; + + /** + * Creates a new Pool instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.Pool + * @static + * @param {cosmos.staking.v1beta1.IPool=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.Pool} Pool instance + */ + Pool.create = function create(properties) { + return new Pool(properties); + }; + + /** + * Encodes the specified Pool message. Does not implicitly {@link cosmos.staking.v1beta1.Pool.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.Pool + * @static + * @param {cosmos.staking.v1beta1.IPool} message Pool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Pool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.notBondedTokens != null && Object.hasOwnProperty.call(message, "notBondedTokens")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.notBondedTokens); + if (message.bondedTokens != null && Object.hasOwnProperty.call(message, "bondedTokens")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.bondedTokens); + return writer; + }; + + /** + * Encodes the specified Pool message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.Pool.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.Pool + * @static + * @param {cosmos.staking.v1beta1.IPool} message Pool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Pool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Pool message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.Pool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.Pool} Pool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Pool.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.Pool(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.notBondedTokens = reader.string(); + break; + case 2: + message.bondedTokens = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Pool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.Pool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.Pool} Pool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Pool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Pool message. + * @function verify + * @memberof cosmos.staking.v1beta1.Pool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Pool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.notBondedTokens != null && message.hasOwnProperty("notBondedTokens")) + if (!$util.isString(message.notBondedTokens)) + return "notBondedTokens: string expected"; + if (message.bondedTokens != null && message.hasOwnProperty("bondedTokens")) + if (!$util.isString(message.bondedTokens)) + return "bondedTokens: string expected"; + return null; + }; + + /** + * Creates a Pool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.Pool + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.Pool} Pool + */ + Pool.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.Pool) + return object; + var message = new $root.cosmos.staking.v1beta1.Pool(); + if (object.notBondedTokens != null) + message.notBondedTokens = String(object.notBondedTokens); + if (object.bondedTokens != null) + message.bondedTokens = String(object.bondedTokens); + return message; + }; + + /** + * Creates a plain object from a Pool message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.Pool + * @static + * @param {cosmos.staking.v1beta1.Pool} message Pool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Pool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.notBondedTokens = ""; + object.bondedTokens = ""; + } + if (message.notBondedTokens != null && message.hasOwnProperty("notBondedTokens")) + object.notBondedTokens = message.notBondedTokens; + if (message.bondedTokens != null && message.hasOwnProperty("bondedTokens")) + object.bondedTokens = message.bondedTokens; + return object; + }; + + /** + * Converts this Pool to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.Pool + * @instance + * @returns {Object.} JSON object + */ + Pool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Pool; + })(v1beta1.Pool || {}); + + v1beta1.Msg = (function(Msg) { + + /** + * Constructs a new Msg service. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a Msg + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Msg(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; + + /** + * Creates new Msg service using the specified rpc implementation. + * @function create + * @memberof cosmos.staking.v1beta1.Msg + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Msg} RPC service. Useful where requests and/or responses are streamed. + */ + Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.staking.v1beta1.Msg#createValidator}. + * @memberof cosmos.staking.v1beta1.Msg + * @typedef CreateValidatorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.staking.v1beta1.IMsgCreateValidatorResponse} [response] MsgCreateValidatorResponse + */ + + /** + * Calls CreateValidator. + * @function createValidator + * @memberof cosmos.staking.v1beta1.Msg + * @instance + * @param {cosmos.staking.v1beta1.IMsgCreateValidator} request MsgCreateValidator message or plain object + * @param {cosmos.staking.v1beta1.Msg.CreateValidatorCallback} callback Node-style callback called with the error, if any, and MsgCreateValidatorResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.createValidator = function createValidator(request, callback) { + return this.rpcCall(createValidator, $root.cosmos.staking.v1beta1.MsgCreateValidator, $root.cosmos.staking.v1beta1.MsgCreateValidatorResponse, request, callback); + }, "name", { value: "CreateValidator" }); + + /** + * Calls CreateValidator. + * @function createValidator + * @memberof cosmos.staking.v1beta1.Msg + * @instance + * @param {cosmos.staking.v1beta1.IMsgCreateValidator} request MsgCreateValidator message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.staking.v1beta1.Msg#editValidator}. + * @memberof cosmos.staking.v1beta1.Msg + * @typedef EditValidatorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.staking.v1beta1.IMsgEditValidatorResponse} [response] MsgEditValidatorResponse + */ + + /** + * Calls EditValidator. + * @function editValidator + * @memberof cosmos.staking.v1beta1.Msg + * @instance + * @param {cosmos.staking.v1beta1.IMsgEditValidator} request MsgEditValidator message or plain object + * @param {cosmos.staking.v1beta1.Msg.EditValidatorCallback} callback Node-style callback called with the error, if any, and MsgEditValidatorResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.editValidator = function editValidator(request, callback) { + return this.rpcCall(editValidator, $root.cosmos.staking.v1beta1.MsgEditValidator, $root.cosmos.staking.v1beta1.MsgEditValidatorResponse, request, callback); + }, "name", { value: "EditValidator" }); + + /** + * Calls EditValidator. + * @function editValidator + * @memberof cosmos.staking.v1beta1.Msg + * @instance + * @param {cosmos.staking.v1beta1.IMsgEditValidator} request MsgEditValidator message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.staking.v1beta1.Msg#delegate}. + * @memberof cosmos.staking.v1beta1.Msg + * @typedef DelegateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.staking.v1beta1.IMsgDelegateResponse} [response] MsgDelegateResponse + */ + + /** + * Calls Delegate. + * @function delegate + * @memberof cosmos.staking.v1beta1.Msg + * @instance + * @param {cosmos.staking.v1beta1.IMsgDelegate} request MsgDelegate message or plain object + * @param {cosmos.staking.v1beta1.Msg.DelegateCallback} callback Node-style callback called with the error, if any, and MsgDelegateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.delegate = function delegate(request, callback) { + return this.rpcCall(delegate, $root.cosmos.staking.v1beta1.MsgDelegate, $root.cosmos.staking.v1beta1.MsgDelegateResponse, request, callback); + }, "name", { value: "Delegate" }); + + /** + * Calls Delegate. + * @function delegate + * @memberof cosmos.staking.v1beta1.Msg + * @instance + * @param {cosmos.staking.v1beta1.IMsgDelegate} request MsgDelegate message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.staking.v1beta1.Msg#beginRedelegate}. + * @memberof cosmos.staking.v1beta1.Msg + * @typedef BeginRedelegateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegateResponse} [response] MsgBeginRedelegateResponse + */ + + /** + * Calls BeginRedelegate. + * @function beginRedelegate + * @memberof cosmos.staking.v1beta1.Msg + * @instance + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegate} request MsgBeginRedelegate message or plain object + * @param {cosmos.staking.v1beta1.Msg.BeginRedelegateCallback} callback Node-style callback called with the error, if any, and MsgBeginRedelegateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.beginRedelegate = function beginRedelegate(request, callback) { + return this.rpcCall(beginRedelegate, $root.cosmos.staking.v1beta1.MsgBeginRedelegate, $root.cosmos.staking.v1beta1.MsgBeginRedelegateResponse, request, callback); + }, "name", { value: "BeginRedelegate" }); + + /** + * Calls BeginRedelegate. + * @function beginRedelegate + * @memberof cosmos.staking.v1beta1.Msg + * @instance + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegate} request MsgBeginRedelegate message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.staking.v1beta1.Msg#undelegate}. + * @memberof cosmos.staking.v1beta1.Msg + * @typedef UndelegateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.staking.v1beta1.IMsgUndelegateResponse} [response] MsgUndelegateResponse + */ + + /** + * Calls Undelegate. + * @function undelegate + * @memberof cosmos.staking.v1beta1.Msg + * @instance + * @param {cosmos.staking.v1beta1.IMsgUndelegate} request MsgUndelegate message or plain object + * @param {cosmos.staking.v1beta1.Msg.UndelegateCallback} callback Node-style callback called with the error, if any, and MsgUndelegateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.undelegate = function undelegate(request, callback) { + return this.rpcCall(undelegate, $root.cosmos.staking.v1beta1.MsgUndelegate, $root.cosmos.staking.v1beta1.MsgUndelegateResponse, request, callback); + }, "name", { value: "Undelegate" }); + + /** + * Calls Undelegate. + * @function undelegate + * @memberof cosmos.staking.v1beta1.Msg + * @instance + * @param {cosmos.staking.v1beta1.IMsgUndelegate} request MsgUndelegate message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Msg; + })(v1beta1.Msg || {}); + + v1beta1.MsgCreateValidator = (function(MsgCreateValidator) { + + /** + * Properties of a MsgCreateValidator. + * @memberof cosmos.staking.v1beta1 + * @interface IMsgCreateValidator + * @property {cosmos.staking.v1beta1.IDescription|null} [description] MsgCreateValidator description + * @property {cosmos.staking.v1beta1.ICommissionRates|null} [commission] MsgCreateValidator commission + * @property {string|null} [minSelfDelegation] MsgCreateValidator minSelfDelegation + * @property {string|null} [delegatorAddress] MsgCreateValidator delegatorAddress + * @property {string|null} [validatorAddress] MsgCreateValidator validatorAddress + * @property {google.protobuf.IAny|null} [pubkey] MsgCreateValidator pubkey + * @property {cosmos.base.v1beta1.ICoin|null} [value] MsgCreateValidator value + */ + + /** + * Constructs a new MsgCreateValidator. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a MsgCreateValidator. + * @implements IMsgCreateValidator + * @constructor + * @param {cosmos.staking.v1beta1.IMsgCreateValidator=} [properties] Properties to set + */ + function MsgCreateValidator(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgCreateValidator description. + * @member {cosmos.staking.v1beta1.IDescription|null|undefined} description + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @instance + */ + MsgCreateValidator.prototype.description = null; + + /** + * MsgCreateValidator commission. + * @member {cosmos.staking.v1beta1.ICommissionRates|null|undefined} commission + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @instance + */ + MsgCreateValidator.prototype.commission = null; + + /** + * MsgCreateValidator minSelfDelegation. + * @member {string} minSelfDelegation + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @instance + */ + MsgCreateValidator.prototype.minSelfDelegation = ""; + + /** + * MsgCreateValidator delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @instance + */ + MsgCreateValidator.prototype.delegatorAddress = ""; + + /** + * MsgCreateValidator validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @instance + */ + MsgCreateValidator.prototype.validatorAddress = ""; + + /** + * MsgCreateValidator pubkey. + * @member {google.protobuf.IAny|null|undefined} pubkey + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @instance + */ + MsgCreateValidator.prototype.pubkey = null; + + /** + * MsgCreateValidator value. + * @member {cosmos.base.v1beta1.ICoin|null|undefined} value + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @instance + */ + MsgCreateValidator.prototype.value = null; + + /** + * Creates a new MsgCreateValidator instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @static + * @param {cosmos.staking.v1beta1.IMsgCreateValidator=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.MsgCreateValidator} MsgCreateValidator instance + */ + MsgCreateValidator.create = function create(properties) { + return new MsgCreateValidator(properties); + }; + + /** + * Encodes the specified MsgCreateValidator message. Does not implicitly {@link cosmos.staking.v1beta1.MsgCreateValidator.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @static + * @param {cosmos.staking.v1beta1.IMsgCreateValidator} message MsgCreateValidator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateValidator.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + $root.cosmos.staking.v1beta1.Description.encode(message.description, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.commission != null && Object.hasOwnProperty.call(message, "commission")) + $root.cosmos.staking.v1beta1.CommissionRates.encode(message.commission, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.minSelfDelegation != null && Object.hasOwnProperty.call(message, "minSelfDelegation")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.minSelfDelegation); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.delegatorAddress); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.validatorAddress); + if (message.pubkey != null && Object.hasOwnProperty.call(message, "pubkey")) + $root.google.protobuf.Any.encode(message.pubkey, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.cosmos.base.v1beta1.Coin.encode(message.value, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MsgCreateValidator message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgCreateValidator.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @static + * @param {cosmos.staking.v1beta1.IMsgCreateValidator} message MsgCreateValidator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateValidator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgCreateValidator message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.MsgCreateValidator} MsgCreateValidator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateValidator.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.MsgCreateValidator(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.description = $root.cosmos.staking.v1beta1.Description.decode(reader, reader.uint32()); + break; + case 2: + message.commission = $root.cosmos.staking.v1beta1.CommissionRates.decode(reader, reader.uint32()); + break; + case 3: + message.minSelfDelegation = reader.string(); + break; + case 4: + message.delegatorAddress = reader.string(); + break; + case 5: + message.validatorAddress = reader.string(); + break; + case 6: + message.pubkey = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 7: + message.value = $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgCreateValidator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.MsgCreateValidator} MsgCreateValidator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateValidator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgCreateValidator message. + * @function verify + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgCreateValidator.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.description != null && message.hasOwnProperty("description")) { + var error = $root.cosmos.staking.v1beta1.Description.verify(message.description); + if (error) + return "description." + error; + } + if (message.commission != null && message.hasOwnProperty("commission")) { + var error = $root.cosmos.staking.v1beta1.CommissionRates.verify(message.commission); + if (error) + return "commission." + error; + } + if (message.minSelfDelegation != null && message.hasOwnProperty("minSelfDelegation")) + if (!$util.isString(message.minSelfDelegation)) + return "minSelfDelegation: string expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + if (message.pubkey != null && message.hasOwnProperty("pubkey")) { + var error = $root.google.protobuf.Any.verify(message.pubkey); + if (error) + return "pubkey." + error; + } + if (message.value != null && message.hasOwnProperty("value")) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.value); + if (error) + return "value." + error; + } + return null; + }; + + /** + * Creates a MsgCreateValidator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.MsgCreateValidator} MsgCreateValidator + */ + MsgCreateValidator.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.MsgCreateValidator) + return object; + var message = new $root.cosmos.staking.v1beta1.MsgCreateValidator(); + if (object.description != null) { + if (typeof object.description !== "object") + throw TypeError(".cosmos.staking.v1beta1.MsgCreateValidator.description: object expected"); + message.description = $root.cosmos.staking.v1beta1.Description.fromObject(object.description); + } + if (object.commission != null) { + if (typeof object.commission !== "object") + throw TypeError(".cosmos.staking.v1beta1.MsgCreateValidator.commission: object expected"); + message.commission = $root.cosmos.staking.v1beta1.CommissionRates.fromObject(object.commission); + } + if (object.minSelfDelegation != null) + message.minSelfDelegation = String(object.minSelfDelegation); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + if (object.pubkey != null) { + if (typeof object.pubkey !== "object") + throw TypeError(".cosmos.staking.v1beta1.MsgCreateValidator.pubkey: object expected"); + message.pubkey = $root.google.protobuf.Any.fromObject(object.pubkey); + } + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".cosmos.staking.v1beta1.MsgCreateValidator.value: object expected"); + message.value = $root.cosmos.base.v1beta1.Coin.fromObject(object.value); + } + return message; + }; + + /** + * Creates a plain object from a MsgCreateValidator message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @static + * @param {cosmos.staking.v1beta1.MsgCreateValidator} message MsgCreateValidator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgCreateValidator.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.description = null; + object.commission = null; + object.minSelfDelegation = ""; + object.delegatorAddress = ""; + object.validatorAddress = ""; + object.pubkey = null; + object.value = null; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = $root.cosmos.staking.v1beta1.Description.toObject(message.description, options); + if (message.commission != null && message.hasOwnProperty("commission")) + object.commission = $root.cosmos.staking.v1beta1.CommissionRates.toObject(message.commission, options); + if (message.minSelfDelegation != null && message.hasOwnProperty("minSelfDelegation")) + object.minSelfDelegation = message.minSelfDelegation; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + if (message.pubkey != null && message.hasOwnProperty("pubkey")) + object.pubkey = $root.google.protobuf.Any.toObject(message.pubkey, options); + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.cosmos.base.v1beta1.Coin.toObject(message.value, options); + return object; + }; + + /** + * Converts this MsgCreateValidator to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @instance + * @returns {Object.} JSON object + */ + MsgCreateValidator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgCreateValidator; + })(v1beta1.MsgCreateValidator || {}); + + v1beta1.MsgCreateValidatorResponse = (function(MsgCreateValidatorResponse) { + + /** + * Properties of a MsgCreateValidatorResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IMsgCreateValidatorResponse + */ + + /** + * Constructs a new MsgCreateValidatorResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a MsgCreateValidatorResponse. + * @implements IMsgCreateValidatorResponse + * @constructor + * @param {cosmos.staking.v1beta1.IMsgCreateValidatorResponse=} [properties] Properties to set + */ + function MsgCreateValidatorResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgCreateValidatorResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgCreateValidatorResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.MsgCreateValidatorResponse} MsgCreateValidatorResponse instance + */ + MsgCreateValidatorResponse.create = function create(properties) { + return new MsgCreateValidatorResponse(properties); + }; + + /** + * Encodes the specified MsgCreateValidatorResponse message. Does not implicitly {@link cosmos.staking.v1beta1.MsgCreateValidatorResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgCreateValidatorResponse} message MsgCreateValidatorResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateValidatorResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgCreateValidatorResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgCreateValidatorResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgCreateValidatorResponse} message MsgCreateValidatorResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateValidatorResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgCreateValidatorResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.MsgCreateValidatorResponse} MsgCreateValidatorResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateValidatorResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.MsgCreateValidatorResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgCreateValidatorResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.MsgCreateValidatorResponse} MsgCreateValidatorResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateValidatorResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgCreateValidatorResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgCreateValidatorResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgCreateValidatorResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.MsgCreateValidatorResponse} MsgCreateValidatorResponse + */ + MsgCreateValidatorResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.MsgCreateValidatorResponse) + return object; + return new $root.cosmos.staking.v1beta1.MsgCreateValidatorResponse(); + }; + + /** + * Creates a plain object from a MsgCreateValidatorResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse + * @static + * @param {cosmos.staking.v1beta1.MsgCreateValidatorResponse} message MsgCreateValidatorResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgCreateValidatorResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgCreateValidatorResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse + * @instance + * @returns {Object.} JSON object + */ + MsgCreateValidatorResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgCreateValidatorResponse; + })(v1beta1.MsgCreateValidatorResponse || {}); + + v1beta1.MsgEditValidator = (function(MsgEditValidator) { + + /** + * Properties of a MsgEditValidator. + * @memberof cosmos.staking.v1beta1 + * @interface IMsgEditValidator + * @property {cosmos.staking.v1beta1.IDescription|null} [description] MsgEditValidator description + * @property {string|null} [validatorAddress] MsgEditValidator validatorAddress + * @property {string|null} [commissionRate] MsgEditValidator commissionRate + * @property {string|null} [minSelfDelegation] MsgEditValidator minSelfDelegation + */ + + /** + * Constructs a new MsgEditValidator. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a MsgEditValidator. + * @implements IMsgEditValidator + * @constructor + * @param {cosmos.staking.v1beta1.IMsgEditValidator=} [properties] Properties to set + */ + function MsgEditValidator(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgEditValidator description. + * @member {cosmos.staking.v1beta1.IDescription|null|undefined} description + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @instance + */ + MsgEditValidator.prototype.description = null; + + /** + * MsgEditValidator validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @instance + */ + MsgEditValidator.prototype.validatorAddress = ""; + + /** + * MsgEditValidator commissionRate. + * @member {string} commissionRate + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @instance + */ + MsgEditValidator.prototype.commissionRate = ""; + + /** + * MsgEditValidator minSelfDelegation. + * @member {string} minSelfDelegation + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @instance + */ + MsgEditValidator.prototype.minSelfDelegation = ""; + + /** + * Creates a new MsgEditValidator instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @static + * @param {cosmos.staking.v1beta1.IMsgEditValidator=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.MsgEditValidator} MsgEditValidator instance + */ + MsgEditValidator.create = function create(properties) { + return new MsgEditValidator(properties); + }; + + /** + * Encodes the specified MsgEditValidator message. Does not implicitly {@link cosmos.staking.v1beta1.MsgEditValidator.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @static + * @param {cosmos.staking.v1beta1.IMsgEditValidator} message MsgEditValidator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgEditValidator.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + $root.cosmos.staking.v1beta1.Description.encode(message.description, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddress); + if (message.commissionRate != null && Object.hasOwnProperty.call(message, "commissionRate")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.commissionRate); + if (message.minSelfDelegation != null && Object.hasOwnProperty.call(message, "minSelfDelegation")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.minSelfDelegation); + return writer; + }; + + /** + * Encodes the specified MsgEditValidator message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgEditValidator.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @static + * @param {cosmos.staking.v1beta1.IMsgEditValidator} message MsgEditValidator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgEditValidator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgEditValidator message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.MsgEditValidator} MsgEditValidator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgEditValidator.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.MsgEditValidator(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.description = $root.cosmos.staking.v1beta1.Description.decode(reader, reader.uint32()); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.commissionRate = reader.string(); + break; + case 4: + message.minSelfDelegation = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgEditValidator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.MsgEditValidator} MsgEditValidator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgEditValidator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgEditValidator message. + * @function verify + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgEditValidator.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.description != null && message.hasOwnProperty("description")) { + var error = $root.cosmos.staking.v1beta1.Description.verify(message.description); + if (error) + return "description." + error; + } + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + if (message.commissionRate != null && message.hasOwnProperty("commissionRate")) + if (!$util.isString(message.commissionRate)) + return "commissionRate: string expected"; + if (message.minSelfDelegation != null && message.hasOwnProperty("minSelfDelegation")) + if (!$util.isString(message.minSelfDelegation)) + return "minSelfDelegation: string expected"; + return null; + }; + + /** + * Creates a MsgEditValidator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.MsgEditValidator} MsgEditValidator + */ + MsgEditValidator.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.MsgEditValidator) + return object; + var message = new $root.cosmos.staking.v1beta1.MsgEditValidator(); + if (object.description != null) { + if (typeof object.description !== "object") + throw TypeError(".cosmos.staking.v1beta1.MsgEditValidator.description: object expected"); + message.description = $root.cosmos.staking.v1beta1.Description.fromObject(object.description); + } + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + if (object.commissionRate != null) + message.commissionRate = String(object.commissionRate); + if (object.minSelfDelegation != null) + message.minSelfDelegation = String(object.minSelfDelegation); + return message; + }; + + /** + * Creates a plain object from a MsgEditValidator message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @static + * @param {cosmos.staking.v1beta1.MsgEditValidator} message MsgEditValidator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgEditValidator.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.description = null; + object.validatorAddress = ""; + object.commissionRate = ""; + object.minSelfDelegation = ""; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = $root.cosmos.staking.v1beta1.Description.toObject(message.description, options); + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + if (message.commissionRate != null && message.hasOwnProperty("commissionRate")) + object.commissionRate = message.commissionRate; + if (message.minSelfDelegation != null && message.hasOwnProperty("minSelfDelegation")) + object.minSelfDelegation = message.minSelfDelegation; + return object; + }; + + /** + * Converts this MsgEditValidator to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @instance + * @returns {Object.} JSON object + */ + MsgEditValidator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgEditValidator; + })(v1beta1.MsgEditValidator || {}); + + v1beta1.MsgEditValidatorResponse = (function(MsgEditValidatorResponse) { + + /** + * Properties of a MsgEditValidatorResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IMsgEditValidatorResponse + */ + + /** + * Constructs a new MsgEditValidatorResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a MsgEditValidatorResponse. + * @implements IMsgEditValidatorResponse + * @constructor + * @param {cosmos.staking.v1beta1.IMsgEditValidatorResponse=} [properties] Properties to set + */ + function MsgEditValidatorResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgEditValidatorResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgEditValidatorResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.MsgEditValidatorResponse} MsgEditValidatorResponse instance + */ + MsgEditValidatorResponse.create = function create(properties) { + return new MsgEditValidatorResponse(properties); + }; + + /** + * Encodes the specified MsgEditValidatorResponse message. Does not implicitly {@link cosmos.staking.v1beta1.MsgEditValidatorResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgEditValidatorResponse} message MsgEditValidatorResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgEditValidatorResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgEditValidatorResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgEditValidatorResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgEditValidatorResponse} message MsgEditValidatorResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgEditValidatorResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgEditValidatorResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.MsgEditValidatorResponse} MsgEditValidatorResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgEditValidatorResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.MsgEditValidatorResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgEditValidatorResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.MsgEditValidatorResponse} MsgEditValidatorResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgEditValidatorResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgEditValidatorResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgEditValidatorResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgEditValidatorResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.MsgEditValidatorResponse} MsgEditValidatorResponse + */ + MsgEditValidatorResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.MsgEditValidatorResponse) + return object; + return new $root.cosmos.staking.v1beta1.MsgEditValidatorResponse(); + }; + + /** + * Creates a plain object from a MsgEditValidatorResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse + * @static + * @param {cosmos.staking.v1beta1.MsgEditValidatorResponse} message MsgEditValidatorResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgEditValidatorResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgEditValidatorResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse + * @instance + * @returns {Object.} JSON object + */ + MsgEditValidatorResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgEditValidatorResponse; + })(v1beta1.MsgEditValidatorResponse || {}); + + v1beta1.MsgDelegate = (function(MsgDelegate) { + + /** + * Properties of a MsgDelegate. + * @memberof cosmos.staking.v1beta1 + * @interface IMsgDelegate + * @property {string|null} [delegatorAddress] MsgDelegate delegatorAddress + * @property {string|null} [validatorAddress] MsgDelegate validatorAddress + * @property {cosmos.base.v1beta1.ICoin|null} [amount] MsgDelegate amount + */ + + /** + * Constructs a new MsgDelegate. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a MsgDelegate. + * @implements IMsgDelegate + * @constructor + * @param {cosmos.staking.v1beta1.IMsgDelegate=} [properties] Properties to set + */ + function MsgDelegate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgDelegate delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @instance + */ + MsgDelegate.prototype.delegatorAddress = ""; + + /** + * MsgDelegate validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @instance + */ + MsgDelegate.prototype.validatorAddress = ""; + + /** + * MsgDelegate amount. + * @member {cosmos.base.v1beta1.ICoin|null|undefined} amount + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @instance + */ + MsgDelegate.prototype.amount = null; + + /** + * Creates a new MsgDelegate instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @static + * @param {cosmos.staking.v1beta1.IMsgDelegate=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.MsgDelegate} MsgDelegate instance + */ + MsgDelegate.create = function create(properties) { + return new MsgDelegate(properties); + }; + + /** + * Encodes the specified MsgDelegate message. Does not implicitly {@link cosmos.staking.v1beta1.MsgDelegate.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @static + * @param {cosmos.staking.v1beta1.IMsgDelegate} message MsgDelegate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgDelegate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddress); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + $root.cosmos.base.v1beta1.Coin.encode(message.amount, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MsgDelegate message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgDelegate.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @static + * @param {cosmos.staking.v1beta1.IMsgDelegate} message MsgDelegate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgDelegate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgDelegate message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.MsgDelegate} MsgDelegate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgDelegate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.MsgDelegate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.amount = $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgDelegate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.MsgDelegate} MsgDelegate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgDelegate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgDelegate message. + * @function verify + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgDelegate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.amount); + if (error) + return "amount." + error; + } + return null; + }; + + /** + * Creates a MsgDelegate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.MsgDelegate} MsgDelegate + */ + MsgDelegate.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.MsgDelegate) + return object; + var message = new $root.cosmos.staking.v1beta1.MsgDelegate(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + if (object.amount != null) { + if (typeof object.amount !== "object") + throw TypeError(".cosmos.staking.v1beta1.MsgDelegate.amount: object expected"); + message.amount = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount); + } + return message; + }; + + /** + * Creates a plain object from a MsgDelegate message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @static + * @param {cosmos.staking.v1beta1.MsgDelegate} message MsgDelegate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgDelegate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.delegatorAddress = ""; + object.validatorAddress = ""; + object.amount = null; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + if (message.amount != null && message.hasOwnProperty("amount")) + object.amount = $root.cosmos.base.v1beta1.Coin.toObject(message.amount, options); + return object; + }; + + /** + * Converts this MsgDelegate to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @instance + * @returns {Object.} JSON object + */ + MsgDelegate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgDelegate; + })(v1beta1.MsgDelegate || {}); + + v1beta1.MsgDelegateResponse = (function(MsgDelegateResponse) { + + /** + * Properties of a MsgDelegateResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IMsgDelegateResponse + */ + + /** + * Constructs a new MsgDelegateResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a MsgDelegateResponse. + * @implements IMsgDelegateResponse + * @constructor + * @param {cosmos.staking.v1beta1.IMsgDelegateResponse=} [properties] Properties to set + */ + function MsgDelegateResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgDelegateResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.MsgDelegateResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgDelegateResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.MsgDelegateResponse} MsgDelegateResponse instance + */ + MsgDelegateResponse.create = function create(properties) { + return new MsgDelegateResponse(properties); + }; + + /** + * Encodes the specified MsgDelegateResponse message. Does not implicitly {@link cosmos.staking.v1beta1.MsgDelegateResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.MsgDelegateResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgDelegateResponse} message MsgDelegateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgDelegateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgDelegateResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgDelegateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.MsgDelegateResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgDelegateResponse} message MsgDelegateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgDelegateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgDelegateResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.MsgDelegateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.MsgDelegateResponse} MsgDelegateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgDelegateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.MsgDelegateResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgDelegateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.MsgDelegateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.MsgDelegateResponse} MsgDelegateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgDelegateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgDelegateResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.MsgDelegateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgDelegateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgDelegateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.MsgDelegateResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.MsgDelegateResponse} MsgDelegateResponse + */ + MsgDelegateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.MsgDelegateResponse) + return object; + return new $root.cosmos.staking.v1beta1.MsgDelegateResponse(); + }; + + /** + * Creates a plain object from a MsgDelegateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.MsgDelegateResponse + * @static + * @param {cosmos.staking.v1beta1.MsgDelegateResponse} message MsgDelegateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgDelegateResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgDelegateResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.MsgDelegateResponse + * @instance + * @returns {Object.} JSON object + */ + MsgDelegateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgDelegateResponse; + })(v1beta1.MsgDelegateResponse || {}); + + v1beta1.MsgBeginRedelegate = (function(MsgBeginRedelegate) { + + /** + * Properties of a MsgBeginRedelegate. + * @memberof cosmos.staking.v1beta1 + * @interface IMsgBeginRedelegate + * @property {string|null} [delegatorAddress] MsgBeginRedelegate delegatorAddress + * @property {string|null} [validatorSrcAddress] MsgBeginRedelegate validatorSrcAddress + * @property {string|null} [validatorDstAddress] MsgBeginRedelegate validatorDstAddress + * @property {cosmos.base.v1beta1.ICoin|null} [amount] MsgBeginRedelegate amount + */ + + /** + * Constructs a new MsgBeginRedelegate. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a MsgBeginRedelegate. + * @implements IMsgBeginRedelegate + * @constructor + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegate=} [properties] Properties to set + */ + function MsgBeginRedelegate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgBeginRedelegate delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @instance + */ + MsgBeginRedelegate.prototype.delegatorAddress = ""; + + /** + * MsgBeginRedelegate validatorSrcAddress. + * @member {string} validatorSrcAddress + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @instance + */ + MsgBeginRedelegate.prototype.validatorSrcAddress = ""; + + /** + * MsgBeginRedelegate validatorDstAddress. + * @member {string} validatorDstAddress + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @instance + */ + MsgBeginRedelegate.prototype.validatorDstAddress = ""; + + /** + * MsgBeginRedelegate amount. + * @member {cosmos.base.v1beta1.ICoin|null|undefined} amount + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @instance + */ + MsgBeginRedelegate.prototype.amount = null; + + /** + * Creates a new MsgBeginRedelegate instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @static + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegate=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.MsgBeginRedelegate} MsgBeginRedelegate instance + */ + MsgBeginRedelegate.create = function create(properties) { + return new MsgBeginRedelegate(properties); + }; + + /** + * Encodes the specified MsgBeginRedelegate message. Does not implicitly {@link cosmos.staking.v1beta1.MsgBeginRedelegate.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @static + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegate} message MsgBeginRedelegate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgBeginRedelegate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.validatorSrcAddress != null && Object.hasOwnProperty.call(message, "validatorSrcAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorSrcAddress); + if (message.validatorDstAddress != null && Object.hasOwnProperty.call(message, "validatorDstAddress")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.validatorDstAddress); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + $root.cosmos.base.v1beta1.Coin.encode(message.amount, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MsgBeginRedelegate message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgBeginRedelegate.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @static + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegate} message MsgBeginRedelegate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgBeginRedelegate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgBeginRedelegate message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.MsgBeginRedelegate} MsgBeginRedelegate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgBeginRedelegate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.MsgBeginRedelegate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorSrcAddress = reader.string(); + break; + case 3: + message.validatorDstAddress = reader.string(); + break; + case 4: + message.amount = $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgBeginRedelegate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.MsgBeginRedelegate} MsgBeginRedelegate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgBeginRedelegate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgBeginRedelegate message. + * @function verify + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgBeginRedelegate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.validatorSrcAddress != null && message.hasOwnProperty("validatorSrcAddress")) + if (!$util.isString(message.validatorSrcAddress)) + return "validatorSrcAddress: string expected"; + if (message.validatorDstAddress != null && message.hasOwnProperty("validatorDstAddress")) + if (!$util.isString(message.validatorDstAddress)) + return "validatorDstAddress: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.amount); + if (error) + return "amount." + error; + } + return null; + }; + + /** + * Creates a MsgBeginRedelegate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.MsgBeginRedelegate} MsgBeginRedelegate + */ + MsgBeginRedelegate.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.MsgBeginRedelegate) + return object; + var message = new $root.cosmos.staking.v1beta1.MsgBeginRedelegate(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.validatorSrcAddress != null) + message.validatorSrcAddress = String(object.validatorSrcAddress); + if (object.validatorDstAddress != null) + message.validatorDstAddress = String(object.validatorDstAddress); + if (object.amount != null) { + if (typeof object.amount !== "object") + throw TypeError(".cosmos.staking.v1beta1.MsgBeginRedelegate.amount: object expected"); + message.amount = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount); + } + return message; + }; + + /** + * Creates a plain object from a MsgBeginRedelegate message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @static + * @param {cosmos.staking.v1beta1.MsgBeginRedelegate} message MsgBeginRedelegate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgBeginRedelegate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.delegatorAddress = ""; + object.validatorSrcAddress = ""; + object.validatorDstAddress = ""; + object.amount = null; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.validatorSrcAddress != null && message.hasOwnProperty("validatorSrcAddress")) + object.validatorSrcAddress = message.validatorSrcAddress; + if (message.validatorDstAddress != null && message.hasOwnProperty("validatorDstAddress")) + object.validatorDstAddress = message.validatorDstAddress; + if (message.amount != null && message.hasOwnProperty("amount")) + object.amount = $root.cosmos.base.v1beta1.Coin.toObject(message.amount, options); + return object; + }; + + /** + * Converts this MsgBeginRedelegate to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @instance + * @returns {Object.} JSON object + */ + MsgBeginRedelegate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgBeginRedelegate; + })(v1beta1.MsgBeginRedelegate || {}); + + v1beta1.MsgBeginRedelegateResponse = (function(MsgBeginRedelegateResponse) { + + /** + * Properties of a MsgBeginRedelegateResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IMsgBeginRedelegateResponse + * @property {google.protobuf.ITimestamp|null} [completionTime] MsgBeginRedelegateResponse completionTime + */ + + /** + * Constructs a new MsgBeginRedelegateResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a MsgBeginRedelegateResponse. + * @implements IMsgBeginRedelegateResponse + * @constructor + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegateResponse=} [properties] Properties to set + */ + function MsgBeginRedelegateResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgBeginRedelegateResponse completionTime. + * @member {google.protobuf.ITimestamp|null|undefined} completionTime + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse + * @instance + */ + MsgBeginRedelegateResponse.prototype.completionTime = null; + + /** + * Creates a new MsgBeginRedelegateResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegateResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.MsgBeginRedelegateResponse} MsgBeginRedelegateResponse instance + */ + MsgBeginRedelegateResponse.create = function create(properties) { + return new MsgBeginRedelegateResponse(properties); + }; + + /** + * Encodes the specified MsgBeginRedelegateResponse message. Does not implicitly {@link cosmos.staking.v1beta1.MsgBeginRedelegateResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegateResponse} message MsgBeginRedelegateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgBeginRedelegateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.completionTime != null && Object.hasOwnProperty.call(message, "completionTime")) + $root.google.protobuf.Timestamp.encode(message.completionTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MsgBeginRedelegateResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgBeginRedelegateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegateResponse} message MsgBeginRedelegateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgBeginRedelegateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgBeginRedelegateResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.MsgBeginRedelegateResponse} MsgBeginRedelegateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgBeginRedelegateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.MsgBeginRedelegateResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.completionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgBeginRedelegateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.MsgBeginRedelegateResponse} MsgBeginRedelegateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgBeginRedelegateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgBeginRedelegateResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgBeginRedelegateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.completionTime != null && message.hasOwnProperty("completionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.completionTime); + if (error) + return "completionTime." + error; + } + return null; + }; + + /** + * Creates a MsgBeginRedelegateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.MsgBeginRedelegateResponse} MsgBeginRedelegateResponse + */ + MsgBeginRedelegateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.MsgBeginRedelegateResponse) + return object; + var message = new $root.cosmos.staking.v1beta1.MsgBeginRedelegateResponse(); + if (object.completionTime != null) { + if (typeof object.completionTime !== "object") + throw TypeError(".cosmos.staking.v1beta1.MsgBeginRedelegateResponse.completionTime: object expected"); + message.completionTime = $root.google.protobuf.Timestamp.fromObject(object.completionTime); + } + return message; + }; + + /** + * Creates a plain object from a MsgBeginRedelegateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse + * @static + * @param {cosmos.staking.v1beta1.MsgBeginRedelegateResponse} message MsgBeginRedelegateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgBeginRedelegateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.completionTime = null; + if (message.completionTime != null && message.hasOwnProperty("completionTime")) + object.completionTime = $root.google.protobuf.Timestamp.toObject(message.completionTime, options); + return object; + }; + + /** + * Converts this MsgBeginRedelegateResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse + * @instance + * @returns {Object.} JSON object + */ + MsgBeginRedelegateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgBeginRedelegateResponse; + })(v1beta1.MsgBeginRedelegateResponse || {}); + + v1beta1.MsgUndelegate = (function(MsgUndelegate) { + + /** + * Properties of a MsgUndelegate. + * @memberof cosmos.staking.v1beta1 + * @interface IMsgUndelegate + * @property {string|null} [delegatorAddress] MsgUndelegate delegatorAddress + * @property {string|null} [validatorAddress] MsgUndelegate validatorAddress + * @property {cosmos.base.v1beta1.ICoin|null} [amount] MsgUndelegate amount + */ + + /** + * Constructs a new MsgUndelegate. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a MsgUndelegate. + * @implements IMsgUndelegate + * @constructor + * @param {cosmos.staking.v1beta1.IMsgUndelegate=} [properties] Properties to set + */ + function MsgUndelegate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgUndelegate delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @instance + */ + MsgUndelegate.prototype.delegatorAddress = ""; + + /** + * MsgUndelegate validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @instance + */ + MsgUndelegate.prototype.validatorAddress = ""; + + /** + * MsgUndelegate amount. + * @member {cosmos.base.v1beta1.ICoin|null|undefined} amount + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @instance + */ + MsgUndelegate.prototype.amount = null; + + /** + * Creates a new MsgUndelegate instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @static + * @param {cosmos.staking.v1beta1.IMsgUndelegate=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.MsgUndelegate} MsgUndelegate instance + */ + MsgUndelegate.create = function create(properties) { + return new MsgUndelegate(properties); + }; + + /** + * Encodes the specified MsgUndelegate message. Does not implicitly {@link cosmos.staking.v1beta1.MsgUndelegate.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @static + * @param {cosmos.staking.v1beta1.IMsgUndelegate} message MsgUndelegate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUndelegate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddress); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + $root.cosmos.base.v1beta1.Coin.encode(message.amount, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MsgUndelegate message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgUndelegate.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @static + * @param {cosmos.staking.v1beta1.IMsgUndelegate} message MsgUndelegate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUndelegate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgUndelegate message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.MsgUndelegate} MsgUndelegate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUndelegate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.MsgUndelegate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.amount = $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgUndelegate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.MsgUndelegate} MsgUndelegate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUndelegate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgUndelegate message. + * @function verify + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgUndelegate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.amount); + if (error) + return "amount." + error; + } + return null; + }; + + /** + * Creates a MsgUndelegate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.MsgUndelegate} MsgUndelegate + */ + MsgUndelegate.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.MsgUndelegate) + return object; + var message = new $root.cosmos.staking.v1beta1.MsgUndelegate(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + if (object.amount != null) { + if (typeof object.amount !== "object") + throw TypeError(".cosmos.staking.v1beta1.MsgUndelegate.amount: object expected"); + message.amount = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount); + } + return message; + }; + + /** + * Creates a plain object from a MsgUndelegate message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @static + * @param {cosmos.staking.v1beta1.MsgUndelegate} message MsgUndelegate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgUndelegate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.delegatorAddress = ""; + object.validatorAddress = ""; + object.amount = null; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + if (message.amount != null && message.hasOwnProperty("amount")) + object.amount = $root.cosmos.base.v1beta1.Coin.toObject(message.amount, options); + return object; + }; + + /** + * Converts this MsgUndelegate to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @instance + * @returns {Object.} JSON object + */ + MsgUndelegate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgUndelegate; + })(v1beta1.MsgUndelegate || {}); + + v1beta1.MsgUndelegateResponse = (function(MsgUndelegateResponse) { + + /** + * Properties of a MsgUndelegateResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IMsgUndelegateResponse + * @property {google.protobuf.ITimestamp|null} [completionTime] MsgUndelegateResponse completionTime + */ + + /** + * Constructs a new MsgUndelegateResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a MsgUndelegateResponse. + * @implements IMsgUndelegateResponse + * @constructor + * @param {cosmos.staking.v1beta1.IMsgUndelegateResponse=} [properties] Properties to set + */ + function MsgUndelegateResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgUndelegateResponse completionTime. + * @member {google.protobuf.ITimestamp|null|undefined} completionTime + * @memberof cosmos.staking.v1beta1.MsgUndelegateResponse + * @instance + */ + MsgUndelegateResponse.prototype.completionTime = null; + + /** + * Creates a new MsgUndelegateResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.MsgUndelegateResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgUndelegateResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.MsgUndelegateResponse} MsgUndelegateResponse instance + */ + MsgUndelegateResponse.create = function create(properties) { + return new MsgUndelegateResponse(properties); + }; + + /** + * Encodes the specified MsgUndelegateResponse message. Does not implicitly {@link cosmos.staking.v1beta1.MsgUndelegateResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.MsgUndelegateResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgUndelegateResponse} message MsgUndelegateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUndelegateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.completionTime != null && Object.hasOwnProperty.call(message, "completionTime")) + $root.google.protobuf.Timestamp.encode(message.completionTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MsgUndelegateResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgUndelegateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.MsgUndelegateResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgUndelegateResponse} message MsgUndelegateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUndelegateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgUndelegateResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.MsgUndelegateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.MsgUndelegateResponse} MsgUndelegateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUndelegateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.MsgUndelegateResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.completionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgUndelegateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.MsgUndelegateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.MsgUndelegateResponse} MsgUndelegateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUndelegateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgUndelegateResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.MsgUndelegateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgUndelegateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.completionTime != null && message.hasOwnProperty("completionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.completionTime); + if (error) + return "completionTime." + error; + } + return null; + }; + + /** + * Creates a MsgUndelegateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.MsgUndelegateResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.MsgUndelegateResponse} MsgUndelegateResponse + */ + MsgUndelegateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.MsgUndelegateResponse) + return object; + var message = new $root.cosmos.staking.v1beta1.MsgUndelegateResponse(); + if (object.completionTime != null) { + if (typeof object.completionTime !== "object") + throw TypeError(".cosmos.staking.v1beta1.MsgUndelegateResponse.completionTime: object expected"); + message.completionTime = $root.google.protobuf.Timestamp.fromObject(object.completionTime); + } + return message; + }; + + /** + * Creates a plain object from a MsgUndelegateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.MsgUndelegateResponse + * @static + * @param {cosmos.staking.v1beta1.MsgUndelegateResponse} message MsgUndelegateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgUndelegateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.completionTime = null; + if (message.completionTime != null && message.hasOwnProperty("completionTime")) + object.completionTime = $root.google.protobuf.Timestamp.toObject(message.completionTime, options); + return object; + }; + + /** + * Converts this MsgUndelegateResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.MsgUndelegateResponse + * @instance + * @returns {Object.} JSON object + */ + MsgUndelegateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgUndelegateResponse; + })(v1beta1.MsgUndelegateResponse || {}); + + return v1beta1; + })(staking.v1beta1 || {}); + + return staking; + })(cosmos.staking || {}); + + /** + * Namespace crypto. + * @memberof cosmos + * @namespace + */ + + cosmos.crypto = (function(crypto) { + + /** + * Namespace multisig. + * @memberof cosmos.crypto + * @namespace + */ + + crypto.multisig = (function(multisig) { + + /** + * Namespace v1beta1. + * @memberof cosmos.crypto.multisig + * @namespace + */ + + multisig.v1beta1 = (function(v1beta1) { + + v1beta1.MultiSignature = (function(MultiSignature) { + + /** + * Properties of a MultiSignature. + * @memberof cosmos.crypto.multisig.v1beta1 + * @interface IMultiSignature + * @property {Array.|null} [signatures] MultiSignature signatures + */ + + /** + * Constructs a new MultiSignature. + * @memberof cosmos.crypto.multisig.v1beta1 + * @classdesc Represents a MultiSignature. + * @implements IMultiSignature + * @constructor + * @param {cosmos.crypto.multisig.v1beta1.IMultiSignature=} [properties] Properties to set + */ + function MultiSignature(properties) { + this.signatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MultiSignature signatures. + * @member {Array.} signatures + * @memberof cosmos.crypto.multisig.v1beta1.MultiSignature + * @instance + */ + MultiSignature.prototype.signatures = $util.emptyArray; + + /** + * Creates a new MultiSignature instance using the specified properties. + * @function create + * @memberof cosmos.crypto.multisig.v1beta1.MultiSignature + * @static + * @param {cosmos.crypto.multisig.v1beta1.IMultiSignature=} [properties] Properties to set + * @returns {cosmos.crypto.multisig.v1beta1.MultiSignature} MultiSignature instance + */ + MultiSignature.create = function create(properties) { + return new MultiSignature(properties); + }; + + /** + * Encodes the specified MultiSignature message. Does not implicitly {@link cosmos.crypto.multisig.v1beta1.MultiSignature.verify|verify} messages. + * @function encode + * @memberof cosmos.crypto.multisig.v1beta1.MultiSignature + * @static + * @param {cosmos.crypto.multisig.v1beta1.IMultiSignature} message MultiSignature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiSignature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.signatures != null && message.signatures.length) + for (var i = 0; i < message.signatures.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.signatures[i]); + return writer; + }; + + /** + * Encodes the specified MultiSignature message, length delimited. Does not implicitly {@link cosmos.crypto.multisig.v1beta1.MultiSignature.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.crypto.multisig.v1beta1.MultiSignature + * @static + * @param {cosmos.crypto.multisig.v1beta1.IMultiSignature} message MultiSignature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiSignature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MultiSignature message from the specified reader or buffer. + * @function decode + * @memberof cosmos.crypto.multisig.v1beta1.MultiSignature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.crypto.multisig.v1beta1.MultiSignature} MultiSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiSignature.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.crypto.multisig.v1beta1.MultiSignature(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.signatures && message.signatures.length)) + message.signatures = []; + message.signatures.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MultiSignature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.crypto.multisig.v1beta1.MultiSignature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.crypto.multisig.v1beta1.MultiSignature} MultiSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiSignature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MultiSignature message. + * @function verify + * @memberof cosmos.crypto.multisig.v1beta1.MultiSignature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MultiSignature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.signatures != null && message.hasOwnProperty("signatures")) { + if (!Array.isArray(message.signatures)) + return "signatures: array expected"; + for (var i = 0; i < message.signatures.length; ++i) + if (!(message.signatures[i] && typeof message.signatures[i].length === "number" || $util.isString(message.signatures[i]))) + return "signatures: buffer[] expected"; + } + return null; + }; + + /** + * Creates a MultiSignature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.crypto.multisig.v1beta1.MultiSignature + * @static + * @param {Object.} object Plain object + * @returns {cosmos.crypto.multisig.v1beta1.MultiSignature} MultiSignature + */ + MultiSignature.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.crypto.multisig.v1beta1.MultiSignature) + return object; + var message = new $root.cosmos.crypto.multisig.v1beta1.MultiSignature(); + if (object.signatures) { + if (!Array.isArray(object.signatures)) + throw TypeError(".cosmos.crypto.multisig.v1beta1.MultiSignature.signatures: array expected"); + message.signatures = []; + for (var i = 0; i < object.signatures.length; ++i) + if (typeof object.signatures[i] === "string") + $util.base64.decode(object.signatures[i], message.signatures[i] = $util.newBuffer($util.base64.length(object.signatures[i])), 0); + else if (object.signatures[i].length) + message.signatures[i] = object.signatures[i]; + } + return message; + }; + + /** + * Creates a plain object from a MultiSignature message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.crypto.multisig.v1beta1.MultiSignature + * @static + * @param {cosmos.crypto.multisig.v1beta1.MultiSignature} message MultiSignature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MultiSignature.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.signatures = []; + if (message.signatures && message.signatures.length) { + object.signatures = []; + for (var j = 0; j < message.signatures.length; ++j) + object.signatures[j] = options.bytes === String ? $util.base64.encode(message.signatures[j], 0, message.signatures[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.signatures[j]) : message.signatures[j]; + } + return object; + }; + + /** + * Converts this MultiSignature to JSON. + * @function toJSON + * @memberof cosmos.crypto.multisig.v1beta1.MultiSignature + * @instance + * @returns {Object.} JSON object + */ + MultiSignature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MultiSignature; + })(v1beta1.MultiSignature || {}); + + v1beta1.CompactBitArray = (function(CompactBitArray) { + + /** + * Properties of a CompactBitArray. + * @memberof cosmos.crypto.multisig.v1beta1 + * @interface ICompactBitArray + * @property {number|null} [extraBitsStored] CompactBitArray extraBitsStored + * @property {Uint8Array|null} [elems] CompactBitArray elems + */ + + /** + * Constructs a new CompactBitArray. + * @memberof cosmos.crypto.multisig.v1beta1 + * @classdesc Represents a CompactBitArray. + * @implements ICompactBitArray + * @constructor + * @param {cosmos.crypto.multisig.v1beta1.ICompactBitArray=} [properties] Properties to set + */ + function CompactBitArray(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompactBitArray extraBitsStored. + * @member {number} extraBitsStored + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @instance + */ + CompactBitArray.prototype.extraBitsStored = 0; + + /** + * CompactBitArray elems. + * @member {Uint8Array} elems + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @instance + */ + CompactBitArray.prototype.elems = $util.newBuffer([]); + + /** + * Creates a new CompactBitArray instance using the specified properties. + * @function create + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @static + * @param {cosmos.crypto.multisig.v1beta1.ICompactBitArray=} [properties] Properties to set + * @returns {cosmos.crypto.multisig.v1beta1.CompactBitArray} CompactBitArray instance + */ + CompactBitArray.create = function create(properties) { + return new CompactBitArray(properties); + }; + + /** + * Encodes the specified CompactBitArray message. Does not implicitly {@link cosmos.crypto.multisig.v1beta1.CompactBitArray.verify|verify} messages. + * @function encode + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @static + * @param {cosmos.crypto.multisig.v1beta1.ICompactBitArray} message CompactBitArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompactBitArray.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.extraBitsStored != null && Object.hasOwnProperty.call(message, "extraBitsStored")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.extraBitsStored); + if (message.elems != null && Object.hasOwnProperty.call(message, "elems")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.elems); + return writer; + }; + + /** + * Encodes the specified CompactBitArray message, length delimited. Does not implicitly {@link cosmos.crypto.multisig.v1beta1.CompactBitArray.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @static + * @param {cosmos.crypto.multisig.v1beta1.ICompactBitArray} message CompactBitArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompactBitArray.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompactBitArray message from the specified reader or buffer. + * @function decode + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.crypto.multisig.v1beta1.CompactBitArray} CompactBitArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompactBitArray.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.crypto.multisig.v1beta1.CompactBitArray(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.extraBitsStored = reader.uint32(); + break; + case 2: + message.elems = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompactBitArray message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.crypto.multisig.v1beta1.CompactBitArray} CompactBitArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompactBitArray.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompactBitArray message. + * @function verify + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompactBitArray.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.extraBitsStored != null && message.hasOwnProperty("extraBitsStored")) + if (!$util.isInteger(message.extraBitsStored)) + return "extraBitsStored: integer expected"; + if (message.elems != null && message.hasOwnProperty("elems")) + if (!(message.elems && typeof message.elems.length === "number" || $util.isString(message.elems))) + return "elems: buffer expected"; + return null; + }; + + /** + * Creates a CompactBitArray message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @static + * @param {Object.} object Plain object + * @returns {cosmos.crypto.multisig.v1beta1.CompactBitArray} CompactBitArray + */ + CompactBitArray.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.crypto.multisig.v1beta1.CompactBitArray) + return object; + var message = new $root.cosmos.crypto.multisig.v1beta1.CompactBitArray(); + if (object.extraBitsStored != null) + message.extraBitsStored = object.extraBitsStored >>> 0; + if (object.elems != null) + if (typeof object.elems === "string") + $util.base64.decode(object.elems, message.elems = $util.newBuffer($util.base64.length(object.elems)), 0); + else if (object.elems.length) + message.elems = object.elems; + return message; + }; + + /** + * Creates a plain object from a CompactBitArray message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @static + * @param {cosmos.crypto.multisig.v1beta1.CompactBitArray} message CompactBitArray + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompactBitArray.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.extraBitsStored = 0; + if (options.bytes === String) + object.elems = ""; + else { + object.elems = []; + if (options.bytes !== Array) + object.elems = $util.newBuffer(object.elems); + } + } + if (message.extraBitsStored != null && message.hasOwnProperty("extraBitsStored")) + object.extraBitsStored = message.extraBitsStored; + if (message.elems != null && message.hasOwnProperty("elems")) + object.elems = options.bytes === String ? $util.base64.encode(message.elems, 0, message.elems.length) : options.bytes === Array ? Array.prototype.slice.call(message.elems) : message.elems; + return object; + }; + + /** + * Converts this CompactBitArray to JSON. + * @function toJSON + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @instance + * @returns {Object.} JSON object + */ + CompactBitArray.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CompactBitArray; + })(v1beta1.CompactBitArray || {}); + + return v1beta1; + })(multisig.v1beta1 || {}); + + return multisig; + })(crypto.multisig || {}); + + return crypto; + })(cosmos.crypto || {}); + + /** + * Namespace tx. + * @memberof cosmos + * @namespace + */ + + cosmos.tx = (function(tx) { + + /** + * Namespace signing. + * @memberof cosmos.tx + * @namespace + */ + + tx.signing = (function(signing) { + + /** + * Namespace v1beta1. + * @memberof cosmos.tx.signing + * @namespace + */ + + signing.v1beta1 = (function(v1beta1) { + + /** + * SignMode enum. + * @name cosmos.tx.signing.v1beta1.SignMode + * @enum {string} + * @property {number} SIGN_MODE_UNSPECIFIED=0 SIGN_MODE_UNSPECIFIED value + * @property {number} SIGN_MODE_DIRECT=1 SIGN_MODE_DIRECT value + * @property {number} SIGN_MODE_TEXTUAL=2 SIGN_MODE_TEXTUAL value + * @property {number} SIGN_MODE_LEGACY_AMINO_JSON=127 SIGN_MODE_LEGACY_AMINO_JSON value + */ + v1beta1.SignMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SIGN_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SIGN_MODE_DIRECT"] = 1; + values[valuesById[2] = "SIGN_MODE_TEXTUAL"] = 2; + values[valuesById[127] = "SIGN_MODE_LEGACY_AMINO_JSON"] = 127; + return values; + })(); + + v1beta1.SignatureDescriptors = (function(SignatureDescriptors) { + + /** + * Properties of a SignatureDescriptors. + * @memberof cosmos.tx.signing.v1beta1 + * @interface ISignatureDescriptors + * @property {Array.|null} [signatures] SignatureDescriptors signatures + */ + + /** + * Constructs a new SignatureDescriptors. + * @memberof cosmos.tx.signing.v1beta1 + * @classdesc Represents a SignatureDescriptors. + * @implements ISignatureDescriptors + * @constructor + * @param {cosmos.tx.signing.v1beta1.ISignatureDescriptors=} [properties] Properties to set + */ + function SignatureDescriptors(properties) { + this.signatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SignatureDescriptors signatures. + * @member {Array.} signatures + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors + * @instance + */ + SignatureDescriptors.prototype.signatures = $util.emptyArray; + + /** + * Creates a new SignatureDescriptors instance using the specified properties. + * @function create + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors + * @static + * @param {cosmos.tx.signing.v1beta1.ISignatureDescriptors=} [properties] Properties to set + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptors} SignatureDescriptors instance + */ + SignatureDescriptors.create = function create(properties) { + return new SignatureDescriptors(properties); + }; + + /** + * Encodes the specified SignatureDescriptors message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptors.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors + * @static + * @param {cosmos.tx.signing.v1beta1.ISignatureDescriptors} message SignatureDescriptors message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureDescriptors.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.signatures != null && message.signatures.length) + for (var i = 0; i < message.signatures.length; ++i) + $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.encode(message.signatures[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SignatureDescriptors message, length delimited. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptors.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors + * @static + * @param {cosmos.tx.signing.v1beta1.ISignatureDescriptors} message SignatureDescriptors message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureDescriptors.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SignatureDescriptors message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptors} SignatureDescriptors + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureDescriptors.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptors(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.signatures && message.signatures.length)) + message.signatures = []; + message.signatures.push($root.cosmos.tx.signing.v1beta1.SignatureDescriptor.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SignatureDescriptors message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptors} SignatureDescriptors + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureDescriptors.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SignatureDescriptors message. + * @function verify + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SignatureDescriptors.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.signatures != null && message.hasOwnProperty("signatures")) { + if (!Array.isArray(message.signatures)) + return "signatures: array expected"; + for (var i = 0; i < message.signatures.length; ++i) { + var error = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.verify(message.signatures[i]); + if (error) + return "signatures." + error; + } + } + return null; + }; + + /** + * Creates a SignatureDescriptors message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptors} SignatureDescriptors + */ + SignatureDescriptors.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.signing.v1beta1.SignatureDescriptors) + return object; + var message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptors(); + if (object.signatures) { + if (!Array.isArray(object.signatures)) + throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptors.signatures: array expected"); + message.signatures = []; + for (var i = 0; i < object.signatures.length; ++i) { + if (typeof object.signatures[i] !== "object") + throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptors.signatures: object expected"); + message.signatures[i] = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.fromObject(object.signatures[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SignatureDescriptors message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptors} message SignatureDescriptors + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SignatureDescriptors.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.signatures = []; + if (message.signatures && message.signatures.length) { + object.signatures = []; + for (var j = 0; j < message.signatures.length; ++j) + object.signatures[j] = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.toObject(message.signatures[j], options); + } + return object; + }; + + /** + * Converts this SignatureDescriptors to JSON. + * @function toJSON + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors + * @instance + * @returns {Object.} JSON object + */ + SignatureDescriptors.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SignatureDescriptors; + })(v1beta1.SignatureDescriptors || {}); + + v1beta1.SignatureDescriptor = (function(SignatureDescriptor) { + + /** + * Properties of a SignatureDescriptor. + * @memberof cosmos.tx.signing.v1beta1 + * @interface ISignatureDescriptor + * @property {google.protobuf.IAny|null} [publicKey] SignatureDescriptor publicKey + * @property {cosmos.tx.signing.v1beta1.SignatureDescriptor.IData|null} [data] SignatureDescriptor data + * @property {number|Long|null} [sequence] SignatureDescriptor sequence + */ + + /** + * Constructs a new SignatureDescriptor. + * @memberof cosmos.tx.signing.v1beta1 + * @classdesc Represents a SignatureDescriptor. + * @implements ISignatureDescriptor + * @constructor + * @param {cosmos.tx.signing.v1beta1.ISignatureDescriptor=} [properties] Properties to set + */ + function SignatureDescriptor(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SignatureDescriptor publicKey. + * @member {google.protobuf.IAny|null|undefined} publicKey + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @instance + */ + SignatureDescriptor.prototype.publicKey = null; + + /** + * SignatureDescriptor data. + * @member {cosmos.tx.signing.v1beta1.SignatureDescriptor.IData|null|undefined} data + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @instance + */ + SignatureDescriptor.prototype.data = null; + + /** + * SignatureDescriptor sequence. + * @member {number|Long} sequence + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @instance + */ + SignatureDescriptor.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new SignatureDescriptor instance using the specified properties. + * @function create + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @static + * @param {cosmos.tx.signing.v1beta1.ISignatureDescriptor=} [properties] Properties to set + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor} SignatureDescriptor instance + */ + SignatureDescriptor.create = function create(properties) { + return new SignatureDescriptor(properties); + }; + + /** + * Encodes the specified SignatureDescriptor message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @static + * @param {cosmos.tx.signing.v1beta1.ISignatureDescriptor} message SignatureDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) + $root.google.protobuf.Any.encode(message.publicKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.encode(message.data, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.sequence); + return writer; + }; + + /** + * Encodes the specified SignatureDescriptor message, length delimited. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @static + * @param {cosmos.tx.signing.v1beta1.ISignatureDescriptor} message SignatureDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SignatureDescriptor message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor} SignatureDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publicKey = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 2: + message.data = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.decode(reader, reader.uint32()); + break; + case 3: + message.sequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SignatureDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor} SignatureDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SignatureDescriptor message. + * @function verify + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SignatureDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.publicKey != null && message.hasOwnProperty("publicKey")) { + var error = $root.google.protobuf.Any.verify(message.publicKey); + if (error) + return "publicKey." + error; + } + if (message.data != null && message.hasOwnProperty("data")) { + var error = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.verify(message.data); + if (error) + return "data." + error; + } + if (message.sequence != null && message.hasOwnProperty("sequence")) + if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) + return "sequence: integer|Long expected"; + return null; + }; + + /** + * Creates a SignatureDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor} SignatureDescriptor + */ + SignatureDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.signing.v1beta1.SignatureDescriptor) + return object; + var message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor(); + if (object.publicKey != null) { + if (typeof object.publicKey !== "object") + throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.publicKey: object expected"); + message.publicKey = $root.google.protobuf.Any.fromObject(object.publicKey); + } + if (object.data != null) { + if (typeof object.data !== "object") + throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.data: object expected"); + message.data = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.fromObject(object.data); + } + if (object.sequence != null) + if ($util.Long) + (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; + else if (typeof object.sequence === "string") + message.sequence = parseInt(object.sequence, 10); + else if (typeof object.sequence === "number") + message.sequence = object.sequence; + else if (typeof object.sequence === "object") + message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a SignatureDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor} message SignatureDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SignatureDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.publicKey = null; + object.data = null; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sequence = options.longs === String ? "0" : 0; + } + if (message.publicKey != null && message.hasOwnProperty("publicKey")) + object.publicKey = $root.google.protobuf.Any.toObject(message.publicKey, options); + if (message.data != null && message.hasOwnProperty("data")) + object.data = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.toObject(message.data, options); + if (message.sequence != null && message.hasOwnProperty("sequence")) + if (typeof message.sequence === "number") + object.sequence = options.longs === String ? String(message.sequence) : message.sequence; + else + object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; + return object; + }; + + /** + * Converts this SignatureDescriptor to JSON. + * @function toJSON + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @instance + * @returns {Object.} JSON object + */ + SignatureDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + SignatureDescriptor.Data = (function(Data) { + + /** + * Properties of a Data. + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @interface IData + * @property {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle|null} [single] Data single + * @property {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti|null} [multi] Data multi + */ + + /** + * Constructs a new Data. + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @classdesc Represents a Data. + * @implements IData + * @constructor + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.IData=} [properties] Properties to set + */ + function Data(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Data single. + * @member {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle|null|undefined} single + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @instance + */ + Data.prototype.single = null; + + /** + * Data multi. + * @member {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti|null|undefined} multi + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @instance + */ + Data.prototype.multi = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Data sum. + * @member {"single"|"multi"|undefined} sum + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @instance + */ + Object.defineProperty(Data.prototype, "sum", { + get: $util.oneOfGetter($oneOfFields = ["single", "multi"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Data instance using the specified properties. + * @function create + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.IData=} [properties] Properties to set + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data} Data instance + */ + Data.create = function create(properties) { + return new Data(properties); + }; + + /** + * Encodes the specified Data message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.IData} message Data message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Data.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.single != null && Object.hasOwnProperty.call(message, "single")) + $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.encode(message.single, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.multi != null && Object.hasOwnProperty.call(message, "multi")) + $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.encode(message.multi, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Data message, length delimited. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.IData} message Data message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Data.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Data message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data} Data + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Data.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.single = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.decode(reader, reader.uint32()); + break; + case 2: + message.multi = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Data message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data} Data + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Data.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Data message. + * @function verify + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Data.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.single != null && message.hasOwnProperty("single")) { + properties.sum = 1; + { + var error = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.verify(message.single); + if (error) + return "single." + error; + } + } + if (message.multi != null && message.hasOwnProperty("multi")) { + if (properties.sum === 1) + return "sum: multiple values"; + properties.sum = 1; + { + var error = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.verify(message.multi); + if (error) + return "multi." + error; + } + } + return null; + }; + + /** + * Creates a Data message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data} Data + */ + Data.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data) + return object; + var message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data(); + if (object.single != null) { + if (typeof object.single !== "object") + throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.single: object expected"); + message.single = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.fromObject(object.single); + } + if (object.multi != null) { + if (typeof object.multi !== "object") + throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.multi: object expected"); + message.multi = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.fromObject(object.multi); + } + return message; + }; + + /** + * Creates a plain object from a Data message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data} message Data + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Data.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.single != null && message.hasOwnProperty("single")) { + object.single = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.toObject(message.single, options); + if (options.oneofs) + object.sum = "single"; + } + if (message.multi != null && message.hasOwnProperty("multi")) { + object.multi = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.toObject(message.multi, options); + if (options.oneofs) + object.sum = "multi"; + } + return object; + }; + + /** + * Converts this Data to JSON. + * @function toJSON + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @instance + * @returns {Object.} JSON object + */ + Data.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Data.Single = (function(Single) { + + /** + * Properties of a Single. + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @interface ISingle + * @property {cosmos.tx.signing.v1beta1.SignMode|null} [mode] Single mode + * @property {Uint8Array|null} [signature] Single signature + */ + + /** + * Constructs a new Single. + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @classdesc Represents a Single. + * @implements ISingle + * @constructor + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle=} [properties] Properties to set + */ + function Single(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Single mode. + * @member {cosmos.tx.signing.v1beta1.SignMode} mode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @instance + */ + Single.prototype.mode = 0; + + /** + * Single signature. + * @member {Uint8Array} signature + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @instance + */ + Single.prototype.signature = $util.newBuffer([]); + + /** + * Creates a new Single instance using the specified properties. + * @function create + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle=} [properties] Properties to set + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single} Single instance + */ + Single.create = function create(properties) { + return new Single(properties); + }; + + /** + * Encodes the specified Single message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle} message Single message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Single.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); + if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.signature); + return writer; + }; + + /** + * Encodes the specified Single message, length delimited. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle} message Single message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Single.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Single message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single} Single + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Single.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mode = reader.int32(); + break; + case 2: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Single message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single} Single + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Single.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Single message. + * @function verify + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Single.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + case 127: + break; + } + if (message.signature != null && message.hasOwnProperty("signature")) + if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) + return "signature: buffer expected"; + return null; + }; + + /** + * Creates a Single message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single} Single + */ + Single.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single) + return object; + var message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single(); + switch (object.mode) { + case "SIGN_MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "SIGN_MODE_DIRECT": + case 1: + message.mode = 1; + break; + case "SIGN_MODE_TEXTUAL": + case 2: + message.mode = 2; + break; + case "SIGN_MODE_LEGACY_AMINO_JSON": + case 127: + message.mode = 127; + break; + } + if (object.signature != null) + if (typeof object.signature === "string") + $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); + else if (object.signature.length) + message.signature = object.signature; + return message; + }; + + /** + * Creates a plain object from a Single message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single} message Single + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Single.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.mode = options.enums === String ? "SIGN_MODE_UNSPECIFIED" : 0; + if (options.bytes === String) + object.signature = ""; + else { + object.signature = []; + if (options.bytes !== Array) + object.signature = $util.newBuffer(object.signature); + } + } + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.cosmos.tx.signing.v1beta1.SignMode[message.mode] : message.mode; + if (message.signature != null && message.hasOwnProperty("signature")) + object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; + return object; + }; + + /** + * Converts this Single to JSON. + * @function toJSON + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @instance + * @returns {Object.} JSON object + */ + Single.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Single; + })(Data.Single || {}); + + Data.Multi = (function(Multi) { + + /** + * Properties of a Multi. + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @interface IMulti + * @property {cosmos.crypto.multisig.v1beta1.ICompactBitArray|null} [bitarray] Multi bitarray + * @property {Array.|null} [signatures] Multi signatures + */ + + /** + * Constructs a new Multi. + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @classdesc Represents a Multi. + * @implements IMulti + * @constructor + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti=} [properties] Properties to set + */ + function Multi(properties) { + this.signatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Multi bitarray. + * @member {cosmos.crypto.multisig.v1beta1.ICompactBitArray|null|undefined} bitarray + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @instance + */ + Multi.prototype.bitarray = null; + + /** + * Multi signatures. + * @member {Array.} signatures + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @instance + */ + Multi.prototype.signatures = $util.emptyArray; + + /** + * Creates a new Multi instance using the specified properties. + * @function create + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti=} [properties] Properties to set + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi} Multi instance + */ + Multi.create = function create(properties) { + return new Multi(properties); + }; + + /** + * Encodes the specified Multi message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti} message Multi message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Multi.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bitarray != null && Object.hasOwnProperty.call(message, "bitarray")) + $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.encode(message.bitarray, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.signatures != null && message.signatures.length) + for (var i = 0; i < message.signatures.length; ++i) + $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.encode(message.signatures[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Multi message, length delimited. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti} message Multi message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Multi.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Multi message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi} Multi + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Multi.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bitarray = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.signatures && message.signatures.length)) + message.signatures = []; + message.signatures.push($root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Multi message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi} Multi + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Multi.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Multi message. + * @function verify + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Multi.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bitarray != null && message.hasOwnProperty("bitarray")) { + var error = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.verify(message.bitarray); + if (error) + return "bitarray." + error; + } + if (message.signatures != null && message.hasOwnProperty("signatures")) { + if (!Array.isArray(message.signatures)) + return "signatures: array expected"; + for (var i = 0; i < message.signatures.length; ++i) { + var error = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.verify(message.signatures[i]); + if (error) + return "signatures." + error; + } + } + return null; + }; + + /** + * Creates a Multi message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi} Multi + */ + Multi.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi) + return object; + var message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi(); + if (object.bitarray != null) { + if (typeof object.bitarray !== "object") + throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.bitarray: object expected"); + message.bitarray = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.fromObject(object.bitarray); + } + if (object.signatures) { + if (!Array.isArray(object.signatures)) + throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.signatures: array expected"); + message.signatures = []; + for (var i = 0; i < object.signatures.length; ++i) { + if (typeof object.signatures[i] !== "object") + throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.signatures: object expected"); + message.signatures[i] = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.fromObject(object.signatures[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Multi message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi} message Multi + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Multi.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.signatures = []; + if (options.defaults) + object.bitarray = null; + if (message.bitarray != null && message.hasOwnProperty("bitarray")) + object.bitarray = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.toObject(message.bitarray, options); + if (message.signatures && message.signatures.length) { + object.signatures = []; + for (var j = 0; j < message.signatures.length; ++j) + object.signatures[j] = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.toObject(message.signatures[j], options); + } + return object; + }; + + /** + * Converts this Multi to JSON. + * @function toJSON + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @instance + * @returns {Object.} JSON object + */ + Multi.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Multi; + })(Data.Multi || {}); + + return Data; + })(SignatureDescriptor.Data || {}); + + return SignatureDescriptor; + })(v1beta1.SignatureDescriptor || {}); + + return v1beta1; + })(signing.v1beta1 || {}); + + return signing; + })(tx.signing || {}); + + /** + * Namespace v1beta1. + * @memberof cosmos.tx + * @namespace + */ + + tx.v1beta1 = (function(v1beta1) { + + v1beta1.Tx = (function(Tx) { + + /** + * Properties of a Tx. + * @memberof cosmos.tx.v1beta1 + * @interface ITx + * @property {cosmos.tx.v1beta1.ITxBody|null} [body] Tx body + * @property {cosmos.tx.v1beta1.IAuthInfo|null} [authInfo] Tx authInfo + * @property {Array.|null} [signatures] Tx signatures + */ + + /** + * Constructs a new Tx. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents a Tx. + * @implements ITx + * @constructor + * @param {cosmos.tx.v1beta1.ITx=} [properties] Properties to set + */ + function Tx(properties) { + this.signatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Tx body. + * @member {cosmos.tx.v1beta1.ITxBody|null|undefined} body + * @memberof cosmos.tx.v1beta1.Tx + * @instance + */ + Tx.prototype.body = null; + + /** + * Tx authInfo. + * @member {cosmos.tx.v1beta1.IAuthInfo|null|undefined} authInfo + * @memberof cosmos.tx.v1beta1.Tx + * @instance + */ + Tx.prototype.authInfo = null; + + /** + * Tx signatures. + * @member {Array.} signatures + * @memberof cosmos.tx.v1beta1.Tx + * @instance + */ + Tx.prototype.signatures = $util.emptyArray; + + /** + * Creates a new Tx instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.Tx + * @static + * @param {cosmos.tx.v1beta1.ITx=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.Tx} Tx instance + */ + Tx.create = function create(properties) { + return new Tx(properties); + }; + + /** + * Encodes the specified Tx message. Does not implicitly {@link cosmos.tx.v1beta1.Tx.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.Tx + * @static + * @param {cosmos.tx.v1beta1.ITx} message Tx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tx.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + $root.cosmos.tx.v1beta1.TxBody.encode(message.body, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.authInfo != null && Object.hasOwnProperty.call(message, "authInfo")) + $root.cosmos.tx.v1beta1.AuthInfo.encode(message.authInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.signatures != null && message.signatures.length) + for (var i = 0; i < message.signatures.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.signatures[i]); + return writer; + }; + + /** + * Encodes the specified Tx message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.Tx.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.Tx + * @static + * @param {cosmos.tx.v1beta1.ITx} message Tx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tx.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Tx message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.Tx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.Tx} Tx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tx.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.Tx(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.body = $root.cosmos.tx.v1beta1.TxBody.decode(reader, reader.uint32()); + break; + case 2: + message.authInfo = $root.cosmos.tx.v1beta1.AuthInfo.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.signatures && message.signatures.length)) + message.signatures = []; + message.signatures.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Tx message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.Tx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.Tx} Tx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tx.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Tx message. + * @function verify + * @memberof cosmos.tx.v1beta1.Tx + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Tx.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.body != null && message.hasOwnProperty("body")) { + var error = $root.cosmos.tx.v1beta1.TxBody.verify(message.body); + if (error) + return "body." + error; + } + if (message.authInfo != null && message.hasOwnProperty("authInfo")) { + var error = $root.cosmos.tx.v1beta1.AuthInfo.verify(message.authInfo); + if (error) + return "authInfo." + error; + } + if (message.signatures != null && message.hasOwnProperty("signatures")) { + if (!Array.isArray(message.signatures)) + return "signatures: array expected"; + for (var i = 0; i < message.signatures.length; ++i) + if (!(message.signatures[i] && typeof message.signatures[i].length === "number" || $util.isString(message.signatures[i]))) + return "signatures: buffer[] expected"; + } + return null; + }; + + /** + * Creates a Tx message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.Tx + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.Tx} Tx + */ + Tx.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.Tx) + return object; + var message = new $root.cosmos.tx.v1beta1.Tx(); + if (object.body != null) { + if (typeof object.body !== "object") + throw TypeError(".cosmos.tx.v1beta1.Tx.body: object expected"); + message.body = $root.cosmos.tx.v1beta1.TxBody.fromObject(object.body); + } + if (object.authInfo != null) { + if (typeof object.authInfo !== "object") + throw TypeError(".cosmos.tx.v1beta1.Tx.authInfo: object expected"); + message.authInfo = $root.cosmos.tx.v1beta1.AuthInfo.fromObject(object.authInfo); + } + if (object.signatures) { + if (!Array.isArray(object.signatures)) + throw TypeError(".cosmos.tx.v1beta1.Tx.signatures: array expected"); + message.signatures = []; + for (var i = 0; i < object.signatures.length; ++i) + if (typeof object.signatures[i] === "string") + $util.base64.decode(object.signatures[i], message.signatures[i] = $util.newBuffer($util.base64.length(object.signatures[i])), 0); + else if (object.signatures[i].length) + message.signatures[i] = object.signatures[i]; + } + return message; + }; + + /** + * Creates a plain object from a Tx message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.Tx + * @static + * @param {cosmos.tx.v1beta1.Tx} message Tx + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Tx.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.signatures = []; + if (options.defaults) { + object.body = null; + object.authInfo = null; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = $root.cosmos.tx.v1beta1.TxBody.toObject(message.body, options); + if (message.authInfo != null && message.hasOwnProperty("authInfo")) + object.authInfo = $root.cosmos.tx.v1beta1.AuthInfo.toObject(message.authInfo, options); + if (message.signatures && message.signatures.length) { + object.signatures = []; + for (var j = 0; j < message.signatures.length; ++j) + object.signatures[j] = options.bytes === String ? $util.base64.encode(message.signatures[j], 0, message.signatures[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.signatures[j]) : message.signatures[j]; + } + return object; + }; + + /** + * Converts this Tx to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.Tx + * @instance + * @returns {Object.} JSON object + */ + Tx.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Tx; + })(v1beta1.Tx || {}); + + v1beta1.TxRaw = (function(TxRaw) { + + /** + * Properties of a TxRaw. + * @memberof cosmos.tx.v1beta1 + * @interface ITxRaw + * @property {Uint8Array|null} [bodyBytes] TxRaw bodyBytes + * @property {Uint8Array|null} [authInfoBytes] TxRaw authInfoBytes + * @property {Array.|null} [signatures] TxRaw signatures + */ + + /** + * Constructs a new TxRaw. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents a TxRaw. + * @implements ITxRaw + * @constructor + * @param {cosmos.tx.v1beta1.ITxRaw=} [properties] Properties to set + */ + function TxRaw(properties) { + this.signatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TxRaw bodyBytes. + * @member {Uint8Array} bodyBytes + * @memberof cosmos.tx.v1beta1.TxRaw + * @instance + */ + TxRaw.prototype.bodyBytes = $util.newBuffer([]); + + /** + * TxRaw authInfoBytes. + * @member {Uint8Array} authInfoBytes + * @memberof cosmos.tx.v1beta1.TxRaw + * @instance + */ + TxRaw.prototype.authInfoBytes = $util.newBuffer([]); + + /** + * TxRaw signatures. + * @member {Array.} signatures + * @memberof cosmos.tx.v1beta1.TxRaw + * @instance + */ + TxRaw.prototype.signatures = $util.emptyArray; + + /** + * Creates a new TxRaw instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.TxRaw + * @static + * @param {cosmos.tx.v1beta1.ITxRaw=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.TxRaw} TxRaw instance + */ + TxRaw.create = function create(properties) { + return new TxRaw(properties); + }; + + /** + * Encodes the specified TxRaw message. Does not implicitly {@link cosmos.tx.v1beta1.TxRaw.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.TxRaw + * @static + * @param {cosmos.tx.v1beta1.ITxRaw} message TxRaw message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TxRaw.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bodyBytes != null && Object.hasOwnProperty.call(message, "bodyBytes")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.bodyBytes); + if (message.authInfoBytes != null && Object.hasOwnProperty.call(message, "authInfoBytes")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.authInfoBytes); + if (message.signatures != null && message.signatures.length) + for (var i = 0; i < message.signatures.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.signatures[i]); + return writer; + }; + + /** + * Encodes the specified TxRaw message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.TxRaw.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.TxRaw + * @static + * @param {cosmos.tx.v1beta1.ITxRaw} message TxRaw message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TxRaw.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TxRaw message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.TxRaw + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.TxRaw} TxRaw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TxRaw.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.TxRaw(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bodyBytes = reader.bytes(); + break; + case 2: + message.authInfoBytes = reader.bytes(); + break; + case 3: + if (!(message.signatures && message.signatures.length)) + message.signatures = []; + message.signatures.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TxRaw message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.TxRaw + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.TxRaw} TxRaw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TxRaw.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TxRaw message. + * @function verify + * @memberof cosmos.tx.v1beta1.TxRaw + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TxRaw.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bodyBytes != null && message.hasOwnProperty("bodyBytes")) + if (!(message.bodyBytes && typeof message.bodyBytes.length === "number" || $util.isString(message.bodyBytes))) + return "bodyBytes: buffer expected"; + if (message.authInfoBytes != null && message.hasOwnProperty("authInfoBytes")) + if (!(message.authInfoBytes && typeof message.authInfoBytes.length === "number" || $util.isString(message.authInfoBytes))) + return "authInfoBytes: buffer expected"; + if (message.signatures != null && message.hasOwnProperty("signatures")) { + if (!Array.isArray(message.signatures)) + return "signatures: array expected"; + for (var i = 0; i < message.signatures.length; ++i) + if (!(message.signatures[i] && typeof message.signatures[i].length === "number" || $util.isString(message.signatures[i]))) + return "signatures: buffer[] expected"; + } + return null; + }; + + /** + * Creates a TxRaw message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.TxRaw + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.TxRaw} TxRaw + */ + TxRaw.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.TxRaw) + return object; + var message = new $root.cosmos.tx.v1beta1.TxRaw(); + if (object.bodyBytes != null) + if (typeof object.bodyBytes === "string") + $util.base64.decode(object.bodyBytes, message.bodyBytes = $util.newBuffer($util.base64.length(object.bodyBytes)), 0); + else if (object.bodyBytes.length) + message.bodyBytes = object.bodyBytes; + if (object.authInfoBytes != null) + if (typeof object.authInfoBytes === "string") + $util.base64.decode(object.authInfoBytes, message.authInfoBytes = $util.newBuffer($util.base64.length(object.authInfoBytes)), 0); + else if (object.authInfoBytes.length) + message.authInfoBytes = object.authInfoBytes; + if (object.signatures) { + if (!Array.isArray(object.signatures)) + throw TypeError(".cosmos.tx.v1beta1.TxRaw.signatures: array expected"); + message.signatures = []; + for (var i = 0; i < object.signatures.length; ++i) + if (typeof object.signatures[i] === "string") + $util.base64.decode(object.signatures[i], message.signatures[i] = $util.newBuffer($util.base64.length(object.signatures[i])), 0); + else if (object.signatures[i].length) + message.signatures[i] = object.signatures[i]; + } + return message; + }; + + /** + * Creates a plain object from a TxRaw message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.TxRaw + * @static + * @param {cosmos.tx.v1beta1.TxRaw} message TxRaw + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TxRaw.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.signatures = []; + if (options.defaults) { + if (options.bytes === String) + object.bodyBytes = ""; + else { + object.bodyBytes = []; + if (options.bytes !== Array) + object.bodyBytes = $util.newBuffer(object.bodyBytes); + } + if (options.bytes === String) + object.authInfoBytes = ""; + else { + object.authInfoBytes = []; + if (options.bytes !== Array) + object.authInfoBytes = $util.newBuffer(object.authInfoBytes); + } + } + if (message.bodyBytes != null && message.hasOwnProperty("bodyBytes")) + object.bodyBytes = options.bytes === String ? $util.base64.encode(message.bodyBytes, 0, message.bodyBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.bodyBytes) : message.bodyBytes; + if (message.authInfoBytes != null && message.hasOwnProperty("authInfoBytes")) + object.authInfoBytes = options.bytes === String ? $util.base64.encode(message.authInfoBytes, 0, message.authInfoBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.authInfoBytes) : message.authInfoBytes; + if (message.signatures && message.signatures.length) { + object.signatures = []; + for (var j = 0; j < message.signatures.length; ++j) + object.signatures[j] = options.bytes === String ? $util.base64.encode(message.signatures[j], 0, message.signatures[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.signatures[j]) : message.signatures[j]; + } + return object; + }; + + /** + * Converts this TxRaw to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.TxRaw + * @instance + * @returns {Object.} JSON object + */ + TxRaw.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TxRaw; + })(v1beta1.TxRaw || {}); + + v1beta1.SignDoc = (function(SignDoc) { + + /** + * Properties of a SignDoc. + * @memberof cosmos.tx.v1beta1 + * @interface ISignDoc + * @property {Uint8Array|null} [bodyBytes] SignDoc bodyBytes + * @property {Uint8Array|null} [authInfoBytes] SignDoc authInfoBytes + * @property {string|null} [chainId] SignDoc chainId + * @property {number|Long|null} [accountNumber] SignDoc accountNumber + */ + + /** + * Constructs a new SignDoc. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents a SignDoc. + * @implements ISignDoc + * @constructor + * @param {cosmos.tx.v1beta1.ISignDoc=} [properties] Properties to set + */ + function SignDoc(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SignDoc bodyBytes. + * @member {Uint8Array} bodyBytes + * @memberof cosmos.tx.v1beta1.SignDoc + * @instance + */ + SignDoc.prototype.bodyBytes = $util.newBuffer([]); + + /** + * SignDoc authInfoBytes. + * @member {Uint8Array} authInfoBytes + * @memberof cosmos.tx.v1beta1.SignDoc + * @instance + */ + SignDoc.prototype.authInfoBytes = $util.newBuffer([]); + + /** + * SignDoc chainId. + * @member {string} chainId + * @memberof cosmos.tx.v1beta1.SignDoc + * @instance + */ + SignDoc.prototype.chainId = ""; + + /** + * SignDoc accountNumber. + * @member {number|Long} accountNumber + * @memberof cosmos.tx.v1beta1.SignDoc + * @instance + */ + SignDoc.prototype.accountNumber = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new SignDoc instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.SignDoc + * @static + * @param {cosmos.tx.v1beta1.ISignDoc=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.SignDoc} SignDoc instance + */ + SignDoc.create = function create(properties) { + return new SignDoc(properties); + }; + + /** + * Encodes the specified SignDoc message. Does not implicitly {@link cosmos.tx.v1beta1.SignDoc.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.SignDoc + * @static + * @param {cosmos.tx.v1beta1.ISignDoc} message SignDoc message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignDoc.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bodyBytes != null && Object.hasOwnProperty.call(message, "bodyBytes")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.bodyBytes); + if (message.authInfoBytes != null && Object.hasOwnProperty.call(message, "authInfoBytes")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.authInfoBytes); + if (message.chainId != null && Object.hasOwnProperty.call(message, "chainId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.chainId); + if (message.accountNumber != null && Object.hasOwnProperty.call(message, "accountNumber")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.accountNumber); + return writer; + }; + + /** + * Encodes the specified SignDoc message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.SignDoc.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.SignDoc + * @static + * @param {cosmos.tx.v1beta1.ISignDoc} message SignDoc message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignDoc.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SignDoc message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.SignDoc + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.SignDoc} SignDoc + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignDoc.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.SignDoc(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bodyBytes = reader.bytes(); + break; + case 2: + message.authInfoBytes = reader.bytes(); + break; + case 3: + message.chainId = reader.string(); + break; + case 4: + message.accountNumber = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SignDoc message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.SignDoc + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.SignDoc} SignDoc + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignDoc.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SignDoc message. + * @function verify + * @memberof cosmos.tx.v1beta1.SignDoc + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SignDoc.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bodyBytes != null && message.hasOwnProperty("bodyBytes")) + if (!(message.bodyBytes && typeof message.bodyBytes.length === "number" || $util.isString(message.bodyBytes))) + return "bodyBytes: buffer expected"; + if (message.authInfoBytes != null && message.hasOwnProperty("authInfoBytes")) + if (!(message.authInfoBytes && typeof message.authInfoBytes.length === "number" || $util.isString(message.authInfoBytes))) + return "authInfoBytes: buffer expected"; + if (message.chainId != null && message.hasOwnProperty("chainId")) + if (!$util.isString(message.chainId)) + return "chainId: string expected"; + if (message.accountNumber != null && message.hasOwnProperty("accountNumber")) + if (!$util.isInteger(message.accountNumber) && !(message.accountNumber && $util.isInteger(message.accountNumber.low) && $util.isInteger(message.accountNumber.high))) + return "accountNumber: integer|Long expected"; + return null; + }; + + /** + * Creates a SignDoc message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.SignDoc + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.SignDoc} SignDoc + */ + SignDoc.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.SignDoc) + return object; + var message = new $root.cosmos.tx.v1beta1.SignDoc(); + if (object.bodyBytes != null) + if (typeof object.bodyBytes === "string") + $util.base64.decode(object.bodyBytes, message.bodyBytes = $util.newBuffer($util.base64.length(object.bodyBytes)), 0); + else if (object.bodyBytes.length) + message.bodyBytes = object.bodyBytes; + if (object.authInfoBytes != null) + if (typeof object.authInfoBytes === "string") + $util.base64.decode(object.authInfoBytes, message.authInfoBytes = $util.newBuffer($util.base64.length(object.authInfoBytes)), 0); + else if (object.authInfoBytes.length) + message.authInfoBytes = object.authInfoBytes; + if (object.chainId != null) + message.chainId = String(object.chainId); + if (object.accountNumber != null) + if ($util.Long) + (message.accountNumber = $util.Long.fromValue(object.accountNumber)).unsigned = true; + else if (typeof object.accountNumber === "string") + message.accountNumber = parseInt(object.accountNumber, 10); + else if (typeof object.accountNumber === "number") + message.accountNumber = object.accountNumber; + else if (typeof object.accountNumber === "object") + message.accountNumber = new $util.LongBits(object.accountNumber.low >>> 0, object.accountNumber.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a SignDoc message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.SignDoc + * @static + * @param {cosmos.tx.v1beta1.SignDoc} message SignDoc + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SignDoc.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.bodyBytes = ""; + else { + object.bodyBytes = []; + if (options.bytes !== Array) + object.bodyBytes = $util.newBuffer(object.bodyBytes); + } + if (options.bytes === String) + object.authInfoBytes = ""; + else { + object.authInfoBytes = []; + if (options.bytes !== Array) + object.authInfoBytes = $util.newBuffer(object.authInfoBytes); + } + object.chainId = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.accountNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.accountNumber = options.longs === String ? "0" : 0; + } + if (message.bodyBytes != null && message.hasOwnProperty("bodyBytes")) + object.bodyBytes = options.bytes === String ? $util.base64.encode(message.bodyBytes, 0, message.bodyBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.bodyBytes) : message.bodyBytes; + if (message.authInfoBytes != null && message.hasOwnProperty("authInfoBytes")) + object.authInfoBytes = options.bytes === String ? $util.base64.encode(message.authInfoBytes, 0, message.authInfoBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.authInfoBytes) : message.authInfoBytes; + if (message.chainId != null && message.hasOwnProperty("chainId")) + object.chainId = message.chainId; + if (message.accountNumber != null && message.hasOwnProperty("accountNumber")) + if (typeof message.accountNumber === "number") + object.accountNumber = options.longs === String ? String(message.accountNumber) : message.accountNumber; + else + object.accountNumber = options.longs === String ? $util.Long.prototype.toString.call(message.accountNumber) : options.longs === Number ? new $util.LongBits(message.accountNumber.low >>> 0, message.accountNumber.high >>> 0).toNumber(true) : message.accountNumber; + return object; + }; + + /** + * Converts this SignDoc to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.SignDoc + * @instance + * @returns {Object.} JSON object + */ + SignDoc.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SignDoc; + })(v1beta1.SignDoc || {}); + + v1beta1.TxBody = (function(TxBody) { + + /** + * Properties of a TxBody. + * @memberof cosmos.tx.v1beta1 + * @interface ITxBody + * @property {Array.|null} [messages] TxBody messages + * @property {string|null} [memo] TxBody memo + * @property {number|Long|null} [timeoutHeight] TxBody timeoutHeight + * @property {Array.|null} [extensionOptions] TxBody extensionOptions + * @property {Array.|null} [nonCriticalExtensionOptions] TxBody nonCriticalExtensionOptions + */ + + /** + * Constructs a new TxBody. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents a TxBody. + * @implements ITxBody + * @constructor + * @param {cosmos.tx.v1beta1.ITxBody=} [properties] Properties to set + */ + function TxBody(properties) { + this.messages = []; + this.extensionOptions = []; + this.nonCriticalExtensionOptions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TxBody messages. + * @member {Array.} messages + * @memberof cosmos.tx.v1beta1.TxBody + * @instance + */ + TxBody.prototype.messages = $util.emptyArray; + + /** + * TxBody memo. + * @member {string} memo + * @memberof cosmos.tx.v1beta1.TxBody + * @instance + */ + TxBody.prototype.memo = ""; + + /** + * TxBody timeoutHeight. + * @member {number|Long} timeoutHeight + * @memberof cosmos.tx.v1beta1.TxBody + * @instance + */ + TxBody.prototype.timeoutHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * TxBody extensionOptions. + * @member {Array.} extensionOptions + * @memberof cosmos.tx.v1beta1.TxBody + * @instance + */ + TxBody.prototype.extensionOptions = $util.emptyArray; + + /** + * TxBody nonCriticalExtensionOptions. + * @member {Array.} nonCriticalExtensionOptions + * @memberof cosmos.tx.v1beta1.TxBody + * @instance + */ + TxBody.prototype.nonCriticalExtensionOptions = $util.emptyArray; + + /** + * Creates a new TxBody instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.TxBody + * @static + * @param {cosmos.tx.v1beta1.ITxBody=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.TxBody} TxBody instance + */ + TxBody.create = function create(properties) { + return new TxBody(properties); + }; + + /** + * Encodes the specified TxBody message. Does not implicitly {@link cosmos.tx.v1beta1.TxBody.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.TxBody + * @static + * @param {cosmos.tx.v1beta1.ITxBody} message TxBody message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TxBody.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.protobuf.Any.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.memo != null && Object.hasOwnProperty.call(message, "memo")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.memo); + if (message.timeoutHeight != null && Object.hasOwnProperty.call(message, "timeoutHeight")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.timeoutHeight); + if (message.extensionOptions != null && message.extensionOptions.length) + for (var i = 0; i < message.extensionOptions.length; ++i) + $root.google.protobuf.Any.encode(message.extensionOptions[i], writer.uint32(/* id 1023, wireType 2 =*/8186).fork()).ldelim(); + if (message.nonCriticalExtensionOptions != null && message.nonCriticalExtensionOptions.length) + for (var i = 0; i < message.nonCriticalExtensionOptions.length; ++i) + $root.google.protobuf.Any.encode(message.nonCriticalExtensionOptions[i], writer.uint32(/* id 2047, wireType 2 =*/16378).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TxBody message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.TxBody.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.TxBody + * @static + * @param {cosmos.tx.v1beta1.ITxBody} message TxBody message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TxBody.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TxBody message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.TxBody + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.TxBody} TxBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TxBody.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.TxBody(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + case 2: + message.memo = reader.string(); + break; + case 3: + message.timeoutHeight = reader.uint64(); + break; + case 1023: + if (!(message.extensionOptions && message.extensionOptions.length)) + message.extensionOptions = []; + message.extensionOptions.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + case 2047: + if (!(message.nonCriticalExtensionOptions && message.nonCriticalExtensionOptions.length)) + message.nonCriticalExtensionOptions = []; + message.nonCriticalExtensionOptions.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TxBody message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.TxBody + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.TxBody} TxBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TxBody.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TxBody message. + * @function verify + * @memberof cosmos.tx.v1beta1.TxBody + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TxBody.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.messages[i]); + if (error) + return "messages." + error; + } + } + if (message.memo != null && message.hasOwnProperty("memo")) + if (!$util.isString(message.memo)) + return "memo: string expected"; + if (message.timeoutHeight != null && message.hasOwnProperty("timeoutHeight")) + if (!$util.isInteger(message.timeoutHeight) && !(message.timeoutHeight && $util.isInteger(message.timeoutHeight.low) && $util.isInteger(message.timeoutHeight.high))) + return "timeoutHeight: integer|Long expected"; + if (message.extensionOptions != null && message.hasOwnProperty("extensionOptions")) { + if (!Array.isArray(message.extensionOptions)) + return "extensionOptions: array expected"; + for (var i = 0; i < message.extensionOptions.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.extensionOptions[i]); + if (error) + return "extensionOptions." + error; + } + } + if (message.nonCriticalExtensionOptions != null && message.hasOwnProperty("nonCriticalExtensionOptions")) { + if (!Array.isArray(message.nonCriticalExtensionOptions)) + return "nonCriticalExtensionOptions: array expected"; + for (var i = 0; i < message.nonCriticalExtensionOptions.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.nonCriticalExtensionOptions[i]); + if (error) + return "nonCriticalExtensionOptions." + error; + } + } + return null; + }; + + /** + * Creates a TxBody message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.TxBody + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.TxBody} TxBody + */ + TxBody.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.TxBody) + return object; + var message = new $root.cosmos.tx.v1beta1.TxBody(); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".cosmos.tx.v1beta1.TxBody.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".cosmos.tx.v1beta1.TxBody.messages: object expected"); + message.messages[i] = $root.google.protobuf.Any.fromObject(object.messages[i]); + } + } + if (object.memo != null) + message.memo = String(object.memo); + if (object.timeoutHeight != null) + if ($util.Long) + (message.timeoutHeight = $util.Long.fromValue(object.timeoutHeight)).unsigned = true; + else if (typeof object.timeoutHeight === "string") + message.timeoutHeight = parseInt(object.timeoutHeight, 10); + else if (typeof object.timeoutHeight === "number") + message.timeoutHeight = object.timeoutHeight; + else if (typeof object.timeoutHeight === "object") + message.timeoutHeight = new $util.LongBits(object.timeoutHeight.low >>> 0, object.timeoutHeight.high >>> 0).toNumber(true); + if (object.extensionOptions) { + if (!Array.isArray(object.extensionOptions)) + throw TypeError(".cosmos.tx.v1beta1.TxBody.extensionOptions: array expected"); + message.extensionOptions = []; + for (var i = 0; i < object.extensionOptions.length; ++i) { + if (typeof object.extensionOptions[i] !== "object") + throw TypeError(".cosmos.tx.v1beta1.TxBody.extensionOptions: object expected"); + message.extensionOptions[i] = $root.google.protobuf.Any.fromObject(object.extensionOptions[i]); + } + } + if (object.nonCriticalExtensionOptions) { + if (!Array.isArray(object.nonCriticalExtensionOptions)) + throw TypeError(".cosmos.tx.v1beta1.TxBody.nonCriticalExtensionOptions: array expected"); + message.nonCriticalExtensionOptions = []; + for (var i = 0; i < object.nonCriticalExtensionOptions.length; ++i) { + if (typeof object.nonCriticalExtensionOptions[i] !== "object") + throw TypeError(".cosmos.tx.v1beta1.TxBody.nonCriticalExtensionOptions: object expected"); + message.nonCriticalExtensionOptions[i] = $root.google.protobuf.Any.fromObject(object.nonCriticalExtensionOptions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TxBody message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.TxBody + * @static + * @param {cosmos.tx.v1beta1.TxBody} message TxBody + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TxBody.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.messages = []; + object.extensionOptions = []; + object.nonCriticalExtensionOptions = []; + } + if (options.defaults) { + object.memo = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.timeoutHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timeoutHeight = options.longs === String ? "0" : 0; + } + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.protobuf.Any.toObject(message.messages[j], options); + } + if (message.memo != null && message.hasOwnProperty("memo")) + object.memo = message.memo; + if (message.timeoutHeight != null && message.hasOwnProperty("timeoutHeight")) + if (typeof message.timeoutHeight === "number") + object.timeoutHeight = options.longs === String ? String(message.timeoutHeight) : message.timeoutHeight; + else + object.timeoutHeight = options.longs === String ? $util.Long.prototype.toString.call(message.timeoutHeight) : options.longs === Number ? new $util.LongBits(message.timeoutHeight.low >>> 0, message.timeoutHeight.high >>> 0).toNumber(true) : message.timeoutHeight; + if (message.extensionOptions && message.extensionOptions.length) { + object.extensionOptions = []; + for (var j = 0; j < message.extensionOptions.length; ++j) + object.extensionOptions[j] = $root.google.protobuf.Any.toObject(message.extensionOptions[j], options); + } + if (message.nonCriticalExtensionOptions && message.nonCriticalExtensionOptions.length) { + object.nonCriticalExtensionOptions = []; + for (var j = 0; j < message.nonCriticalExtensionOptions.length; ++j) + object.nonCriticalExtensionOptions[j] = $root.google.protobuf.Any.toObject(message.nonCriticalExtensionOptions[j], options); + } + return object; + }; + + /** + * Converts this TxBody to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.TxBody + * @instance + * @returns {Object.} JSON object + */ + TxBody.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TxBody; + })(v1beta1.TxBody || {}); + + v1beta1.AuthInfo = (function(AuthInfo) { + + /** + * Properties of an AuthInfo. + * @memberof cosmos.tx.v1beta1 + * @interface IAuthInfo + * @property {Array.|null} [signerInfos] AuthInfo signerInfos + * @property {cosmos.tx.v1beta1.IFee|null} [fee] AuthInfo fee + */ + + /** + * Constructs a new AuthInfo. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents an AuthInfo. + * @implements IAuthInfo + * @constructor + * @param {cosmos.tx.v1beta1.IAuthInfo=} [properties] Properties to set + */ + function AuthInfo(properties) { + this.signerInfos = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuthInfo signerInfos. + * @member {Array.} signerInfos + * @memberof cosmos.tx.v1beta1.AuthInfo + * @instance + */ + AuthInfo.prototype.signerInfos = $util.emptyArray; + + /** + * AuthInfo fee. + * @member {cosmos.tx.v1beta1.IFee|null|undefined} fee + * @memberof cosmos.tx.v1beta1.AuthInfo + * @instance + */ + AuthInfo.prototype.fee = null; + + /** + * Creates a new AuthInfo instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.AuthInfo + * @static + * @param {cosmos.tx.v1beta1.IAuthInfo=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.AuthInfo} AuthInfo instance + */ + AuthInfo.create = function create(properties) { + return new AuthInfo(properties); + }; + + /** + * Encodes the specified AuthInfo message. Does not implicitly {@link cosmos.tx.v1beta1.AuthInfo.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.AuthInfo + * @static + * @param {cosmos.tx.v1beta1.IAuthInfo} message AuthInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.signerInfos != null && message.signerInfos.length) + for (var i = 0; i < message.signerInfos.length; ++i) + $root.cosmos.tx.v1beta1.SignerInfo.encode(message.signerInfos[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fee != null && Object.hasOwnProperty.call(message, "fee")) + $root.cosmos.tx.v1beta1.Fee.encode(message.fee, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuthInfo message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.AuthInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.AuthInfo + * @static + * @param {cosmos.tx.v1beta1.IAuthInfo} message AuthInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuthInfo message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.AuthInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.AuthInfo} AuthInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.AuthInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.signerInfos && message.signerInfos.length)) + message.signerInfos = []; + message.signerInfos.push($root.cosmos.tx.v1beta1.SignerInfo.decode(reader, reader.uint32())); + break; + case 2: + message.fee = $root.cosmos.tx.v1beta1.Fee.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuthInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.AuthInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.AuthInfo} AuthInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuthInfo message. + * @function verify + * @memberof cosmos.tx.v1beta1.AuthInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuthInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.signerInfos != null && message.hasOwnProperty("signerInfos")) { + if (!Array.isArray(message.signerInfos)) + return "signerInfos: array expected"; + for (var i = 0; i < message.signerInfos.length; ++i) { + var error = $root.cosmos.tx.v1beta1.SignerInfo.verify(message.signerInfos[i]); + if (error) + return "signerInfos." + error; + } + } + if (message.fee != null && message.hasOwnProperty("fee")) { + var error = $root.cosmos.tx.v1beta1.Fee.verify(message.fee); + if (error) + return "fee." + error; + } + return null; + }; + + /** + * Creates an AuthInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.AuthInfo + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.AuthInfo} AuthInfo + */ + AuthInfo.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.AuthInfo) + return object; + var message = new $root.cosmos.tx.v1beta1.AuthInfo(); + if (object.signerInfos) { + if (!Array.isArray(object.signerInfos)) + throw TypeError(".cosmos.tx.v1beta1.AuthInfo.signerInfos: array expected"); + message.signerInfos = []; + for (var i = 0; i < object.signerInfos.length; ++i) { + if (typeof object.signerInfos[i] !== "object") + throw TypeError(".cosmos.tx.v1beta1.AuthInfo.signerInfos: object expected"); + message.signerInfos[i] = $root.cosmos.tx.v1beta1.SignerInfo.fromObject(object.signerInfos[i]); + } + } + if (object.fee != null) { + if (typeof object.fee !== "object") + throw TypeError(".cosmos.tx.v1beta1.AuthInfo.fee: object expected"); + message.fee = $root.cosmos.tx.v1beta1.Fee.fromObject(object.fee); + } + return message; + }; + + /** + * Creates a plain object from an AuthInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.AuthInfo + * @static + * @param {cosmos.tx.v1beta1.AuthInfo} message AuthInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuthInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.signerInfos = []; + if (options.defaults) + object.fee = null; + if (message.signerInfos && message.signerInfos.length) { + object.signerInfos = []; + for (var j = 0; j < message.signerInfos.length; ++j) + object.signerInfos[j] = $root.cosmos.tx.v1beta1.SignerInfo.toObject(message.signerInfos[j], options); + } + if (message.fee != null && message.hasOwnProperty("fee")) + object.fee = $root.cosmos.tx.v1beta1.Fee.toObject(message.fee, options); + return object; + }; + + /** + * Converts this AuthInfo to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.AuthInfo + * @instance + * @returns {Object.} JSON object + */ + AuthInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AuthInfo; + })(v1beta1.AuthInfo || {}); + + v1beta1.SignerInfo = (function(SignerInfo) { + + /** + * Properties of a SignerInfo. + * @memberof cosmos.tx.v1beta1 + * @interface ISignerInfo + * @property {google.protobuf.IAny|null} [publicKey] SignerInfo publicKey + * @property {cosmos.tx.v1beta1.IModeInfo|null} [modeInfo] SignerInfo modeInfo + * @property {number|Long|null} [sequence] SignerInfo sequence + */ + + /** + * Constructs a new SignerInfo. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents a SignerInfo. + * @implements ISignerInfo + * @constructor + * @param {cosmos.tx.v1beta1.ISignerInfo=} [properties] Properties to set + */ + function SignerInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SignerInfo publicKey. + * @member {google.protobuf.IAny|null|undefined} publicKey + * @memberof cosmos.tx.v1beta1.SignerInfo + * @instance + */ + SignerInfo.prototype.publicKey = null; + + /** + * SignerInfo modeInfo. + * @member {cosmos.tx.v1beta1.IModeInfo|null|undefined} modeInfo + * @memberof cosmos.tx.v1beta1.SignerInfo + * @instance + */ + SignerInfo.prototype.modeInfo = null; + + /** + * SignerInfo sequence. + * @member {number|Long} sequence + * @memberof cosmos.tx.v1beta1.SignerInfo + * @instance + */ + SignerInfo.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new SignerInfo instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.SignerInfo + * @static + * @param {cosmos.tx.v1beta1.ISignerInfo=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.SignerInfo} SignerInfo instance + */ + SignerInfo.create = function create(properties) { + return new SignerInfo(properties); + }; + + /** + * Encodes the specified SignerInfo message. Does not implicitly {@link cosmos.tx.v1beta1.SignerInfo.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.SignerInfo + * @static + * @param {cosmos.tx.v1beta1.ISignerInfo} message SignerInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignerInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) + $root.google.protobuf.Any.encode(message.publicKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.modeInfo != null && Object.hasOwnProperty.call(message, "modeInfo")) + $root.cosmos.tx.v1beta1.ModeInfo.encode(message.modeInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.sequence); + return writer; + }; + + /** + * Encodes the specified SignerInfo message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.SignerInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.SignerInfo + * @static + * @param {cosmos.tx.v1beta1.ISignerInfo} message SignerInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignerInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SignerInfo message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.SignerInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.SignerInfo} SignerInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignerInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.SignerInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publicKey = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 2: + message.modeInfo = $root.cosmos.tx.v1beta1.ModeInfo.decode(reader, reader.uint32()); + break; + case 3: + message.sequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SignerInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.SignerInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.SignerInfo} SignerInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignerInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SignerInfo message. + * @function verify + * @memberof cosmos.tx.v1beta1.SignerInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SignerInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.publicKey != null && message.hasOwnProperty("publicKey")) { + var error = $root.google.protobuf.Any.verify(message.publicKey); + if (error) + return "publicKey." + error; + } + if (message.modeInfo != null && message.hasOwnProperty("modeInfo")) { + var error = $root.cosmos.tx.v1beta1.ModeInfo.verify(message.modeInfo); + if (error) + return "modeInfo." + error; + } + if (message.sequence != null && message.hasOwnProperty("sequence")) + if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) + return "sequence: integer|Long expected"; + return null; + }; + + /** + * Creates a SignerInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.SignerInfo + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.SignerInfo} SignerInfo + */ + SignerInfo.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.SignerInfo) + return object; + var message = new $root.cosmos.tx.v1beta1.SignerInfo(); + if (object.publicKey != null) { + if (typeof object.publicKey !== "object") + throw TypeError(".cosmos.tx.v1beta1.SignerInfo.publicKey: object expected"); + message.publicKey = $root.google.protobuf.Any.fromObject(object.publicKey); + } + if (object.modeInfo != null) { + if (typeof object.modeInfo !== "object") + throw TypeError(".cosmos.tx.v1beta1.SignerInfo.modeInfo: object expected"); + message.modeInfo = $root.cosmos.tx.v1beta1.ModeInfo.fromObject(object.modeInfo); + } + if (object.sequence != null) + if ($util.Long) + (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; + else if (typeof object.sequence === "string") + message.sequence = parseInt(object.sequence, 10); + else if (typeof object.sequence === "number") + message.sequence = object.sequence; + else if (typeof object.sequence === "object") + message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a SignerInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.SignerInfo + * @static + * @param {cosmos.tx.v1beta1.SignerInfo} message SignerInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SignerInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.publicKey = null; + object.modeInfo = null; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sequence = options.longs === String ? "0" : 0; + } + if (message.publicKey != null && message.hasOwnProperty("publicKey")) + object.publicKey = $root.google.protobuf.Any.toObject(message.publicKey, options); + if (message.modeInfo != null && message.hasOwnProperty("modeInfo")) + object.modeInfo = $root.cosmos.tx.v1beta1.ModeInfo.toObject(message.modeInfo, options); + if (message.sequence != null && message.hasOwnProperty("sequence")) + if (typeof message.sequence === "number") + object.sequence = options.longs === String ? String(message.sequence) : message.sequence; + else + object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; + return object; + }; + + /** + * Converts this SignerInfo to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.SignerInfo + * @instance + * @returns {Object.} JSON object + */ + SignerInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SignerInfo; + })(v1beta1.SignerInfo || {}); + + v1beta1.ModeInfo = (function(ModeInfo) { + + /** + * Properties of a ModeInfo. + * @memberof cosmos.tx.v1beta1 + * @interface IModeInfo + * @property {cosmos.tx.v1beta1.ModeInfo.ISingle|null} [single] ModeInfo single + * @property {cosmos.tx.v1beta1.ModeInfo.IMulti|null} [multi] ModeInfo multi + */ + + /** + * Constructs a new ModeInfo. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents a ModeInfo. + * @implements IModeInfo + * @constructor + * @param {cosmos.tx.v1beta1.IModeInfo=} [properties] Properties to set + */ + function ModeInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModeInfo single. + * @member {cosmos.tx.v1beta1.ModeInfo.ISingle|null|undefined} single + * @memberof cosmos.tx.v1beta1.ModeInfo + * @instance + */ + ModeInfo.prototype.single = null; + + /** + * ModeInfo multi. + * @member {cosmos.tx.v1beta1.ModeInfo.IMulti|null|undefined} multi + * @memberof cosmos.tx.v1beta1.ModeInfo + * @instance + */ + ModeInfo.prototype.multi = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ModeInfo sum. + * @member {"single"|"multi"|undefined} sum + * @memberof cosmos.tx.v1beta1.ModeInfo + * @instance + */ + Object.defineProperty(ModeInfo.prototype, "sum", { + get: $util.oneOfGetter($oneOfFields = ["single", "multi"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ModeInfo instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.ModeInfo + * @static + * @param {cosmos.tx.v1beta1.IModeInfo=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.ModeInfo} ModeInfo instance + */ + ModeInfo.create = function create(properties) { + return new ModeInfo(properties); + }; + + /** + * Encodes the specified ModeInfo message. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.ModeInfo + * @static + * @param {cosmos.tx.v1beta1.IModeInfo} message ModeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.single != null && Object.hasOwnProperty.call(message, "single")) + $root.cosmos.tx.v1beta1.ModeInfo.Single.encode(message.single, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.multi != null && Object.hasOwnProperty.call(message, "multi")) + $root.cosmos.tx.v1beta1.ModeInfo.Multi.encode(message.multi, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ModeInfo message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.ModeInfo + * @static + * @param {cosmos.tx.v1beta1.IModeInfo} message ModeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModeInfo message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.ModeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.ModeInfo} ModeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.ModeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.single = $root.cosmos.tx.v1beta1.ModeInfo.Single.decode(reader, reader.uint32()); + break; + case 2: + message.multi = $root.cosmos.tx.v1beta1.ModeInfo.Multi.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.ModeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.ModeInfo} ModeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModeInfo message. + * @function verify + * @memberof cosmos.tx.v1beta1.ModeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.single != null && message.hasOwnProperty("single")) { + properties.sum = 1; + { + var error = $root.cosmos.tx.v1beta1.ModeInfo.Single.verify(message.single); + if (error) + return "single." + error; + } + } + if (message.multi != null && message.hasOwnProperty("multi")) { + if (properties.sum === 1) + return "sum: multiple values"; + properties.sum = 1; + { + var error = $root.cosmos.tx.v1beta1.ModeInfo.Multi.verify(message.multi); + if (error) + return "multi." + error; + } + } + return null; + }; + + /** + * Creates a ModeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.ModeInfo + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.ModeInfo} ModeInfo + */ + ModeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.ModeInfo) + return object; + var message = new $root.cosmos.tx.v1beta1.ModeInfo(); + if (object.single != null) { + if (typeof object.single !== "object") + throw TypeError(".cosmos.tx.v1beta1.ModeInfo.single: object expected"); + message.single = $root.cosmos.tx.v1beta1.ModeInfo.Single.fromObject(object.single); + } + if (object.multi != null) { + if (typeof object.multi !== "object") + throw TypeError(".cosmos.tx.v1beta1.ModeInfo.multi: object expected"); + message.multi = $root.cosmos.tx.v1beta1.ModeInfo.Multi.fromObject(object.multi); + } + return message; + }; + + /** + * Creates a plain object from a ModeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.ModeInfo + * @static + * @param {cosmos.tx.v1beta1.ModeInfo} message ModeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.single != null && message.hasOwnProperty("single")) { + object.single = $root.cosmos.tx.v1beta1.ModeInfo.Single.toObject(message.single, options); + if (options.oneofs) + object.sum = "single"; + } + if (message.multi != null && message.hasOwnProperty("multi")) { + object.multi = $root.cosmos.tx.v1beta1.ModeInfo.Multi.toObject(message.multi, options); + if (options.oneofs) + object.sum = "multi"; + } + return object; + }; + + /** + * Converts this ModeInfo to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.ModeInfo + * @instance + * @returns {Object.} JSON object + */ + ModeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + ModeInfo.Single = (function(Single) { + + /** + * Properties of a Single. + * @memberof cosmos.tx.v1beta1.ModeInfo + * @interface ISingle + * @property {cosmos.tx.signing.v1beta1.SignMode|null} [mode] Single mode + */ + + /** + * Constructs a new Single. + * @memberof cosmos.tx.v1beta1.ModeInfo + * @classdesc Represents a Single. + * @implements ISingle + * @constructor + * @param {cosmos.tx.v1beta1.ModeInfo.ISingle=} [properties] Properties to set + */ + function Single(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Single mode. + * @member {cosmos.tx.signing.v1beta1.SignMode} mode + * @memberof cosmos.tx.v1beta1.ModeInfo.Single + * @instance + */ + Single.prototype.mode = 0; + + /** + * Creates a new Single instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.ModeInfo.Single + * @static + * @param {cosmos.tx.v1beta1.ModeInfo.ISingle=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.ModeInfo.Single} Single instance + */ + Single.create = function create(properties) { + return new Single(properties); + }; + + /** + * Encodes the specified Single message. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.Single.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.ModeInfo.Single + * @static + * @param {cosmos.tx.v1beta1.ModeInfo.ISingle} message Single message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Single.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); + return writer; + }; + + /** + * Encodes the specified Single message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.Single.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.ModeInfo.Single + * @static + * @param {cosmos.tx.v1beta1.ModeInfo.ISingle} message Single message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Single.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Single message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.ModeInfo.Single + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.ModeInfo.Single} Single + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Single.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.ModeInfo.Single(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mode = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Single message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.ModeInfo.Single + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.ModeInfo.Single} Single + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Single.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Single message. + * @function verify + * @memberof cosmos.tx.v1beta1.ModeInfo.Single + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Single.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + case 127: + break; + } + return null; + }; + + /** + * Creates a Single message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.ModeInfo.Single + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.ModeInfo.Single} Single + */ + Single.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.ModeInfo.Single) + return object; + var message = new $root.cosmos.tx.v1beta1.ModeInfo.Single(); + switch (object.mode) { + case "SIGN_MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "SIGN_MODE_DIRECT": + case 1: + message.mode = 1; + break; + case "SIGN_MODE_TEXTUAL": + case 2: + message.mode = 2; + break; + case "SIGN_MODE_LEGACY_AMINO_JSON": + case 127: + message.mode = 127; + break; + } + return message; + }; + + /** + * Creates a plain object from a Single message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.ModeInfo.Single + * @static + * @param {cosmos.tx.v1beta1.ModeInfo.Single} message Single + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Single.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.mode = options.enums === String ? "SIGN_MODE_UNSPECIFIED" : 0; + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.cosmos.tx.signing.v1beta1.SignMode[message.mode] : message.mode; + return object; + }; + + /** + * Converts this Single to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.ModeInfo.Single + * @instance + * @returns {Object.} JSON object + */ + Single.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Single; + })(ModeInfo.Single || {}); + + ModeInfo.Multi = (function(Multi) { + + /** + * Properties of a Multi. + * @memberof cosmos.tx.v1beta1.ModeInfo + * @interface IMulti + * @property {cosmos.crypto.multisig.v1beta1.ICompactBitArray|null} [bitarray] Multi bitarray + * @property {Array.|null} [modeInfos] Multi modeInfos + */ + + /** + * Constructs a new Multi. + * @memberof cosmos.tx.v1beta1.ModeInfo + * @classdesc Represents a Multi. + * @implements IMulti + * @constructor + * @param {cosmos.tx.v1beta1.ModeInfo.IMulti=} [properties] Properties to set + */ + function Multi(properties) { + this.modeInfos = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Multi bitarray. + * @member {cosmos.crypto.multisig.v1beta1.ICompactBitArray|null|undefined} bitarray + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @instance + */ + Multi.prototype.bitarray = null; + + /** + * Multi modeInfos. + * @member {Array.} modeInfos + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @instance + */ + Multi.prototype.modeInfos = $util.emptyArray; + + /** + * Creates a new Multi instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @static + * @param {cosmos.tx.v1beta1.ModeInfo.IMulti=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.ModeInfo.Multi} Multi instance + */ + Multi.create = function create(properties) { + return new Multi(properties); + }; + + /** + * Encodes the specified Multi message. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.Multi.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @static + * @param {cosmos.tx.v1beta1.ModeInfo.IMulti} message Multi message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Multi.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bitarray != null && Object.hasOwnProperty.call(message, "bitarray")) + $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.encode(message.bitarray, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.modeInfos != null && message.modeInfos.length) + for (var i = 0; i < message.modeInfos.length; ++i) + $root.cosmos.tx.v1beta1.ModeInfo.encode(message.modeInfos[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Multi message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.Multi.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @static + * @param {cosmos.tx.v1beta1.ModeInfo.IMulti} message Multi message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Multi.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Multi message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.ModeInfo.Multi} Multi + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Multi.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.ModeInfo.Multi(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bitarray = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.modeInfos && message.modeInfos.length)) + message.modeInfos = []; + message.modeInfos.push($root.cosmos.tx.v1beta1.ModeInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Multi message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.ModeInfo.Multi} Multi + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Multi.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Multi message. + * @function verify + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Multi.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bitarray != null && message.hasOwnProperty("bitarray")) { + var error = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.verify(message.bitarray); + if (error) + return "bitarray." + error; + } + if (message.modeInfos != null && message.hasOwnProperty("modeInfos")) { + if (!Array.isArray(message.modeInfos)) + return "modeInfos: array expected"; + for (var i = 0; i < message.modeInfos.length; ++i) { + var error = $root.cosmos.tx.v1beta1.ModeInfo.verify(message.modeInfos[i]); + if (error) + return "modeInfos." + error; + } + } + return null; + }; + + /** + * Creates a Multi message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.ModeInfo.Multi} Multi + */ + Multi.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.ModeInfo.Multi) + return object; + var message = new $root.cosmos.tx.v1beta1.ModeInfo.Multi(); + if (object.bitarray != null) { + if (typeof object.bitarray !== "object") + throw TypeError(".cosmos.tx.v1beta1.ModeInfo.Multi.bitarray: object expected"); + message.bitarray = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.fromObject(object.bitarray); + } + if (object.modeInfos) { + if (!Array.isArray(object.modeInfos)) + throw TypeError(".cosmos.tx.v1beta1.ModeInfo.Multi.modeInfos: array expected"); + message.modeInfos = []; + for (var i = 0; i < object.modeInfos.length; ++i) { + if (typeof object.modeInfos[i] !== "object") + throw TypeError(".cosmos.tx.v1beta1.ModeInfo.Multi.modeInfos: object expected"); + message.modeInfos[i] = $root.cosmos.tx.v1beta1.ModeInfo.fromObject(object.modeInfos[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Multi message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @static + * @param {cosmos.tx.v1beta1.ModeInfo.Multi} message Multi + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Multi.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.modeInfos = []; + if (options.defaults) + object.bitarray = null; + if (message.bitarray != null && message.hasOwnProperty("bitarray")) + object.bitarray = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.toObject(message.bitarray, options); + if (message.modeInfos && message.modeInfos.length) { + object.modeInfos = []; + for (var j = 0; j < message.modeInfos.length; ++j) + object.modeInfos[j] = $root.cosmos.tx.v1beta1.ModeInfo.toObject(message.modeInfos[j], options); + } + return object; + }; + + /** + * Converts this Multi to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @instance + * @returns {Object.} JSON object + */ + Multi.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Multi; + })(ModeInfo.Multi || {}); + + return ModeInfo; + })(v1beta1.ModeInfo || {}); + + v1beta1.Fee = (function(Fee) { + + /** + * Properties of a Fee. + * @memberof cosmos.tx.v1beta1 + * @interface IFee + * @property {Array.|null} [amount] Fee amount + * @property {number|Long|null} [gasLimit] Fee gasLimit + * @property {string|null} [payer] Fee payer + * @property {string|null} [granter] Fee granter + */ + + /** + * Constructs a new Fee. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents a Fee. + * @implements IFee + * @constructor + * @param {cosmos.tx.v1beta1.IFee=} [properties] Properties to set + */ + function Fee(properties) { + this.amount = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Fee amount. + * @member {Array.} amount + * @memberof cosmos.tx.v1beta1.Fee + * @instance + */ + Fee.prototype.amount = $util.emptyArray; + + /** + * Fee gasLimit. + * @member {number|Long} gasLimit + * @memberof cosmos.tx.v1beta1.Fee + * @instance + */ + Fee.prototype.gasLimit = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Fee payer. + * @member {string} payer + * @memberof cosmos.tx.v1beta1.Fee + * @instance + */ + Fee.prototype.payer = ""; + + /** + * Fee granter. + * @member {string} granter + * @memberof cosmos.tx.v1beta1.Fee + * @instance + */ + Fee.prototype.granter = ""; + + /** + * Creates a new Fee instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.Fee + * @static + * @param {cosmos.tx.v1beta1.IFee=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.Fee} Fee instance + */ + Fee.create = function create(properties) { + return new Fee(properties); + }; + + /** + * Encodes the specified Fee message. Does not implicitly {@link cosmos.tx.v1beta1.Fee.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.Fee + * @static + * @param {cosmos.tx.v1beta1.IFee} message Fee message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fee.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.amount != null && message.amount.length) + for (var i = 0; i < message.amount.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.amount[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.gasLimit != null && Object.hasOwnProperty.call(message, "gasLimit")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.gasLimit); + if (message.payer != null && Object.hasOwnProperty.call(message, "payer")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.payer); + if (message.granter != null && Object.hasOwnProperty.call(message, "granter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.granter); + return writer; + }; + + /** + * Encodes the specified Fee message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.Fee.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.Fee + * @static + * @param {cosmos.tx.v1beta1.IFee} message Fee message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fee.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Fee message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.Fee + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.Fee} Fee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fee.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.Fee(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.amount && message.amount.length)) + message.amount = []; + message.amount.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + case 2: + message.gasLimit = reader.uint64(); + break; + case 3: + message.payer = reader.string(); + break; + case 4: + message.granter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Fee message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.Fee + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.Fee} Fee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fee.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Fee message. + * @function verify + * @memberof cosmos.tx.v1beta1.Fee + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Fee.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + if (!Array.isArray(message.amount)) + return "amount: array expected"; + for (var i = 0; i < message.amount.length; ++i) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.amount[i]); + if (error) + return "amount." + error; + } + } + if (message.gasLimit != null && message.hasOwnProperty("gasLimit")) + if (!$util.isInteger(message.gasLimit) && !(message.gasLimit && $util.isInteger(message.gasLimit.low) && $util.isInteger(message.gasLimit.high))) + return "gasLimit: integer|Long expected"; + if (message.payer != null && message.hasOwnProperty("payer")) + if (!$util.isString(message.payer)) + return "payer: string expected"; + if (message.granter != null && message.hasOwnProperty("granter")) + if (!$util.isString(message.granter)) + return "granter: string expected"; + return null; + }; + + /** + * Creates a Fee message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.Fee + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.Fee} Fee + */ + Fee.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.Fee) + return object; + var message = new $root.cosmos.tx.v1beta1.Fee(); + if (object.amount) { + if (!Array.isArray(object.amount)) + throw TypeError(".cosmos.tx.v1beta1.Fee.amount: array expected"); + message.amount = []; + for (var i = 0; i < object.amount.length; ++i) { + if (typeof object.amount[i] !== "object") + throw TypeError(".cosmos.tx.v1beta1.Fee.amount: object expected"); + message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]); + } + } + if (object.gasLimit != null) + if ($util.Long) + (message.gasLimit = $util.Long.fromValue(object.gasLimit)).unsigned = true; + else if (typeof object.gasLimit === "string") + message.gasLimit = parseInt(object.gasLimit, 10); + else if (typeof object.gasLimit === "number") + message.gasLimit = object.gasLimit; + else if (typeof object.gasLimit === "object") + message.gasLimit = new $util.LongBits(object.gasLimit.low >>> 0, object.gasLimit.high >>> 0).toNumber(true); + if (object.payer != null) + message.payer = String(object.payer); + if (object.granter != null) + message.granter = String(object.granter); + return message; + }; + + /** + * Creates a plain object from a Fee message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.Fee + * @static + * @param {cosmos.tx.v1beta1.Fee} message Fee + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Fee.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.amount = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.gasLimit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.gasLimit = options.longs === String ? "0" : 0; + object.payer = ""; + object.granter = ""; + } + if (message.amount && message.amount.length) { + object.amount = []; + for (var j = 0; j < message.amount.length; ++j) + object.amount[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.amount[j], options); + } + if (message.gasLimit != null && message.hasOwnProperty("gasLimit")) + if (typeof message.gasLimit === "number") + object.gasLimit = options.longs === String ? String(message.gasLimit) : message.gasLimit; + else + object.gasLimit = options.longs === String ? $util.Long.prototype.toString.call(message.gasLimit) : options.longs === Number ? new $util.LongBits(message.gasLimit.low >>> 0, message.gasLimit.high >>> 0).toNumber(true) : message.gasLimit; + if (message.payer != null && message.hasOwnProperty("payer")) + object.payer = message.payer; + if (message.granter != null && message.hasOwnProperty("granter")) + object.granter = message.granter; + return object; + }; + + /** + * Converts this Fee to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.Fee + * @instance + * @returns {Object.} JSON object + */ + Fee.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Fee; + })(v1beta1.Fee || {}); + + return v1beta1; + })(tx.v1beta1 || {}); + + return tx; + })(cosmos.tx || {}); + + /** + * Namespace crisis. + * @memberof cosmos + * @namespace + */ + + cosmos.crisis = (function(crisis) { + + /** + * Namespace v1beta1. + * @memberof cosmos.crisis + * @namespace + */ + + crisis.v1beta1 = (function(v1beta1) { + + v1beta1.Msg = (function(Msg) { + + /** + * Constructs a new Msg service. + * @memberof cosmos.crisis.v1beta1 + * @classdesc Represents a Msg + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Msg(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; + + /** + * Creates new Msg service using the specified rpc implementation. + * @function create + * @memberof cosmos.crisis.v1beta1.Msg + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Msg} RPC service. Useful where requests and/or responses are streamed. + */ + Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.crisis.v1beta1.Msg#verifyInvariant}. + * @memberof cosmos.crisis.v1beta1.Msg + * @typedef VerifyInvariantCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariantResponse} [response] MsgVerifyInvariantResponse + */ + + /** + * Calls VerifyInvariant. + * @function verifyInvariant + * @memberof cosmos.crisis.v1beta1.Msg + * @instance + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariant} request MsgVerifyInvariant message or plain object + * @param {cosmos.crisis.v1beta1.Msg.VerifyInvariantCallback} callback Node-style callback called with the error, if any, and MsgVerifyInvariantResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.verifyInvariant = function verifyInvariant(request, callback) { + return this.rpcCall(verifyInvariant, $root.cosmos.crisis.v1beta1.MsgVerifyInvariant, $root.cosmos.crisis.v1beta1.MsgVerifyInvariantResponse, request, callback); + }, "name", { value: "VerifyInvariant" }); + + /** + * Calls VerifyInvariant. + * @function verifyInvariant + * @memberof cosmos.crisis.v1beta1.Msg + * @instance + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariant} request MsgVerifyInvariant message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Msg; + })(v1beta1.Msg || {}); + + v1beta1.MsgVerifyInvariant = (function(MsgVerifyInvariant) { + + /** + * Properties of a MsgVerifyInvariant. + * @memberof cosmos.crisis.v1beta1 + * @interface IMsgVerifyInvariant + * @property {string|null} [sender] MsgVerifyInvariant sender + * @property {string|null} [invariantModuleName] MsgVerifyInvariant invariantModuleName + * @property {string|null} [invariantRoute] MsgVerifyInvariant invariantRoute + */ + + /** + * Constructs a new MsgVerifyInvariant. + * @memberof cosmos.crisis.v1beta1 + * @classdesc Represents a MsgVerifyInvariant. + * @implements IMsgVerifyInvariant + * @constructor + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariant=} [properties] Properties to set + */ + function MsgVerifyInvariant(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgVerifyInvariant sender. + * @member {string} sender + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @instance + */ + MsgVerifyInvariant.prototype.sender = ""; + + /** + * MsgVerifyInvariant invariantModuleName. + * @member {string} invariantModuleName + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @instance + */ + MsgVerifyInvariant.prototype.invariantModuleName = ""; + + /** + * MsgVerifyInvariant invariantRoute. + * @member {string} invariantRoute + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @instance + */ + MsgVerifyInvariant.prototype.invariantRoute = ""; + + /** + * Creates a new MsgVerifyInvariant instance using the specified properties. + * @function create + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @static + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariant=} [properties] Properties to set + * @returns {cosmos.crisis.v1beta1.MsgVerifyInvariant} MsgVerifyInvariant instance + */ + MsgVerifyInvariant.create = function create(properties) { + return new MsgVerifyInvariant(properties); + }; + + /** + * Encodes the specified MsgVerifyInvariant message. Does not implicitly {@link cosmos.crisis.v1beta1.MsgVerifyInvariant.verify|verify} messages. + * @function encode + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @static + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariant} message MsgVerifyInvariant message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgVerifyInvariant.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sender != null && Object.hasOwnProperty.call(message, "sender")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sender); + if (message.invariantModuleName != null && Object.hasOwnProperty.call(message, "invariantModuleName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.invariantModuleName); + if (message.invariantRoute != null && Object.hasOwnProperty.call(message, "invariantRoute")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.invariantRoute); + return writer; + }; + + /** + * Encodes the specified MsgVerifyInvariant message, length delimited. Does not implicitly {@link cosmos.crisis.v1beta1.MsgVerifyInvariant.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @static + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariant} message MsgVerifyInvariant message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgVerifyInvariant.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgVerifyInvariant message from the specified reader or buffer. + * @function decode + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.crisis.v1beta1.MsgVerifyInvariant} MsgVerifyInvariant + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgVerifyInvariant.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.crisis.v1beta1.MsgVerifyInvariant(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.invariantModuleName = reader.string(); + break; + case 3: + message.invariantRoute = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgVerifyInvariant message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.crisis.v1beta1.MsgVerifyInvariant} MsgVerifyInvariant + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgVerifyInvariant.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgVerifyInvariant message. + * @function verify + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgVerifyInvariant.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sender != null && message.hasOwnProperty("sender")) + if (!$util.isString(message.sender)) + return "sender: string expected"; + if (message.invariantModuleName != null && message.hasOwnProperty("invariantModuleName")) + if (!$util.isString(message.invariantModuleName)) + return "invariantModuleName: string expected"; + if (message.invariantRoute != null && message.hasOwnProperty("invariantRoute")) + if (!$util.isString(message.invariantRoute)) + return "invariantRoute: string expected"; + return null; + }; + + /** + * Creates a MsgVerifyInvariant message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @static + * @param {Object.} object Plain object + * @returns {cosmos.crisis.v1beta1.MsgVerifyInvariant} MsgVerifyInvariant + */ + MsgVerifyInvariant.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.crisis.v1beta1.MsgVerifyInvariant) + return object; + var message = new $root.cosmos.crisis.v1beta1.MsgVerifyInvariant(); + if (object.sender != null) + message.sender = String(object.sender); + if (object.invariantModuleName != null) + message.invariantModuleName = String(object.invariantModuleName); + if (object.invariantRoute != null) + message.invariantRoute = String(object.invariantRoute); + return message; + }; + + /** + * Creates a plain object from a MsgVerifyInvariant message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @static + * @param {cosmos.crisis.v1beta1.MsgVerifyInvariant} message MsgVerifyInvariant + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgVerifyInvariant.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sender = ""; + object.invariantModuleName = ""; + object.invariantRoute = ""; + } + if (message.sender != null && message.hasOwnProperty("sender")) + object.sender = message.sender; + if (message.invariantModuleName != null && message.hasOwnProperty("invariantModuleName")) + object.invariantModuleName = message.invariantModuleName; + if (message.invariantRoute != null && message.hasOwnProperty("invariantRoute")) + object.invariantRoute = message.invariantRoute; + return object; + }; + + /** + * Converts this MsgVerifyInvariant to JSON. + * @function toJSON + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @instance + * @returns {Object.} JSON object + */ + MsgVerifyInvariant.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgVerifyInvariant; + })(v1beta1.MsgVerifyInvariant || {}); + + v1beta1.MsgVerifyInvariantResponse = (function(MsgVerifyInvariantResponse) { + + /** + * Properties of a MsgVerifyInvariantResponse. + * @memberof cosmos.crisis.v1beta1 + * @interface IMsgVerifyInvariantResponse + */ + + /** + * Constructs a new MsgVerifyInvariantResponse. + * @memberof cosmos.crisis.v1beta1 + * @classdesc Represents a MsgVerifyInvariantResponse. + * @implements IMsgVerifyInvariantResponse + * @constructor + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariantResponse=} [properties] Properties to set + */ + function MsgVerifyInvariantResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgVerifyInvariantResponse instance using the specified properties. + * @function create + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse + * @static + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariantResponse=} [properties] Properties to set + * @returns {cosmos.crisis.v1beta1.MsgVerifyInvariantResponse} MsgVerifyInvariantResponse instance + */ + MsgVerifyInvariantResponse.create = function create(properties) { + return new MsgVerifyInvariantResponse(properties); + }; + + /** + * Encodes the specified MsgVerifyInvariantResponse message. Does not implicitly {@link cosmos.crisis.v1beta1.MsgVerifyInvariantResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse + * @static + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariantResponse} message MsgVerifyInvariantResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgVerifyInvariantResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgVerifyInvariantResponse message, length delimited. Does not implicitly {@link cosmos.crisis.v1beta1.MsgVerifyInvariantResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse + * @static + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariantResponse} message MsgVerifyInvariantResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgVerifyInvariantResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgVerifyInvariantResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.crisis.v1beta1.MsgVerifyInvariantResponse} MsgVerifyInvariantResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgVerifyInvariantResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.crisis.v1beta1.MsgVerifyInvariantResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgVerifyInvariantResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.crisis.v1beta1.MsgVerifyInvariantResponse} MsgVerifyInvariantResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgVerifyInvariantResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgVerifyInvariantResponse message. + * @function verify + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgVerifyInvariantResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgVerifyInvariantResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.crisis.v1beta1.MsgVerifyInvariantResponse} MsgVerifyInvariantResponse + */ + MsgVerifyInvariantResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.crisis.v1beta1.MsgVerifyInvariantResponse) + return object; + return new $root.cosmos.crisis.v1beta1.MsgVerifyInvariantResponse(); + }; + + /** + * Creates a plain object from a MsgVerifyInvariantResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse + * @static + * @param {cosmos.crisis.v1beta1.MsgVerifyInvariantResponse} message MsgVerifyInvariantResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgVerifyInvariantResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgVerifyInvariantResponse to JSON. + * @function toJSON + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse + * @instance + * @returns {Object.} JSON object + */ + MsgVerifyInvariantResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgVerifyInvariantResponse; + })(v1beta1.MsgVerifyInvariantResponse || {}); + + return v1beta1; + })(crisis.v1beta1 || {}); + + return crisis; + })(cosmos.crisis || {}); + + /** + * Namespace distribution. + * @memberof cosmos + * @namespace + */ + + cosmos.distribution = (function(distribution) { + + /** + * Namespace v1beta1. + * @memberof cosmos.distribution + * @namespace + */ + + distribution.v1beta1 = (function(v1beta1) { + + v1beta1.Msg = (function(Msg) { + + /** + * Constructs a new Msg service. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a Msg + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Msg(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; + + /** + * Creates new Msg service using the specified rpc implementation. + * @function create + * @memberof cosmos.distribution.v1beta1.Msg + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Msg} RPC service. Useful where requests and/or responses are streamed. + */ + Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.distribution.v1beta1.Msg#setWithdrawAddress}. + * @memberof cosmos.distribution.v1beta1.Msg + * @typedef SetWithdrawAddressCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddressResponse} [response] MsgSetWithdrawAddressResponse + */ + + /** + * Calls SetWithdrawAddress. + * @function setWithdrawAddress + * @memberof cosmos.distribution.v1beta1.Msg + * @instance + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddress} request MsgSetWithdrawAddress message or plain object + * @param {cosmos.distribution.v1beta1.Msg.SetWithdrawAddressCallback} callback Node-style callback called with the error, if any, and MsgSetWithdrawAddressResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.setWithdrawAddress = function setWithdrawAddress(request, callback) { + return this.rpcCall(setWithdrawAddress, $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddress, $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse, request, callback); + }, "name", { value: "SetWithdrawAddress" }); + + /** + * Calls SetWithdrawAddress. + * @function setWithdrawAddress + * @memberof cosmos.distribution.v1beta1.Msg + * @instance + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddress} request MsgSetWithdrawAddress message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.distribution.v1beta1.Msg#withdrawDelegatorReward}. + * @memberof cosmos.distribution.v1beta1.Msg + * @typedef WithdrawDelegatorRewardCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorRewardResponse} [response] MsgWithdrawDelegatorRewardResponse + */ + + /** + * Calls WithdrawDelegatorReward. + * @function withdrawDelegatorReward + * @memberof cosmos.distribution.v1beta1.Msg + * @instance + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorReward} request MsgWithdrawDelegatorReward message or plain object + * @param {cosmos.distribution.v1beta1.Msg.WithdrawDelegatorRewardCallback} callback Node-style callback called with the error, if any, and MsgWithdrawDelegatorRewardResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.withdrawDelegatorReward = function withdrawDelegatorReward(request, callback) { + return this.rpcCall(withdrawDelegatorReward, $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward, $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse, request, callback); + }, "name", { value: "WithdrawDelegatorReward" }); + + /** + * Calls WithdrawDelegatorReward. + * @function withdrawDelegatorReward + * @memberof cosmos.distribution.v1beta1.Msg + * @instance + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorReward} request MsgWithdrawDelegatorReward message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.distribution.v1beta1.Msg#withdrawValidatorCommission}. + * @memberof cosmos.distribution.v1beta1.Msg + * @typedef WithdrawValidatorCommissionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommissionResponse} [response] MsgWithdrawValidatorCommissionResponse + */ + + /** + * Calls WithdrawValidatorCommission. + * @function withdrawValidatorCommission + * @memberof cosmos.distribution.v1beta1.Msg + * @instance + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommission} request MsgWithdrawValidatorCommission message or plain object + * @param {cosmos.distribution.v1beta1.Msg.WithdrawValidatorCommissionCallback} callback Node-style callback called with the error, if any, and MsgWithdrawValidatorCommissionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.withdrawValidatorCommission = function withdrawValidatorCommission(request, callback) { + return this.rpcCall(withdrawValidatorCommission, $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission, $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse, request, callback); + }, "name", { value: "WithdrawValidatorCommission" }); + + /** + * Calls WithdrawValidatorCommission. + * @function withdrawValidatorCommission + * @memberof cosmos.distribution.v1beta1.Msg + * @instance + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommission} request MsgWithdrawValidatorCommission message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.distribution.v1beta1.Msg#fundCommunityPool}. + * @memberof cosmos.distribution.v1beta1.Msg + * @typedef FundCommunityPoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPoolResponse} [response] MsgFundCommunityPoolResponse + */ + + /** + * Calls FundCommunityPool. + * @function fundCommunityPool + * @memberof cosmos.distribution.v1beta1.Msg + * @instance + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPool} request MsgFundCommunityPool message or plain object + * @param {cosmos.distribution.v1beta1.Msg.FundCommunityPoolCallback} callback Node-style callback called with the error, if any, and MsgFundCommunityPoolResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.fundCommunityPool = function fundCommunityPool(request, callback) { + return this.rpcCall(fundCommunityPool, $root.cosmos.distribution.v1beta1.MsgFundCommunityPool, $root.cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse, request, callback); + }, "name", { value: "FundCommunityPool" }); + + /** + * Calls FundCommunityPool. + * @function fundCommunityPool + * @memberof cosmos.distribution.v1beta1.Msg + * @instance + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPool} request MsgFundCommunityPool message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Msg; + })(v1beta1.Msg || {}); + + v1beta1.MsgSetWithdrawAddress = (function(MsgSetWithdrawAddress) { + + /** + * Properties of a MsgSetWithdrawAddress. + * @memberof cosmos.distribution.v1beta1 + * @interface IMsgSetWithdrawAddress + * @property {string|null} [delegatorAddress] MsgSetWithdrawAddress delegatorAddress + * @property {string|null} [withdrawAddress] MsgSetWithdrawAddress withdrawAddress + */ + + /** + * Constructs a new MsgSetWithdrawAddress. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a MsgSetWithdrawAddress. + * @implements IMsgSetWithdrawAddress + * @constructor + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddress=} [properties] Properties to set + */ + function MsgSetWithdrawAddress(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgSetWithdrawAddress delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @instance + */ + MsgSetWithdrawAddress.prototype.delegatorAddress = ""; + + /** + * MsgSetWithdrawAddress withdrawAddress. + * @member {string} withdrawAddress + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @instance + */ + MsgSetWithdrawAddress.prototype.withdrawAddress = ""; + + /** + * Creates a new MsgSetWithdrawAddress instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @static + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddress=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.MsgSetWithdrawAddress} MsgSetWithdrawAddress instance + */ + MsgSetWithdrawAddress.create = function create(properties) { + return new MsgSetWithdrawAddress(properties); + }; + + /** + * Encodes the specified MsgSetWithdrawAddress message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgSetWithdrawAddress.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @static + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddress} message MsgSetWithdrawAddress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSetWithdrawAddress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.withdrawAddress != null && Object.hasOwnProperty.call(message, "withdrawAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.withdrawAddress); + return writer; + }; + + /** + * Encodes the specified MsgSetWithdrawAddress message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.MsgSetWithdrawAddress.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @static + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddress} message MsgSetWithdrawAddress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSetWithdrawAddress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgSetWithdrawAddress message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.MsgSetWithdrawAddress} MsgSetWithdrawAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSetWithdrawAddress.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddress(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.withdrawAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgSetWithdrawAddress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.MsgSetWithdrawAddress} MsgSetWithdrawAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSetWithdrawAddress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgSetWithdrawAddress message. + * @function verify + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgSetWithdrawAddress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.withdrawAddress != null && message.hasOwnProperty("withdrawAddress")) + if (!$util.isString(message.withdrawAddress)) + return "withdrawAddress: string expected"; + return null; + }; + + /** + * Creates a MsgSetWithdrawAddress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.MsgSetWithdrawAddress} MsgSetWithdrawAddress + */ + MsgSetWithdrawAddress.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddress) + return object; + var message = new $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddress(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.withdrawAddress != null) + message.withdrawAddress = String(object.withdrawAddress); + return message; + }; + + /** + * Creates a plain object from a MsgSetWithdrawAddress message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @static + * @param {cosmos.distribution.v1beta1.MsgSetWithdrawAddress} message MsgSetWithdrawAddress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSetWithdrawAddress.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.delegatorAddress = ""; + object.withdrawAddress = ""; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.withdrawAddress != null && message.hasOwnProperty("withdrawAddress")) + object.withdrawAddress = message.withdrawAddress; + return object; + }; + + /** + * Converts this MsgSetWithdrawAddress to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @instance + * @returns {Object.} JSON object + */ + MsgSetWithdrawAddress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgSetWithdrawAddress; + })(v1beta1.MsgSetWithdrawAddress || {}); + + v1beta1.MsgSetWithdrawAddressResponse = (function(MsgSetWithdrawAddressResponse) { + + /** + * Properties of a MsgSetWithdrawAddressResponse. + * @memberof cosmos.distribution.v1beta1 + * @interface IMsgSetWithdrawAddressResponse + */ + + /** + * Constructs a new MsgSetWithdrawAddressResponse. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a MsgSetWithdrawAddressResponse. + * @implements IMsgSetWithdrawAddressResponse + * @constructor + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddressResponse=} [properties] Properties to set + */ + function MsgSetWithdrawAddressResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgSetWithdrawAddressResponse instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddressResponse=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse} MsgSetWithdrawAddressResponse instance + */ + MsgSetWithdrawAddressResponse.create = function create(properties) { + return new MsgSetWithdrawAddressResponse(properties); + }; + + /** + * Encodes the specified MsgSetWithdrawAddressResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddressResponse} message MsgSetWithdrawAddressResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSetWithdrawAddressResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgSetWithdrawAddressResponse message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddressResponse} message MsgSetWithdrawAddressResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSetWithdrawAddressResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgSetWithdrawAddressResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse} MsgSetWithdrawAddressResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSetWithdrawAddressResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgSetWithdrawAddressResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse} MsgSetWithdrawAddressResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSetWithdrawAddressResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgSetWithdrawAddressResponse message. + * @function verify + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgSetWithdrawAddressResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgSetWithdrawAddressResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse} MsgSetWithdrawAddressResponse + */ + MsgSetWithdrawAddressResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse) + return object; + return new $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse(); + }; + + /** + * Creates a plain object from a MsgSetWithdrawAddressResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse + * @static + * @param {cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse} message MsgSetWithdrawAddressResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSetWithdrawAddressResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgSetWithdrawAddressResponse to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse + * @instance + * @returns {Object.} JSON object + */ + MsgSetWithdrawAddressResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgSetWithdrawAddressResponse; + })(v1beta1.MsgSetWithdrawAddressResponse || {}); + + v1beta1.MsgWithdrawDelegatorReward = (function(MsgWithdrawDelegatorReward) { + + /** + * Properties of a MsgWithdrawDelegatorReward. + * @memberof cosmos.distribution.v1beta1 + * @interface IMsgWithdrawDelegatorReward + * @property {string|null} [delegatorAddress] MsgWithdrawDelegatorReward delegatorAddress + * @property {string|null} [validatorAddress] MsgWithdrawDelegatorReward validatorAddress + */ + + /** + * Constructs a new MsgWithdrawDelegatorReward. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a MsgWithdrawDelegatorReward. + * @implements IMsgWithdrawDelegatorReward + * @constructor + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorReward=} [properties] Properties to set + */ + function MsgWithdrawDelegatorReward(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgWithdrawDelegatorReward delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @instance + */ + MsgWithdrawDelegatorReward.prototype.delegatorAddress = ""; + + /** + * MsgWithdrawDelegatorReward validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @instance + */ + MsgWithdrawDelegatorReward.prototype.validatorAddress = ""; + + /** + * Creates a new MsgWithdrawDelegatorReward instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorReward=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward} MsgWithdrawDelegatorReward instance + */ + MsgWithdrawDelegatorReward.create = function create(properties) { + return new MsgWithdrawDelegatorReward(properties); + }; + + /** + * Encodes the specified MsgWithdrawDelegatorReward message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorReward} message MsgWithdrawDelegatorReward message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgWithdrawDelegatorReward.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddress); + return writer; + }; + + /** + * Encodes the specified MsgWithdrawDelegatorReward message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorReward} message MsgWithdrawDelegatorReward message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgWithdrawDelegatorReward.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgWithdrawDelegatorReward message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward} MsgWithdrawDelegatorReward + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgWithdrawDelegatorReward.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgWithdrawDelegatorReward message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward} MsgWithdrawDelegatorReward + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgWithdrawDelegatorReward.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgWithdrawDelegatorReward message. + * @function verify + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgWithdrawDelegatorReward.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + return null; + }; + + /** + * Creates a MsgWithdrawDelegatorReward message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward} MsgWithdrawDelegatorReward + */ + MsgWithdrawDelegatorReward.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward) + return object; + var message = new $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + return message; + }; + + /** + * Creates a plain object from a MsgWithdrawDelegatorReward message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @static + * @param {cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward} message MsgWithdrawDelegatorReward + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgWithdrawDelegatorReward.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.delegatorAddress = ""; + object.validatorAddress = ""; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + return object; + }; + + /** + * Converts this MsgWithdrawDelegatorReward to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @instance + * @returns {Object.} JSON object + */ + MsgWithdrawDelegatorReward.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgWithdrawDelegatorReward; + })(v1beta1.MsgWithdrawDelegatorReward || {}); + + v1beta1.MsgWithdrawDelegatorRewardResponse = (function(MsgWithdrawDelegatorRewardResponse) { + + /** + * Properties of a MsgWithdrawDelegatorRewardResponse. + * @memberof cosmos.distribution.v1beta1 + * @interface IMsgWithdrawDelegatorRewardResponse + */ + + /** + * Constructs a new MsgWithdrawDelegatorRewardResponse. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a MsgWithdrawDelegatorRewardResponse. + * @implements IMsgWithdrawDelegatorRewardResponse + * @constructor + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorRewardResponse=} [properties] Properties to set + */ + function MsgWithdrawDelegatorRewardResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgWithdrawDelegatorRewardResponse instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorRewardResponse=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse} MsgWithdrawDelegatorRewardResponse instance + */ + MsgWithdrawDelegatorRewardResponse.create = function create(properties) { + return new MsgWithdrawDelegatorRewardResponse(properties); + }; + + /** + * Encodes the specified MsgWithdrawDelegatorRewardResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorRewardResponse} message MsgWithdrawDelegatorRewardResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgWithdrawDelegatorRewardResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgWithdrawDelegatorRewardResponse message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorRewardResponse} message MsgWithdrawDelegatorRewardResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgWithdrawDelegatorRewardResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgWithdrawDelegatorRewardResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse} MsgWithdrawDelegatorRewardResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgWithdrawDelegatorRewardResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgWithdrawDelegatorRewardResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse} MsgWithdrawDelegatorRewardResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgWithdrawDelegatorRewardResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgWithdrawDelegatorRewardResponse message. + * @function verify + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgWithdrawDelegatorRewardResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgWithdrawDelegatorRewardResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse} MsgWithdrawDelegatorRewardResponse + */ + MsgWithdrawDelegatorRewardResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse) + return object; + return new $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse(); + }; + + /** + * Creates a plain object from a MsgWithdrawDelegatorRewardResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse + * @static + * @param {cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse} message MsgWithdrawDelegatorRewardResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgWithdrawDelegatorRewardResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgWithdrawDelegatorRewardResponse to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse + * @instance + * @returns {Object.} JSON object + */ + MsgWithdrawDelegatorRewardResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgWithdrawDelegatorRewardResponse; + })(v1beta1.MsgWithdrawDelegatorRewardResponse || {}); + + v1beta1.MsgWithdrawValidatorCommission = (function(MsgWithdrawValidatorCommission) { + + /** + * Properties of a MsgWithdrawValidatorCommission. + * @memberof cosmos.distribution.v1beta1 + * @interface IMsgWithdrawValidatorCommission + * @property {string|null} [validatorAddress] MsgWithdrawValidatorCommission validatorAddress + */ + + /** + * Constructs a new MsgWithdrawValidatorCommission. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a MsgWithdrawValidatorCommission. + * @implements IMsgWithdrawValidatorCommission + * @constructor + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommission=} [properties] Properties to set + */ + function MsgWithdrawValidatorCommission(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgWithdrawValidatorCommission validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission + * @instance + */ + MsgWithdrawValidatorCommission.prototype.validatorAddress = ""; + + /** + * Creates a new MsgWithdrawValidatorCommission instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommission=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission} MsgWithdrawValidatorCommission instance + */ + MsgWithdrawValidatorCommission.create = function create(properties) { + return new MsgWithdrawValidatorCommission(properties); + }; + + /** + * Encodes the specified MsgWithdrawValidatorCommission message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommission} message MsgWithdrawValidatorCommission message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgWithdrawValidatorCommission.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.validatorAddress); + return writer; + }; + + /** + * Encodes the specified MsgWithdrawValidatorCommission message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommission} message MsgWithdrawValidatorCommission message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgWithdrawValidatorCommission.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgWithdrawValidatorCommission message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission} MsgWithdrawValidatorCommission + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgWithdrawValidatorCommission.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgWithdrawValidatorCommission message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission} MsgWithdrawValidatorCommission + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgWithdrawValidatorCommission.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgWithdrawValidatorCommission message. + * @function verify + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgWithdrawValidatorCommission.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + return null; + }; + + /** + * Creates a MsgWithdrawValidatorCommission message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission} MsgWithdrawValidatorCommission + */ + MsgWithdrawValidatorCommission.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission) + return object; + var message = new $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission(); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + return message; + }; + + /** + * Creates a plain object from a MsgWithdrawValidatorCommission message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission + * @static + * @param {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission} message MsgWithdrawValidatorCommission + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgWithdrawValidatorCommission.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.validatorAddress = ""; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + return object; + }; + + /** + * Converts this MsgWithdrawValidatorCommission to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission + * @instance + * @returns {Object.} JSON object + */ + MsgWithdrawValidatorCommission.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgWithdrawValidatorCommission; + })(v1beta1.MsgWithdrawValidatorCommission || {}); + + v1beta1.MsgWithdrawValidatorCommissionResponse = (function(MsgWithdrawValidatorCommissionResponse) { + + /** + * Properties of a MsgWithdrawValidatorCommissionResponse. + * @memberof cosmos.distribution.v1beta1 + * @interface IMsgWithdrawValidatorCommissionResponse + */ + + /** + * Constructs a new MsgWithdrawValidatorCommissionResponse. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a MsgWithdrawValidatorCommissionResponse. + * @implements IMsgWithdrawValidatorCommissionResponse + * @constructor + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommissionResponse=} [properties] Properties to set + */ + function MsgWithdrawValidatorCommissionResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgWithdrawValidatorCommissionResponse instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommissionResponse=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse} MsgWithdrawValidatorCommissionResponse instance + */ + MsgWithdrawValidatorCommissionResponse.create = function create(properties) { + return new MsgWithdrawValidatorCommissionResponse(properties); + }; + + /** + * Encodes the specified MsgWithdrawValidatorCommissionResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommissionResponse} message MsgWithdrawValidatorCommissionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgWithdrawValidatorCommissionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgWithdrawValidatorCommissionResponse message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommissionResponse} message MsgWithdrawValidatorCommissionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgWithdrawValidatorCommissionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgWithdrawValidatorCommissionResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse} MsgWithdrawValidatorCommissionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgWithdrawValidatorCommissionResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgWithdrawValidatorCommissionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse} MsgWithdrawValidatorCommissionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgWithdrawValidatorCommissionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgWithdrawValidatorCommissionResponse message. + * @function verify + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgWithdrawValidatorCommissionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgWithdrawValidatorCommissionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse} MsgWithdrawValidatorCommissionResponse + */ + MsgWithdrawValidatorCommissionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse) + return object; + return new $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse(); + }; + + /** + * Creates a plain object from a MsgWithdrawValidatorCommissionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse + * @static + * @param {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse} message MsgWithdrawValidatorCommissionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgWithdrawValidatorCommissionResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgWithdrawValidatorCommissionResponse to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse + * @instance + * @returns {Object.} JSON object + */ + MsgWithdrawValidatorCommissionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgWithdrawValidatorCommissionResponse; + })(v1beta1.MsgWithdrawValidatorCommissionResponse || {}); + + v1beta1.MsgFundCommunityPool = (function(MsgFundCommunityPool) { + + /** + * Properties of a MsgFundCommunityPool. + * @memberof cosmos.distribution.v1beta1 + * @interface IMsgFundCommunityPool + * @property {Array.|null} [amount] MsgFundCommunityPool amount + * @property {string|null} [depositor] MsgFundCommunityPool depositor + */ + + /** + * Constructs a new MsgFundCommunityPool. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a MsgFundCommunityPool. + * @implements IMsgFundCommunityPool + * @constructor + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPool=} [properties] Properties to set + */ + function MsgFundCommunityPool(properties) { + this.amount = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgFundCommunityPool amount. + * @member {Array.} amount + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @instance + */ + MsgFundCommunityPool.prototype.amount = $util.emptyArray; + + /** + * MsgFundCommunityPool depositor. + * @member {string} depositor + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @instance + */ + MsgFundCommunityPool.prototype.depositor = ""; + + /** + * Creates a new MsgFundCommunityPool instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @static + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPool=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.MsgFundCommunityPool} MsgFundCommunityPool instance + */ + MsgFundCommunityPool.create = function create(properties) { + return new MsgFundCommunityPool(properties); + }; + + /** + * Encodes the specified MsgFundCommunityPool message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgFundCommunityPool.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @static + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPool} message MsgFundCommunityPool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgFundCommunityPool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.amount != null && message.amount.length) + for (var i = 0; i < message.amount.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.amount[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.depositor != null && Object.hasOwnProperty.call(message, "depositor")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.depositor); + return writer; + }; + + /** + * Encodes the specified MsgFundCommunityPool message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.MsgFundCommunityPool.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @static + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPool} message MsgFundCommunityPool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgFundCommunityPool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgFundCommunityPool message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.MsgFundCommunityPool} MsgFundCommunityPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgFundCommunityPool.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.MsgFundCommunityPool(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.amount && message.amount.length)) + message.amount = []; + message.amount.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + case 2: + message.depositor = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgFundCommunityPool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.MsgFundCommunityPool} MsgFundCommunityPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgFundCommunityPool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgFundCommunityPool message. + * @function verify + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgFundCommunityPool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + if (!Array.isArray(message.amount)) + return "amount: array expected"; + for (var i = 0; i < message.amount.length; ++i) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.amount[i]); + if (error) + return "amount." + error; + } + } + if (message.depositor != null && message.hasOwnProperty("depositor")) + if (!$util.isString(message.depositor)) + return "depositor: string expected"; + return null; + }; + + /** + * Creates a MsgFundCommunityPool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.MsgFundCommunityPool} MsgFundCommunityPool + */ + MsgFundCommunityPool.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.MsgFundCommunityPool) + return object; + var message = new $root.cosmos.distribution.v1beta1.MsgFundCommunityPool(); + if (object.amount) { + if (!Array.isArray(object.amount)) + throw TypeError(".cosmos.distribution.v1beta1.MsgFundCommunityPool.amount: array expected"); + message.amount = []; + for (var i = 0; i < object.amount.length; ++i) { + if (typeof object.amount[i] !== "object") + throw TypeError(".cosmos.distribution.v1beta1.MsgFundCommunityPool.amount: object expected"); + message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]); + } + } + if (object.depositor != null) + message.depositor = String(object.depositor); + return message; + }; + + /** + * Creates a plain object from a MsgFundCommunityPool message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @static + * @param {cosmos.distribution.v1beta1.MsgFundCommunityPool} message MsgFundCommunityPool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgFundCommunityPool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.amount = []; + if (options.defaults) + object.depositor = ""; + if (message.amount && message.amount.length) { + object.amount = []; + for (var j = 0; j < message.amount.length; ++j) + object.amount[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.amount[j], options); + } + if (message.depositor != null && message.hasOwnProperty("depositor")) + object.depositor = message.depositor; + return object; + }; + + /** + * Converts this MsgFundCommunityPool to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @instance + * @returns {Object.} JSON object + */ + MsgFundCommunityPool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgFundCommunityPool; + })(v1beta1.MsgFundCommunityPool || {}); + + v1beta1.MsgFundCommunityPoolResponse = (function(MsgFundCommunityPoolResponse) { + + /** + * Properties of a MsgFundCommunityPoolResponse. + * @memberof cosmos.distribution.v1beta1 + * @interface IMsgFundCommunityPoolResponse + */ + + /** + * Constructs a new MsgFundCommunityPoolResponse. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a MsgFundCommunityPoolResponse. + * @implements IMsgFundCommunityPoolResponse + * @constructor + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPoolResponse=} [properties] Properties to set + */ + function MsgFundCommunityPoolResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgFundCommunityPoolResponse instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPoolResponse=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse} MsgFundCommunityPoolResponse instance + */ + MsgFundCommunityPoolResponse.create = function create(properties) { + return new MsgFundCommunityPoolResponse(properties); + }; + + /** + * Encodes the specified MsgFundCommunityPoolResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPoolResponse} message MsgFundCommunityPoolResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgFundCommunityPoolResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgFundCommunityPoolResponse message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPoolResponse} message MsgFundCommunityPoolResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgFundCommunityPoolResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgFundCommunityPoolResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse} MsgFundCommunityPoolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgFundCommunityPoolResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgFundCommunityPoolResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse} MsgFundCommunityPoolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgFundCommunityPoolResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgFundCommunityPoolResponse message. + * @function verify + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgFundCommunityPoolResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgFundCommunityPoolResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse} MsgFundCommunityPoolResponse + */ + MsgFundCommunityPoolResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse) + return object; + return new $root.cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse(); + }; + + /** + * Creates a plain object from a MsgFundCommunityPoolResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse + * @static + * @param {cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse} message MsgFundCommunityPoolResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgFundCommunityPoolResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgFundCommunityPoolResponse to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse + * @instance + * @returns {Object.} JSON object + */ + MsgFundCommunityPoolResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgFundCommunityPoolResponse; + })(v1beta1.MsgFundCommunityPoolResponse || {}); + + return v1beta1; + })(distribution.v1beta1 || {}); + + return distribution; + })(cosmos.distribution || {}); + + /** + * Namespace evidence. + * @memberof cosmos + * @namespace + */ + + cosmos.evidence = (function(evidence) { + + /** + * Namespace v1beta1. + * @memberof cosmos.evidence + * @namespace + */ + + evidence.v1beta1 = (function(v1beta1) { + + v1beta1.Msg = (function(Msg) { + + /** + * Constructs a new Msg service. + * @memberof cosmos.evidence.v1beta1 + * @classdesc Represents a Msg + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Msg(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; + + /** + * Creates new Msg service using the specified rpc implementation. + * @function create + * @memberof cosmos.evidence.v1beta1.Msg + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Msg} RPC service. Useful where requests and/or responses are streamed. + */ + Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.evidence.v1beta1.Msg#submitEvidence}. + * @memberof cosmos.evidence.v1beta1.Msg + * @typedef SubmitEvidenceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidenceResponse} [response] MsgSubmitEvidenceResponse + */ + + /** + * Calls SubmitEvidence. + * @function submitEvidence + * @memberof cosmos.evidence.v1beta1.Msg + * @instance + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidence} request MsgSubmitEvidence message or plain object + * @param {cosmos.evidence.v1beta1.Msg.SubmitEvidenceCallback} callback Node-style callback called with the error, if any, and MsgSubmitEvidenceResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.submitEvidence = function submitEvidence(request, callback) { + return this.rpcCall(submitEvidence, $root.cosmos.evidence.v1beta1.MsgSubmitEvidence, $root.cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse, request, callback); + }, "name", { value: "SubmitEvidence" }); + + /** + * Calls SubmitEvidence. + * @function submitEvidence + * @memberof cosmos.evidence.v1beta1.Msg + * @instance + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidence} request MsgSubmitEvidence message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Msg; + })(v1beta1.Msg || {}); + + v1beta1.MsgSubmitEvidence = (function(MsgSubmitEvidence) { + + /** + * Properties of a MsgSubmitEvidence. + * @memberof cosmos.evidence.v1beta1 + * @interface IMsgSubmitEvidence + * @property {string|null} [submitter] MsgSubmitEvidence submitter + * @property {google.protobuf.IAny|null} [evidence] MsgSubmitEvidence evidence + */ + + /** + * Constructs a new MsgSubmitEvidence. + * @memberof cosmos.evidence.v1beta1 + * @classdesc Represents a MsgSubmitEvidence. + * @implements IMsgSubmitEvidence + * @constructor + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidence=} [properties] Properties to set + */ + function MsgSubmitEvidence(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgSubmitEvidence submitter. + * @member {string} submitter + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @instance + */ + MsgSubmitEvidence.prototype.submitter = ""; + + /** + * MsgSubmitEvidence evidence. + * @member {google.protobuf.IAny|null|undefined} evidence + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @instance + */ + MsgSubmitEvidence.prototype.evidence = null; + + /** + * Creates a new MsgSubmitEvidence instance using the specified properties. + * @function create + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @static + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidence=} [properties] Properties to set + * @returns {cosmos.evidence.v1beta1.MsgSubmitEvidence} MsgSubmitEvidence instance + */ + MsgSubmitEvidence.create = function create(properties) { + return new MsgSubmitEvidence(properties); + }; + + /** + * Encodes the specified MsgSubmitEvidence message. Does not implicitly {@link cosmos.evidence.v1beta1.MsgSubmitEvidence.verify|verify} messages. + * @function encode + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @static + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidence} message MsgSubmitEvidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitEvidence.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.submitter != null && Object.hasOwnProperty.call(message, "submitter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.submitter); + if (message.evidence != null && Object.hasOwnProperty.call(message, "evidence")) + $root.google.protobuf.Any.encode(message.evidence, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MsgSubmitEvidence message, length delimited. Does not implicitly {@link cosmos.evidence.v1beta1.MsgSubmitEvidence.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @static + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidence} message MsgSubmitEvidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitEvidence.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgSubmitEvidence message from the specified reader or buffer. + * @function decode + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.evidence.v1beta1.MsgSubmitEvidence} MsgSubmitEvidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitEvidence.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.evidence.v1beta1.MsgSubmitEvidence(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.submitter = reader.string(); + break; + case 2: + message.evidence = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgSubmitEvidence message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.evidence.v1beta1.MsgSubmitEvidence} MsgSubmitEvidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitEvidence.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgSubmitEvidence message. + * @function verify + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgSubmitEvidence.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.submitter != null && message.hasOwnProperty("submitter")) + if (!$util.isString(message.submitter)) + return "submitter: string expected"; + if (message.evidence != null && message.hasOwnProperty("evidence")) { + var error = $root.google.protobuf.Any.verify(message.evidence); + if (error) + return "evidence." + error; + } + return null; + }; + + /** + * Creates a MsgSubmitEvidence message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @static + * @param {Object.} object Plain object + * @returns {cosmos.evidence.v1beta1.MsgSubmitEvidence} MsgSubmitEvidence + */ + MsgSubmitEvidence.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.evidence.v1beta1.MsgSubmitEvidence) + return object; + var message = new $root.cosmos.evidence.v1beta1.MsgSubmitEvidence(); + if (object.submitter != null) + message.submitter = String(object.submitter); + if (object.evidence != null) { + if (typeof object.evidence !== "object") + throw TypeError(".cosmos.evidence.v1beta1.MsgSubmitEvidence.evidence: object expected"); + message.evidence = $root.google.protobuf.Any.fromObject(object.evidence); + } + return message; + }; + + /** + * Creates a plain object from a MsgSubmitEvidence message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @static + * @param {cosmos.evidence.v1beta1.MsgSubmitEvidence} message MsgSubmitEvidence + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSubmitEvidence.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.submitter = ""; + object.evidence = null; + } + if (message.submitter != null && message.hasOwnProperty("submitter")) + object.submitter = message.submitter; + if (message.evidence != null && message.hasOwnProperty("evidence")) + object.evidence = $root.google.protobuf.Any.toObject(message.evidence, options); + return object; + }; + + /** + * Converts this MsgSubmitEvidence to JSON. + * @function toJSON + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @instance + * @returns {Object.} JSON object + */ + MsgSubmitEvidence.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgSubmitEvidence; + })(v1beta1.MsgSubmitEvidence || {}); + + v1beta1.MsgSubmitEvidenceResponse = (function(MsgSubmitEvidenceResponse) { + + /** + * Properties of a MsgSubmitEvidenceResponse. + * @memberof cosmos.evidence.v1beta1 + * @interface IMsgSubmitEvidenceResponse + * @property {Uint8Array|null} [hash] MsgSubmitEvidenceResponse hash + */ + + /** + * Constructs a new MsgSubmitEvidenceResponse. + * @memberof cosmos.evidence.v1beta1 + * @classdesc Represents a MsgSubmitEvidenceResponse. + * @implements IMsgSubmitEvidenceResponse + * @constructor + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidenceResponse=} [properties] Properties to set + */ + function MsgSubmitEvidenceResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgSubmitEvidenceResponse hash. + * @member {Uint8Array} hash + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse + * @instance + */ + MsgSubmitEvidenceResponse.prototype.hash = $util.newBuffer([]); + + /** + * Creates a new MsgSubmitEvidenceResponse instance using the specified properties. + * @function create + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse + * @static + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidenceResponse=} [properties] Properties to set + * @returns {cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse} MsgSubmitEvidenceResponse instance + */ + MsgSubmitEvidenceResponse.create = function create(properties) { + return new MsgSubmitEvidenceResponse(properties); + }; + + /** + * Encodes the specified MsgSubmitEvidenceResponse message. Does not implicitly {@link cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse + * @static + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidenceResponse} message MsgSubmitEvidenceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitEvidenceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.hash); + return writer; + }; + + /** + * Encodes the specified MsgSubmitEvidenceResponse message, length delimited. Does not implicitly {@link cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse + * @static + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidenceResponse} message MsgSubmitEvidenceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitEvidenceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgSubmitEvidenceResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse} MsgSubmitEvidenceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitEvidenceResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + message.hash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgSubmitEvidenceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse} MsgSubmitEvidenceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitEvidenceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgSubmitEvidenceResponse message. + * @function verify + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgSubmitEvidenceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash))) + return "hash: buffer expected"; + return null; + }; + + /** + * Creates a MsgSubmitEvidenceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse} MsgSubmitEvidenceResponse + */ + MsgSubmitEvidenceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse) + return object; + var message = new $root.cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse(); + if (object.hash != null) + if (typeof object.hash === "string") + $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0); + else if (object.hash.length) + message.hash = object.hash; + return message; + }; + + /** + * Creates a plain object from a MsgSubmitEvidenceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse + * @static + * @param {cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse} message MsgSubmitEvidenceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSubmitEvidenceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.hash = ""; + else { + object.hash = []; + if (options.bytes !== Array) + object.hash = $util.newBuffer(object.hash); + } + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash; + return object; + }; + + /** + * Converts this MsgSubmitEvidenceResponse to JSON. + * @function toJSON + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse + * @instance + * @returns {Object.} JSON object + */ + MsgSubmitEvidenceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgSubmitEvidenceResponse; + })(v1beta1.MsgSubmitEvidenceResponse || {}); + + return v1beta1; + })(evidence.v1beta1 || {}); + + return evidence; + })(cosmos.evidence || {}); + + /** + * Namespace slashing. + * @memberof cosmos + * @namespace + */ + + cosmos.slashing = (function(slashing) { + + /** + * Namespace v1beta1. + * @memberof cosmos.slashing + * @namespace + */ + + slashing.v1beta1 = (function(v1beta1) { + + v1beta1.Msg = (function(Msg) { + + /** + * Constructs a new Msg service. + * @memberof cosmos.slashing.v1beta1 + * @classdesc Represents a Msg + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Msg(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; + + /** + * Creates new Msg service using the specified rpc implementation. + * @function create + * @memberof cosmos.slashing.v1beta1.Msg + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Msg} RPC service. Useful where requests and/or responses are streamed. + */ + Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.slashing.v1beta1.Msg#unjail}. + * @memberof cosmos.slashing.v1beta1.Msg + * @typedef UnjailCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.slashing.v1beta1.IMsgUnjailResponse} [response] MsgUnjailResponse + */ + + /** + * Calls Unjail. + * @function unjail + * @memberof cosmos.slashing.v1beta1.Msg + * @instance + * @param {cosmos.slashing.v1beta1.IMsgUnjail} request MsgUnjail message or plain object + * @param {cosmos.slashing.v1beta1.Msg.UnjailCallback} callback Node-style callback called with the error, if any, and MsgUnjailResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.unjail = function unjail(request, callback) { + return this.rpcCall(unjail, $root.cosmos.slashing.v1beta1.MsgUnjail, $root.cosmos.slashing.v1beta1.MsgUnjailResponse, request, callback); + }, "name", { value: "Unjail" }); + + /** + * Calls Unjail. + * @function unjail + * @memberof cosmos.slashing.v1beta1.Msg + * @instance + * @param {cosmos.slashing.v1beta1.IMsgUnjail} request MsgUnjail message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Msg; + })(v1beta1.Msg || {}); + + v1beta1.MsgUnjail = (function(MsgUnjail) { + + /** + * Properties of a MsgUnjail. + * @memberof cosmos.slashing.v1beta1 + * @interface IMsgUnjail + * @property {string|null} [validatorAddr] MsgUnjail validatorAddr + */ + + /** + * Constructs a new MsgUnjail. + * @memberof cosmos.slashing.v1beta1 + * @classdesc Represents a MsgUnjail. + * @implements IMsgUnjail + * @constructor + * @param {cosmos.slashing.v1beta1.IMsgUnjail=} [properties] Properties to set + */ + function MsgUnjail(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgUnjail validatorAddr. + * @member {string} validatorAddr + * @memberof cosmos.slashing.v1beta1.MsgUnjail + * @instance + */ + MsgUnjail.prototype.validatorAddr = ""; + + /** + * Creates a new MsgUnjail instance using the specified properties. + * @function create + * @memberof cosmos.slashing.v1beta1.MsgUnjail + * @static + * @param {cosmos.slashing.v1beta1.IMsgUnjail=} [properties] Properties to set + * @returns {cosmos.slashing.v1beta1.MsgUnjail} MsgUnjail instance + */ + MsgUnjail.create = function create(properties) { + return new MsgUnjail(properties); + }; + + /** + * Encodes the specified MsgUnjail message. Does not implicitly {@link cosmos.slashing.v1beta1.MsgUnjail.verify|verify} messages. + * @function encode + * @memberof cosmos.slashing.v1beta1.MsgUnjail + * @static + * @param {cosmos.slashing.v1beta1.IMsgUnjail} message MsgUnjail message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUnjail.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validatorAddr != null && Object.hasOwnProperty.call(message, "validatorAddr")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.validatorAddr); + return writer; + }; + + /** + * Encodes the specified MsgUnjail message, length delimited. Does not implicitly {@link cosmos.slashing.v1beta1.MsgUnjail.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.slashing.v1beta1.MsgUnjail + * @static + * @param {cosmos.slashing.v1beta1.IMsgUnjail} message MsgUnjail message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUnjail.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgUnjail message from the specified reader or buffer. + * @function decode + * @memberof cosmos.slashing.v1beta1.MsgUnjail + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.slashing.v1beta1.MsgUnjail} MsgUnjail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUnjail.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.slashing.v1beta1.MsgUnjail(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgUnjail message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.slashing.v1beta1.MsgUnjail + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.slashing.v1beta1.MsgUnjail} MsgUnjail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUnjail.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgUnjail message. + * @function verify + * @memberof cosmos.slashing.v1beta1.MsgUnjail + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgUnjail.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validatorAddr != null && message.hasOwnProperty("validatorAddr")) + if (!$util.isString(message.validatorAddr)) + return "validatorAddr: string expected"; + return null; + }; + + /** + * Creates a MsgUnjail message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.slashing.v1beta1.MsgUnjail + * @static + * @param {Object.} object Plain object + * @returns {cosmos.slashing.v1beta1.MsgUnjail} MsgUnjail + */ + MsgUnjail.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.slashing.v1beta1.MsgUnjail) + return object; + var message = new $root.cosmos.slashing.v1beta1.MsgUnjail(); + if (object.validatorAddr != null) + message.validatorAddr = String(object.validatorAddr); + return message; + }; + + /** + * Creates a plain object from a MsgUnjail message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.slashing.v1beta1.MsgUnjail + * @static + * @param {cosmos.slashing.v1beta1.MsgUnjail} message MsgUnjail + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgUnjail.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.validatorAddr = ""; + if (message.validatorAddr != null && message.hasOwnProperty("validatorAddr")) + object.validatorAddr = message.validatorAddr; + return object; + }; + + /** + * Converts this MsgUnjail to JSON. + * @function toJSON + * @memberof cosmos.slashing.v1beta1.MsgUnjail + * @instance + * @returns {Object.} JSON object + */ + MsgUnjail.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgUnjail; + })(v1beta1.MsgUnjail || {}); + + v1beta1.MsgUnjailResponse = (function(MsgUnjailResponse) { + + /** + * Properties of a MsgUnjailResponse. + * @memberof cosmos.slashing.v1beta1 + * @interface IMsgUnjailResponse + */ + + /** + * Constructs a new MsgUnjailResponse. + * @memberof cosmos.slashing.v1beta1 + * @classdesc Represents a MsgUnjailResponse. + * @implements IMsgUnjailResponse + * @constructor + * @param {cosmos.slashing.v1beta1.IMsgUnjailResponse=} [properties] Properties to set + */ + function MsgUnjailResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgUnjailResponse instance using the specified properties. + * @function create + * @memberof cosmos.slashing.v1beta1.MsgUnjailResponse + * @static + * @param {cosmos.slashing.v1beta1.IMsgUnjailResponse=} [properties] Properties to set + * @returns {cosmos.slashing.v1beta1.MsgUnjailResponse} MsgUnjailResponse instance + */ + MsgUnjailResponse.create = function create(properties) { + return new MsgUnjailResponse(properties); + }; + + /** + * Encodes the specified MsgUnjailResponse message. Does not implicitly {@link cosmos.slashing.v1beta1.MsgUnjailResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.slashing.v1beta1.MsgUnjailResponse + * @static + * @param {cosmos.slashing.v1beta1.IMsgUnjailResponse} message MsgUnjailResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUnjailResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgUnjailResponse message, length delimited. Does not implicitly {@link cosmos.slashing.v1beta1.MsgUnjailResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.slashing.v1beta1.MsgUnjailResponse + * @static + * @param {cosmos.slashing.v1beta1.IMsgUnjailResponse} message MsgUnjailResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUnjailResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgUnjailResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.slashing.v1beta1.MsgUnjailResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.slashing.v1beta1.MsgUnjailResponse} MsgUnjailResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUnjailResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.slashing.v1beta1.MsgUnjailResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgUnjailResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.slashing.v1beta1.MsgUnjailResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.slashing.v1beta1.MsgUnjailResponse} MsgUnjailResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUnjailResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgUnjailResponse message. + * @function verify + * @memberof cosmos.slashing.v1beta1.MsgUnjailResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgUnjailResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgUnjailResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.slashing.v1beta1.MsgUnjailResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.slashing.v1beta1.MsgUnjailResponse} MsgUnjailResponse + */ + MsgUnjailResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.slashing.v1beta1.MsgUnjailResponse) + return object; + return new $root.cosmos.slashing.v1beta1.MsgUnjailResponse(); + }; + + /** + * Creates a plain object from a MsgUnjailResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.slashing.v1beta1.MsgUnjailResponse + * @static + * @param {cosmos.slashing.v1beta1.MsgUnjailResponse} message MsgUnjailResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgUnjailResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgUnjailResponse to JSON. + * @function toJSON + * @memberof cosmos.slashing.v1beta1.MsgUnjailResponse + * @instance + * @returns {Object.} JSON object + */ + MsgUnjailResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgUnjailResponse; + })(v1beta1.MsgUnjailResponse || {}); + + return v1beta1; + })(slashing.v1beta1 || {}); + + return slashing; + })(cosmos.slashing || {}); + + /** + * Namespace vesting. + * @memberof cosmos + * @namespace + */ + + cosmos.vesting = (function(vesting) { + + /** + * Namespace v1beta1. + * @memberof cosmos.vesting + * @namespace + */ + + vesting.v1beta1 = (function(v1beta1) { + + v1beta1.Msg = (function(Msg) { + + /** + * Constructs a new Msg service. + * @memberof cosmos.vesting.v1beta1 + * @classdesc Represents a Msg + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Msg(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; + + /** + * Creates new Msg service using the specified rpc implementation. + * @function create + * @memberof cosmos.vesting.v1beta1.Msg + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Msg} RPC service. Useful where requests and/or responses are streamed. + */ + Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.vesting.v1beta1.Msg#createVestingAccount}. + * @memberof cosmos.vesting.v1beta1.Msg + * @typedef CreateVestingAccountCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccountResponse} [response] MsgCreateVestingAccountResponse + */ + + /** + * Calls CreateVestingAccount. + * @function createVestingAccount + * @memberof cosmos.vesting.v1beta1.Msg + * @instance + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccount} request MsgCreateVestingAccount message or plain object + * @param {cosmos.vesting.v1beta1.Msg.CreateVestingAccountCallback} callback Node-style callback called with the error, if any, and MsgCreateVestingAccountResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.createVestingAccount = function createVestingAccount(request, callback) { + return this.rpcCall(createVestingAccount, $root.cosmos.vesting.v1beta1.MsgCreateVestingAccount, $root.cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse, request, callback); + }, "name", { value: "CreateVestingAccount" }); + + /** + * Calls CreateVestingAccount. + * @function createVestingAccount + * @memberof cosmos.vesting.v1beta1.Msg + * @instance + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccount} request MsgCreateVestingAccount message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Msg; + })(v1beta1.Msg || {}); + + v1beta1.MsgCreateVestingAccount = (function(MsgCreateVestingAccount) { + + /** + * Properties of a MsgCreateVestingAccount. + * @memberof cosmos.vesting.v1beta1 + * @interface IMsgCreateVestingAccount + * @property {string|null} [fromAddress] MsgCreateVestingAccount fromAddress + * @property {string|null} [toAddress] MsgCreateVestingAccount toAddress + * @property {Array.|null} [amount] MsgCreateVestingAccount amount + * @property {number|Long|null} [endTime] MsgCreateVestingAccount endTime + * @property {boolean|null} [delayed] MsgCreateVestingAccount delayed + */ + + /** + * Constructs a new MsgCreateVestingAccount. + * @memberof cosmos.vesting.v1beta1 + * @classdesc Represents a MsgCreateVestingAccount. + * @implements IMsgCreateVestingAccount + * @constructor + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccount=} [properties] Properties to set + */ + function MsgCreateVestingAccount(properties) { + this.amount = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgCreateVestingAccount fromAddress. + * @member {string} fromAddress + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @instance + */ + MsgCreateVestingAccount.prototype.fromAddress = ""; + + /** + * MsgCreateVestingAccount toAddress. + * @member {string} toAddress + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @instance + */ + MsgCreateVestingAccount.prototype.toAddress = ""; + + /** + * MsgCreateVestingAccount amount. + * @member {Array.} amount + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @instance + */ + MsgCreateVestingAccount.prototype.amount = $util.emptyArray; + + /** + * MsgCreateVestingAccount endTime. + * @member {number|Long} endTime + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @instance + */ + MsgCreateVestingAccount.prototype.endTime = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * MsgCreateVestingAccount delayed. + * @member {boolean} delayed + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @instance + */ + MsgCreateVestingAccount.prototype.delayed = false; + + /** + * Creates a new MsgCreateVestingAccount instance using the specified properties. + * @function create + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @static + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccount=} [properties] Properties to set + * @returns {cosmos.vesting.v1beta1.MsgCreateVestingAccount} MsgCreateVestingAccount instance + */ + MsgCreateVestingAccount.create = function create(properties) { + return new MsgCreateVestingAccount(properties); + }; + + /** + * Encodes the specified MsgCreateVestingAccount message. Does not implicitly {@link cosmos.vesting.v1beta1.MsgCreateVestingAccount.verify|verify} messages. + * @function encode + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @static + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccount} message MsgCreateVestingAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateVestingAccount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fromAddress != null && Object.hasOwnProperty.call(message, "fromAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fromAddress); + if (message.toAddress != null && Object.hasOwnProperty.call(message, "toAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.toAddress); + if (message.amount != null && message.amount.length) + for (var i = 0; i < message.amount.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.amount[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.endTime); + if (message.delayed != null && Object.hasOwnProperty.call(message, "delayed")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.delayed); + return writer; + }; + + /** + * Encodes the specified MsgCreateVestingAccount message, length delimited. Does not implicitly {@link cosmos.vesting.v1beta1.MsgCreateVestingAccount.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @static + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccount} message MsgCreateVestingAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateVestingAccount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgCreateVestingAccount message from the specified reader or buffer. + * @function decode + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.vesting.v1beta1.MsgCreateVestingAccount} MsgCreateVestingAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateVestingAccount.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.vesting.v1beta1.MsgCreateVestingAccount(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fromAddress = reader.string(); + break; + case 2: + message.toAddress = reader.string(); + break; + case 3: + if (!(message.amount && message.amount.length)) + message.amount = []; + message.amount.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + case 4: + message.endTime = reader.int64(); + break; + case 5: + message.delayed = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgCreateVestingAccount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.vesting.v1beta1.MsgCreateVestingAccount} MsgCreateVestingAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateVestingAccount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgCreateVestingAccount message. + * @function verify + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgCreateVestingAccount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fromAddress != null && message.hasOwnProperty("fromAddress")) + if (!$util.isString(message.fromAddress)) + return "fromAddress: string expected"; + if (message.toAddress != null && message.hasOwnProperty("toAddress")) + if (!$util.isString(message.toAddress)) + return "toAddress: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + if (!Array.isArray(message.amount)) + return "amount: array expected"; + for (var i = 0; i < message.amount.length; ++i) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.amount[i]); + if (error) + return "amount." + error; + } + } + if (message.endTime != null && message.hasOwnProperty("endTime")) + if (!$util.isInteger(message.endTime) && !(message.endTime && $util.isInteger(message.endTime.low) && $util.isInteger(message.endTime.high))) + return "endTime: integer|Long expected"; + if (message.delayed != null && message.hasOwnProperty("delayed")) + if (typeof message.delayed !== "boolean") + return "delayed: boolean expected"; + return null; + }; + + /** + * Creates a MsgCreateVestingAccount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @static + * @param {Object.} object Plain object + * @returns {cosmos.vesting.v1beta1.MsgCreateVestingAccount} MsgCreateVestingAccount + */ + MsgCreateVestingAccount.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.vesting.v1beta1.MsgCreateVestingAccount) + return object; + var message = new $root.cosmos.vesting.v1beta1.MsgCreateVestingAccount(); + if (object.fromAddress != null) + message.fromAddress = String(object.fromAddress); + if (object.toAddress != null) + message.toAddress = String(object.toAddress); + if (object.amount) { + if (!Array.isArray(object.amount)) + throw TypeError(".cosmos.vesting.v1beta1.MsgCreateVestingAccount.amount: array expected"); + message.amount = []; + for (var i = 0; i < object.amount.length; ++i) { + if (typeof object.amount[i] !== "object") + throw TypeError(".cosmos.vesting.v1beta1.MsgCreateVestingAccount.amount: object expected"); + message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]); + } + } + if (object.endTime != null) + if ($util.Long) + (message.endTime = $util.Long.fromValue(object.endTime)).unsigned = false; + else if (typeof object.endTime === "string") + message.endTime = parseInt(object.endTime, 10); + else if (typeof object.endTime === "number") + message.endTime = object.endTime; + else if (typeof object.endTime === "object") + message.endTime = new $util.LongBits(object.endTime.low >>> 0, object.endTime.high >>> 0).toNumber(); + if (object.delayed != null) + message.delayed = Boolean(object.delayed); + return message; + }; + + /** + * Creates a plain object from a MsgCreateVestingAccount message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @static + * @param {cosmos.vesting.v1beta1.MsgCreateVestingAccount} message MsgCreateVestingAccount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgCreateVestingAccount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.amount = []; + if (options.defaults) { + object.fromAddress = ""; + object.toAddress = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.endTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.endTime = options.longs === String ? "0" : 0; + object.delayed = false; + } + if (message.fromAddress != null && message.hasOwnProperty("fromAddress")) + object.fromAddress = message.fromAddress; + if (message.toAddress != null && message.hasOwnProperty("toAddress")) + object.toAddress = message.toAddress; + if (message.amount && message.amount.length) { + object.amount = []; + for (var j = 0; j < message.amount.length; ++j) + object.amount[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.amount[j], options); + } + if (message.endTime != null && message.hasOwnProperty("endTime")) + if (typeof message.endTime === "number") + object.endTime = options.longs === String ? String(message.endTime) : message.endTime; + else + object.endTime = options.longs === String ? $util.Long.prototype.toString.call(message.endTime) : options.longs === Number ? new $util.LongBits(message.endTime.low >>> 0, message.endTime.high >>> 0).toNumber() : message.endTime; + if (message.delayed != null && message.hasOwnProperty("delayed")) + object.delayed = message.delayed; + return object; + }; + + /** + * Converts this MsgCreateVestingAccount to JSON. + * @function toJSON + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @instance + * @returns {Object.} JSON object + */ + MsgCreateVestingAccount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgCreateVestingAccount; + })(v1beta1.MsgCreateVestingAccount || {}); + + v1beta1.MsgCreateVestingAccountResponse = (function(MsgCreateVestingAccountResponse) { + + /** + * Properties of a MsgCreateVestingAccountResponse. + * @memberof cosmos.vesting.v1beta1 + * @interface IMsgCreateVestingAccountResponse + */ + + /** + * Constructs a new MsgCreateVestingAccountResponse. + * @memberof cosmos.vesting.v1beta1 + * @classdesc Represents a MsgCreateVestingAccountResponse. + * @implements IMsgCreateVestingAccountResponse + * @constructor + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccountResponse=} [properties] Properties to set + */ + function MsgCreateVestingAccountResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgCreateVestingAccountResponse instance using the specified properties. + * @function create + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse + * @static + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccountResponse=} [properties] Properties to set + * @returns {cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse} MsgCreateVestingAccountResponse instance + */ + MsgCreateVestingAccountResponse.create = function create(properties) { + return new MsgCreateVestingAccountResponse(properties); + }; + + /** + * Encodes the specified MsgCreateVestingAccountResponse message. Does not implicitly {@link cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse + * @static + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccountResponse} message MsgCreateVestingAccountResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateVestingAccountResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgCreateVestingAccountResponse message, length delimited. Does not implicitly {@link cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse + * @static + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccountResponse} message MsgCreateVestingAccountResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateVestingAccountResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgCreateVestingAccountResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse} MsgCreateVestingAccountResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateVestingAccountResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgCreateVestingAccountResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse} MsgCreateVestingAccountResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateVestingAccountResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgCreateVestingAccountResponse message. + * @function verify + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgCreateVestingAccountResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgCreateVestingAccountResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse} MsgCreateVestingAccountResponse + */ + MsgCreateVestingAccountResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse) + return object; + return new $root.cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse(); + }; + + /** + * Creates a plain object from a MsgCreateVestingAccountResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse + * @static + * @param {cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse} message MsgCreateVestingAccountResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgCreateVestingAccountResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgCreateVestingAccountResponse to JSON. + * @function toJSON + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse + * @instance + * @returns {Object.} JSON object + */ + MsgCreateVestingAccountResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgCreateVestingAccountResponse; + })(v1beta1.MsgCreateVestingAccountResponse || {}); + + return v1beta1; + })(vesting.v1beta1 || {}); + + return vesting; + })(cosmos.vesting || {}); + + return cosmos; +})($root.cosmos || {}); + +/** + * Namespace google. + * @exports google + * @namespace + */ + +$root.google = (function(google) { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + + google.protobuf = (function(protobuf) { + + protobuf.Timestamp = (function(Timestamp) { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Timestamp; + })(protobuf.Timestamp || {}); + + protobuf.Any = (function(Any) { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type_url = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Any; + })(protobuf.Any || {}); + + protobuf.Duration = (function(Duration) { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Duration; + })(protobuf.Duration || {}); + + return protobuf; + })(google.protobuf || {}); + + return google; +})($root.google || {}); + +/** + * Namespace tendermint. + * @exports tendermint + * @namespace + */ + +$root.tendermint = (function(tendermint) { + + /** + * Namespace abci. + * @memberof tendermint + * @namespace + */ + + tendermint.abci = (function(abci) { + + abci.Request = (function(Request) { + + /** + * Properties of a Request. + * @memberof tendermint.abci + * @interface IRequest + * @property {tendermint.abci.IRequestEcho|null} [echo] Request echo + * @property {tendermint.abci.IRequestFlush|null} [flush] Request flush + * @property {tendermint.abci.IRequestInfo|null} [info] Request info + * @property {tendermint.abci.IRequestSetOption|null} [setOption] Request setOption + * @property {tendermint.abci.IRequestInitChain|null} [initChain] Request initChain + * @property {tendermint.abci.IRequestQuery|null} [query] Request query + * @property {tendermint.abci.IRequestBeginBlock|null} [beginBlock] Request beginBlock + * @property {tendermint.abci.IRequestCheckTx|null} [checkTx] Request checkTx + * @property {tendermint.abci.IRequestDeliverTx|null} [deliverTx] Request deliverTx + * @property {tendermint.abci.IRequestEndBlock|null} [endBlock] Request endBlock + * @property {tendermint.abci.IRequestCommit|null} [commit] Request commit + * @property {tendermint.abci.IRequestListSnapshots|null} [listSnapshots] Request listSnapshots + * @property {tendermint.abci.IRequestOfferSnapshot|null} [offerSnapshot] Request offerSnapshot + * @property {tendermint.abci.IRequestLoadSnapshotChunk|null} [loadSnapshotChunk] Request loadSnapshotChunk + * @property {tendermint.abci.IRequestApplySnapshotChunk|null} [applySnapshotChunk] Request applySnapshotChunk + */ + + /** + * Constructs a new Request. + * @memberof tendermint.abci + * @classdesc Represents a Request. + * @implements IRequest + * @constructor + * @param {tendermint.abci.IRequest=} [properties] Properties to set + */ + function Request(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Request echo. + * @member {tendermint.abci.IRequestEcho|null|undefined} echo + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.echo = null; + + /** + * Request flush. + * @member {tendermint.abci.IRequestFlush|null|undefined} flush + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.flush = null; + + /** + * Request info. + * @member {tendermint.abci.IRequestInfo|null|undefined} info + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.info = null; + + /** + * Request setOption. + * @member {tendermint.abci.IRequestSetOption|null|undefined} setOption + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.setOption = null; + + /** + * Request initChain. + * @member {tendermint.abci.IRequestInitChain|null|undefined} initChain + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.initChain = null; + + /** + * Request query. + * @member {tendermint.abci.IRequestQuery|null|undefined} query + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.query = null; + + /** + * Request beginBlock. + * @member {tendermint.abci.IRequestBeginBlock|null|undefined} beginBlock + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.beginBlock = null; + + /** + * Request checkTx. + * @member {tendermint.abci.IRequestCheckTx|null|undefined} checkTx + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.checkTx = null; + + /** + * Request deliverTx. + * @member {tendermint.abci.IRequestDeliverTx|null|undefined} deliverTx + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.deliverTx = null; + + /** + * Request endBlock. + * @member {tendermint.abci.IRequestEndBlock|null|undefined} endBlock + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.endBlock = null; + + /** + * Request commit. + * @member {tendermint.abci.IRequestCommit|null|undefined} commit + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.commit = null; + + /** + * Request listSnapshots. + * @member {tendermint.abci.IRequestListSnapshots|null|undefined} listSnapshots + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.listSnapshots = null; + + /** + * Request offerSnapshot. + * @member {tendermint.abci.IRequestOfferSnapshot|null|undefined} offerSnapshot + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.offerSnapshot = null; + + /** + * Request loadSnapshotChunk. + * @member {tendermint.abci.IRequestLoadSnapshotChunk|null|undefined} loadSnapshotChunk + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.loadSnapshotChunk = null; + + /** + * Request applySnapshotChunk. + * @member {tendermint.abci.IRequestApplySnapshotChunk|null|undefined} applySnapshotChunk + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.applySnapshotChunk = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Request value. + * @member {"echo"|"flush"|"info"|"setOption"|"initChain"|"query"|"beginBlock"|"checkTx"|"deliverTx"|"endBlock"|"commit"|"listSnapshots"|"offerSnapshot"|"loadSnapshotChunk"|"applySnapshotChunk"|undefined} value + * @memberof tendermint.abci.Request + * @instance + */ + Object.defineProperty(Request.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["echo", "flush", "info", "setOption", "initChain", "query", "beginBlock", "checkTx", "deliverTx", "endBlock", "commit", "listSnapshots", "offerSnapshot", "loadSnapshotChunk", "applySnapshotChunk"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Request instance using the specified properties. + * @function create + * @memberof tendermint.abci.Request + * @static + * @param {tendermint.abci.IRequest=} [properties] Properties to set + * @returns {tendermint.abci.Request} Request instance + */ + Request.create = function create(properties) { + return new Request(properties); + }; + + /** + * Encodes the specified Request message. Does not implicitly {@link tendermint.abci.Request.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.Request + * @static + * @param {tendermint.abci.IRequest} message Request message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Request.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.echo != null && Object.hasOwnProperty.call(message, "echo")) + $root.tendermint.abci.RequestEcho.encode(message.echo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.flush != null && Object.hasOwnProperty.call(message, "flush")) + $root.tendermint.abci.RequestFlush.encode(message.flush, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.info != null && Object.hasOwnProperty.call(message, "info")) + $root.tendermint.abci.RequestInfo.encode(message.info, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.setOption != null && Object.hasOwnProperty.call(message, "setOption")) + $root.tendermint.abci.RequestSetOption.encode(message.setOption, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.initChain != null && Object.hasOwnProperty.call(message, "initChain")) + $root.tendermint.abci.RequestInitChain.encode(message.initChain, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + $root.tendermint.abci.RequestQuery.encode(message.query, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.beginBlock != null && Object.hasOwnProperty.call(message, "beginBlock")) + $root.tendermint.abci.RequestBeginBlock.encode(message.beginBlock, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.checkTx != null && Object.hasOwnProperty.call(message, "checkTx")) + $root.tendermint.abci.RequestCheckTx.encode(message.checkTx, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.deliverTx != null && Object.hasOwnProperty.call(message, "deliverTx")) + $root.tendermint.abci.RequestDeliverTx.encode(message.deliverTx, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.endBlock != null && Object.hasOwnProperty.call(message, "endBlock")) + $root.tendermint.abci.RequestEndBlock.encode(message.endBlock, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.commit != null && Object.hasOwnProperty.call(message, "commit")) + $root.tendermint.abci.RequestCommit.encode(message.commit, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.listSnapshots != null && Object.hasOwnProperty.call(message, "listSnapshots")) + $root.tendermint.abci.RequestListSnapshots.encode(message.listSnapshots, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.offerSnapshot != null && Object.hasOwnProperty.call(message, "offerSnapshot")) + $root.tendermint.abci.RequestOfferSnapshot.encode(message.offerSnapshot, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.loadSnapshotChunk != null && Object.hasOwnProperty.call(message, "loadSnapshotChunk")) + $root.tendermint.abci.RequestLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.applySnapshotChunk != null && Object.hasOwnProperty.call(message, "applySnapshotChunk")) + $root.tendermint.abci.RequestApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Request message, length delimited. Does not implicitly {@link tendermint.abci.Request.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.Request + * @static + * @param {tendermint.abci.IRequest} message Request message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Request.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Request message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.Request + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.Request} Request + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Request.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.Request(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.echo = $root.tendermint.abci.RequestEcho.decode(reader, reader.uint32()); + break; + case 2: + message.flush = $root.tendermint.abci.RequestFlush.decode(reader, reader.uint32()); + break; + case 3: + message.info = $root.tendermint.abci.RequestInfo.decode(reader, reader.uint32()); + break; + case 4: + message.setOption = $root.tendermint.abci.RequestSetOption.decode(reader, reader.uint32()); + break; + case 5: + message.initChain = $root.tendermint.abci.RequestInitChain.decode(reader, reader.uint32()); + break; + case 6: + message.query = $root.tendermint.abci.RequestQuery.decode(reader, reader.uint32()); + break; + case 7: + message.beginBlock = $root.tendermint.abci.RequestBeginBlock.decode(reader, reader.uint32()); + break; + case 8: + message.checkTx = $root.tendermint.abci.RequestCheckTx.decode(reader, reader.uint32()); + break; + case 9: + message.deliverTx = $root.tendermint.abci.RequestDeliverTx.decode(reader, reader.uint32()); + break; + case 10: + message.endBlock = $root.tendermint.abci.RequestEndBlock.decode(reader, reader.uint32()); + break; + case 11: + message.commit = $root.tendermint.abci.RequestCommit.decode(reader, reader.uint32()); + break; + case 12: + message.listSnapshots = $root.tendermint.abci.RequestListSnapshots.decode(reader, reader.uint32()); + break; + case 13: + message.offerSnapshot = $root.tendermint.abci.RequestOfferSnapshot.decode(reader, reader.uint32()); + break; + case 14: + message.loadSnapshotChunk = $root.tendermint.abci.RequestLoadSnapshotChunk.decode(reader, reader.uint32()); + break; + case 15: + message.applySnapshotChunk = $root.tendermint.abci.RequestApplySnapshotChunk.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Request message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.Request + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.Request} Request + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Request.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Request message. + * @function verify + * @memberof tendermint.abci.Request + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Request.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.echo != null && message.hasOwnProperty("echo")) { + properties.value = 1; + { + var error = $root.tendermint.abci.RequestEcho.verify(message.echo); + if (error) + return "echo." + error; + } + } + if (message.flush != null && message.hasOwnProperty("flush")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.RequestFlush.verify(message.flush); + if (error) + return "flush." + error; + } + } + if (message.info != null && message.hasOwnProperty("info")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.RequestInfo.verify(message.info); + if (error) + return "info." + error; + } + } + if (message.setOption != null && message.hasOwnProperty("setOption")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.RequestSetOption.verify(message.setOption); + if (error) + return "setOption." + error; + } + } + if (message.initChain != null && message.hasOwnProperty("initChain")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.RequestInitChain.verify(message.initChain); + if (error) + return "initChain." + error; + } + } + if (message.query != null && message.hasOwnProperty("query")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.RequestQuery.verify(message.query); + if (error) + return "query." + error; + } + } + if (message.beginBlock != null && message.hasOwnProperty("beginBlock")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.RequestBeginBlock.verify(message.beginBlock); + if (error) + return "beginBlock." + error; + } + } + if (message.checkTx != null && message.hasOwnProperty("checkTx")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.RequestCheckTx.verify(message.checkTx); + if (error) + return "checkTx." + error; + } + } + if (message.deliverTx != null && message.hasOwnProperty("deliverTx")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.RequestDeliverTx.verify(message.deliverTx); + if (error) + return "deliverTx." + error; + } + } + if (message.endBlock != null && message.hasOwnProperty("endBlock")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.RequestEndBlock.verify(message.endBlock); + if (error) + return "endBlock." + error; + } + } + if (message.commit != null && message.hasOwnProperty("commit")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.RequestCommit.verify(message.commit); + if (error) + return "commit." + error; + } + } + if (message.listSnapshots != null && message.hasOwnProperty("listSnapshots")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.RequestListSnapshots.verify(message.listSnapshots); + if (error) + return "listSnapshots." + error; + } + } + if (message.offerSnapshot != null && message.hasOwnProperty("offerSnapshot")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.RequestOfferSnapshot.verify(message.offerSnapshot); + if (error) + return "offerSnapshot." + error; + } + } + if (message.loadSnapshotChunk != null && message.hasOwnProperty("loadSnapshotChunk")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.RequestLoadSnapshotChunk.verify(message.loadSnapshotChunk); + if (error) + return "loadSnapshotChunk." + error; + } + } + if (message.applySnapshotChunk != null && message.hasOwnProperty("applySnapshotChunk")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.RequestApplySnapshotChunk.verify(message.applySnapshotChunk); + if (error) + return "applySnapshotChunk." + error; + } + } + return null; + }; + + /** + * Creates a Request message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.Request + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.Request} Request + */ + Request.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.Request) + return object; + var message = new $root.tendermint.abci.Request(); + if (object.echo != null) { + if (typeof object.echo !== "object") + throw TypeError(".tendermint.abci.Request.echo: object expected"); + message.echo = $root.tendermint.abci.RequestEcho.fromObject(object.echo); + } + if (object.flush != null) { + if (typeof object.flush !== "object") + throw TypeError(".tendermint.abci.Request.flush: object expected"); + message.flush = $root.tendermint.abci.RequestFlush.fromObject(object.flush); + } + if (object.info != null) { + if (typeof object.info !== "object") + throw TypeError(".tendermint.abci.Request.info: object expected"); + message.info = $root.tendermint.abci.RequestInfo.fromObject(object.info); + } + if (object.setOption != null) { + if (typeof object.setOption !== "object") + throw TypeError(".tendermint.abci.Request.setOption: object expected"); + message.setOption = $root.tendermint.abci.RequestSetOption.fromObject(object.setOption); + } + if (object.initChain != null) { + if (typeof object.initChain !== "object") + throw TypeError(".tendermint.abci.Request.initChain: object expected"); + message.initChain = $root.tendermint.abci.RequestInitChain.fromObject(object.initChain); + } + if (object.query != null) { + if (typeof object.query !== "object") + throw TypeError(".tendermint.abci.Request.query: object expected"); + message.query = $root.tendermint.abci.RequestQuery.fromObject(object.query); + } + if (object.beginBlock != null) { + if (typeof object.beginBlock !== "object") + throw TypeError(".tendermint.abci.Request.beginBlock: object expected"); + message.beginBlock = $root.tendermint.abci.RequestBeginBlock.fromObject(object.beginBlock); + } + if (object.checkTx != null) { + if (typeof object.checkTx !== "object") + throw TypeError(".tendermint.abci.Request.checkTx: object expected"); + message.checkTx = $root.tendermint.abci.RequestCheckTx.fromObject(object.checkTx); + } + if (object.deliverTx != null) { + if (typeof object.deliverTx !== "object") + throw TypeError(".tendermint.abci.Request.deliverTx: object expected"); + message.deliverTx = $root.tendermint.abci.RequestDeliverTx.fromObject(object.deliverTx); + } + if (object.endBlock != null) { + if (typeof object.endBlock !== "object") + throw TypeError(".tendermint.abci.Request.endBlock: object expected"); + message.endBlock = $root.tendermint.abci.RequestEndBlock.fromObject(object.endBlock); + } + if (object.commit != null) { + if (typeof object.commit !== "object") + throw TypeError(".tendermint.abci.Request.commit: object expected"); + message.commit = $root.tendermint.abci.RequestCommit.fromObject(object.commit); + } + if (object.listSnapshots != null) { + if (typeof object.listSnapshots !== "object") + throw TypeError(".tendermint.abci.Request.listSnapshots: object expected"); + message.listSnapshots = $root.tendermint.abci.RequestListSnapshots.fromObject(object.listSnapshots); + } + if (object.offerSnapshot != null) { + if (typeof object.offerSnapshot !== "object") + throw TypeError(".tendermint.abci.Request.offerSnapshot: object expected"); + message.offerSnapshot = $root.tendermint.abci.RequestOfferSnapshot.fromObject(object.offerSnapshot); + } + if (object.loadSnapshotChunk != null) { + if (typeof object.loadSnapshotChunk !== "object") + throw TypeError(".tendermint.abci.Request.loadSnapshotChunk: object expected"); + message.loadSnapshotChunk = $root.tendermint.abci.RequestLoadSnapshotChunk.fromObject(object.loadSnapshotChunk); + } + if (object.applySnapshotChunk != null) { + if (typeof object.applySnapshotChunk !== "object") + throw TypeError(".tendermint.abci.Request.applySnapshotChunk: object expected"); + message.applySnapshotChunk = $root.tendermint.abci.RequestApplySnapshotChunk.fromObject(object.applySnapshotChunk); + } + return message; + }; + + /** + * Creates a plain object from a Request message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.Request + * @static + * @param {tendermint.abci.Request} message Request + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Request.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.echo != null && message.hasOwnProperty("echo")) { + object.echo = $root.tendermint.abci.RequestEcho.toObject(message.echo, options); + if (options.oneofs) + object.value = "echo"; + } + if (message.flush != null && message.hasOwnProperty("flush")) { + object.flush = $root.tendermint.abci.RequestFlush.toObject(message.flush, options); + if (options.oneofs) + object.value = "flush"; + } + if (message.info != null && message.hasOwnProperty("info")) { + object.info = $root.tendermint.abci.RequestInfo.toObject(message.info, options); + if (options.oneofs) + object.value = "info"; + } + if (message.setOption != null && message.hasOwnProperty("setOption")) { + object.setOption = $root.tendermint.abci.RequestSetOption.toObject(message.setOption, options); + if (options.oneofs) + object.value = "setOption"; + } + if (message.initChain != null && message.hasOwnProperty("initChain")) { + object.initChain = $root.tendermint.abci.RequestInitChain.toObject(message.initChain, options); + if (options.oneofs) + object.value = "initChain"; + } + if (message.query != null && message.hasOwnProperty("query")) { + object.query = $root.tendermint.abci.RequestQuery.toObject(message.query, options); + if (options.oneofs) + object.value = "query"; + } + if (message.beginBlock != null && message.hasOwnProperty("beginBlock")) { + object.beginBlock = $root.tendermint.abci.RequestBeginBlock.toObject(message.beginBlock, options); + if (options.oneofs) + object.value = "beginBlock"; + } + if (message.checkTx != null && message.hasOwnProperty("checkTx")) { + object.checkTx = $root.tendermint.abci.RequestCheckTx.toObject(message.checkTx, options); + if (options.oneofs) + object.value = "checkTx"; + } + if (message.deliverTx != null && message.hasOwnProperty("deliverTx")) { + object.deliverTx = $root.tendermint.abci.RequestDeliverTx.toObject(message.deliverTx, options); + if (options.oneofs) + object.value = "deliverTx"; + } + if (message.endBlock != null && message.hasOwnProperty("endBlock")) { + object.endBlock = $root.tendermint.abci.RequestEndBlock.toObject(message.endBlock, options); + if (options.oneofs) + object.value = "endBlock"; + } + if (message.commit != null && message.hasOwnProperty("commit")) { + object.commit = $root.tendermint.abci.RequestCommit.toObject(message.commit, options); + if (options.oneofs) + object.value = "commit"; + } + if (message.listSnapshots != null && message.hasOwnProperty("listSnapshots")) { + object.listSnapshots = $root.tendermint.abci.RequestListSnapshots.toObject(message.listSnapshots, options); + if (options.oneofs) + object.value = "listSnapshots"; + } + if (message.offerSnapshot != null && message.hasOwnProperty("offerSnapshot")) { + object.offerSnapshot = $root.tendermint.abci.RequestOfferSnapshot.toObject(message.offerSnapshot, options); + if (options.oneofs) + object.value = "offerSnapshot"; + } + if (message.loadSnapshotChunk != null && message.hasOwnProperty("loadSnapshotChunk")) { + object.loadSnapshotChunk = $root.tendermint.abci.RequestLoadSnapshotChunk.toObject(message.loadSnapshotChunk, options); + if (options.oneofs) + object.value = "loadSnapshotChunk"; + } + if (message.applySnapshotChunk != null && message.hasOwnProperty("applySnapshotChunk")) { + object.applySnapshotChunk = $root.tendermint.abci.RequestApplySnapshotChunk.toObject(message.applySnapshotChunk, options); + if (options.oneofs) + object.value = "applySnapshotChunk"; + } + return object; + }; + + /** + * Converts this Request to JSON. + * @function toJSON + * @memberof tendermint.abci.Request + * @instance + * @returns {Object.} JSON object + */ + Request.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Request; + })(abci.Request || {}); + + abci.RequestEcho = (function(RequestEcho) { + + /** + * Properties of a RequestEcho. + * @memberof tendermint.abci + * @interface IRequestEcho + * @property {string|null} [message] RequestEcho message + */ + + /** + * Constructs a new RequestEcho. + * @memberof tendermint.abci + * @classdesc Represents a RequestEcho. + * @implements IRequestEcho + * @constructor + * @param {tendermint.abci.IRequestEcho=} [properties] Properties to set + */ + function RequestEcho(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestEcho message. + * @member {string} message + * @memberof tendermint.abci.RequestEcho + * @instance + */ + RequestEcho.prototype.message = ""; + + /** + * Creates a new RequestEcho instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestEcho + * @static + * @param {tendermint.abci.IRequestEcho=} [properties] Properties to set + * @returns {tendermint.abci.RequestEcho} RequestEcho instance + */ + RequestEcho.create = function create(properties) { + return new RequestEcho(properties); + }; + + /** + * Encodes the specified RequestEcho message. Does not implicitly {@link tendermint.abci.RequestEcho.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestEcho + * @static + * @param {tendermint.abci.IRequestEcho} message RequestEcho message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestEcho.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + return writer; + }; + + /** + * Encodes the specified RequestEcho message, length delimited. Does not implicitly {@link tendermint.abci.RequestEcho.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestEcho + * @static + * @param {tendermint.abci.IRequestEcho} message RequestEcho message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestEcho.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestEcho message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestEcho + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestEcho} RequestEcho + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestEcho.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestEcho(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestEcho message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestEcho + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestEcho} RequestEcho + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestEcho.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestEcho message. + * @function verify + * @memberof tendermint.abci.RequestEcho + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestEcho.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + return null; + }; + + /** + * Creates a RequestEcho message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestEcho + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestEcho} RequestEcho + */ + RequestEcho.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestEcho) + return object; + var message = new $root.tendermint.abci.RequestEcho(); + if (object.message != null) + message.message = String(object.message); + return message; + }; + + /** + * Creates a plain object from a RequestEcho message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestEcho + * @static + * @param {tendermint.abci.RequestEcho} message RequestEcho + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestEcho.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.message = ""; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + return object; + }; + + /** + * Converts this RequestEcho to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestEcho + * @instance + * @returns {Object.} JSON object + */ + RequestEcho.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestEcho; + })(abci.RequestEcho || {}); + + abci.RequestFlush = (function(RequestFlush) { + + /** + * Properties of a RequestFlush. + * @memberof tendermint.abci + * @interface IRequestFlush + */ + + /** + * Constructs a new RequestFlush. + * @memberof tendermint.abci + * @classdesc Represents a RequestFlush. + * @implements IRequestFlush + * @constructor + * @param {tendermint.abci.IRequestFlush=} [properties] Properties to set + */ + function RequestFlush(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new RequestFlush instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestFlush + * @static + * @param {tendermint.abci.IRequestFlush=} [properties] Properties to set + * @returns {tendermint.abci.RequestFlush} RequestFlush instance + */ + RequestFlush.create = function create(properties) { + return new RequestFlush(properties); + }; + + /** + * Encodes the specified RequestFlush message. Does not implicitly {@link tendermint.abci.RequestFlush.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestFlush + * @static + * @param {tendermint.abci.IRequestFlush} message RequestFlush message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestFlush.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RequestFlush message, length delimited. Does not implicitly {@link tendermint.abci.RequestFlush.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestFlush + * @static + * @param {tendermint.abci.IRequestFlush} message RequestFlush message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestFlush.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestFlush message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestFlush + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestFlush} RequestFlush + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestFlush.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestFlush(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestFlush message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestFlush + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestFlush} RequestFlush + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestFlush.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestFlush message. + * @function verify + * @memberof tendermint.abci.RequestFlush + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestFlush.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RequestFlush message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestFlush + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestFlush} RequestFlush + */ + RequestFlush.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestFlush) + return object; + return new $root.tendermint.abci.RequestFlush(); + }; + + /** + * Creates a plain object from a RequestFlush message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestFlush + * @static + * @param {tendermint.abci.RequestFlush} message RequestFlush + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestFlush.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RequestFlush to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestFlush + * @instance + * @returns {Object.} JSON object + */ + RequestFlush.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestFlush; + })(abci.RequestFlush || {}); + + abci.RequestInfo = (function(RequestInfo) { + + /** + * Properties of a RequestInfo. + * @memberof tendermint.abci + * @interface IRequestInfo + * @property {string|null} [version] RequestInfo version + * @property {number|Long|null} [blockVersion] RequestInfo blockVersion + * @property {number|Long|null} [p2pVersion] RequestInfo p2pVersion + */ + + /** + * Constructs a new RequestInfo. + * @memberof tendermint.abci + * @classdesc Represents a RequestInfo. + * @implements IRequestInfo + * @constructor + * @param {tendermint.abci.IRequestInfo=} [properties] Properties to set + */ + function RequestInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestInfo version. + * @member {string} version + * @memberof tendermint.abci.RequestInfo + * @instance + */ + RequestInfo.prototype.version = ""; + + /** + * RequestInfo blockVersion. + * @member {number|Long} blockVersion + * @memberof tendermint.abci.RequestInfo + * @instance + */ + RequestInfo.prototype.blockVersion = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * RequestInfo p2pVersion. + * @member {number|Long} p2pVersion + * @memberof tendermint.abci.RequestInfo + * @instance + */ + RequestInfo.prototype.p2pVersion = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new RequestInfo instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestInfo + * @static + * @param {tendermint.abci.IRequestInfo=} [properties] Properties to set + * @returns {tendermint.abci.RequestInfo} RequestInfo instance + */ + RequestInfo.create = function create(properties) { + return new RequestInfo(properties); + }; + + /** + * Encodes the specified RequestInfo message. Does not implicitly {@link tendermint.abci.RequestInfo.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestInfo + * @static + * @param {tendermint.abci.IRequestInfo} message RequestInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.blockVersion != null && Object.hasOwnProperty.call(message, "blockVersion")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.blockVersion); + if (message.p2pVersion != null && Object.hasOwnProperty.call(message, "p2pVersion")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.p2pVersion); + return writer; + }; + + /** + * Encodes the specified RequestInfo message, length delimited. Does not implicitly {@link tendermint.abci.RequestInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestInfo + * @static + * @param {tendermint.abci.IRequestInfo} message RequestInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestInfo message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestInfo} RequestInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.string(); + break; + case 2: + message.blockVersion = reader.uint64(); + break; + case 3: + message.p2pVersion = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestInfo} RequestInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestInfo message. + * @function verify + * @memberof tendermint.abci.RequestInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.blockVersion != null && message.hasOwnProperty("blockVersion")) + if (!$util.isInteger(message.blockVersion) && !(message.blockVersion && $util.isInteger(message.blockVersion.low) && $util.isInteger(message.blockVersion.high))) + return "blockVersion: integer|Long expected"; + if (message.p2pVersion != null && message.hasOwnProperty("p2pVersion")) + if (!$util.isInteger(message.p2pVersion) && !(message.p2pVersion && $util.isInteger(message.p2pVersion.low) && $util.isInteger(message.p2pVersion.high))) + return "p2pVersion: integer|Long expected"; + return null; + }; + + /** + * Creates a RequestInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestInfo + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestInfo} RequestInfo + */ + RequestInfo.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestInfo) + return object; + var message = new $root.tendermint.abci.RequestInfo(); + if (object.version != null) + message.version = String(object.version); + if (object.blockVersion != null) + if ($util.Long) + (message.blockVersion = $util.Long.fromValue(object.blockVersion)).unsigned = true; + else if (typeof object.blockVersion === "string") + message.blockVersion = parseInt(object.blockVersion, 10); + else if (typeof object.blockVersion === "number") + message.blockVersion = object.blockVersion; + else if (typeof object.blockVersion === "object") + message.blockVersion = new $util.LongBits(object.blockVersion.low >>> 0, object.blockVersion.high >>> 0).toNumber(true); + if (object.p2pVersion != null) + if ($util.Long) + (message.p2pVersion = $util.Long.fromValue(object.p2pVersion)).unsigned = true; + else if (typeof object.p2pVersion === "string") + message.p2pVersion = parseInt(object.p2pVersion, 10); + else if (typeof object.p2pVersion === "number") + message.p2pVersion = object.p2pVersion; + else if (typeof object.p2pVersion === "object") + message.p2pVersion = new $util.LongBits(object.p2pVersion.low >>> 0, object.p2pVersion.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a RequestInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestInfo + * @static + * @param {tendermint.abci.RequestInfo} message RequestInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.blockVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.blockVersion = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.p2pVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.p2pVersion = options.longs === String ? "0" : 0; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.blockVersion != null && message.hasOwnProperty("blockVersion")) + if (typeof message.blockVersion === "number") + object.blockVersion = options.longs === String ? String(message.blockVersion) : message.blockVersion; + else + object.blockVersion = options.longs === String ? $util.Long.prototype.toString.call(message.blockVersion) : options.longs === Number ? new $util.LongBits(message.blockVersion.low >>> 0, message.blockVersion.high >>> 0).toNumber(true) : message.blockVersion; + if (message.p2pVersion != null && message.hasOwnProperty("p2pVersion")) + if (typeof message.p2pVersion === "number") + object.p2pVersion = options.longs === String ? String(message.p2pVersion) : message.p2pVersion; + else + object.p2pVersion = options.longs === String ? $util.Long.prototype.toString.call(message.p2pVersion) : options.longs === Number ? new $util.LongBits(message.p2pVersion.low >>> 0, message.p2pVersion.high >>> 0).toNumber(true) : message.p2pVersion; + return object; + }; + + /** + * Converts this RequestInfo to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestInfo + * @instance + * @returns {Object.} JSON object + */ + RequestInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestInfo; + })(abci.RequestInfo || {}); + + abci.RequestSetOption = (function(RequestSetOption) { + + /** + * Properties of a RequestSetOption. + * @memberof tendermint.abci + * @interface IRequestSetOption + * @property {string|null} [key] RequestSetOption key + * @property {string|null} [value] RequestSetOption value + */ + + /** + * Constructs a new RequestSetOption. + * @memberof tendermint.abci + * @classdesc Represents a RequestSetOption. + * @implements IRequestSetOption + * @constructor + * @param {tendermint.abci.IRequestSetOption=} [properties] Properties to set + */ + function RequestSetOption(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestSetOption key. + * @member {string} key + * @memberof tendermint.abci.RequestSetOption + * @instance + */ + RequestSetOption.prototype.key = ""; + + /** + * RequestSetOption value. + * @member {string} value + * @memberof tendermint.abci.RequestSetOption + * @instance + */ + RequestSetOption.prototype.value = ""; + + /** + * Creates a new RequestSetOption instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestSetOption + * @static + * @param {tendermint.abci.IRequestSetOption=} [properties] Properties to set + * @returns {tendermint.abci.RequestSetOption} RequestSetOption instance + */ + RequestSetOption.create = function create(properties) { + return new RequestSetOption(properties); + }; + + /** + * Encodes the specified RequestSetOption message. Does not implicitly {@link tendermint.abci.RequestSetOption.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestSetOption + * @static + * @param {tendermint.abci.IRequestSetOption} message RequestSetOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestSetOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + return writer; + }; + + /** + * Encodes the specified RequestSetOption message, length delimited. Does not implicitly {@link tendermint.abci.RequestSetOption.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestSetOption + * @static + * @param {tendermint.abci.IRequestSetOption} message RequestSetOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestSetOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestSetOption message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestSetOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestSetOption} RequestSetOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestSetOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestSetOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestSetOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestSetOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestSetOption} RequestSetOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestSetOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestSetOption message. + * @function verify + * @memberof tendermint.abci.RequestSetOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestSetOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a RequestSetOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestSetOption + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestSetOption} RequestSetOption + */ + RequestSetOption.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestSetOption) + return object; + var message = new $root.tendermint.abci.RequestSetOption(); + if (object.key != null) + message.key = String(object.key); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a RequestSetOption message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestSetOption + * @static + * @param {tendermint.abci.RequestSetOption} message RequestSetOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestSetOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.key = ""; + object.value = ""; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this RequestSetOption to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestSetOption + * @instance + * @returns {Object.} JSON object + */ + RequestSetOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestSetOption; + })(abci.RequestSetOption || {}); + + abci.RequestInitChain = (function(RequestInitChain) { + + /** + * Properties of a RequestInitChain. + * @memberof tendermint.abci + * @interface IRequestInitChain + * @property {google.protobuf.ITimestamp|null} [time] RequestInitChain time + * @property {string|null} [chainId] RequestInitChain chainId + * @property {tendermint.abci.IConsensusParams|null} [consensusParams] RequestInitChain consensusParams + * @property {Array.|null} [validators] RequestInitChain validators + * @property {Uint8Array|null} [appStateBytes] RequestInitChain appStateBytes + * @property {number|Long|null} [initialHeight] RequestInitChain initialHeight + */ + + /** + * Constructs a new RequestInitChain. + * @memberof tendermint.abci + * @classdesc Represents a RequestInitChain. + * @implements IRequestInitChain + * @constructor + * @param {tendermint.abci.IRequestInitChain=} [properties] Properties to set + */ + function RequestInitChain(properties) { + this.validators = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestInitChain time. + * @member {google.protobuf.ITimestamp|null|undefined} time + * @memberof tendermint.abci.RequestInitChain + * @instance + */ + RequestInitChain.prototype.time = null; + + /** + * RequestInitChain chainId. + * @member {string} chainId + * @memberof tendermint.abci.RequestInitChain + * @instance + */ + RequestInitChain.prototype.chainId = ""; + + /** + * RequestInitChain consensusParams. + * @member {tendermint.abci.IConsensusParams|null|undefined} consensusParams + * @memberof tendermint.abci.RequestInitChain + * @instance + */ + RequestInitChain.prototype.consensusParams = null; + + /** + * RequestInitChain validators. + * @member {Array.} validators + * @memberof tendermint.abci.RequestInitChain + * @instance + */ + RequestInitChain.prototype.validators = $util.emptyArray; + + /** + * RequestInitChain appStateBytes. + * @member {Uint8Array} appStateBytes + * @memberof tendermint.abci.RequestInitChain + * @instance + */ + RequestInitChain.prototype.appStateBytes = $util.newBuffer([]); + + /** + * RequestInitChain initialHeight. + * @member {number|Long} initialHeight + * @memberof tendermint.abci.RequestInitChain + * @instance + */ + RequestInitChain.prototype.initialHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RequestInitChain instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestInitChain + * @static + * @param {tendermint.abci.IRequestInitChain=} [properties] Properties to set + * @returns {tendermint.abci.RequestInitChain} RequestInitChain instance + */ + RequestInitChain.create = function create(properties) { + return new RequestInitChain(properties); + }; + + /** + * Encodes the specified RequestInitChain message. Does not implicitly {@link tendermint.abci.RequestInitChain.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestInitChain + * @static + * @param {tendermint.abci.IRequestInitChain} message RequestInitChain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestInitChain.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.time != null && Object.hasOwnProperty.call(message, "time")) + $root.google.protobuf.Timestamp.encode(message.time, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.chainId != null && Object.hasOwnProperty.call(message, "chainId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.chainId); + if (message.consensusParams != null && Object.hasOwnProperty.call(message, "consensusParams")) + $root.tendermint.abci.ConsensusParams.encode(message.consensusParams, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.validators != null && message.validators.length) + for (var i = 0; i < message.validators.length; ++i) + $root.tendermint.abci.ValidatorUpdate.encode(message.validators[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.appStateBytes != null && Object.hasOwnProperty.call(message, "appStateBytes")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.appStateBytes); + if (message.initialHeight != null && Object.hasOwnProperty.call(message, "initialHeight")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.initialHeight); + return writer; + }; + + /** + * Encodes the specified RequestInitChain message, length delimited. Does not implicitly {@link tendermint.abci.RequestInitChain.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestInitChain + * @static + * @param {tendermint.abci.IRequestInitChain} message RequestInitChain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestInitChain.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestInitChain message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestInitChain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestInitChain} RequestInitChain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestInitChain.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestInitChain(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 2: + message.chainId = reader.string(); + break; + case 3: + message.consensusParams = $root.tendermint.abci.ConsensusParams.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.validators && message.validators.length)) + message.validators = []; + message.validators.push($root.tendermint.abci.ValidatorUpdate.decode(reader, reader.uint32())); + break; + case 5: + message.appStateBytes = reader.bytes(); + break; + case 6: + message.initialHeight = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestInitChain message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestInitChain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestInitChain} RequestInitChain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestInitChain.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestInitChain message. + * @function verify + * @memberof tendermint.abci.RequestInitChain + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestInitChain.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.time != null && message.hasOwnProperty("time")) { + var error = $root.google.protobuf.Timestamp.verify(message.time); + if (error) + return "time." + error; + } + if (message.chainId != null && message.hasOwnProperty("chainId")) + if (!$util.isString(message.chainId)) + return "chainId: string expected"; + if (message.consensusParams != null && message.hasOwnProperty("consensusParams")) { + var error = $root.tendermint.abci.ConsensusParams.verify(message.consensusParams); + if (error) + return "consensusParams." + error; + } + if (message.validators != null && message.hasOwnProperty("validators")) { + if (!Array.isArray(message.validators)) + return "validators: array expected"; + for (var i = 0; i < message.validators.length; ++i) { + var error = $root.tendermint.abci.ValidatorUpdate.verify(message.validators[i]); + if (error) + return "validators." + error; + } + } + if (message.appStateBytes != null && message.hasOwnProperty("appStateBytes")) + if (!(message.appStateBytes && typeof message.appStateBytes.length === "number" || $util.isString(message.appStateBytes))) + return "appStateBytes: buffer expected"; + if (message.initialHeight != null && message.hasOwnProperty("initialHeight")) + if (!$util.isInteger(message.initialHeight) && !(message.initialHeight && $util.isInteger(message.initialHeight.low) && $util.isInteger(message.initialHeight.high))) + return "initialHeight: integer|Long expected"; + return null; + }; + + /** + * Creates a RequestInitChain message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestInitChain + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestInitChain} RequestInitChain + */ + RequestInitChain.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestInitChain) + return object; + var message = new $root.tendermint.abci.RequestInitChain(); + if (object.time != null) { + if (typeof object.time !== "object") + throw TypeError(".tendermint.abci.RequestInitChain.time: object expected"); + message.time = $root.google.protobuf.Timestamp.fromObject(object.time); + } + if (object.chainId != null) + message.chainId = String(object.chainId); + if (object.consensusParams != null) { + if (typeof object.consensusParams !== "object") + throw TypeError(".tendermint.abci.RequestInitChain.consensusParams: object expected"); + message.consensusParams = $root.tendermint.abci.ConsensusParams.fromObject(object.consensusParams); + } + if (object.validators) { + if (!Array.isArray(object.validators)) + throw TypeError(".tendermint.abci.RequestInitChain.validators: array expected"); + message.validators = []; + for (var i = 0; i < object.validators.length; ++i) { + if (typeof object.validators[i] !== "object") + throw TypeError(".tendermint.abci.RequestInitChain.validators: object expected"); + message.validators[i] = $root.tendermint.abci.ValidatorUpdate.fromObject(object.validators[i]); + } + } + if (object.appStateBytes != null) + if (typeof object.appStateBytes === "string") + $util.base64.decode(object.appStateBytes, message.appStateBytes = $util.newBuffer($util.base64.length(object.appStateBytes)), 0); + else if (object.appStateBytes.length) + message.appStateBytes = object.appStateBytes; + if (object.initialHeight != null) + if ($util.Long) + (message.initialHeight = $util.Long.fromValue(object.initialHeight)).unsigned = false; + else if (typeof object.initialHeight === "string") + message.initialHeight = parseInt(object.initialHeight, 10); + else if (typeof object.initialHeight === "number") + message.initialHeight = object.initialHeight; + else if (typeof object.initialHeight === "object") + message.initialHeight = new $util.LongBits(object.initialHeight.low >>> 0, object.initialHeight.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a RequestInitChain message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestInitChain + * @static + * @param {tendermint.abci.RequestInitChain} message RequestInitChain + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestInitChain.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.validators = []; + if (options.defaults) { + object.time = null; + object.chainId = ""; + object.consensusParams = null; + if (options.bytes === String) + object.appStateBytes = ""; + else { + object.appStateBytes = []; + if (options.bytes !== Array) + object.appStateBytes = $util.newBuffer(object.appStateBytes); + } + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.initialHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.initialHeight = options.longs === String ? "0" : 0; + } + if (message.time != null && message.hasOwnProperty("time")) + object.time = $root.google.protobuf.Timestamp.toObject(message.time, options); + if (message.chainId != null && message.hasOwnProperty("chainId")) + object.chainId = message.chainId; + if (message.consensusParams != null && message.hasOwnProperty("consensusParams")) + object.consensusParams = $root.tendermint.abci.ConsensusParams.toObject(message.consensusParams, options); + if (message.validators && message.validators.length) { + object.validators = []; + for (var j = 0; j < message.validators.length; ++j) + object.validators[j] = $root.tendermint.abci.ValidatorUpdate.toObject(message.validators[j], options); + } + if (message.appStateBytes != null && message.hasOwnProperty("appStateBytes")) + object.appStateBytes = options.bytes === String ? $util.base64.encode(message.appStateBytes, 0, message.appStateBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.appStateBytes) : message.appStateBytes; + if (message.initialHeight != null && message.hasOwnProperty("initialHeight")) + if (typeof message.initialHeight === "number") + object.initialHeight = options.longs === String ? String(message.initialHeight) : message.initialHeight; + else + object.initialHeight = options.longs === String ? $util.Long.prototype.toString.call(message.initialHeight) : options.longs === Number ? new $util.LongBits(message.initialHeight.low >>> 0, message.initialHeight.high >>> 0).toNumber() : message.initialHeight; + return object; + }; + + /** + * Converts this RequestInitChain to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestInitChain + * @instance + * @returns {Object.} JSON object + */ + RequestInitChain.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestInitChain; + })(abci.RequestInitChain || {}); + + abci.RequestQuery = (function(RequestQuery) { + + /** + * Properties of a RequestQuery. + * @memberof tendermint.abci + * @interface IRequestQuery + * @property {Uint8Array|null} [data] RequestQuery data + * @property {string|null} [path] RequestQuery path + * @property {number|Long|null} [height] RequestQuery height + * @property {boolean|null} [prove] RequestQuery prove + */ + + /** + * Constructs a new RequestQuery. + * @memberof tendermint.abci + * @classdesc Represents a RequestQuery. + * @implements IRequestQuery + * @constructor + * @param {tendermint.abci.IRequestQuery=} [properties] Properties to set + */ + function RequestQuery(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestQuery data. + * @member {Uint8Array} data + * @memberof tendermint.abci.RequestQuery + * @instance + */ + RequestQuery.prototype.data = $util.newBuffer([]); + + /** + * RequestQuery path. + * @member {string} path + * @memberof tendermint.abci.RequestQuery + * @instance + */ + RequestQuery.prototype.path = ""; + + /** + * RequestQuery height. + * @member {number|Long} height + * @memberof tendermint.abci.RequestQuery + * @instance + */ + RequestQuery.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * RequestQuery prove. + * @member {boolean} prove + * @memberof tendermint.abci.RequestQuery + * @instance + */ + RequestQuery.prototype.prove = false; + + /** + * Creates a new RequestQuery instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestQuery + * @static + * @param {tendermint.abci.IRequestQuery=} [properties] Properties to set + * @returns {tendermint.abci.RequestQuery} RequestQuery instance + */ + RequestQuery.create = function create(properties) { + return new RequestQuery(properties); + }; + + /** + * Encodes the specified RequestQuery message. Does not implicitly {@link tendermint.abci.RequestQuery.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestQuery + * @static + * @param {tendermint.abci.IRequestQuery} message RequestQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestQuery.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.data); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.height); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified RequestQuery message, length delimited. Does not implicitly {@link tendermint.abci.RequestQuery.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestQuery + * @static + * @param {tendermint.abci.IRequestQuery} message RequestQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestQuery.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestQuery message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestQuery} RequestQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestQuery.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestQuery(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + case 2: + message.path = reader.string(); + break; + case 3: + message.height = reader.int64(); + break; + case 4: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestQuery message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestQuery} RequestQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestQuery.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestQuery message. + * @function verify + * @memberof tendermint.abci.RequestQuery + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestQuery.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a RequestQuery message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestQuery + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestQuery} RequestQuery + */ + RequestQuery.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestQuery) + return object; + var message = new $root.tendermint.abci.RequestQuery(); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length) + message.data = object.data; + if (object.path != null) + message.path = String(object.path); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a RequestQuery message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestQuery + * @static + * @param {tendermint.abci.RequestQuery} message RequestQuery + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestQuery.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + object.path = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.prove = false; + } + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this RequestQuery to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestQuery + * @instance + * @returns {Object.} JSON object + */ + RequestQuery.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestQuery; + })(abci.RequestQuery || {}); + + abci.RequestBeginBlock = (function(RequestBeginBlock) { + + /** + * Properties of a RequestBeginBlock. + * @memberof tendermint.abci + * @interface IRequestBeginBlock + * @property {Uint8Array|null} [hash] RequestBeginBlock hash + * @property {tendermint.types.IHeader|null} [header] RequestBeginBlock header + * @property {tendermint.abci.ILastCommitInfo|null} [lastCommitInfo] RequestBeginBlock lastCommitInfo + * @property {Array.|null} [byzantineValidators] RequestBeginBlock byzantineValidators + */ + + /** + * Constructs a new RequestBeginBlock. + * @memberof tendermint.abci + * @classdesc Represents a RequestBeginBlock. + * @implements IRequestBeginBlock + * @constructor + * @param {tendermint.abci.IRequestBeginBlock=} [properties] Properties to set + */ + function RequestBeginBlock(properties) { + this.byzantineValidators = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestBeginBlock hash. + * @member {Uint8Array} hash + * @memberof tendermint.abci.RequestBeginBlock + * @instance + */ + RequestBeginBlock.prototype.hash = $util.newBuffer([]); + + /** + * RequestBeginBlock header. + * @member {tendermint.types.IHeader|null|undefined} header + * @memberof tendermint.abci.RequestBeginBlock + * @instance + */ + RequestBeginBlock.prototype.header = null; + + /** + * RequestBeginBlock lastCommitInfo. + * @member {tendermint.abci.ILastCommitInfo|null|undefined} lastCommitInfo + * @memberof tendermint.abci.RequestBeginBlock + * @instance + */ + RequestBeginBlock.prototype.lastCommitInfo = null; + + /** + * RequestBeginBlock byzantineValidators. + * @member {Array.} byzantineValidators + * @memberof tendermint.abci.RequestBeginBlock + * @instance + */ + RequestBeginBlock.prototype.byzantineValidators = $util.emptyArray; + + /** + * Creates a new RequestBeginBlock instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestBeginBlock + * @static + * @param {tendermint.abci.IRequestBeginBlock=} [properties] Properties to set + * @returns {tendermint.abci.RequestBeginBlock} RequestBeginBlock instance + */ + RequestBeginBlock.create = function create(properties) { + return new RequestBeginBlock(properties); + }; + + /** + * Encodes the specified RequestBeginBlock message. Does not implicitly {@link tendermint.abci.RequestBeginBlock.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestBeginBlock + * @static + * @param {tendermint.abci.IRequestBeginBlock} message RequestBeginBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestBeginBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.hash); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + $root.tendermint.types.Header.encode(message.header, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.lastCommitInfo != null && Object.hasOwnProperty.call(message, "lastCommitInfo")) + $root.tendermint.abci.LastCommitInfo.encode(message.lastCommitInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.byzantineValidators != null && message.byzantineValidators.length) + for (var i = 0; i < message.byzantineValidators.length; ++i) + $root.tendermint.abci.Evidence.encode(message.byzantineValidators[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RequestBeginBlock message, length delimited. Does not implicitly {@link tendermint.abci.RequestBeginBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestBeginBlock + * @static + * @param {tendermint.abci.IRequestBeginBlock} message RequestBeginBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestBeginBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestBeginBlock message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestBeginBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestBeginBlock} RequestBeginBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestBeginBlock.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestBeginBlock(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.bytes(); + break; + case 2: + message.header = $root.tendermint.types.Header.decode(reader, reader.uint32()); + break; + case 3: + message.lastCommitInfo = $root.tendermint.abci.LastCommitInfo.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.byzantineValidators && message.byzantineValidators.length)) + message.byzantineValidators = []; + message.byzantineValidators.push($root.tendermint.abci.Evidence.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestBeginBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestBeginBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestBeginBlock} RequestBeginBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestBeginBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestBeginBlock message. + * @function verify + * @memberof tendermint.abci.RequestBeginBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestBeginBlock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash))) + return "hash: buffer expected"; + if (message.header != null && message.hasOwnProperty("header")) { + var error = $root.tendermint.types.Header.verify(message.header); + if (error) + return "header." + error; + } + if (message.lastCommitInfo != null && message.hasOwnProperty("lastCommitInfo")) { + var error = $root.tendermint.abci.LastCommitInfo.verify(message.lastCommitInfo); + if (error) + return "lastCommitInfo." + error; + } + if (message.byzantineValidators != null && message.hasOwnProperty("byzantineValidators")) { + if (!Array.isArray(message.byzantineValidators)) + return "byzantineValidators: array expected"; + for (var i = 0; i < message.byzantineValidators.length; ++i) { + var error = $root.tendermint.abci.Evidence.verify(message.byzantineValidators[i]); + if (error) + return "byzantineValidators." + error; + } + } + return null; + }; + + /** + * Creates a RequestBeginBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestBeginBlock + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestBeginBlock} RequestBeginBlock + */ + RequestBeginBlock.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestBeginBlock) + return object; + var message = new $root.tendermint.abci.RequestBeginBlock(); + if (object.hash != null) + if (typeof object.hash === "string") + $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0); + else if (object.hash.length) + message.hash = object.hash; + if (object.header != null) { + if (typeof object.header !== "object") + throw TypeError(".tendermint.abci.RequestBeginBlock.header: object expected"); + message.header = $root.tendermint.types.Header.fromObject(object.header); + } + if (object.lastCommitInfo != null) { + if (typeof object.lastCommitInfo !== "object") + throw TypeError(".tendermint.abci.RequestBeginBlock.lastCommitInfo: object expected"); + message.lastCommitInfo = $root.tendermint.abci.LastCommitInfo.fromObject(object.lastCommitInfo); + } + if (object.byzantineValidators) { + if (!Array.isArray(object.byzantineValidators)) + throw TypeError(".tendermint.abci.RequestBeginBlock.byzantineValidators: array expected"); + message.byzantineValidators = []; + for (var i = 0; i < object.byzantineValidators.length; ++i) { + if (typeof object.byzantineValidators[i] !== "object") + throw TypeError(".tendermint.abci.RequestBeginBlock.byzantineValidators: object expected"); + message.byzantineValidators[i] = $root.tendermint.abci.Evidence.fromObject(object.byzantineValidators[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RequestBeginBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestBeginBlock + * @static + * @param {tendermint.abci.RequestBeginBlock} message RequestBeginBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestBeginBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.byzantineValidators = []; + if (options.defaults) { + if (options.bytes === String) + object.hash = ""; + else { + object.hash = []; + if (options.bytes !== Array) + object.hash = $util.newBuffer(object.hash); + } + object.header = null; + object.lastCommitInfo = null; + } + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash; + if (message.header != null && message.hasOwnProperty("header")) + object.header = $root.tendermint.types.Header.toObject(message.header, options); + if (message.lastCommitInfo != null && message.hasOwnProperty("lastCommitInfo")) + object.lastCommitInfo = $root.tendermint.abci.LastCommitInfo.toObject(message.lastCommitInfo, options); + if (message.byzantineValidators && message.byzantineValidators.length) { + object.byzantineValidators = []; + for (var j = 0; j < message.byzantineValidators.length; ++j) + object.byzantineValidators[j] = $root.tendermint.abci.Evidence.toObject(message.byzantineValidators[j], options); + } + return object; + }; + + /** + * Converts this RequestBeginBlock to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestBeginBlock + * @instance + * @returns {Object.} JSON object + */ + RequestBeginBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestBeginBlock; + })(abci.RequestBeginBlock || {}); + + /** + * CheckTxType enum. + * @name tendermint.abci.CheckTxType + * @enum {string} + * @property {number} NEW=0 NEW value + * @property {number} RECHECK=1 RECHECK value + */ + abci.CheckTxType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NEW"] = 0; + values[valuesById[1] = "RECHECK"] = 1; + return values; + })(); + + abci.RequestCheckTx = (function(RequestCheckTx) { + + /** + * Properties of a RequestCheckTx. + * @memberof tendermint.abci + * @interface IRequestCheckTx + * @property {Uint8Array|null} [tx] RequestCheckTx tx + * @property {tendermint.abci.CheckTxType|null} [type] RequestCheckTx type + */ + + /** + * Constructs a new RequestCheckTx. + * @memberof tendermint.abci + * @classdesc Represents a RequestCheckTx. + * @implements IRequestCheckTx + * @constructor + * @param {tendermint.abci.IRequestCheckTx=} [properties] Properties to set + */ + function RequestCheckTx(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestCheckTx tx. + * @member {Uint8Array} tx + * @memberof tendermint.abci.RequestCheckTx + * @instance + */ + RequestCheckTx.prototype.tx = $util.newBuffer([]); + + /** + * RequestCheckTx type. + * @member {tendermint.abci.CheckTxType} type + * @memberof tendermint.abci.RequestCheckTx + * @instance + */ + RequestCheckTx.prototype.type = 0; + + /** + * Creates a new RequestCheckTx instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestCheckTx + * @static + * @param {tendermint.abci.IRequestCheckTx=} [properties] Properties to set + * @returns {tendermint.abci.RequestCheckTx} RequestCheckTx instance + */ + RequestCheckTx.create = function create(properties) { + return new RequestCheckTx(properties); + }; + + /** + * Encodes the specified RequestCheckTx message. Does not implicitly {@link tendermint.abci.RequestCheckTx.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestCheckTx + * @static + * @param {tendermint.abci.IRequestCheckTx} message RequestCheckTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestCheckTx.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tx != null && Object.hasOwnProperty.call(message, "tx")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tx); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + return writer; + }; + + /** + * Encodes the specified RequestCheckTx message, length delimited. Does not implicitly {@link tendermint.abci.RequestCheckTx.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestCheckTx + * @static + * @param {tendermint.abci.IRequestCheckTx} message RequestCheckTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestCheckTx.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestCheckTx message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestCheckTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestCheckTx} RequestCheckTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestCheckTx.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestCheckTx(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = reader.bytes(); + break; + case 2: + message.type = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestCheckTx message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestCheckTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestCheckTx} RequestCheckTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestCheckTx.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestCheckTx message. + * @function verify + * @memberof tendermint.abci.RequestCheckTx + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestCheckTx.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tx != null && message.hasOwnProperty("tx")) + if (!(message.tx && typeof message.tx.length === "number" || $util.isString(message.tx))) + return "tx: buffer expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a RequestCheckTx message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestCheckTx + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestCheckTx} RequestCheckTx + */ + RequestCheckTx.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestCheckTx) + return object; + var message = new $root.tendermint.abci.RequestCheckTx(); + if (object.tx != null) + if (typeof object.tx === "string") + $util.base64.decode(object.tx, message.tx = $util.newBuffer($util.base64.length(object.tx)), 0); + else if (object.tx.length) + message.tx = object.tx; + switch (object.type) { + case "NEW": + case 0: + message.type = 0; + break; + case "RECHECK": + case 1: + message.type = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a RequestCheckTx message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestCheckTx + * @static + * @param {tendermint.abci.RequestCheckTx} message RequestCheckTx + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestCheckTx.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.tx = ""; + else { + object.tx = []; + if (options.bytes !== Array) + object.tx = $util.newBuffer(object.tx); + } + object.type = options.enums === String ? "NEW" : 0; + } + if (message.tx != null && message.hasOwnProperty("tx")) + object.tx = options.bytes === String ? $util.base64.encode(message.tx, 0, message.tx.length) : options.bytes === Array ? Array.prototype.slice.call(message.tx) : message.tx; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.tendermint.abci.CheckTxType[message.type] : message.type; + return object; + }; + + /** + * Converts this RequestCheckTx to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestCheckTx + * @instance + * @returns {Object.} JSON object + */ + RequestCheckTx.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestCheckTx; + })(abci.RequestCheckTx || {}); + + abci.RequestDeliverTx = (function(RequestDeliverTx) { + + /** + * Properties of a RequestDeliverTx. + * @memberof tendermint.abci + * @interface IRequestDeliverTx + * @property {Uint8Array|null} [tx] RequestDeliverTx tx + */ + + /** + * Constructs a new RequestDeliverTx. + * @memberof tendermint.abci + * @classdesc Represents a RequestDeliverTx. + * @implements IRequestDeliverTx + * @constructor + * @param {tendermint.abci.IRequestDeliverTx=} [properties] Properties to set + */ + function RequestDeliverTx(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestDeliverTx tx. + * @member {Uint8Array} tx + * @memberof tendermint.abci.RequestDeliverTx + * @instance + */ + RequestDeliverTx.prototype.tx = $util.newBuffer([]); + + /** + * Creates a new RequestDeliverTx instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestDeliverTx + * @static + * @param {tendermint.abci.IRequestDeliverTx=} [properties] Properties to set + * @returns {tendermint.abci.RequestDeliverTx} RequestDeliverTx instance + */ + RequestDeliverTx.create = function create(properties) { + return new RequestDeliverTx(properties); + }; + + /** + * Encodes the specified RequestDeliverTx message. Does not implicitly {@link tendermint.abci.RequestDeliverTx.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestDeliverTx + * @static + * @param {tendermint.abci.IRequestDeliverTx} message RequestDeliverTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestDeliverTx.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tx != null && Object.hasOwnProperty.call(message, "tx")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tx); + return writer; + }; + + /** + * Encodes the specified RequestDeliverTx message, length delimited. Does not implicitly {@link tendermint.abci.RequestDeliverTx.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestDeliverTx + * @static + * @param {tendermint.abci.IRequestDeliverTx} message RequestDeliverTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestDeliverTx.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestDeliverTx message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestDeliverTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestDeliverTx} RequestDeliverTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestDeliverTx.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestDeliverTx(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestDeliverTx message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestDeliverTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestDeliverTx} RequestDeliverTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestDeliverTx.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestDeliverTx message. + * @function verify + * @memberof tendermint.abci.RequestDeliverTx + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestDeliverTx.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tx != null && message.hasOwnProperty("tx")) + if (!(message.tx && typeof message.tx.length === "number" || $util.isString(message.tx))) + return "tx: buffer expected"; + return null; + }; + + /** + * Creates a RequestDeliverTx message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestDeliverTx + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestDeliverTx} RequestDeliverTx + */ + RequestDeliverTx.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestDeliverTx) + return object; + var message = new $root.tendermint.abci.RequestDeliverTx(); + if (object.tx != null) + if (typeof object.tx === "string") + $util.base64.decode(object.tx, message.tx = $util.newBuffer($util.base64.length(object.tx)), 0); + else if (object.tx.length) + message.tx = object.tx; + return message; + }; + + /** + * Creates a plain object from a RequestDeliverTx message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestDeliverTx + * @static + * @param {tendermint.abci.RequestDeliverTx} message RequestDeliverTx + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestDeliverTx.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.tx = ""; + else { + object.tx = []; + if (options.bytes !== Array) + object.tx = $util.newBuffer(object.tx); + } + if (message.tx != null && message.hasOwnProperty("tx")) + object.tx = options.bytes === String ? $util.base64.encode(message.tx, 0, message.tx.length) : options.bytes === Array ? Array.prototype.slice.call(message.tx) : message.tx; + return object; + }; + + /** + * Converts this RequestDeliverTx to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestDeliverTx + * @instance + * @returns {Object.} JSON object + */ + RequestDeliverTx.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestDeliverTx; + })(abci.RequestDeliverTx || {}); + + abci.RequestEndBlock = (function(RequestEndBlock) { + + /** + * Properties of a RequestEndBlock. + * @memberof tendermint.abci + * @interface IRequestEndBlock + * @property {number|Long|null} [height] RequestEndBlock height + */ + + /** + * Constructs a new RequestEndBlock. + * @memberof tendermint.abci + * @classdesc Represents a RequestEndBlock. + * @implements IRequestEndBlock + * @constructor + * @param {tendermint.abci.IRequestEndBlock=} [properties] Properties to set + */ + function RequestEndBlock(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestEndBlock height. + * @member {number|Long} height + * @memberof tendermint.abci.RequestEndBlock + * @instance + */ + RequestEndBlock.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RequestEndBlock instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestEndBlock + * @static + * @param {tendermint.abci.IRequestEndBlock=} [properties] Properties to set + * @returns {tendermint.abci.RequestEndBlock} RequestEndBlock instance + */ + RequestEndBlock.create = function create(properties) { + return new RequestEndBlock(properties); + }; + + /** + * Encodes the specified RequestEndBlock message. Does not implicitly {@link tendermint.abci.RequestEndBlock.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestEndBlock + * @static + * @param {tendermint.abci.IRequestEndBlock} message RequestEndBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestEndBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.height); + return writer; + }; + + /** + * Encodes the specified RequestEndBlock message, length delimited. Does not implicitly {@link tendermint.abci.RequestEndBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestEndBlock + * @static + * @param {tendermint.abci.IRequestEndBlock} message RequestEndBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestEndBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestEndBlock message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestEndBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestEndBlock} RequestEndBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestEndBlock.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestEndBlock(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestEndBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestEndBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestEndBlock} RequestEndBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestEndBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestEndBlock message. + * @function verify + * @memberof tendermint.abci.RequestEndBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestEndBlock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + return null; + }; + + /** + * Creates a RequestEndBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestEndBlock + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestEndBlock} RequestEndBlock + */ + RequestEndBlock.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestEndBlock) + return object; + var message = new $root.tendermint.abci.RequestEndBlock(); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a RequestEndBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestEndBlock + * @static + * @param {tendermint.abci.RequestEndBlock} message RequestEndBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestEndBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + return object; + }; + + /** + * Converts this RequestEndBlock to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestEndBlock + * @instance + * @returns {Object.} JSON object + */ + RequestEndBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestEndBlock; + })(abci.RequestEndBlock || {}); + + abci.RequestCommit = (function(RequestCommit) { + + /** + * Properties of a RequestCommit. + * @memberof tendermint.abci + * @interface IRequestCommit + */ + + /** + * Constructs a new RequestCommit. + * @memberof tendermint.abci + * @classdesc Represents a RequestCommit. + * @implements IRequestCommit + * @constructor + * @param {tendermint.abci.IRequestCommit=} [properties] Properties to set + */ + function RequestCommit(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new RequestCommit instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestCommit + * @static + * @param {tendermint.abci.IRequestCommit=} [properties] Properties to set + * @returns {tendermint.abci.RequestCommit} RequestCommit instance + */ + RequestCommit.create = function create(properties) { + return new RequestCommit(properties); + }; + + /** + * Encodes the specified RequestCommit message. Does not implicitly {@link tendermint.abci.RequestCommit.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestCommit + * @static + * @param {tendermint.abci.IRequestCommit} message RequestCommit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestCommit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RequestCommit message, length delimited. Does not implicitly {@link tendermint.abci.RequestCommit.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestCommit + * @static + * @param {tendermint.abci.IRequestCommit} message RequestCommit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestCommit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestCommit message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestCommit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestCommit} RequestCommit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestCommit.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestCommit(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestCommit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestCommit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestCommit} RequestCommit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestCommit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestCommit message. + * @function verify + * @memberof tendermint.abci.RequestCommit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestCommit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RequestCommit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestCommit + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestCommit} RequestCommit + */ + RequestCommit.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestCommit) + return object; + return new $root.tendermint.abci.RequestCommit(); + }; + + /** + * Creates a plain object from a RequestCommit message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestCommit + * @static + * @param {tendermint.abci.RequestCommit} message RequestCommit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestCommit.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RequestCommit to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestCommit + * @instance + * @returns {Object.} JSON object + */ + RequestCommit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestCommit; + })(abci.RequestCommit || {}); + + abci.RequestListSnapshots = (function(RequestListSnapshots) { + + /** + * Properties of a RequestListSnapshots. + * @memberof tendermint.abci + * @interface IRequestListSnapshots + */ + + /** + * Constructs a new RequestListSnapshots. + * @memberof tendermint.abci + * @classdesc Represents a RequestListSnapshots. + * @implements IRequestListSnapshots + * @constructor + * @param {tendermint.abci.IRequestListSnapshots=} [properties] Properties to set + */ + function RequestListSnapshots(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new RequestListSnapshots instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestListSnapshots + * @static + * @param {tendermint.abci.IRequestListSnapshots=} [properties] Properties to set + * @returns {tendermint.abci.RequestListSnapshots} RequestListSnapshots instance + */ + RequestListSnapshots.create = function create(properties) { + return new RequestListSnapshots(properties); + }; + + /** + * Encodes the specified RequestListSnapshots message. Does not implicitly {@link tendermint.abci.RequestListSnapshots.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestListSnapshots + * @static + * @param {tendermint.abci.IRequestListSnapshots} message RequestListSnapshots message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestListSnapshots.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RequestListSnapshots message, length delimited. Does not implicitly {@link tendermint.abci.RequestListSnapshots.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestListSnapshots + * @static + * @param {tendermint.abci.IRequestListSnapshots} message RequestListSnapshots message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestListSnapshots.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestListSnapshots message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestListSnapshots + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestListSnapshots} RequestListSnapshots + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestListSnapshots.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestListSnapshots(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestListSnapshots message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestListSnapshots + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestListSnapshots} RequestListSnapshots + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestListSnapshots.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestListSnapshots message. + * @function verify + * @memberof tendermint.abci.RequestListSnapshots + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestListSnapshots.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RequestListSnapshots message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestListSnapshots + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestListSnapshots} RequestListSnapshots + */ + RequestListSnapshots.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestListSnapshots) + return object; + return new $root.tendermint.abci.RequestListSnapshots(); + }; + + /** + * Creates a plain object from a RequestListSnapshots message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestListSnapshots + * @static + * @param {tendermint.abci.RequestListSnapshots} message RequestListSnapshots + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestListSnapshots.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RequestListSnapshots to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestListSnapshots + * @instance + * @returns {Object.} JSON object + */ + RequestListSnapshots.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestListSnapshots; + })(abci.RequestListSnapshots || {}); + + abci.RequestOfferSnapshot = (function(RequestOfferSnapshot) { + + /** + * Properties of a RequestOfferSnapshot. + * @memberof tendermint.abci + * @interface IRequestOfferSnapshot + * @property {tendermint.abci.ISnapshot|null} [snapshot] RequestOfferSnapshot snapshot + * @property {Uint8Array|null} [appHash] RequestOfferSnapshot appHash + */ + + /** + * Constructs a new RequestOfferSnapshot. + * @memberof tendermint.abci + * @classdesc Represents a RequestOfferSnapshot. + * @implements IRequestOfferSnapshot + * @constructor + * @param {tendermint.abci.IRequestOfferSnapshot=} [properties] Properties to set + */ + function RequestOfferSnapshot(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestOfferSnapshot snapshot. + * @member {tendermint.abci.ISnapshot|null|undefined} snapshot + * @memberof tendermint.abci.RequestOfferSnapshot + * @instance + */ + RequestOfferSnapshot.prototype.snapshot = null; + + /** + * RequestOfferSnapshot appHash. + * @member {Uint8Array} appHash + * @memberof tendermint.abci.RequestOfferSnapshot + * @instance + */ + RequestOfferSnapshot.prototype.appHash = $util.newBuffer([]); + + /** + * Creates a new RequestOfferSnapshot instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestOfferSnapshot + * @static + * @param {tendermint.abci.IRequestOfferSnapshot=} [properties] Properties to set + * @returns {tendermint.abci.RequestOfferSnapshot} RequestOfferSnapshot instance + */ + RequestOfferSnapshot.create = function create(properties) { + return new RequestOfferSnapshot(properties); + }; + + /** + * Encodes the specified RequestOfferSnapshot message. Does not implicitly {@link tendermint.abci.RequestOfferSnapshot.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestOfferSnapshot + * @static + * @param {tendermint.abci.IRequestOfferSnapshot} message RequestOfferSnapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestOfferSnapshot.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) + $root.tendermint.abci.Snapshot.encode(message.snapshot, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.appHash != null && Object.hasOwnProperty.call(message, "appHash")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.appHash); + return writer; + }; + + /** + * Encodes the specified RequestOfferSnapshot message, length delimited. Does not implicitly {@link tendermint.abci.RequestOfferSnapshot.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestOfferSnapshot + * @static + * @param {tendermint.abci.IRequestOfferSnapshot} message RequestOfferSnapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestOfferSnapshot.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestOfferSnapshot message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestOfferSnapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestOfferSnapshot} RequestOfferSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestOfferSnapshot.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestOfferSnapshot(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.snapshot = $root.tendermint.abci.Snapshot.decode(reader, reader.uint32()); + break; + case 2: + message.appHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestOfferSnapshot message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestOfferSnapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestOfferSnapshot} RequestOfferSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestOfferSnapshot.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestOfferSnapshot message. + * @function verify + * @memberof tendermint.abci.RequestOfferSnapshot + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestOfferSnapshot.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.snapshot != null && message.hasOwnProperty("snapshot")) { + var error = $root.tendermint.abci.Snapshot.verify(message.snapshot); + if (error) + return "snapshot." + error; + } + if (message.appHash != null && message.hasOwnProperty("appHash")) + if (!(message.appHash && typeof message.appHash.length === "number" || $util.isString(message.appHash))) + return "appHash: buffer expected"; + return null; + }; + + /** + * Creates a RequestOfferSnapshot message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestOfferSnapshot + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestOfferSnapshot} RequestOfferSnapshot + */ + RequestOfferSnapshot.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestOfferSnapshot) + return object; + var message = new $root.tendermint.abci.RequestOfferSnapshot(); + if (object.snapshot != null) { + if (typeof object.snapshot !== "object") + throw TypeError(".tendermint.abci.RequestOfferSnapshot.snapshot: object expected"); + message.snapshot = $root.tendermint.abci.Snapshot.fromObject(object.snapshot); + } + if (object.appHash != null) + if (typeof object.appHash === "string") + $util.base64.decode(object.appHash, message.appHash = $util.newBuffer($util.base64.length(object.appHash)), 0); + else if (object.appHash.length) + message.appHash = object.appHash; + return message; + }; + + /** + * Creates a plain object from a RequestOfferSnapshot message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestOfferSnapshot + * @static + * @param {tendermint.abci.RequestOfferSnapshot} message RequestOfferSnapshot + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestOfferSnapshot.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.snapshot = null; + if (options.bytes === String) + object.appHash = ""; + else { + object.appHash = []; + if (options.bytes !== Array) + object.appHash = $util.newBuffer(object.appHash); + } + } + if (message.snapshot != null && message.hasOwnProperty("snapshot")) + object.snapshot = $root.tendermint.abci.Snapshot.toObject(message.snapshot, options); + if (message.appHash != null && message.hasOwnProperty("appHash")) + object.appHash = options.bytes === String ? $util.base64.encode(message.appHash, 0, message.appHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.appHash) : message.appHash; + return object; + }; + + /** + * Converts this RequestOfferSnapshot to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestOfferSnapshot + * @instance + * @returns {Object.} JSON object + */ + RequestOfferSnapshot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestOfferSnapshot; + })(abci.RequestOfferSnapshot || {}); + + abci.RequestLoadSnapshotChunk = (function(RequestLoadSnapshotChunk) { + + /** + * Properties of a RequestLoadSnapshotChunk. + * @memberof tendermint.abci + * @interface IRequestLoadSnapshotChunk + * @property {number|Long|null} [height] RequestLoadSnapshotChunk height + * @property {number|null} [format] RequestLoadSnapshotChunk format + * @property {number|null} [chunk] RequestLoadSnapshotChunk chunk + */ + + /** + * Constructs a new RequestLoadSnapshotChunk. + * @memberof tendermint.abci + * @classdesc Represents a RequestLoadSnapshotChunk. + * @implements IRequestLoadSnapshotChunk + * @constructor + * @param {tendermint.abci.IRequestLoadSnapshotChunk=} [properties] Properties to set + */ + function RequestLoadSnapshotChunk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestLoadSnapshotChunk height. + * @member {number|Long} height + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @instance + */ + RequestLoadSnapshotChunk.prototype.height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * RequestLoadSnapshotChunk format. + * @member {number} format + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @instance + */ + RequestLoadSnapshotChunk.prototype.format = 0; + + /** + * RequestLoadSnapshotChunk chunk. + * @member {number} chunk + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @instance + */ + RequestLoadSnapshotChunk.prototype.chunk = 0; + + /** + * Creates a new RequestLoadSnapshotChunk instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @static + * @param {tendermint.abci.IRequestLoadSnapshotChunk=} [properties] Properties to set + * @returns {tendermint.abci.RequestLoadSnapshotChunk} RequestLoadSnapshotChunk instance + */ + RequestLoadSnapshotChunk.create = function create(properties) { + return new RequestLoadSnapshotChunk(properties); + }; + + /** + * Encodes the specified RequestLoadSnapshotChunk message. Does not implicitly {@link tendermint.abci.RequestLoadSnapshotChunk.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @static + * @param {tendermint.abci.IRequestLoadSnapshotChunk} message RequestLoadSnapshotChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestLoadSnapshotChunk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.height); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.format); + if (message.chunk != null && Object.hasOwnProperty.call(message, "chunk")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.chunk); + return writer; + }; + + /** + * Encodes the specified RequestLoadSnapshotChunk message, length delimited. Does not implicitly {@link tendermint.abci.RequestLoadSnapshotChunk.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @static + * @param {tendermint.abci.IRequestLoadSnapshotChunk} message RequestLoadSnapshotChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestLoadSnapshotChunk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestLoadSnapshotChunk message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestLoadSnapshotChunk} RequestLoadSnapshotChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestLoadSnapshotChunk.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestLoadSnapshotChunk(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.uint64(); + break; + case 2: + message.format = reader.uint32(); + break; + case 3: + message.chunk = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestLoadSnapshotChunk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestLoadSnapshotChunk} RequestLoadSnapshotChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestLoadSnapshotChunk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestLoadSnapshotChunk message. + * @function verify + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestLoadSnapshotChunk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.format != null && message.hasOwnProperty("format")) + if (!$util.isInteger(message.format)) + return "format: integer expected"; + if (message.chunk != null && message.hasOwnProperty("chunk")) + if (!$util.isInteger(message.chunk)) + return "chunk: integer expected"; + return null; + }; + + /** + * Creates a RequestLoadSnapshotChunk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestLoadSnapshotChunk} RequestLoadSnapshotChunk + */ + RequestLoadSnapshotChunk.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestLoadSnapshotChunk) + return object; + var message = new $root.tendermint.abci.RequestLoadSnapshotChunk(); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = true; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(true); + if (object.format != null) + message.format = object.format >>> 0; + if (object.chunk != null) + message.chunk = object.chunk >>> 0; + return message; + }; + + /** + * Creates a plain object from a RequestLoadSnapshotChunk message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @static + * @param {tendermint.abci.RequestLoadSnapshotChunk} message RequestLoadSnapshotChunk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestLoadSnapshotChunk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.format = 0; + object.chunk = 0; + } + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber(true) : message.height; + if (message.format != null && message.hasOwnProperty("format")) + object.format = message.format; + if (message.chunk != null && message.hasOwnProperty("chunk")) + object.chunk = message.chunk; + return object; + }; + + /** + * Converts this RequestLoadSnapshotChunk to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @instance + * @returns {Object.} JSON object + */ + RequestLoadSnapshotChunk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestLoadSnapshotChunk; + })(abci.RequestLoadSnapshotChunk || {}); + + abci.RequestApplySnapshotChunk = (function(RequestApplySnapshotChunk) { + + /** + * Properties of a RequestApplySnapshotChunk. + * @memberof tendermint.abci + * @interface IRequestApplySnapshotChunk + * @property {number|null} [index] RequestApplySnapshotChunk index + * @property {Uint8Array|null} [chunk] RequestApplySnapshotChunk chunk + * @property {string|null} [sender] RequestApplySnapshotChunk sender + */ + + /** + * Constructs a new RequestApplySnapshotChunk. + * @memberof tendermint.abci + * @classdesc Represents a RequestApplySnapshotChunk. + * @implements IRequestApplySnapshotChunk + * @constructor + * @param {tendermint.abci.IRequestApplySnapshotChunk=} [properties] Properties to set + */ + function RequestApplySnapshotChunk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestApplySnapshotChunk index. + * @member {number} index + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @instance + */ + RequestApplySnapshotChunk.prototype.index = 0; + + /** + * RequestApplySnapshotChunk chunk. + * @member {Uint8Array} chunk + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @instance + */ + RequestApplySnapshotChunk.prototype.chunk = $util.newBuffer([]); + + /** + * RequestApplySnapshotChunk sender. + * @member {string} sender + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @instance + */ + RequestApplySnapshotChunk.prototype.sender = ""; + + /** + * Creates a new RequestApplySnapshotChunk instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @static + * @param {tendermint.abci.IRequestApplySnapshotChunk=} [properties] Properties to set + * @returns {tendermint.abci.RequestApplySnapshotChunk} RequestApplySnapshotChunk instance + */ + RequestApplySnapshotChunk.create = function create(properties) { + return new RequestApplySnapshotChunk(properties); + }; + + /** + * Encodes the specified RequestApplySnapshotChunk message. Does not implicitly {@link tendermint.abci.RequestApplySnapshotChunk.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @static + * @param {tendermint.abci.IRequestApplySnapshotChunk} message RequestApplySnapshotChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestApplySnapshotChunk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.index); + if (message.chunk != null && Object.hasOwnProperty.call(message, "chunk")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.chunk); + if (message.sender != null && Object.hasOwnProperty.call(message, "sender")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sender); + return writer; + }; + + /** + * Encodes the specified RequestApplySnapshotChunk message, length delimited. Does not implicitly {@link tendermint.abci.RequestApplySnapshotChunk.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @static + * @param {tendermint.abci.IRequestApplySnapshotChunk} message RequestApplySnapshotChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestApplySnapshotChunk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestApplySnapshotChunk message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestApplySnapshotChunk} RequestApplySnapshotChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestApplySnapshotChunk.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestApplySnapshotChunk(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.uint32(); + break; + case 2: + message.chunk = reader.bytes(); + break; + case 3: + message.sender = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestApplySnapshotChunk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestApplySnapshotChunk} RequestApplySnapshotChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestApplySnapshotChunk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestApplySnapshotChunk message. + * @function verify + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestApplySnapshotChunk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index)) + return "index: integer expected"; + if (message.chunk != null && message.hasOwnProperty("chunk")) + if (!(message.chunk && typeof message.chunk.length === "number" || $util.isString(message.chunk))) + return "chunk: buffer expected"; + if (message.sender != null && message.hasOwnProperty("sender")) + if (!$util.isString(message.sender)) + return "sender: string expected"; + return null; + }; + + /** + * Creates a RequestApplySnapshotChunk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestApplySnapshotChunk} RequestApplySnapshotChunk + */ + RequestApplySnapshotChunk.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestApplySnapshotChunk) + return object; + var message = new $root.tendermint.abci.RequestApplySnapshotChunk(); + if (object.index != null) + message.index = object.index >>> 0; + if (object.chunk != null) + if (typeof object.chunk === "string") + $util.base64.decode(object.chunk, message.chunk = $util.newBuffer($util.base64.length(object.chunk)), 0); + else if (object.chunk.length) + message.chunk = object.chunk; + if (object.sender != null) + message.sender = String(object.sender); + return message; + }; + + /** + * Creates a plain object from a RequestApplySnapshotChunk message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @static + * @param {tendermint.abci.RequestApplySnapshotChunk} message RequestApplySnapshotChunk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestApplySnapshotChunk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.index = 0; + if (options.bytes === String) + object.chunk = ""; + else { + object.chunk = []; + if (options.bytes !== Array) + object.chunk = $util.newBuffer(object.chunk); + } + object.sender = ""; + } + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + if (message.chunk != null && message.hasOwnProperty("chunk")) + object.chunk = options.bytes === String ? $util.base64.encode(message.chunk, 0, message.chunk.length) : options.bytes === Array ? Array.prototype.slice.call(message.chunk) : message.chunk; + if (message.sender != null && message.hasOwnProperty("sender")) + object.sender = message.sender; + return object; + }; + + /** + * Converts this RequestApplySnapshotChunk to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @instance + * @returns {Object.} JSON object + */ + RequestApplySnapshotChunk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestApplySnapshotChunk; + })(abci.RequestApplySnapshotChunk || {}); + + abci.Response = (function(Response) { + + /** + * Properties of a Response. + * @memberof tendermint.abci + * @interface IResponse + * @property {tendermint.abci.IResponseException|null} [exception] Response exception + * @property {tendermint.abci.IResponseEcho|null} [echo] Response echo + * @property {tendermint.abci.IResponseFlush|null} [flush] Response flush + * @property {tendermint.abci.IResponseInfo|null} [info] Response info + * @property {tendermint.abci.IResponseSetOption|null} [setOption] Response setOption + * @property {tendermint.abci.IResponseInitChain|null} [initChain] Response initChain + * @property {tendermint.abci.IResponseQuery|null} [query] Response query + * @property {tendermint.abci.IResponseBeginBlock|null} [beginBlock] Response beginBlock + * @property {tendermint.abci.IResponseCheckTx|null} [checkTx] Response checkTx + * @property {tendermint.abci.IResponseDeliverTx|null} [deliverTx] Response deliverTx + * @property {tendermint.abci.IResponseEndBlock|null} [endBlock] Response endBlock + * @property {tendermint.abci.IResponseCommit|null} [commit] Response commit + * @property {tendermint.abci.IResponseListSnapshots|null} [listSnapshots] Response listSnapshots + * @property {tendermint.abci.IResponseOfferSnapshot|null} [offerSnapshot] Response offerSnapshot + * @property {tendermint.abci.IResponseLoadSnapshotChunk|null} [loadSnapshotChunk] Response loadSnapshotChunk + * @property {tendermint.abci.IResponseApplySnapshotChunk|null} [applySnapshotChunk] Response applySnapshotChunk + */ + + /** + * Constructs a new Response. + * @memberof tendermint.abci + * @classdesc Represents a Response. + * @implements IResponse + * @constructor + * @param {tendermint.abci.IResponse=} [properties] Properties to set + */ + function Response(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Response exception. + * @member {tendermint.abci.IResponseException|null|undefined} exception + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.exception = null; + + /** + * Response echo. + * @member {tendermint.abci.IResponseEcho|null|undefined} echo + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.echo = null; + + /** + * Response flush. + * @member {tendermint.abci.IResponseFlush|null|undefined} flush + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.flush = null; + + /** + * Response info. + * @member {tendermint.abci.IResponseInfo|null|undefined} info + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.info = null; + + /** + * Response setOption. + * @member {tendermint.abci.IResponseSetOption|null|undefined} setOption + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.setOption = null; + + /** + * Response initChain. + * @member {tendermint.abci.IResponseInitChain|null|undefined} initChain + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.initChain = null; + + /** + * Response query. + * @member {tendermint.abci.IResponseQuery|null|undefined} query + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.query = null; + + /** + * Response beginBlock. + * @member {tendermint.abci.IResponseBeginBlock|null|undefined} beginBlock + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.beginBlock = null; + + /** + * Response checkTx. + * @member {tendermint.abci.IResponseCheckTx|null|undefined} checkTx + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.checkTx = null; + + /** + * Response deliverTx. + * @member {tendermint.abci.IResponseDeliverTx|null|undefined} deliverTx + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.deliverTx = null; + + /** + * Response endBlock. + * @member {tendermint.abci.IResponseEndBlock|null|undefined} endBlock + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.endBlock = null; + + /** + * Response commit. + * @member {tendermint.abci.IResponseCommit|null|undefined} commit + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.commit = null; + + /** + * Response listSnapshots. + * @member {tendermint.abci.IResponseListSnapshots|null|undefined} listSnapshots + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.listSnapshots = null; + + /** + * Response offerSnapshot. + * @member {tendermint.abci.IResponseOfferSnapshot|null|undefined} offerSnapshot + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.offerSnapshot = null; + + /** + * Response loadSnapshotChunk. + * @member {tendermint.abci.IResponseLoadSnapshotChunk|null|undefined} loadSnapshotChunk + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.loadSnapshotChunk = null; + + /** + * Response applySnapshotChunk. + * @member {tendermint.abci.IResponseApplySnapshotChunk|null|undefined} applySnapshotChunk + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.applySnapshotChunk = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Response value. + * @member {"exception"|"echo"|"flush"|"info"|"setOption"|"initChain"|"query"|"beginBlock"|"checkTx"|"deliverTx"|"endBlock"|"commit"|"listSnapshots"|"offerSnapshot"|"loadSnapshotChunk"|"applySnapshotChunk"|undefined} value + * @memberof tendermint.abci.Response + * @instance + */ + Object.defineProperty(Response.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["exception", "echo", "flush", "info", "setOption", "initChain", "query", "beginBlock", "checkTx", "deliverTx", "endBlock", "commit", "listSnapshots", "offerSnapshot", "loadSnapshotChunk", "applySnapshotChunk"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Response instance using the specified properties. + * @function create + * @memberof tendermint.abci.Response + * @static + * @param {tendermint.abci.IResponse=} [properties] Properties to set + * @returns {tendermint.abci.Response} Response instance + */ + Response.create = function create(properties) { + return new Response(properties); + }; + + /** + * Encodes the specified Response message. Does not implicitly {@link tendermint.abci.Response.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.Response + * @static + * @param {tendermint.abci.IResponse} message Response message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Response.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.exception != null && Object.hasOwnProperty.call(message, "exception")) + $root.tendermint.abci.ResponseException.encode(message.exception, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.echo != null && Object.hasOwnProperty.call(message, "echo")) + $root.tendermint.abci.ResponseEcho.encode(message.echo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.flush != null && Object.hasOwnProperty.call(message, "flush")) + $root.tendermint.abci.ResponseFlush.encode(message.flush, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.info != null && Object.hasOwnProperty.call(message, "info")) + $root.tendermint.abci.ResponseInfo.encode(message.info, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.setOption != null && Object.hasOwnProperty.call(message, "setOption")) + $root.tendermint.abci.ResponseSetOption.encode(message.setOption, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.initChain != null && Object.hasOwnProperty.call(message, "initChain")) + $root.tendermint.abci.ResponseInitChain.encode(message.initChain, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + $root.tendermint.abci.ResponseQuery.encode(message.query, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.beginBlock != null && Object.hasOwnProperty.call(message, "beginBlock")) + $root.tendermint.abci.ResponseBeginBlock.encode(message.beginBlock, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.checkTx != null && Object.hasOwnProperty.call(message, "checkTx")) + $root.tendermint.abci.ResponseCheckTx.encode(message.checkTx, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.deliverTx != null && Object.hasOwnProperty.call(message, "deliverTx")) + $root.tendermint.abci.ResponseDeliverTx.encode(message.deliverTx, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.endBlock != null && Object.hasOwnProperty.call(message, "endBlock")) + $root.tendermint.abci.ResponseEndBlock.encode(message.endBlock, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.commit != null && Object.hasOwnProperty.call(message, "commit")) + $root.tendermint.abci.ResponseCommit.encode(message.commit, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.listSnapshots != null && Object.hasOwnProperty.call(message, "listSnapshots")) + $root.tendermint.abci.ResponseListSnapshots.encode(message.listSnapshots, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.offerSnapshot != null && Object.hasOwnProperty.call(message, "offerSnapshot")) + $root.tendermint.abci.ResponseOfferSnapshot.encode(message.offerSnapshot, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.loadSnapshotChunk != null && Object.hasOwnProperty.call(message, "loadSnapshotChunk")) + $root.tendermint.abci.ResponseLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.applySnapshotChunk != null && Object.hasOwnProperty.call(message, "applySnapshotChunk")) + $root.tendermint.abci.ResponseApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Response message, length delimited. Does not implicitly {@link tendermint.abci.Response.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.Response + * @static + * @param {tendermint.abci.IResponse} message Response message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Response.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Response message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.Response + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.Response} Response + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Response.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.Response(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exception = $root.tendermint.abci.ResponseException.decode(reader, reader.uint32()); + break; + case 2: + message.echo = $root.tendermint.abci.ResponseEcho.decode(reader, reader.uint32()); + break; + case 3: + message.flush = $root.tendermint.abci.ResponseFlush.decode(reader, reader.uint32()); + break; + case 4: + message.info = $root.tendermint.abci.ResponseInfo.decode(reader, reader.uint32()); + break; + case 5: + message.setOption = $root.tendermint.abci.ResponseSetOption.decode(reader, reader.uint32()); + break; + case 6: + message.initChain = $root.tendermint.abci.ResponseInitChain.decode(reader, reader.uint32()); + break; + case 7: + message.query = $root.tendermint.abci.ResponseQuery.decode(reader, reader.uint32()); + break; + case 8: + message.beginBlock = $root.tendermint.abci.ResponseBeginBlock.decode(reader, reader.uint32()); + break; + case 9: + message.checkTx = $root.tendermint.abci.ResponseCheckTx.decode(reader, reader.uint32()); + break; + case 10: + message.deliverTx = $root.tendermint.abci.ResponseDeliverTx.decode(reader, reader.uint32()); + break; + case 11: + message.endBlock = $root.tendermint.abci.ResponseEndBlock.decode(reader, reader.uint32()); + break; + case 12: + message.commit = $root.tendermint.abci.ResponseCommit.decode(reader, reader.uint32()); + break; + case 13: + message.listSnapshots = $root.tendermint.abci.ResponseListSnapshots.decode(reader, reader.uint32()); + break; + case 14: + message.offerSnapshot = $root.tendermint.abci.ResponseOfferSnapshot.decode(reader, reader.uint32()); + break; + case 15: + message.loadSnapshotChunk = $root.tendermint.abci.ResponseLoadSnapshotChunk.decode(reader, reader.uint32()); + break; + case 16: + message.applySnapshotChunk = $root.tendermint.abci.ResponseApplySnapshotChunk.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Response message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.Response + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.Response} Response + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Response.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Response message. + * @function verify + * @memberof tendermint.abci.Response + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Response.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.exception != null && message.hasOwnProperty("exception")) { + properties.value = 1; + { + var error = $root.tendermint.abci.ResponseException.verify(message.exception); + if (error) + return "exception." + error; + } + } + if (message.echo != null && message.hasOwnProperty("echo")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.ResponseEcho.verify(message.echo); + if (error) + return "echo." + error; + } + } + if (message.flush != null && message.hasOwnProperty("flush")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.ResponseFlush.verify(message.flush); + if (error) + return "flush." + error; + } + } + if (message.info != null && message.hasOwnProperty("info")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.ResponseInfo.verify(message.info); + if (error) + return "info." + error; + } + } + if (message.setOption != null && message.hasOwnProperty("setOption")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.ResponseSetOption.verify(message.setOption); + if (error) + return "setOption." + error; + } + } + if (message.initChain != null && message.hasOwnProperty("initChain")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.ResponseInitChain.verify(message.initChain); + if (error) + return "initChain." + error; + } + } + if (message.query != null && message.hasOwnProperty("query")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.ResponseQuery.verify(message.query); + if (error) + return "query." + error; + } + } + if (message.beginBlock != null && message.hasOwnProperty("beginBlock")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.ResponseBeginBlock.verify(message.beginBlock); + if (error) + return "beginBlock." + error; + } + } + if (message.checkTx != null && message.hasOwnProperty("checkTx")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.ResponseCheckTx.verify(message.checkTx); + if (error) + return "checkTx." + error; + } + } + if (message.deliverTx != null && message.hasOwnProperty("deliverTx")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.ResponseDeliverTx.verify(message.deliverTx); + if (error) + return "deliverTx." + error; + } + } + if (message.endBlock != null && message.hasOwnProperty("endBlock")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.ResponseEndBlock.verify(message.endBlock); + if (error) + return "endBlock." + error; + } + } + if (message.commit != null && message.hasOwnProperty("commit")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.ResponseCommit.verify(message.commit); + if (error) + return "commit." + error; + } + } + if (message.listSnapshots != null && message.hasOwnProperty("listSnapshots")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.ResponseListSnapshots.verify(message.listSnapshots); + if (error) + return "listSnapshots." + error; + } + } + if (message.offerSnapshot != null && message.hasOwnProperty("offerSnapshot")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.ResponseOfferSnapshot.verify(message.offerSnapshot); + if (error) + return "offerSnapshot." + error; + } + } + if (message.loadSnapshotChunk != null && message.hasOwnProperty("loadSnapshotChunk")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.ResponseLoadSnapshotChunk.verify(message.loadSnapshotChunk); + if (error) + return "loadSnapshotChunk." + error; + } + } + if (message.applySnapshotChunk != null && message.hasOwnProperty("applySnapshotChunk")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.tendermint.abci.ResponseApplySnapshotChunk.verify(message.applySnapshotChunk); + if (error) + return "applySnapshotChunk." + error; + } + } + return null; + }; + + /** + * Creates a Response message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.Response + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.Response} Response + */ + Response.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.Response) + return object; + var message = new $root.tendermint.abci.Response(); + if (object.exception != null) { + if (typeof object.exception !== "object") + throw TypeError(".tendermint.abci.Response.exception: object expected"); + message.exception = $root.tendermint.abci.ResponseException.fromObject(object.exception); + } + if (object.echo != null) { + if (typeof object.echo !== "object") + throw TypeError(".tendermint.abci.Response.echo: object expected"); + message.echo = $root.tendermint.abci.ResponseEcho.fromObject(object.echo); + } + if (object.flush != null) { + if (typeof object.flush !== "object") + throw TypeError(".tendermint.abci.Response.flush: object expected"); + message.flush = $root.tendermint.abci.ResponseFlush.fromObject(object.flush); + } + if (object.info != null) { + if (typeof object.info !== "object") + throw TypeError(".tendermint.abci.Response.info: object expected"); + message.info = $root.tendermint.abci.ResponseInfo.fromObject(object.info); + } + if (object.setOption != null) { + if (typeof object.setOption !== "object") + throw TypeError(".tendermint.abci.Response.setOption: object expected"); + message.setOption = $root.tendermint.abci.ResponseSetOption.fromObject(object.setOption); + } + if (object.initChain != null) { + if (typeof object.initChain !== "object") + throw TypeError(".tendermint.abci.Response.initChain: object expected"); + message.initChain = $root.tendermint.abci.ResponseInitChain.fromObject(object.initChain); + } + if (object.query != null) { + if (typeof object.query !== "object") + throw TypeError(".tendermint.abci.Response.query: object expected"); + message.query = $root.tendermint.abci.ResponseQuery.fromObject(object.query); + } + if (object.beginBlock != null) { + if (typeof object.beginBlock !== "object") + throw TypeError(".tendermint.abci.Response.beginBlock: object expected"); + message.beginBlock = $root.tendermint.abci.ResponseBeginBlock.fromObject(object.beginBlock); + } + if (object.checkTx != null) { + if (typeof object.checkTx !== "object") + throw TypeError(".tendermint.abci.Response.checkTx: object expected"); + message.checkTx = $root.tendermint.abci.ResponseCheckTx.fromObject(object.checkTx); + } + if (object.deliverTx != null) { + if (typeof object.deliverTx !== "object") + throw TypeError(".tendermint.abci.Response.deliverTx: object expected"); + message.deliverTx = $root.tendermint.abci.ResponseDeliverTx.fromObject(object.deliverTx); + } + if (object.endBlock != null) { + if (typeof object.endBlock !== "object") + throw TypeError(".tendermint.abci.Response.endBlock: object expected"); + message.endBlock = $root.tendermint.abci.ResponseEndBlock.fromObject(object.endBlock); + } + if (object.commit != null) { + if (typeof object.commit !== "object") + throw TypeError(".tendermint.abci.Response.commit: object expected"); + message.commit = $root.tendermint.abci.ResponseCommit.fromObject(object.commit); + } + if (object.listSnapshots != null) { + if (typeof object.listSnapshots !== "object") + throw TypeError(".tendermint.abci.Response.listSnapshots: object expected"); + message.listSnapshots = $root.tendermint.abci.ResponseListSnapshots.fromObject(object.listSnapshots); + } + if (object.offerSnapshot != null) { + if (typeof object.offerSnapshot !== "object") + throw TypeError(".tendermint.abci.Response.offerSnapshot: object expected"); + message.offerSnapshot = $root.tendermint.abci.ResponseOfferSnapshot.fromObject(object.offerSnapshot); + } + if (object.loadSnapshotChunk != null) { + if (typeof object.loadSnapshotChunk !== "object") + throw TypeError(".tendermint.abci.Response.loadSnapshotChunk: object expected"); + message.loadSnapshotChunk = $root.tendermint.abci.ResponseLoadSnapshotChunk.fromObject(object.loadSnapshotChunk); + } + if (object.applySnapshotChunk != null) { + if (typeof object.applySnapshotChunk !== "object") + throw TypeError(".tendermint.abci.Response.applySnapshotChunk: object expected"); + message.applySnapshotChunk = $root.tendermint.abci.ResponseApplySnapshotChunk.fromObject(object.applySnapshotChunk); + } + return message; + }; + + /** + * Creates a plain object from a Response message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.Response + * @static + * @param {tendermint.abci.Response} message Response + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Response.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.exception != null && message.hasOwnProperty("exception")) { + object.exception = $root.tendermint.abci.ResponseException.toObject(message.exception, options); + if (options.oneofs) + object.value = "exception"; + } + if (message.echo != null && message.hasOwnProperty("echo")) { + object.echo = $root.tendermint.abci.ResponseEcho.toObject(message.echo, options); + if (options.oneofs) + object.value = "echo"; + } + if (message.flush != null && message.hasOwnProperty("flush")) { + object.flush = $root.tendermint.abci.ResponseFlush.toObject(message.flush, options); + if (options.oneofs) + object.value = "flush"; + } + if (message.info != null && message.hasOwnProperty("info")) { + object.info = $root.tendermint.abci.ResponseInfo.toObject(message.info, options); + if (options.oneofs) + object.value = "info"; + } + if (message.setOption != null && message.hasOwnProperty("setOption")) { + object.setOption = $root.tendermint.abci.ResponseSetOption.toObject(message.setOption, options); + if (options.oneofs) + object.value = "setOption"; + } + if (message.initChain != null && message.hasOwnProperty("initChain")) { + object.initChain = $root.tendermint.abci.ResponseInitChain.toObject(message.initChain, options); + if (options.oneofs) + object.value = "initChain"; + } + if (message.query != null && message.hasOwnProperty("query")) { + object.query = $root.tendermint.abci.ResponseQuery.toObject(message.query, options); + if (options.oneofs) + object.value = "query"; + } + if (message.beginBlock != null && message.hasOwnProperty("beginBlock")) { + object.beginBlock = $root.tendermint.abci.ResponseBeginBlock.toObject(message.beginBlock, options); + if (options.oneofs) + object.value = "beginBlock"; + } + if (message.checkTx != null && message.hasOwnProperty("checkTx")) { + object.checkTx = $root.tendermint.abci.ResponseCheckTx.toObject(message.checkTx, options); + if (options.oneofs) + object.value = "checkTx"; + } + if (message.deliverTx != null && message.hasOwnProperty("deliverTx")) { + object.deliverTx = $root.tendermint.abci.ResponseDeliverTx.toObject(message.deliverTx, options); + if (options.oneofs) + object.value = "deliverTx"; + } + if (message.endBlock != null && message.hasOwnProperty("endBlock")) { + object.endBlock = $root.tendermint.abci.ResponseEndBlock.toObject(message.endBlock, options); + if (options.oneofs) + object.value = "endBlock"; + } + if (message.commit != null && message.hasOwnProperty("commit")) { + object.commit = $root.tendermint.abci.ResponseCommit.toObject(message.commit, options); + if (options.oneofs) + object.value = "commit"; + } + if (message.listSnapshots != null && message.hasOwnProperty("listSnapshots")) { + object.listSnapshots = $root.tendermint.abci.ResponseListSnapshots.toObject(message.listSnapshots, options); + if (options.oneofs) + object.value = "listSnapshots"; + } + if (message.offerSnapshot != null && message.hasOwnProperty("offerSnapshot")) { + object.offerSnapshot = $root.tendermint.abci.ResponseOfferSnapshot.toObject(message.offerSnapshot, options); + if (options.oneofs) + object.value = "offerSnapshot"; + } + if (message.loadSnapshotChunk != null && message.hasOwnProperty("loadSnapshotChunk")) { + object.loadSnapshotChunk = $root.tendermint.abci.ResponseLoadSnapshotChunk.toObject(message.loadSnapshotChunk, options); + if (options.oneofs) + object.value = "loadSnapshotChunk"; + } + if (message.applySnapshotChunk != null && message.hasOwnProperty("applySnapshotChunk")) { + object.applySnapshotChunk = $root.tendermint.abci.ResponseApplySnapshotChunk.toObject(message.applySnapshotChunk, options); + if (options.oneofs) + object.value = "applySnapshotChunk"; + } + return object; + }; + + /** + * Converts this Response to JSON. + * @function toJSON + * @memberof tendermint.abci.Response + * @instance + * @returns {Object.} JSON object + */ + Response.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Response; + })(abci.Response || {}); + + abci.ResponseException = (function(ResponseException) { + + /** + * Properties of a ResponseException. + * @memberof tendermint.abci + * @interface IResponseException + * @property {string|null} [error] ResponseException error + */ + + /** + * Constructs a new ResponseException. + * @memberof tendermint.abci + * @classdesc Represents a ResponseException. + * @implements IResponseException + * @constructor + * @param {tendermint.abci.IResponseException=} [properties] Properties to set + */ + function ResponseException(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseException error. + * @member {string} error + * @memberof tendermint.abci.ResponseException + * @instance + */ + ResponseException.prototype.error = ""; + + /** + * Creates a new ResponseException instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseException + * @static + * @param {tendermint.abci.IResponseException=} [properties] Properties to set + * @returns {tendermint.abci.ResponseException} ResponseException instance + */ + ResponseException.create = function create(properties) { + return new ResponseException(properties); + }; + + /** + * Encodes the specified ResponseException message. Does not implicitly {@link tendermint.abci.ResponseException.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseException + * @static + * @param {tendermint.abci.IResponseException} message ResponseException message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseException.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.error); + return writer; + }; + + /** + * Encodes the specified ResponseException message, length delimited. Does not implicitly {@link tendermint.abci.ResponseException.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseException + * @static + * @param {tendermint.abci.IResponseException} message ResponseException message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseException.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseException message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseException + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseException} ResponseException + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseException.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseException(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.error = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseException message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseException + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseException} ResponseException + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseException.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseException message. + * @function verify + * @memberof tendermint.abci.ResponseException + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseException.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.error != null && message.hasOwnProperty("error")) + if (!$util.isString(message.error)) + return "error: string expected"; + return null; + }; + + /** + * Creates a ResponseException message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseException + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseException} ResponseException + */ + ResponseException.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseException) + return object; + var message = new $root.tendermint.abci.ResponseException(); + if (object.error != null) + message.error = String(object.error); + return message; + }; + + /** + * Creates a plain object from a ResponseException message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseException + * @static + * @param {tendermint.abci.ResponseException} message ResponseException + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseException.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.error = ""; + if (message.error != null && message.hasOwnProperty("error")) + object.error = message.error; + return object; + }; + + /** + * Converts this ResponseException to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseException + * @instance + * @returns {Object.} JSON object + */ + ResponseException.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseException; + })(abci.ResponseException || {}); + + abci.ResponseEcho = (function(ResponseEcho) { + + /** + * Properties of a ResponseEcho. + * @memberof tendermint.abci + * @interface IResponseEcho + * @property {string|null} [message] ResponseEcho message + */ + + /** + * Constructs a new ResponseEcho. + * @memberof tendermint.abci + * @classdesc Represents a ResponseEcho. + * @implements IResponseEcho + * @constructor + * @param {tendermint.abci.IResponseEcho=} [properties] Properties to set + */ + function ResponseEcho(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseEcho message. + * @member {string} message + * @memberof tendermint.abci.ResponseEcho + * @instance + */ + ResponseEcho.prototype.message = ""; + + /** + * Creates a new ResponseEcho instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseEcho + * @static + * @param {tendermint.abci.IResponseEcho=} [properties] Properties to set + * @returns {tendermint.abci.ResponseEcho} ResponseEcho instance + */ + ResponseEcho.create = function create(properties) { + return new ResponseEcho(properties); + }; + + /** + * Encodes the specified ResponseEcho message. Does not implicitly {@link tendermint.abci.ResponseEcho.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseEcho + * @static + * @param {tendermint.abci.IResponseEcho} message ResponseEcho message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseEcho.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + return writer; + }; + + /** + * Encodes the specified ResponseEcho message, length delimited. Does not implicitly {@link tendermint.abci.ResponseEcho.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseEcho + * @static + * @param {tendermint.abci.IResponseEcho} message ResponseEcho message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseEcho.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseEcho message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseEcho + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseEcho} ResponseEcho + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseEcho.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseEcho(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseEcho message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseEcho + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseEcho} ResponseEcho + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseEcho.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseEcho message. + * @function verify + * @memberof tendermint.abci.ResponseEcho + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseEcho.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + return null; + }; + + /** + * Creates a ResponseEcho message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseEcho + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseEcho} ResponseEcho + */ + ResponseEcho.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseEcho) + return object; + var message = new $root.tendermint.abci.ResponseEcho(); + if (object.message != null) + message.message = String(object.message); + return message; + }; + + /** + * Creates a plain object from a ResponseEcho message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseEcho + * @static + * @param {tendermint.abci.ResponseEcho} message ResponseEcho + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseEcho.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.message = ""; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + return object; + }; + + /** + * Converts this ResponseEcho to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseEcho + * @instance + * @returns {Object.} JSON object + */ + ResponseEcho.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseEcho; + })(abci.ResponseEcho || {}); + + abci.ResponseFlush = (function(ResponseFlush) { + + /** + * Properties of a ResponseFlush. + * @memberof tendermint.abci + * @interface IResponseFlush + */ + + /** + * Constructs a new ResponseFlush. + * @memberof tendermint.abci + * @classdesc Represents a ResponseFlush. + * @implements IResponseFlush + * @constructor + * @param {tendermint.abci.IResponseFlush=} [properties] Properties to set + */ + function ResponseFlush(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new ResponseFlush instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseFlush + * @static + * @param {tendermint.abci.IResponseFlush=} [properties] Properties to set + * @returns {tendermint.abci.ResponseFlush} ResponseFlush instance + */ + ResponseFlush.create = function create(properties) { + return new ResponseFlush(properties); + }; + + /** + * Encodes the specified ResponseFlush message. Does not implicitly {@link tendermint.abci.ResponseFlush.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseFlush + * @static + * @param {tendermint.abci.IResponseFlush} message ResponseFlush message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseFlush.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ResponseFlush message, length delimited. Does not implicitly {@link tendermint.abci.ResponseFlush.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseFlush + * @static + * @param {tendermint.abci.IResponseFlush} message ResponseFlush message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseFlush.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseFlush message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseFlush + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseFlush} ResponseFlush + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseFlush.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseFlush(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseFlush message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseFlush + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseFlush} ResponseFlush + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseFlush.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseFlush message. + * @function verify + * @memberof tendermint.abci.ResponseFlush + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseFlush.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a ResponseFlush message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseFlush + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseFlush} ResponseFlush + */ + ResponseFlush.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseFlush) + return object; + return new $root.tendermint.abci.ResponseFlush(); + }; + + /** + * Creates a plain object from a ResponseFlush message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseFlush + * @static + * @param {tendermint.abci.ResponseFlush} message ResponseFlush + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseFlush.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ResponseFlush to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseFlush + * @instance + * @returns {Object.} JSON object + */ + ResponseFlush.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseFlush; + })(abci.ResponseFlush || {}); + + abci.ResponseInfo = (function(ResponseInfo) { + + /** + * Properties of a ResponseInfo. + * @memberof tendermint.abci + * @interface IResponseInfo + * @property {string|null} [data] ResponseInfo data + * @property {string|null} [version] ResponseInfo version + * @property {number|Long|null} [appVersion] ResponseInfo appVersion + * @property {number|Long|null} [lastBlockHeight] ResponseInfo lastBlockHeight + * @property {Uint8Array|null} [lastBlockAppHash] ResponseInfo lastBlockAppHash + */ + + /** + * Constructs a new ResponseInfo. + * @memberof tendermint.abci + * @classdesc Represents a ResponseInfo. + * @implements IResponseInfo + * @constructor + * @param {tendermint.abci.IResponseInfo=} [properties] Properties to set + */ + function ResponseInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseInfo data. + * @member {string} data + * @memberof tendermint.abci.ResponseInfo + * @instance + */ + ResponseInfo.prototype.data = ""; + + /** + * ResponseInfo version. + * @member {string} version + * @memberof tendermint.abci.ResponseInfo + * @instance + */ + ResponseInfo.prototype.version = ""; + + /** + * ResponseInfo appVersion. + * @member {number|Long} appVersion + * @memberof tendermint.abci.ResponseInfo + * @instance + */ + ResponseInfo.prototype.appVersion = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ResponseInfo lastBlockHeight. + * @member {number|Long} lastBlockHeight + * @memberof tendermint.abci.ResponseInfo + * @instance + */ + ResponseInfo.prototype.lastBlockHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ResponseInfo lastBlockAppHash. + * @member {Uint8Array} lastBlockAppHash + * @memberof tendermint.abci.ResponseInfo + * @instance + */ + ResponseInfo.prototype.lastBlockAppHash = $util.newBuffer([]); + + /** + * Creates a new ResponseInfo instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseInfo + * @static + * @param {tendermint.abci.IResponseInfo=} [properties] Properties to set + * @returns {tendermint.abci.ResponseInfo} ResponseInfo instance + */ + ResponseInfo.create = function create(properties) { + return new ResponseInfo(properties); + }; + + /** + * Encodes the specified ResponseInfo message. Does not implicitly {@link tendermint.abci.ResponseInfo.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseInfo + * @static + * @param {tendermint.abci.IResponseInfo} message ResponseInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.data); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); + if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.appVersion); + if (message.lastBlockHeight != null && Object.hasOwnProperty.call(message, "lastBlockHeight")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.lastBlockHeight); + if (message.lastBlockAppHash != null && Object.hasOwnProperty.call(message, "lastBlockAppHash")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.lastBlockAppHash); + return writer; + }; + + /** + * Encodes the specified ResponseInfo message, length delimited. Does not implicitly {@link tendermint.abci.ResponseInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseInfo + * @static + * @param {tendermint.abci.IResponseInfo} message ResponseInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseInfo message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseInfo} ResponseInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.string(); + break; + case 2: + message.version = reader.string(); + break; + case 3: + message.appVersion = reader.uint64(); + break; + case 4: + message.lastBlockHeight = reader.int64(); + break; + case 5: + message.lastBlockAppHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseInfo} ResponseInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseInfo message. + * @function verify + * @memberof tendermint.abci.ResponseInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!$util.isString(message.data)) + return "data: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + if (!$util.isInteger(message.appVersion) && !(message.appVersion && $util.isInteger(message.appVersion.low) && $util.isInteger(message.appVersion.high))) + return "appVersion: integer|Long expected"; + if (message.lastBlockHeight != null && message.hasOwnProperty("lastBlockHeight")) + if (!$util.isInteger(message.lastBlockHeight) && !(message.lastBlockHeight && $util.isInteger(message.lastBlockHeight.low) && $util.isInteger(message.lastBlockHeight.high))) + return "lastBlockHeight: integer|Long expected"; + if (message.lastBlockAppHash != null && message.hasOwnProperty("lastBlockAppHash")) + if (!(message.lastBlockAppHash && typeof message.lastBlockAppHash.length === "number" || $util.isString(message.lastBlockAppHash))) + return "lastBlockAppHash: buffer expected"; + return null; + }; + + /** + * Creates a ResponseInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseInfo + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseInfo} ResponseInfo + */ + ResponseInfo.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseInfo) + return object; + var message = new $root.tendermint.abci.ResponseInfo(); + if (object.data != null) + message.data = String(object.data); + if (object.version != null) + message.version = String(object.version); + if (object.appVersion != null) + if ($util.Long) + (message.appVersion = $util.Long.fromValue(object.appVersion)).unsigned = true; + else if (typeof object.appVersion === "string") + message.appVersion = parseInt(object.appVersion, 10); + else if (typeof object.appVersion === "number") + message.appVersion = object.appVersion; + else if (typeof object.appVersion === "object") + message.appVersion = new $util.LongBits(object.appVersion.low >>> 0, object.appVersion.high >>> 0).toNumber(true); + if (object.lastBlockHeight != null) + if ($util.Long) + (message.lastBlockHeight = $util.Long.fromValue(object.lastBlockHeight)).unsigned = false; + else if (typeof object.lastBlockHeight === "string") + message.lastBlockHeight = parseInt(object.lastBlockHeight, 10); + else if (typeof object.lastBlockHeight === "number") + message.lastBlockHeight = object.lastBlockHeight; + else if (typeof object.lastBlockHeight === "object") + message.lastBlockHeight = new $util.LongBits(object.lastBlockHeight.low >>> 0, object.lastBlockHeight.high >>> 0).toNumber(); + if (object.lastBlockAppHash != null) + if (typeof object.lastBlockAppHash === "string") + $util.base64.decode(object.lastBlockAppHash, message.lastBlockAppHash = $util.newBuffer($util.base64.length(object.lastBlockAppHash)), 0); + else if (object.lastBlockAppHash.length) + message.lastBlockAppHash = object.lastBlockAppHash; + return message; + }; + + /** + * Creates a plain object from a ResponseInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseInfo + * @static + * @param {tendermint.abci.ResponseInfo} message ResponseInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.data = ""; + object.version = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.appVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.appVersion = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.lastBlockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.lastBlockHeight = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.lastBlockAppHash = ""; + else { + object.lastBlockAppHash = []; + if (options.bytes !== Array) + object.lastBlockAppHash = $util.newBuffer(object.lastBlockAppHash); + } + } + if (message.data != null && message.hasOwnProperty("data")) + object.data = message.data; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + if (typeof message.appVersion === "number") + object.appVersion = options.longs === String ? String(message.appVersion) : message.appVersion; + else + object.appVersion = options.longs === String ? $util.Long.prototype.toString.call(message.appVersion) : options.longs === Number ? new $util.LongBits(message.appVersion.low >>> 0, message.appVersion.high >>> 0).toNumber(true) : message.appVersion; + if (message.lastBlockHeight != null && message.hasOwnProperty("lastBlockHeight")) + if (typeof message.lastBlockHeight === "number") + object.lastBlockHeight = options.longs === String ? String(message.lastBlockHeight) : message.lastBlockHeight; + else + object.lastBlockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.lastBlockHeight) : options.longs === Number ? new $util.LongBits(message.lastBlockHeight.low >>> 0, message.lastBlockHeight.high >>> 0).toNumber() : message.lastBlockHeight; + if (message.lastBlockAppHash != null && message.hasOwnProperty("lastBlockAppHash")) + object.lastBlockAppHash = options.bytes === String ? $util.base64.encode(message.lastBlockAppHash, 0, message.lastBlockAppHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.lastBlockAppHash) : message.lastBlockAppHash; + return object; + }; + + /** + * Converts this ResponseInfo to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseInfo + * @instance + * @returns {Object.} JSON object + */ + ResponseInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseInfo; + })(abci.ResponseInfo || {}); + + abci.ResponseSetOption = (function(ResponseSetOption) { + + /** + * Properties of a ResponseSetOption. + * @memberof tendermint.abci + * @interface IResponseSetOption + * @property {number|null} [code] ResponseSetOption code + * @property {string|null} [log] ResponseSetOption log + * @property {string|null} [info] ResponseSetOption info + */ + + /** + * Constructs a new ResponseSetOption. + * @memberof tendermint.abci + * @classdesc Represents a ResponseSetOption. + * @implements IResponseSetOption + * @constructor + * @param {tendermint.abci.IResponseSetOption=} [properties] Properties to set + */ + function ResponseSetOption(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseSetOption code. + * @member {number} code + * @memberof tendermint.abci.ResponseSetOption + * @instance + */ + ResponseSetOption.prototype.code = 0; + + /** + * ResponseSetOption log. + * @member {string} log + * @memberof tendermint.abci.ResponseSetOption + * @instance + */ + ResponseSetOption.prototype.log = ""; + + /** + * ResponseSetOption info. + * @member {string} info + * @memberof tendermint.abci.ResponseSetOption + * @instance + */ + ResponseSetOption.prototype.info = ""; + + /** + * Creates a new ResponseSetOption instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseSetOption + * @static + * @param {tendermint.abci.IResponseSetOption=} [properties] Properties to set + * @returns {tendermint.abci.ResponseSetOption} ResponseSetOption instance + */ + ResponseSetOption.create = function create(properties) { + return new ResponseSetOption(properties); + }; + + /** + * Encodes the specified ResponseSetOption message. Does not implicitly {@link tendermint.abci.ResponseSetOption.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseSetOption + * @static + * @param {tendermint.abci.IResponseSetOption} message ResponseSetOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseSetOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.code); + if (message.log != null && Object.hasOwnProperty.call(message, "log")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.log); + if (message.info != null && Object.hasOwnProperty.call(message, "info")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.info); + return writer; + }; + + /** + * Encodes the specified ResponseSetOption message, length delimited. Does not implicitly {@link tendermint.abci.ResponseSetOption.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseSetOption + * @static + * @param {tendermint.abci.IResponseSetOption} message ResponseSetOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseSetOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseSetOption message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseSetOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseSetOption} ResponseSetOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseSetOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseSetOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 3: + message.log = reader.string(); + break; + case 4: + message.info = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseSetOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseSetOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseSetOption} ResponseSetOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseSetOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseSetOption message. + * @function verify + * @memberof tendermint.abci.ResponseSetOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseSetOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.log != null && message.hasOwnProperty("log")) + if (!$util.isString(message.log)) + return "log: string expected"; + if (message.info != null && message.hasOwnProperty("info")) + if (!$util.isString(message.info)) + return "info: string expected"; + return null; + }; + + /** + * Creates a ResponseSetOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseSetOption + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseSetOption} ResponseSetOption + */ + ResponseSetOption.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseSetOption) + return object; + var message = new $root.tendermint.abci.ResponseSetOption(); + if (object.code != null) + message.code = object.code >>> 0; + if (object.log != null) + message.log = String(object.log); + if (object.info != null) + message.info = String(object.info); + return message; + }; + + /** + * Creates a plain object from a ResponseSetOption message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseSetOption + * @static + * @param {tendermint.abci.ResponseSetOption} message ResponseSetOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseSetOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.code = 0; + object.log = ""; + object.info = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.log != null && message.hasOwnProperty("log")) + object.log = message.log; + if (message.info != null && message.hasOwnProperty("info")) + object.info = message.info; + return object; + }; + + /** + * Converts this ResponseSetOption to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseSetOption + * @instance + * @returns {Object.} JSON object + */ + ResponseSetOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseSetOption; + })(abci.ResponseSetOption || {}); + + abci.ResponseInitChain = (function(ResponseInitChain) { + + /** + * Properties of a ResponseInitChain. + * @memberof tendermint.abci + * @interface IResponseInitChain + * @property {tendermint.abci.IConsensusParams|null} [consensusParams] ResponseInitChain consensusParams + * @property {Array.|null} [validators] ResponseInitChain validators + * @property {Uint8Array|null} [appHash] ResponseInitChain appHash + */ + + /** + * Constructs a new ResponseInitChain. + * @memberof tendermint.abci + * @classdesc Represents a ResponseInitChain. + * @implements IResponseInitChain + * @constructor + * @param {tendermint.abci.IResponseInitChain=} [properties] Properties to set + */ + function ResponseInitChain(properties) { + this.validators = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseInitChain consensusParams. + * @member {tendermint.abci.IConsensusParams|null|undefined} consensusParams + * @memberof tendermint.abci.ResponseInitChain + * @instance + */ + ResponseInitChain.prototype.consensusParams = null; + + /** + * ResponseInitChain validators. + * @member {Array.} validators + * @memberof tendermint.abci.ResponseInitChain + * @instance + */ + ResponseInitChain.prototype.validators = $util.emptyArray; + + /** + * ResponseInitChain appHash. + * @member {Uint8Array} appHash + * @memberof tendermint.abci.ResponseInitChain + * @instance + */ + ResponseInitChain.prototype.appHash = $util.newBuffer([]); + + /** + * Creates a new ResponseInitChain instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseInitChain + * @static + * @param {tendermint.abci.IResponseInitChain=} [properties] Properties to set + * @returns {tendermint.abci.ResponseInitChain} ResponseInitChain instance + */ + ResponseInitChain.create = function create(properties) { + return new ResponseInitChain(properties); + }; + + /** + * Encodes the specified ResponseInitChain message. Does not implicitly {@link tendermint.abci.ResponseInitChain.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseInitChain + * @static + * @param {tendermint.abci.IResponseInitChain} message ResponseInitChain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseInitChain.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.consensusParams != null && Object.hasOwnProperty.call(message, "consensusParams")) + $root.tendermint.abci.ConsensusParams.encode(message.consensusParams, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.validators != null && message.validators.length) + for (var i = 0; i < message.validators.length; ++i) + $root.tendermint.abci.ValidatorUpdate.encode(message.validators[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.appHash != null && Object.hasOwnProperty.call(message, "appHash")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.appHash); + return writer; + }; + + /** + * Encodes the specified ResponseInitChain message, length delimited. Does not implicitly {@link tendermint.abci.ResponseInitChain.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseInitChain + * @static + * @param {tendermint.abci.IResponseInitChain} message ResponseInitChain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseInitChain.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseInitChain message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseInitChain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseInitChain} ResponseInitChain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseInitChain.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseInitChain(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consensusParams = $root.tendermint.abci.ConsensusParams.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.validators && message.validators.length)) + message.validators = []; + message.validators.push($root.tendermint.abci.ValidatorUpdate.decode(reader, reader.uint32())); + break; + case 3: + message.appHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseInitChain message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseInitChain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseInitChain} ResponseInitChain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseInitChain.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseInitChain message. + * @function verify + * @memberof tendermint.abci.ResponseInitChain + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseInitChain.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.consensusParams != null && message.hasOwnProperty("consensusParams")) { + var error = $root.tendermint.abci.ConsensusParams.verify(message.consensusParams); + if (error) + return "consensusParams." + error; + } + if (message.validators != null && message.hasOwnProperty("validators")) { + if (!Array.isArray(message.validators)) + return "validators: array expected"; + for (var i = 0; i < message.validators.length; ++i) { + var error = $root.tendermint.abci.ValidatorUpdate.verify(message.validators[i]); + if (error) + return "validators." + error; + } + } + if (message.appHash != null && message.hasOwnProperty("appHash")) + if (!(message.appHash && typeof message.appHash.length === "number" || $util.isString(message.appHash))) + return "appHash: buffer expected"; + return null; + }; + + /** + * Creates a ResponseInitChain message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseInitChain + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseInitChain} ResponseInitChain + */ + ResponseInitChain.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseInitChain) + return object; + var message = new $root.tendermint.abci.ResponseInitChain(); + if (object.consensusParams != null) { + if (typeof object.consensusParams !== "object") + throw TypeError(".tendermint.abci.ResponseInitChain.consensusParams: object expected"); + message.consensusParams = $root.tendermint.abci.ConsensusParams.fromObject(object.consensusParams); + } + if (object.validators) { + if (!Array.isArray(object.validators)) + throw TypeError(".tendermint.abci.ResponseInitChain.validators: array expected"); + message.validators = []; + for (var i = 0; i < object.validators.length; ++i) { + if (typeof object.validators[i] !== "object") + throw TypeError(".tendermint.abci.ResponseInitChain.validators: object expected"); + message.validators[i] = $root.tendermint.abci.ValidatorUpdate.fromObject(object.validators[i]); + } + } + if (object.appHash != null) + if (typeof object.appHash === "string") + $util.base64.decode(object.appHash, message.appHash = $util.newBuffer($util.base64.length(object.appHash)), 0); + else if (object.appHash.length) + message.appHash = object.appHash; + return message; + }; + + /** + * Creates a plain object from a ResponseInitChain message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseInitChain + * @static + * @param {tendermint.abci.ResponseInitChain} message ResponseInitChain + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseInitChain.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.validators = []; + if (options.defaults) { + object.consensusParams = null; + if (options.bytes === String) + object.appHash = ""; + else { + object.appHash = []; + if (options.bytes !== Array) + object.appHash = $util.newBuffer(object.appHash); + } + } + if (message.consensusParams != null && message.hasOwnProperty("consensusParams")) + object.consensusParams = $root.tendermint.abci.ConsensusParams.toObject(message.consensusParams, options); + if (message.validators && message.validators.length) { + object.validators = []; + for (var j = 0; j < message.validators.length; ++j) + object.validators[j] = $root.tendermint.abci.ValidatorUpdate.toObject(message.validators[j], options); + } + if (message.appHash != null && message.hasOwnProperty("appHash")) + object.appHash = options.bytes === String ? $util.base64.encode(message.appHash, 0, message.appHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.appHash) : message.appHash; + return object; + }; + + /** + * Converts this ResponseInitChain to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseInitChain + * @instance + * @returns {Object.} JSON object + */ + ResponseInitChain.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseInitChain; + })(abci.ResponseInitChain || {}); + + abci.ResponseQuery = (function(ResponseQuery) { + + /** + * Properties of a ResponseQuery. + * @memberof tendermint.abci + * @interface IResponseQuery + * @property {number|null} [code] ResponseQuery code + * @property {string|null} [log] ResponseQuery log + * @property {string|null} [info] ResponseQuery info + * @property {number|Long|null} [index] ResponseQuery index + * @property {Uint8Array|null} [key] ResponseQuery key + * @property {Uint8Array|null} [value] ResponseQuery value + * @property {tendermint.crypto.IProofOps|null} [proofOps] ResponseQuery proofOps + * @property {number|Long|null} [height] ResponseQuery height + * @property {string|null} [codespace] ResponseQuery codespace + */ + + /** + * Constructs a new ResponseQuery. + * @memberof tendermint.abci + * @classdesc Represents a ResponseQuery. + * @implements IResponseQuery + * @constructor + * @param {tendermint.abci.IResponseQuery=} [properties] Properties to set + */ + function ResponseQuery(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseQuery code. + * @member {number} code + * @memberof tendermint.abci.ResponseQuery + * @instance + */ + ResponseQuery.prototype.code = 0; + + /** + * ResponseQuery log. + * @member {string} log + * @memberof tendermint.abci.ResponseQuery + * @instance + */ + ResponseQuery.prototype.log = ""; + + /** + * ResponseQuery info. + * @member {string} info + * @memberof tendermint.abci.ResponseQuery + * @instance + */ + ResponseQuery.prototype.info = ""; + + /** + * ResponseQuery index. + * @member {number|Long} index + * @memberof tendermint.abci.ResponseQuery + * @instance + */ + ResponseQuery.prototype.index = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ResponseQuery key. + * @member {Uint8Array} key + * @memberof tendermint.abci.ResponseQuery + * @instance + */ + ResponseQuery.prototype.key = $util.newBuffer([]); + + /** + * ResponseQuery value. + * @member {Uint8Array} value + * @memberof tendermint.abci.ResponseQuery + * @instance + */ + ResponseQuery.prototype.value = $util.newBuffer([]); + + /** + * ResponseQuery proofOps. + * @member {tendermint.crypto.IProofOps|null|undefined} proofOps + * @memberof tendermint.abci.ResponseQuery + * @instance + */ + ResponseQuery.prototype.proofOps = null; + + /** + * ResponseQuery height. + * @member {number|Long} height + * @memberof tendermint.abci.ResponseQuery + * @instance + */ + ResponseQuery.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ResponseQuery codespace. + * @member {string} codespace + * @memberof tendermint.abci.ResponseQuery + * @instance + */ + ResponseQuery.prototype.codespace = ""; + + /** + * Creates a new ResponseQuery instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseQuery + * @static + * @param {tendermint.abci.IResponseQuery=} [properties] Properties to set + * @returns {tendermint.abci.ResponseQuery} ResponseQuery instance + */ + ResponseQuery.create = function create(properties) { + return new ResponseQuery(properties); + }; + + /** + * Encodes the specified ResponseQuery message. Does not implicitly {@link tendermint.abci.ResponseQuery.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseQuery + * @static + * @param {tendermint.abci.IResponseQuery} message ResponseQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseQuery.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.code); + if (message.log != null && Object.hasOwnProperty.call(message, "log")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.log); + if (message.info != null && Object.hasOwnProperty.call(message, "info")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.info); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.index); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.value); + if (message.proofOps != null && Object.hasOwnProperty.call(message, "proofOps")) + $root.tendermint.crypto.ProofOps.encode(message.proofOps, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.height); + if (message.codespace != null && Object.hasOwnProperty.call(message, "codespace")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.codespace); + return writer; + }; + + /** + * Encodes the specified ResponseQuery message, length delimited. Does not implicitly {@link tendermint.abci.ResponseQuery.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseQuery + * @static + * @param {tendermint.abci.IResponseQuery} message ResponseQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseQuery.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseQuery message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseQuery} ResponseQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseQuery.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseQuery(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 3: + message.log = reader.string(); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.index = reader.int64(); + break; + case 6: + message.key = reader.bytes(); + break; + case 7: + message.value = reader.bytes(); + break; + case 8: + message.proofOps = $root.tendermint.crypto.ProofOps.decode(reader, reader.uint32()); + break; + case 9: + message.height = reader.int64(); + break; + case 10: + message.codespace = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseQuery message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseQuery} ResponseQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseQuery.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseQuery message. + * @function verify + * @memberof tendermint.abci.ResponseQuery + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseQuery.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.log != null && message.hasOwnProperty("log")) + if (!$util.isString(message.log)) + return "log: string expected"; + if (message.info != null && message.hasOwnProperty("info")) + if (!$util.isString(message.info)) + return "info: string expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index) && !(message.index && $util.isInteger(message.index.low) && $util.isInteger(message.index.high))) + return "index: integer|Long expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + if (message.proofOps != null && message.hasOwnProperty("proofOps")) { + var error = $root.tendermint.crypto.ProofOps.verify(message.proofOps); + if (error) + return "proofOps." + error; + } + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.codespace != null && message.hasOwnProperty("codespace")) + if (!$util.isString(message.codespace)) + return "codespace: string expected"; + return null; + }; + + /** + * Creates a ResponseQuery message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseQuery + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseQuery} ResponseQuery + */ + ResponseQuery.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseQuery) + return object; + var message = new $root.tendermint.abci.ResponseQuery(); + if (object.code != null) + message.code = object.code >>> 0; + if (object.log != null) + message.log = String(object.log); + if (object.info != null) + message.info = String(object.info); + if (object.index != null) + if ($util.Long) + (message.index = $util.Long.fromValue(object.index)).unsigned = false; + else if (typeof object.index === "string") + message.index = parseInt(object.index, 10); + else if (typeof object.index === "number") + message.index = object.index; + else if (typeof object.index === "object") + message.index = new $util.LongBits(object.index.low >>> 0, object.index.high >>> 0).toNumber(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length) + message.key = object.key; + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length) + message.value = object.value; + if (object.proofOps != null) { + if (typeof object.proofOps !== "object") + throw TypeError(".tendermint.abci.ResponseQuery.proofOps: object expected"); + message.proofOps = $root.tendermint.crypto.ProofOps.fromObject(object.proofOps); + } + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + if (object.codespace != null) + message.codespace = String(object.codespace); + return message; + }; + + /** + * Creates a plain object from a ResponseQuery message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseQuery + * @static + * @param {tendermint.abci.ResponseQuery} message ResponseQuery + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseQuery.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.code = 0; + object.log = ""; + object.info = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.index = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.index = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + object.proofOps = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.codespace = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.log != null && message.hasOwnProperty("log")) + object.log = message.log; + if (message.info != null && message.hasOwnProperty("info")) + object.info = message.info; + if (message.index != null && message.hasOwnProperty("index")) + if (typeof message.index === "number") + object.index = options.longs === String ? String(message.index) : message.index; + else + object.index = options.longs === String ? $util.Long.prototype.toString.call(message.index) : options.longs === Number ? new $util.LongBits(message.index.low >>> 0, message.index.high >>> 0).toNumber() : message.index; + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + if (message.proofOps != null && message.hasOwnProperty("proofOps")) + object.proofOps = $root.tendermint.crypto.ProofOps.toObject(message.proofOps, options); + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + if (message.codespace != null && message.hasOwnProperty("codespace")) + object.codespace = message.codespace; + return object; + }; + + /** + * Converts this ResponseQuery to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseQuery + * @instance + * @returns {Object.} JSON object + */ + ResponseQuery.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseQuery; + })(abci.ResponseQuery || {}); + + abci.ResponseBeginBlock = (function(ResponseBeginBlock) { + + /** + * Properties of a ResponseBeginBlock. + * @memberof tendermint.abci + * @interface IResponseBeginBlock + * @property {Array.|null} [events] ResponseBeginBlock events + */ + + /** + * Constructs a new ResponseBeginBlock. + * @memberof tendermint.abci + * @classdesc Represents a ResponseBeginBlock. + * @implements IResponseBeginBlock + * @constructor + * @param {tendermint.abci.IResponseBeginBlock=} [properties] Properties to set + */ + function ResponseBeginBlock(properties) { + this.events = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseBeginBlock events. + * @member {Array.} events + * @memberof tendermint.abci.ResponseBeginBlock + * @instance + */ + ResponseBeginBlock.prototype.events = $util.emptyArray; + + /** + * Creates a new ResponseBeginBlock instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseBeginBlock + * @static + * @param {tendermint.abci.IResponseBeginBlock=} [properties] Properties to set + * @returns {tendermint.abci.ResponseBeginBlock} ResponseBeginBlock instance + */ + ResponseBeginBlock.create = function create(properties) { + return new ResponseBeginBlock(properties); + }; + + /** + * Encodes the specified ResponseBeginBlock message. Does not implicitly {@link tendermint.abci.ResponseBeginBlock.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseBeginBlock + * @static + * @param {tendermint.abci.IResponseBeginBlock} message ResponseBeginBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseBeginBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.events != null && message.events.length) + for (var i = 0; i < message.events.length; ++i) + $root.tendermint.abci.Event.encode(message.events[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResponseBeginBlock message, length delimited. Does not implicitly {@link tendermint.abci.ResponseBeginBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseBeginBlock + * @static + * @param {tendermint.abci.IResponseBeginBlock} message ResponseBeginBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseBeginBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseBeginBlock message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseBeginBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseBeginBlock} ResponseBeginBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseBeginBlock.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseBeginBlock(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.events && message.events.length)) + message.events = []; + message.events.push($root.tendermint.abci.Event.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseBeginBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseBeginBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseBeginBlock} ResponseBeginBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseBeginBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseBeginBlock message. + * @function verify + * @memberof tendermint.abci.ResponseBeginBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseBeginBlock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.events != null && message.hasOwnProperty("events")) { + if (!Array.isArray(message.events)) + return "events: array expected"; + for (var i = 0; i < message.events.length; ++i) { + var error = $root.tendermint.abci.Event.verify(message.events[i]); + if (error) + return "events." + error; + } + } + return null; + }; + + /** + * Creates a ResponseBeginBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseBeginBlock + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseBeginBlock} ResponseBeginBlock + */ + ResponseBeginBlock.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseBeginBlock) + return object; + var message = new $root.tendermint.abci.ResponseBeginBlock(); + if (object.events) { + if (!Array.isArray(object.events)) + throw TypeError(".tendermint.abci.ResponseBeginBlock.events: array expected"); + message.events = []; + for (var i = 0; i < object.events.length; ++i) { + if (typeof object.events[i] !== "object") + throw TypeError(".tendermint.abci.ResponseBeginBlock.events: object expected"); + message.events[i] = $root.tendermint.abci.Event.fromObject(object.events[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ResponseBeginBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseBeginBlock + * @static + * @param {tendermint.abci.ResponseBeginBlock} message ResponseBeginBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseBeginBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.events = []; + if (message.events && message.events.length) { + object.events = []; + for (var j = 0; j < message.events.length; ++j) + object.events[j] = $root.tendermint.abci.Event.toObject(message.events[j], options); + } + return object; + }; + + /** + * Converts this ResponseBeginBlock to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseBeginBlock + * @instance + * @returns {Object.} JSON object + */ + ResponseBeginBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseBeginBlock; + })(abci.ResponseBeginBlock || {}); + + abci.ResponseCheckTx = (function(ResponseCheckTx) { + + /** + * Properties of a ResponseCheckTx. + * @memberof tendermint.abci + * @interface IResponseCheckTx + * @property {number|null} [code] ResponseCheckTx code + * @property {Uint8Array|null} [data] ResponseCheckTx data + * @property {string|null} [log] ResponseCheckTx log + * @property {string|null} [info] ResponseCheckTx info + * @property {number|Long|null} [gasWanted] ResponseCheckTx gasWanted + * @property {number|Long|null} [gasUsed] ResponseCheckTx gasUsed + * @property {Array.|null} [events] ResponseCheckTx events + * @property {string|null} [codespace] ResponseCheckTx codespace + */ + + /** + * Constructs a new ResponseCheckTx. + * @memberof tendermint.abci + * @classdesc Represents a ResponseCheckTx. + * @implements IResponseCheckTx + * @constructor + * @param {tendermint.abci.IResponseCheckTx=} [properties] Properties to set + */ + function ResponseCheckTx(properties) { + this.events = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseCheckTx code. + * @member {number} code + * @memberof tendermint.abci.ResponseCheckTx + * @instance + */ + ResponseCheckTx.prototype.code = 0; + + /** + * ResponseCheckTx data. + * @member {Uint8Array} data + * @memberof tendermint.abci.ResponseCheckTx + * @instance + */ + ResponseCheckTx.prototype.data = $util.newBuffer([]); + + /** + * ResponseCheckTx log. + * @member {string} log + * @memberof tendermint.abci.ResponseCheckTx + * @instance + */ + ResponseCheckTx.prototype.log = ""; + + /** + * ResponseCheckTx info. + * @member {string} info + * @memberof tendermint.abci.ResponseCheckTx + * @instance + */ + ResponseCheckTx.prototype.info = ""; + + /** + * ResponseCheckTx gasWanted. + * @member {number|Long} gasWanted + * @memberof tendermint.abci.ResponseCheckTx + * @instance + */ + ResponseCheckTx.prototype.gasWanted = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ResponseCheckTx gasUsed. + * @member {number|Long} gasUsed + * @memberof tendermint.abci.ResponseCheckTx + * @instance + */ + ResponseCheckTx.prototype.gasUsed = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ResponseCheckTx events. + * @member {Array.} events + * @memberof tendermint.abci.ResponseCheckTx + * @instance + */ + ResponseCheckTx.prototype.events = $util.emptyArray; + + /** + * ResponseCheckTx codespace. + * @member {string} codespace + * @memberof tendermint.abci.ResponseCheckTx + * @instance + */ + ResponseCheckTx.prototype.codespace = ""; + + /** + * Creates a new ResponseCheckTx instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseCheckTx + * @static + * @param {tendermint.abci.IResponseCheckTx=} [properties] Properties to set + * @returns {tendermint.abci.ResponseCheckTx} ResponseCheckTx instance + */ + ResponseCheckTx.create = function create(properties) { + return new ResponseCheckTx(properties); + }; + + /** + * Encodes the specified ResponseCheckTx message. Does not implicitly {@link tendermint.abci.ResponseCheckTx.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseCheckTx + * @static + * @param {tendermint.abci.IResponseCheckTx} message ResponseCheckTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseCheckTx.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.code); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); + if (message.log != null && Object.hasOwnProperty.call(message, "log")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.log); + if (message.info != null && Object.hasOwnProperty.call(message, "info")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.info); + if (message.gasWanted != null && Object.hasOwnProperty.call(message, "gasWanted")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.gasWanted); + if (message.gasUsed != null && Object.hasOwnProperty.call(message, "gasUsed")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.gasUsed); + if (message.events != null && message.events.length) + for (var i = 0; i < message.events.length; ++i) + $root.tendermint.abci.Event.encode(message.events[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.codespace != null && Object.hasOwnProperty.call(message, "codespace")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.codespace); + return writer; + }; + + /** + * Encodes the specified ResponseCheckTx message, length delimited. Does not implicitly {@link tendermint.abci.ResponseCheckTx.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseCheckTx + * @static + * @param {tendermint.abci.IResponseCheckTx} message ResponseCheckTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseCheckTx.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseCheckTx message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseCheckTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseCheckTx} ResponseCheckTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseCheckTx.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseCheckTx(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 2: + message.data = reader.bytes(); + break; + case 3: + message.log = reader.string(); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.gasWanted = reader.int64(); + break; + case 6: + message.gasUsed = reader.int64(); + break; + case 7: + if (!(message.events && message.events.length)) + message.events = []; + message.events.push($root.tendermint.abci.Event.decode(reader, reader.uint32())); + break; + case 8: + message.codespace = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseCheckTx message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseCheckTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseCheckTx} ResponseCheckTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseCheckTx.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseCheckTx message. + * @function verify + * @memberof tendermint.abci.ResponseCheckTx + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseCheckTx.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + if (message.log != null && message.hasOwnProperty("log")) + if (!$util.isString(message.log)) + return "log: string expected"; + if (message.info != null && message.hasOwnProperty("info")) + if (!$util.isString(message.info)) + return "info: string expected"; + if (message.gasWanted != null && message.hasOwnProperty("gasWanted")) + if (!$util.isInteger(message.gasWanted) && !(message.gasWanted && $util.isInteger(message.gasWanted.low) && $util.isInteger(message.gasWanted.high))) + return "gasWanted: integer|Long expected"; + if (message.gasUsed != null && message.hasOwnProperty("gasUsed")) + if (!$util.isInteger(message.gasUsed) && !(message.gasUsed && $util.isInteger(message.gasUsed.low) && $util.isInteger(message.gasUsed.high))) + return "gasUsed: integer|Long expected"; + if (message.events != null && message.hasOwnProperty("events")) { + if (!Array.isArray(message.events)) + return "events: array expected"; + for (var i = 0; i < message.events.length; ++i) { + var error = $root.tendermint.abci.Event.verify(message.events[i]); + if (error) + return "events." + error; + } + } + if (message.codespace != null && message.hasOwnProperty("codespace")) + if (!$util.isString(message.codespace)) + return "codespace: string expected"; + return null; + }; + + /** + * Creates a ResponseCheckTx message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseCheckTx + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseCheckTx} ResponseCheckTx + */ + ResponseCheckTx.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseCheckTx) + return object; + var message = new $root.tendermint.abci.ResponseCheckTx(); + if (object.code != null) + message.code = object.code >>> 0; + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length) + message.data = object.data; + if (object.log != null) + message.log = String(object.log); + if (object.info != null) + message.info = String(object.info); + if (object.gasWanted != null) + if ($util.Long) + (message.gasWanted = $util.Long.fromValue(object.gasWanted)).unsigned = false; + else if (typeof object.gasWanted === "string") + message.gasWanted = parseInt(object.gasWanted, 10); + else if (typeof object.gasWanted === "number") + message.gasWanted = object.gasWanted; + else if (typeof object.gasWanted === "object") + message.gasWanted = new $util.LongBits(object.gasWanted.low >>> 0, object.gasWanted.high >>> 0).toNumber(); + if (object.gasUsed != null) + if ($util.Long) + (message.gasUsed = $util.Long.fromValue(object.gasUsed)).unsigned = false; + else if (typeof object.gasUsed === "string") + message.gasUsed = parseInt(object.gasUsed, 10); + else if (typeof object.gasUsed === "number") + message.gasUsed = object.gasUsed; + else if (typeof object.gasUsed === "object") + message.gasUsed = new $util.LongBits(object.gasUsed.low >>> 0, object.gasUsed.high >>> 0).toNumber(); + if (object.events) { + if (!Array.isArray(object.events)) + throw TypeError(".tendermint.abci.ResponseCheckTx.events: array expected"); + message.events = []; + for (var i = 0; i < object.events.length; ++i) { + if (typeof object.events[i] !== "object") + throw TypeError(".tendermint.abci.ResponseCheckTx.events: object expected"); + message.events[i] = $root.tendermint.abci.Event.fromObject(object.events[i]); + } + } + if (object.codespace != null) + message.codespace = String(object.codespace); + return message; + }; + + /** + * Creates a plain object from a ResponseCheckTx message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseCheckTx + * @static + * @param {tendermint.abci.ResponseCheckTx} message ResponseCheckTx + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseCheckTx.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.events = []; + if (options.defaults) { + object.code = 0; + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + object.log = ""; + object.info = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.gasWanted = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.gasWanted = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.gasUsed = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.gasUsed = options.longs === String ? "0" : 0; + object.codespace = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + if (message.log != null && message.hasOwnProperty("log")) + object.log = message.log; + if (message.info != null && message.hasOwnProperty("info")) + object.info = message.info; + if (message.gasWanted != null && message.hasOwnProperty("gasWanted")) + if (typeof message.gasWanted === "number") + object.gasWanted = options.longs === String ? String(message.gasWanted) : message.gasWanted; + else + object.gasWanted = options.longs === String ? $util.Long.prototype.toString.call(message.gasWanted) : options.longs === Number ? new $util.LongBits(message.gasWanted.low >>> 0, message.gasWanted.high >>> 0).toNumber() : message.gasWanted; + if (message.gasUsed != null && message.hasOwnProperty("gasUsed")) + if (typeof message.gasUsed === "number") + object.gasUsed = options.longs === String ? String(message.gasUsed) : message.gasUsed; + else + object.gasUsed = options.longs === String ? $util.Long.prototype.toString.call(message.gasUsed) : options.longs === Number ? new $util.LongBits(message.gasUsed.low >>> 0, message.gasUsed.high >>> 0).toNumber() : message.gasUsed; + if (message.events && message.events.length) { + object.events = []; + for (var j = 0; j < message.events.length; ++j) + object.events[j] = $root.tendermint.abci.Event.toObject(message.events[j], options); + } + if (message.codespace != null && message.hasOwnProperty("codespace")) + object.codespace = message.codespace; + return object; + }; + + /** + * Converts this ResponseCheckTx to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseCheckTx + * @instance + * @returns {Object.} JSON object + */ + ResponseCheckTx.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseCheckTx; + })(abci.ResponseCheckTx || {}); + + abci.ResponseDeliverTx = (function(ResponseDeliverTx) { + + /** + * Properties of a ResponseDeliverTx. + * @memberof tendermint.abci + * @interface IResponseDeliverTx + * @property {number|null} [code] ResponseDeliverTx code + * @property {Uint8Array|null} [data] ResponseDeliverTx data + * @property {string|null} [log] ResponseDeliverTx log + * @property {string|null} [info] ResponseDeliverTx info + * @property {number|Long|null} [gasWanted] ResponseDeliverTx gasWanted + * @property {number|Long|null} [gasUsed] ResponseDeliverTx gasUsed + * @property {Array.|null} [events] ResponseDeliverTx events + * @property {string|null} [codespace] ResponseDeliverTx codespace + */ + + /** + * Constructs a new ResponseDeliverTx. + * @memberof tendermint.abci + * @classdesc Represents a ResponseDeliverTx. + * @implements IResponseDeliverTx + * @constructor + * @param {tendermint.abci.IResponseDeliverTx=} [properties] Properties to set + */ + function ResponseDeliverTx(properties) { + this.events = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseDeliverTx code. + * @member {number} code + * @memberof tendermint.abci.ResponseDeliverTx + * @instance + */ + ResponseDeliverTx.prototype.code = 0; + + /** + * ResponseDeliverTx data. + * @member {Uint8Array} data + * @memberof tendermint.abci.ResponseDeliverTx + * @instance + */ + ResponseDeliverTx.prototype.data = $util.newBuffer([]); + + /** + * ResponseDeliverTx log. + * @member {string} log + * @memberof tendermint.abci.ResponseDeliverTx + * @instance + */ + ResponseDeliverTx.prototype.log = ""; + + /** + * ResponseDeliverTx info. + * @member {string} info + * @memberof tendermint.abci.ResponseDeliverTx + * @instance + */ + ResponseDeliverTx.prototype.info = ""; + + /** + * ResponseDeliverTx gasWanted. + * @member {number|Long} gasWanted + * @memberof tendermint.abci.ResponseDeliverTx + * @instance + */ + ResponseDeliverTx.prototype.gasWanted = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ResponseDeliverTx gasUsed. + * @member {number|Long} gasUsed + * @memberof tendermint.abci.ResponseDeliverTx + * @instance + */ + ResponseDeliverTx.prototype.gasUsed = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ResponseDeliverTx events. + * @member {Array.} events + * @memberof tendermint.abci.ResponseDeliverTx + * @instance + */ + ResponseDeliverTx.prototype.events = $util.emptyArray; + + /** + * ResponseDeliverTx codespace. + * @member {string} codespace + * @memberof tendermint.abci.ResponseDeliverTx + * @instance + */ + ResponseDeliverTx.prototype.codespace = ""; + + /** + * Creates a new ResponseDeliverTx instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseDeliverTx + * @static + * @param {tendermint.abci.IResponseDeliverTx=} [properties] Properties to set + * @returns {tendermint.abci.ResponseDeliverTx} ResponseDeliverTx instance + */ + ResponseDeliverTx.create = function create(properties) { + return new ResponseDeliverTx(properties); + }; + + /** + * Encodes the specified ResponseDeliverTx message. Does not implicitly {@link tendermint.abci.ResponseDeliverTx.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseDeliverTx + * @static + * @param {tendermint.abci.IResponseDeliverTx} message ResponseDeliverTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseDeliverTx.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.code); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); + if (message.log != null && Object.hasOwnProperty.call(message, "log")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.log); + if (message.info != null && Object.hasOwnProperty.call(message, "info")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.info); + if (message.gasWanted != null && Object.hasOwnProperty.call(message, "gasWanted")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.gasWanted); + if (message.gasUsed != null && Object.hasOwnProperty.call(message, "gasUsed")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.gasUsed); + if (message.events != null && message.events.length) + for (var i = 0; i < message.events.length; ++i) + $root.tendermint.abci.Event.encode(message.events[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.codespace != null && Object.hasOwnProperty.call(message, "codespace")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.codespace); + return writer; + }; + + /** + * Encodes the specified ResponseDeliverTx message, length delimited. Does not implicitly {@link tendermint.abci.ResponseDeliverTx.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseDeliverTx + * @static + * @param {tendermint.abci.IResponseDeliverTx} message ResponseDeliverTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseDeliverTx.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseDeliverTx message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseDeliverTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseDeliverTx} ResponseDeliverTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseDeliverTx.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseDeliverTx(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 2: + message.data = reader.bytes(); + break; + case 3: + message.log = reader.string(); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.gasWanted = reader.int64(); + break; + case 6: + message.gasUsed = reader.int64(); + break; + case 7: + if (!(message.events && message.events.length)) + message.events = []; + message.events.push($root.tendermint.abci.Event.decode(reader, reader.uint32())); + break; + case 8: + message.codespace = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseDeliverTx message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseDeliverTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseDeliverTx} ResponseDeliverTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseDeliverTx.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseDeliverTx message. + * @function verify + * @memberof tendermint.abci.ResponseDeliverTx + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseDeliverTx.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + if (message.log != null && message.hasOwnProperty("log")) + if (!$util.isString(message.log)) + return "log: string expected"; + if (message.info != null && message.hasOwnProperty("info")) + if (!$util.isString(message.info)) + return "info: string expected"; + if (message.gasWanted != null && message.hasOwnProperty("gasWanted")) + if (!$util.isInteger(message.gasWanted) && !(message.gasWanted && $util.isInteger(message.gasWanted.low) && $util.isInteger(message.gasWanted.high))) + return "gasWanted: integer|Long expected"; + if (message.gasUsed != null && message.hasOwnProperty("gasUsed")) + if (!$util.isInteger(message.gasUsed) && !(message.gasUsed && $util.isInteger(message.gasUsed.low) && $util.isInteger(message.gasUsed.high))) + return "gasUsed: integer|Long expected"; + if (message.events != null && message.hasOwnProperty("events")) { + if (!Array.isArray(message.events)) + return "events: array expected"; + for (var i = 0; i < message.events.length; ++i) { + var error = $root.tendermint.abci.Event.verify(message.events[i]); + if (error) + return "events." + error; + } + } + if (message.codespace != null && message.hasOwnProperty("codespace")) + if (!$util.isString(message.codespace)) + return "codespace: string expected"; + return null; + }; + + /** + * Creates a ResponseDeliverTx message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseDeliverTx + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseDeliverTx} ResponseDeliverTx + */ + ResponseDeliverTx.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseDeliverTx) + return object; + var message = new $root.tendermint.abci.ResponseDeliverTx(); + if (object.code != null) + message.code = object.code >>> 0; + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length) + message.data = object.data; + if (object.log != null) + message.log = String(object.log); + if (object.info != null) + message.info = String(object.info); + if (object.gasWanted != null) + if ($util.Long) + (message.gasWanted = $util.Long.fromValue(object.gasWanted)).unsigned = false; + else if (typeof object.gasWanted === "string") + message.gasWanted = parseInt(object.gasWanted, 10); + else if (typeof object.gasWanted === "number") + message.gasWanted = object.gasWanted; + else if (typeof object.gasWanted === "object") + message.gasWanted = new $util.LongBits(object.gasWanted.low >>> 0, object.gasWanted.high >>> 0).toNumber(); + if (object.gasUsed != null) + if ($util.Long) + (message.gasUsed = $util.Long.fromValue(object.gasUsed)).unsigned = false; + else if (typeof object.gasUsed === "string") + message.gasUsed = parseInt(object.gasUsed, 10); + else if (typeof object.gasUsed === "number") + message.gasUsed = object.gasUsed; + else if (typeof object.gasUsed === "object") + message.gasUsed = new $util.LongBits(object.gasUsed.low >>> 0, object.gasUsed.high >>> 0).toNumber(); + if (object.events) { + if (!Array.isArray(object.events)) + throw TypeError(".tendermint.abci.ResponseDeliverTx.events: array expected"); + message.events = []; + for (var i = 0; i < object.events.length; ++i) { + if (typeof object.events[i] !== "object") + throw TypeError(".tendermint.abci.ResponseDeliverTx.events: object expected"); + message.events[i] = $root.tendermint.abci.Event.fromObject(object.events[i]); + } + } + if (object.codespace != null) + message.codespace = String(object.codespace); + return message; + }; + + /** + * Creates a plain object from a ResponseDeliverTx message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseDeliverTx + * @static + * @param {tendermint.abci.ResponseDeliverTx} message ResponseDeliverTx + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseDeliverTx.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.events = []; + if (options.defaults) { + object.code = 0; + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + object.log = ""; + object.info = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.gasWanted = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.gasWanted = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.gasUsed = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.gasUsed = options.longs === String ? "0" : 0; + object.codespace = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + if (message.log != null && message.hasOwnProperty("log")) + object.log = message.log; + if (message.info != null && message.hasOwnProperty("info")) + object.info = message.info; + if (message.gasWanted != null && message.hasOwnProperty("gasWanted")) + if (typeof message.gasWanted === "number") + object.gasWanted = options.longs === String ? String(message.gasWanted) : message.gasWanted; + else + object.gasWanted = options.longs === String ? $util.Long.prototype.toString.call(message.gasWanted) : options.longs === Number ? new $util.LongBits(message.gasWanted.low >>> 0, message.gasWanted.high >>> 0).toNumber() : message.gasWanted; + if (message.gasUsed != null && message.hasOwnProperty("gasUsed")) + if (typeof message.gasUsed === "number") + object.gasUsed = options.longs === String ? String(message.gasUsed) : message.gasUsed; + else + object.gasUsed = options.longs === String ? $util.Long.prototype.toString.call(message.gasUsed) : options.longs === Number ? new $util.LongBits(message.gasUsed.low >>> 0, message.gasUsed.high >>> 0).toNumber() : message.gasUsed; + if (message.events && message.events.length) { + object.events = []; + for (var j = 0; j < message.events.length; ++j) + object.events[j] = $root.tendermint.abci.Event.toObject(message.events[j], options); + } + if (message.codespace != null && message.hasOwnProperty("codespace")) + object.codespace = message.codespace; + return object; + }; + + /** + * Converts this ResponseDeliverTx to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseDeliverTx + * @instance + * @returns {Object.} JSON object + */ + ResponseDeliverTx.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseDeliverTx; + })(abci.ResponseDeliverTx || {}); + + abci.ResponseEndBlock = (function(ResponseEndBlock) { + + /** + * Properties of a ResponseEndBlock. + * @memberof tendermint.abci + * @interface IResponseEndBlock + * @property {Array.|null} [validatorUpdates] ResponseEndBlock validatorUpdates + * @property {tendermint.abci.IConsensusParams|null} [consensusParamUpdates] ResponseEndBlock consensusParamUpdates + * @property {Array.|null} [events] ResponseEndBlock events + */ + + /** + * Constructs a new ResponseEndBlock. + * @memberof tendermint.abci + * @classdesc Represents a ResponseEndBlock. + * @implements IResponseEndBlock + * @constructor + * @param {tendermint.abci.IResponseEndBlock=} [properties] Properties to set + */ + function ResponseEndBlock(properties) { + this.validatorUpdates = []; + this.events = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseEndBlock validatorUpdates. + * @member {Array.} validatorUpdates + * @memberof tendermint.abci.ResponseEndBlock + * @instance + */ + ResponseEndBlock.prototype.validatorUpdates = $util.emptyArray; + + /** + * ResponseEndBlock consensusParamUpdates. + * @member {tendermint.abci.IConsensusParams|null|undefined} consensusParamUpdates + * @memberof tendermint.abci.ResponseEndBlock + * @instance + */ + ResponseEndBlock.prototype.consensusParamUpdates = null; + + /** + * ResponseEndBlock events. + * @member {Array.} events + * @memberof tendermint.abci.ResponseEndBlock + * @instance + */ + ResponseEndBlock.prototype.events = $util.emptyArray; + + /** + * Creates a new ResponseEndBlock instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseEndBlock + * @static + * @param {tendermint.abci.IResponseEndBlock=} [properties] Properties to set + * @returns {tendermint.abci.ResponseEndBlock} ResponseEndBlock instance + */ + ResponseEndBlock.create = function create(properties) { + return new ResponseEndBlock(properties); + }; + + /** + * Encodes the specified ResponseEndBlock message. Does not implicitly {@link tendermint.abci.ResponseEndBlock.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseEndBlock + * @static + * @param {tendermint.abci.IResponseEndBlock} message ResponseEndBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseEndBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validatorUpdates != null && message.validatorUpdates.length) + for (var i = 0; i < message.validatorUpdates.length; ++i) + $root.tendermint.abci.ValidatorUpdate.encode(message.validatorUpdates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.consensusParamUpdates != null && Object.hasOwnProperty.call(message, "consensusParamUpdates")) + $root.tendermint.abci.ConsensusParams.encode(message.consensusParamUpdates, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.events != null && message.events.length) + for (var i = 0; i < message.events.length; ++i) + $root.tendermint.abci.Event.encode(message.events[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResponseEndBlock message, length delimited. Does not implicitly {@link tendermint.abci.ResponseEndBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseEndBlock + * @static + * @param {tendermint.abci.IResponseEndBlock} message ResponseEndBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseEndBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseEndBlock message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseEndBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseEndBlock} ResponseEndBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseEndBlock.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseEndBlock(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.validatorUpdates && message.validatorUpdates.length)) + message.validatorUpdates = []; + message.validatorUpdates.push($root.tendermint.abci.ValidatorUpdate.decode(reader, reader.uint32())); + break; + case 2: + message.consensusParamUpdates = $root.tendermint.abci.ConsensusParams.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.events && message.events.length)) + message.events = []; + message.events.push($root.tendermint.abci.Event.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseEndBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseEndBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseEndBlock} ResponseEndBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseEndBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseEndBlock message. + * @function verify + * @memberof tendermint.abci.ResponseEndBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseEndBlock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validatorUpdates != null && message.hasOwnProperty("validatorUpdates")) { + if (!Array.isArray(message.validatorUpdates)) + return "validatorUpdates: array expected"; + for (var i = 0; i < message.validatorUpdates.length; ++i) { + var error = $root.tendermint.abci.ValidatorUpdate.verify(message.validatorUpdates[i]); + if (error) + return "validatorUpdates." + error; + } + } + if (message.consensusParamUpdates != null && message.hasOwnProperty("consensusParamUpdates")) { + var error = $root.tendermint.abci.ConsensusParams.verify(message.consensusParamUpdates); + if (error) + return "consensusParamUpdates." + error; + } + if (message.events != null && message.hasOwnProperty("events")) { + if (!Array.isArray(message.events)) + return "events: array expected"; + for (var i = 0; i < message.events.length; ++i) { + var error = $root.tendermint.abci.Event.verify(message.events[i]); + if (error) + return "events." + error; + } + } + return null; + }; + + /** + * Creates a ResponseEndBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseEndBlock + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseEndBlock} ResponseEndBlock + */ + ResponseEndBlock.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseEndBlock) + return object; + var message = new $root.tendermint.abci.ResponseEndBlock(); + if (object.validatorUpdates) { + if (!Array.isArray(object.validatorUpdates)) + throw TypeError(".tendermint.abci.ResponseEndBlock.validatorUpdates: array expected"); + message.validatorUpdates = []; + for (var i = 0; i < object.validatorUpdates.length; ++i) { + if (typeof object.validatorUpdates[i] !== "object") + throw TypeError(".tendermint.abci.ResponseEndBlock.validatorUpdates: object expected"); + message.validatorUpdates[i] = $root.tendermint.abci.ValidatorUpdate.fromObject(object.validatorUpdates[i]); + } + } + if (object.consensusParamUpdates != null) { + if (typeof object.consensusParamUpdates !== "object") + throw TypeError(".tendermint.abci.ResponseEndBlock.consensusParamUpdates: object expected"); + message.consensusParamUpdates = $root.tendermint.abci.ConsensusParams.fromObject(object.consensusParamUpdates); + } + if (object.events) { + if (!Array.isArray(object.events)) + throw TypeError(".tendermint.abci.ResponseEndBlock.events: array expected"); + message.events = []; + for (var i = 0; i < object.events.length; ++i) { + if (typeof object.events[i] !== "object") + throw TypeError(".tendermint.abci.ResponseEndBlock.events: object expected"); + message.events[i] = $root.tendermint.abci.Event.fromObject(object.events[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ResponseEndBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseEndBlock + * @static + * @param {tendermint.abci.ResponseEndBlock} message ResponseEndBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseEndBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.validatorUpdates = []; + object.events = []; + } + if (options.defaults) + object.consensusParamUpdates = null; + if (message.validatorUpdates && message.validatorUpdates.length) { + object.validatorUpdates = []; + for (var j = 0; j < message.validatorUpdates.length; ++j) + object.validatorUpdates[j] = $root.tendermint.abci.ValidatorUpdate.toObject(message.validatorUpdates[j], options); + } + if (message.consensusParamUpdates != null && message.hasOwnProperty("consensusParamUpdates")) + object.consensusParamUpdates = $root.tendermint.abci.ConsensusParams.toObject(message.consensusParamUpdates, options); + if (message.events && message.events.length) { + object.events = []; + for (var j = 0; j < message.events.length; ++j) + object.events[j] = $root.tendermint.abci.Event.toObject(message.events[j], options); + } + return object; + }; + + /** + * Converts this ResponseEndBlock to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseEndBlock + * @instance + * @returns {Object.} JSON object + */ + ResponseEndBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseEndBlock; + })(abci.ResponseEndBlock || {}); + + abci.ResponseCommit = (function(ResponseCommit) { + + /** + * Properties of a ResponseCommit. + * @memberof tendermint.abci + * @interface IResponseCommit + * @property {Uint8Array|null} [data] ResponseCommit data + * @property {number|Long|null} [retainHeight] ResponseCommit retainHeight + */ + + /** + * Constructs a new ResponseCommit. + * @memberof tendermint.abci + * @classdesc Represents a ResponseCommit. + * @implements IResponseCommit + * @constructor + * @param {tendermint.abci.IResponseCommit=} [properties] Properties to set + */ + function ResponseCommit(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseCommit data. + * @member {Uint8Array} data + * @memberof tendermint.abci.ResponseCommit + * @instance + */ + ResponseCommit.prototype.data = $util.newBuffer([]); + + /** + * ResponseCommit retainHeight. + * @member {number|Long} retainHeight + * @memberof tendermint.abci.ResponseCommit + * @instance + */ + ResponseCommit.prototype.retainHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ResponseCommit instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseCommit + * @static + * @param {tendermint.abci.IResponseCommit=} [properties] Properties to set + * @returns {tendermint.abci.ResponseCommit} ResponseCommit instance + */ + ResponseCommit.create = function create(properties) { + return new ResponseCommit(properties); + }; + + /** + * Encodes the specified ResponseCommit message. Does not implicitly {@link tendermint.abci.ResponseCommit.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseCommit + * @static + * @param {tendermint.abci.IResponseCommit} message ResponseCommit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseCommit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); + if (message.retainHeight != null && Object.hasOwnProperty.call(message, "retainHeight")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.retainHeight); + return writer; + }; + + /** + * Encodes the specified ResponseCommit message, length delimited. Does not implicitly {@link tendermint.abci.ResponseCommit.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseCommit + * @static + * @param {tendermint.abci.IResponseCommit} message ResponseCommit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseCommit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseCommit message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseCommit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseCommit} ResponseCommit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseCommit.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseCommit(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.data = reader.bytes(); + break; + case 3: + message.retainHeight = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseCommit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseCommit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseCommit} ResponseCommit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseCommit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseCommit message. + * @function verify + * @memberof tendermint.abci.ResponseCommit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseCommit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + if (message.retainHeight != null && message.hasOwnProperty("retainHeight")) + if (!$util.isInteger(message.retainHeight) && !(message.retainHeight && $util.isInteger(message.retainHeight.low) && $util.isInteger(message.retainHeight.high))) + return "retainHeight: integer|Long expected"; + return null; + }; + + /** + * Creates a ResponseCommit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseCommit + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseCommit} ResponseCommit + */ + ResponseCommit.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseCommit) + return object; + var message = new $root.tendermint.abci.ResponseCommit(); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length) + message.data = object.data; + if (object.retainHeight != null) + if ($util.Long) + (message.retainHeight = $util.Long.fromValue(object.retainHeight)).unsigned = false; + else if (typeof object.retainHeight === "string") + message.retainHeight = parseInt(object.retainHeight, 10); + else if (typeof object.retainHeight === "number") + message.retainHeight = object.retainHeight; + else if (typeof object.retainHeight === "object") + message.retainHeight = new $util.LongBits(object.retainHeight.low >>> 0, object.retainHeight.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ResponseCommit message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseCommit + * @static + * @param {tendermint.abci.ResponseCommit} message ResponseCommit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseCommit.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.retainHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.retainHeight = options.longs === String ? "0" : 0; + } + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + if (message.retainHeight != null && message.hasOwnProperty("retainHeight")) + if (typeof message.retainHeight === "number") + object.retainHeight = options.longs === String ? String(message.retainHeight) : message.retainHeight; + else + object.retainHeight = options.longs === String ? $util.Long.prototype.toString.call(message.retainHeight) : options.longs === Number ? new $util.LongBits(message.retainHeight.low >>> 0, message.retainHeight.high >>> 0).toNumber() : message.retainHeight; + return object; + }; + + /** + * Converts this ResponseCommit to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseCommit + * @instance + * @returns {Object.} JSON object + */ + ResponseCommit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseCommit; + })(abci.ResponseCommit || {}); + + abci.ResponseListSnapshots = (function(ResponseListSnapshots) { + + /** + * Properties of a ResponseListSnapshots. + * @memberof tendermint.abci + * @interface IResponseListSnapshots + * @property {Array.|null} [snapshots] ResponseListSnapshots snapshots + */ + + /** + * Constructs a new ResponseListSnapshots. + * @memberof tendermint.abci + * @classdesc Represents a ResponseListSnapshots. + * @implements IResponseListSnapshots + * @constructor + * @param {tendermint.abci.IResponseListSnapshots=} [properties] Properties to set + */ + function ResponseListSnapshots(properties) { + this.snapshots = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseListSnapshots snapshots. + * @member {Array.} snapshots + * @memberof tendermint.abci.ResponseListSnapshots + * @instance + */ + ResponseListSnapshots.prototype.snapshots = $util.emptyArray; + + /** + * Creates a new ResponseListSnapshots instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseListSnapshots + * @static + * @param {tendermint.abci.IResponseListSnapshots=} [properties] Properties to set + * @returns {tendermint.abci.ResponseListSnapshots} ResponseListSnapshots instance + */ + ResponseListSnapshots.create = function create(properties) { + return new ResponseListSnapshots(properties); + }; + + /** + * Encodes the specified ResponseListSnapshots message. Does not implicitly {@link tendermint.abci.ResponseListSnapshots.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseListSnapshots + * @static + * @param {tendermint.abci.IResponseListSnapshots} message ResponseListSnapshots message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseListSnapshots.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.snapshots != null && message.snapshots.length) + for (var i = 0; i < message.snapshots.length; ++i) + $root.tendermint.abci.Snapshot.encode(message.snapshots[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResponseListSnapshots message, length delimited. Does not implicitly {@link tendermint.abci.ResponseListSnapshots.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseListSnapshots + * @static + * @param {tendermint.abci.IResponseListSnapshots} message ResponseListSnapshots message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseListSnapshots.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseListSnapshots message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseListSnapshots + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseListSnapshots} ResponseListSnapshots + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseListSnapshots.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseListSnapshots(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.snapshots && message.snapshots.length)) + message.snapshots = []; + message.snapshots.push($root.tendermint.abci.Snapshot.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseListSnapshots message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseListSnapshots + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseListSnapshots} ResponseListSnapshots + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseListSnapshots.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseListSnapshots message. + * @function verify + * @memberof tendermint.abci.ResponseListSnapshots + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseListSnapshots.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.snapshots != null && message.hasOwnProperty("snapshots")) { + if (!Array.isArray(message.snapshots)) + return "snapshots: array expected"; + for (var i = 0; i < message.snapshots.length; ++i) { + var error = $root.tendermint.abci.Snapshot.verify(message.snapshots[i]); + if (error) + return "snapshots." + error; + } + } + return null; + }; + + /** + * Creates a ResponseListSnapshots message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseListSnapshots + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseListSnapshots} ResponseListSnapshots + */ + ResponseListSnapshots.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseListSnapshots) + return object; + var message = new $root.tendermint.abci.ResponseListSnapshots(); + if (object.snapshots) { + if (!Array.isArray(object.snapshots)) + throw TypeError(".tendermint.abci.ResponseListSnapshots.snapshots: array expected"); + message.snapshots = []; + for (var i = 0; i < object.snapshots.length; ++i) { + if (typeof object.snapshots[i] !== "object") + throw TypeError(".tendermint.abci.ResponseListSnapshots.snapshots: object expected"); + message.snapshots[i] = $root.tendermint.abci.Snapshot.fromObject(object.snapshots[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ResponseListSnapshots message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseListSnapshots + * @static + * @param {tendermint.abci.ResponseListSnapshots} message ResponseListSnapshots + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseListSnapshots.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.snapshots = []; + if (message.snapshots && message.snapshots.length) { + object.snapshots = []; + for (var j = 0; j < message.snapshots.length; ++j) + object.snapshots[j] = $root.tendermint.abci.Snapshot.toObject(message.snapshots[j], options); + } + return object; + }; + + /** + * Converts this ResponseListSnapshots to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseListSnapshots + * @instance + * @returns {Object.} JSON object + */ + ResponseListSnapshots.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseListSnapshots; + })(abci.ResponseListSnapshots || {}); + + abci.ResponseOfferSnapshot = (function(ResponseOfferSnapshot) { + + /** + * Properties of a ResponseOfferSnapshot. + * @memberof tendermint.abci + * @interface IResponseOfferSnapshot + * @property {tendermint.abci.ResponseOfferSnapshot.Result|null} [result] ResponseOfferSnapshot result + */ + + /** + * Constructs a new ResponseOfferSnapshot. + * @memberof tendermint.abci + * @classdesc Represents a ResponseOfferSnapshot. + * @implements IResponseOfferSnapshot + * @constructor + * @param {tendermint.abci.IResponseOfferSnapshot=} [properties] Properties to set + */ + function ResponseOfferSnapshot(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseOfferSnapshot result. + * @member {tendermint.abci.ResponseOfferSnapshot.Result} result + * @memberof tendermint.abci.ResponseOfferSnapshot + * @instance + */ + ResponseOfferSnapshot.prototype.result = 0; + + /** + * Creates a new ResponseOfferSnapshot instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseOfferSnapshot + * @static + * @param {tendermint.abci.IResponseOfferSnapshot=} [properties] Properties to set + * @returns {tendermint.abci.ResponseOfferSnapshot} ResponseOfferSnapshot instance + */ + ResponseOfferSnapshot.create = function create(properties) { + return new ResponseOfferSnapshot(properties); + }; + + /** + * Encodes the specified ResponseOfferSnapshot message. Does not implicitly {@link tendermint.abci.ResponseOfferSnapshot.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseOfferSnapshot + * @static + * @param {tendermint.abci.IResponseOfferSnapshot} message ResponseOfferSnapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseOfferSnapshot.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.result != null && Object.hasOwnProperty.call(message, "result")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.result); + return writer; + }; + + /** + * Encodes the specified ResponseOfferSnapshot message, length delimited. Does not implicitly {@link tendermint.abci.ResponseOfferSnapshot.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseOfferSnapshot + * @static + * @param {tendermint.abci.IResponseOfferSnapshot} message ResponseOfferSnapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseOfferSnapshot.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseOfferSnapshot message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseOfferSnapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseOfferSnapshot} ResponseOfferSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseOfferSnapshot.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseOfferSnapshot(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.result = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseOfferSnapshot message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseOfferSnapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseOfferSnapshot} ResponseOfferSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseOfferSnapshot.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseOfferSnapshot message. + * @function verify + * @memberof tendermint.abci.ResponseOfferSnapshot + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseOfferSnapshot.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.result != null && message.hasOwnProperty("result")) + switch (message.result) { + default: + return "result: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a ResponseOfferSnapshot message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseOfferSnapshot + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseOfferSnapshot} ResponseOfferSnapshot + */ + ResponseOfferSnapshot.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseOfferSnapshot) + return object; + var message = new $root.tendermint.abci.ResponseOfferSnapshot(); + switch (object.result) { + case "UNKNOWN": + case 0: + message.result = 0; + break; + case "ACCEPT": + case 1: + message.result = 1; + break; + case "ABORT": + case 2: + message.result = 2; + break; + case "REJECT": + case 3: + message.result = 3; + break; + case "REJECT_FORMAT": + case 4: + message.result = 4; + break; + case "REJECT_SENDER": + case 5: + message.result = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a ResponseOfferSnapshot message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseOfferSnapshot + * @static + * @param {tendermint.abci.ResponseOfferSnapshot} message ResponseOfferSnapshot + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseOfferSnapshot.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.result = options.enums === String ? "UNKNOWN" : 0; + if (message.result != null && message.hasOwnProperty("result")) + object.result = options.enums === String ? $root.tendermint.abci.ResponseOfferSnapshot.Result[message.result] : message.result; + return object; + }; + + /** + * Converts this ResponseOfferSnapshot to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseOfferSnapshot + * @instance + * @returns {Object.} JSON object + */ + ResponseOfferSnapshot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Result enum. + * @name tendermint.abci.ResponseOfferSnapshot.Result + * @enum {string} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} ACCEPT=1 ACCEPT value + * @property {number} ABORT=2 ABORT value + * @property {number} REJECT=3 REJECT value + * @property {number} REJECT_FORMAT=4 REJECT_FORMAT value + * @property {number} REJECT_SENDER=5 REJECT_SENDER value + */ + ResponseOfferSnapshot.Result = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "ACCEPT"] = 1; + values[valuesById[2] = "ABORT"] = 2; + values[valuesById[3] = "REJECT"] = 3; + values[valuesById[4] = "REJECT_FORMAT"] = 4; + values[valuesById[5] = "REJECT_SENDER"] = 5; + return values; + })(); + + return ResponseOfferSnapshot; + })(abci.ResponseOfferSnapshot || {}); + + abci.ResponseLoadSnapshotChunk = (function(ResponseLoadSnapshotChunk) { + + /** + * Properties of a ResponseLoadSnapshotChunk. + * @memberof tendermint.abci + * @interface IResponseLoadSnapshotChunk + * @property {Uint8Array|null} [chunk] ResponseLoadSnapshotChunk chunk + */ + + /** + * Constructs a new ResponseLoadSnapshotChunk. + * @memberof tendermint.abci + * @classdesc Represents a ResponseLoadSnapshotChunk. + * @implements IResponseLoadSnapshotChunk + * @constructor + * @param {tendermint.abci.IResponseLoadSnapshotChunk=} [properties] Properties to set + */ + function ResponseLoadSnapshotChunk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseLoadSnapshotChunk chunk. + * @member {Uint8Array} chunk + * @memberof tendermint.abci.ResponseLoadSnapshotChunk + * @instance + */ + ResponseLoadSnapshotChunk.prototype.chunk = $util.newBuffer([]); + + /** + * Creates a new ResponseLoadSnapshotChunk instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseLoadSnapshotChunk + * @static + * @param {tendermint.abci.IResponseLoadSnapshotChunk=} [properties] Properties to set + * @returns {tendermint.abci.ResponseLoadSnapshotChunk} ResponseLoadSnapshotChunk instance + */ + ResponseLoadSnapshotChunk.create = function create(properties) { + return new ResponseLoadSnapshotChunk(properties); + }; + + /** + * Encodes the specified ResponseLoadSnapshotChunk message. Does not implicitly {@link tendermint.abci.ResponseLoadSnapshotChunk.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseLoadSnapshotChunk + * @static + * @param {tendermint.abci.IResponseLoadSnapshotChunk} message ResponseLoadSnapshotChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseLoadSnapshotChunk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.chunk != null && Object.hasOwnProperty.call(message, "chunk")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.chunk); + return writer; + }; + + /** + * Encodes the specified ResponseLoadSnapshotChunk message, length delimited. Does not implicitly {@link tendermint.abci.ResponseLoadSnapshotChunk.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseLoadSnapshotChunk + * @static + * @param {tendermint.abci.IResponseLoadSnapshotChunk} message ResponseLoadSnapshotChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseLoadSnapshotChunk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseLoadSnapshotChunk message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseLoadSnapshotChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseLoadSnapshotChunk} ResponseLoadSnapshotChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseLoadSnapshotChunk.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseLoadSnapshotChunk(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chunk = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseLoadSnapshotChunk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseLoadSnapshotChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseLoadSnapshotChunk} ResponseLoadSnapshotChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseLoadSnapshotChunk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseLoadSnapshotChunk message. + * @function verify + * @memberof tendermint.abci.ResponseLoadSnapshotChunk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseLoadSnapshotChunk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.chunk != null && message.hasOwnProperty("chunk")) + if (!(message.chunk && typeof message.chunk.length === "number" || $util.isString(message.chunk))) + return "chunk: buffer expected"; + return null; + }; + + /** + * Creates a ResponseLoadSnapshotChunk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseLoadSnapshotChunk + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseLoadSnapshotChunk} ResponseLoadSnapshotChunk + */ + ResponseLoadSnapshotChunk.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseLoadSnapshotChunk) + return object; + var message = new $root.tendermint.abci.ResponseLoadSnapshotChunk(); + if (object.chunk != null) + if (typeof object.chunk === "string") + $util.base64.decode(object.chunk, message.chunk = $util.newBuffer($util.base64.length(object.chunk)), 0); + else if (object.chunk.length) + message.chunk = object.chunk; + return message; + }; + + /** + * Creates a plain object from a ResponseLoadSnapshotChunk message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseLoadSnapshotChunk + * @static + * @param {tendermint.abci.ResponseLoadSnapshotChunk} message ResponseLoadSnapshotChunk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseLoadSnapshotChunk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.chunk = ""; + else { + object.chunk = []; + if (options.bytes !== Array) + object.chunk = $util.newBuffer(object.chunk); + } + if (message.chunk != null && message.hasOwnProperty("chunk")) + object.chunk = options.bytes === String ? $util.base64.encode(message.chunk, 0, message.chunk.length) : options.bytes === Array ? Array.prototype.slice.call(message.chunk) : message.chunk; + return object; + }; + + /** + * Converts this ResponseLoadSnapshotChunk to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseLoadSnapshotChunk + * @instance + * @returns {Object.} JSON object + */ + ResponseLoadSnapshotChunk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseLoadSnapshotChunk; + })(abci.ResponseLoadSnapshotChunk || {}); + + abci.ResponseApplySnapshotChunk = (function(ResponseApplySnapshotChunk) { + + /** + * Properties of a ResponseApplySnapshotChunk. + * @memberof tendermint.abci + * @interface IResponseApplySnapshotChunk + * @property {tendermint.abci.ResponseApplySnapshotChunk.Result|null} [result] ResponseApplySnapshotChunk result + * @property {Array.|null} [refetchChunks] ResponseApplySnapshotChunk refetchChunks + * @property {Array.|null} [rejectSenders] ResponseApplySnapshotChunk rejectSenders + */ + + /** + * Constructs a new ResponseApplySnapshotChunk. + * @memberof tendermint.abci + * @classdesc Represents a ResponseApplySnapshotChunk. + * @implements IResponseApplySnapshotChunk + * @constructor + * @param {tendermint.abci.IResponseApplySnapshotChunk=} [properties] Properties to set + */ + function ResponseApplySnapshotChunk(properties) { + this.refetchChunks = []; + this.rejectSenders = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseApplySnapshotChunk result. + * @member {tendermint.abci.ResponseApplySnapshotChunk.Result} result + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @instance + */ + ResponseApplySnapshotChunk.prototype.result = 0; + + /** + * ResponseApplySnapshotChunk refetchChunks. + * @member {Array.} refetchChunks + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @instance + */ + ResponseApplySnapshotChunk.prototype.refetchChunks = $util.emptyArray; + + /** + * ResponseApplySnapshotChunk rejectSenders. + * @member {Array.} rejectSenders + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @instance + */ + ResponseApplySnapshotChunk.prototype.rejectSenders = $util.emptyArray; + + /** + * Creates a new ResponseApplySnapshotChunk instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @static + * @param {tendermint.abci.IResponseApplySnapshotChunk=} [properties] Properties to set + * @returns {tendermint.abci.ResponseApplySnapshotChunk} ResponseApplySnapshotChunk instance + */ + ResponseApplySnapshotChunk.create = function create(properties) { + return new ResponseApplySnapshotChunk(properties); + }; + + /** + * Encodes the specified ResponseApplySnapshotChunk message. Does not implicitly {@link tendermint.abci.ResponseApplySnapshotChunk.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @static + * @param {tendermint.abci.IResponseApplySnapshotChunk} message ResponseApplySnapshotChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseApplySnapshotChunk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.result != null && Object.hasOwnProperty.call(message, "result")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.result); + if (message.refetchChunks != null && message.refetchChunks.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.refetchChunks.length; ++i) + writer.uint32(message.refetchChunks[i]); + writer.ldelim(); + } + if (message.rejectSenders != null && message.rejectSenders.length) + for (var i = 0; i < message.rejectSenders.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.rejectSenders[i]); + return writer; + }; + + /** + * Encodes the specified ResponseApplySnapshotChunk message, length delimited. Does not implicitly {@link tendermint.abci.ResponseApplySnapshotChunk.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @static + * @param {tendermint.abci.IResponseApplySnapshotChunk} message ResponseApplySnapshotChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseApplySnapshotChunk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseApplySnapshotChunk message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseApplySnapshotChunk} ResponseApplySnapshotChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseApplySnapshotChunk.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseApplySnapshotChunk(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.result = reader.int32(); + break; + case 2: + if (!(message.refetchChunks && message.refetchChunks.length)) + message.refetchChunks = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.refetchChunks.push(reader.uint32()); + } else + message.refetchChunks.push(reader.uint32()); + break; + case 3: + if (!(message.rejectSenders && message.rejectSenders.length)) + message.rejectSenders = []; + message.rejectSenders.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseApplySnapshotChunk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseApplySnapshotChunk} ResponseApplySnapshotChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseApplySnapshotChunk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseApplySnapshotChunk message. + * @function verify + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseApplySnapshotChunk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.result != null && message.hasOwnProperty("result")) + switch (message.result) { + default: + return "result: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.refetchChunks != null && message.hasOwnProperty("refetchChunks")) { + if (!Array.isArray(message.refetchChunks)) + return "refetchChunks: array expected"; + for (var i = 0; i < message.refetchChunks.length; ++i) + if (!$util.isInteger(message.refetchChunks[i])) + return "refetchChunks: integer[] expected"; + } + if (message.rejectSenders != null && message.hasOwnProperty("rejectSenders")) { + if (!Array.isArray(message.rejectSenders)) + return "rejectSenders: array expected"; + for (var i = 0; i < message.rejectSenders.length; ++i) + if (!$util.isString(message.rejectSenders[i])) + return "rejectSenders: string[] expected"; + } + return null; + }; + + /** + * Creates a ResponseApplySnapshotChunk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseApplySnapshotChunk} ResponseApplySnapshotChunk + */ + ResponseApplySnapshotChunk.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseApplySnapshotChunk) + return object; + var message = new $root.tendermint.abci.ResponseApplySnapshotChunk(); + switch (object.result) { + case "UNKNOWN": + case 0: + message.result = 0; + break; + case "ACCEPT": + case 1: + message.result = 1; + break; + case "ABORT": + case 2: + message.result = 2; + break; + case "RETRY": + case 3: + message.result = 3; + break; + case "RETRY_SNAPSHOT": + case 4: + message.result = 4; + break; + case "REJECT_SNAPSHOT": + case 5: + message.result = 5; + break; + } + if (object.refetchChunks) { + if (!Array.isArray(object.refetchChunks)) + throw TypeError(".tendermint.abci.ResponseApplySnapshotChunk.refetchChunks: array expected"); + message.refetchChunks = []; + for (var i = 0; i < object.refetchChunks.length; ++i) + message.refetchChunks[i] = object.refetchChunks[i] >>> 0; + } + if (object.rejectSenders) { + if (!Array.isArray(object.rejectSenders)) + throw TypeError(".tendermint.abci.ResponseApplySnapshotChunk.rejectSenders: array expected"); + message.rejectSenders = []; + for (var i = 0; i < object.rejectSenders.length; ++i) + message.rejectSenders[i] = String(object.rejectSenders[i]); + } + return message; + }; + + /** + * Creates a plain object from a ResponseApplySnapshotChunk message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @static + * @param {tendermint.abci.ResponseApplySnapshotChunk} message ResponseApplySnapshotChunk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseApplySnapshotChunk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.refetchChunks = []; + object.rejectSenders = []; + } + if (options.defaults) + object.result = options.enums === String ? "UNKNOWN" : 0; + if (message.result != null && message.hasOwnProperty("result")) + object.result = options.enums === String ? $root.tendermint.abci.ResponseApplySnapshotChunk.Result[message.result] : message.result; + if (message.refetchChunks && message.refetchChunks.length) { + object.refetchChunks = []; + for (var j = 0; j < message.refetchChunks.length; ++j) + object.refetchChunks[j] = message.refetchChunks[j]; + } + if (message.rejectSenders && message.rejectSenders.length) { + object.rejectSenders = []; + for (var j = 0; j < message.rejectSenders.length; ++j) + object.rejectSenders[j] = message.rejectSenders[j]; + } + return object; + }; + + /** + * Converts this ResponseApplySnapshotChunk to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @instance + * @returns {Object.} JSON object + */ + ResponseApplySnapshotChunk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Result enum. + * @name tendermint.abci.ResponseApplySnapshotChunk.Result + * @enum {string} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} ACCEPT=1 ACCEPT value + * @property {number} ABORT=2 ABORT value + * @property {number} RETRY=3 RETRY value + * @property {number} RETRY_SNAPSHOT=4 RETRY_SNAPSHOT value + * @property {number} REJECT_SNAPSHOT=5 REJECT_SNAPSHOT value + */ + ResponseApplySnapshotChunk.Result = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "ACCEPT"] = 1; + values[valuesById[2] = "ABORT"] = 2; + values[valuesById[3] = "RETRY"] = 3; + values[valuesById[4] = "RETRY_SNAPSHOT"] = 4; + values[valuesById[5] = "REJECT_SNAPSHOT"] = 5; + return values; + })(); + + return ResponseApplySnapshotChunk; + })(abci.ResponseApplySnapshotChunk || {}); + + abci.ConsensusParams = (function(ConsensusParams) { + + /** + * Properties of a ConsensusParams. + * @memberof tendermint.abci + * @interface IConsensusParams + * @property {tendermint.abci.IBlockParams|null} [block] ConsensusParams block + * @property {tendermint.types.IEvidenceParams|null} [evidence] ConsensusParams evidence + * @property {tendermint.types.IValidatorParams|null} [validator] ConsensusParams validator + * @property {tendermint.types.IVersionParams|null} [version] ConsensusParams version + */ + + /** + * Constructs a new ConsensusParams. + * @memberof tendermint.abci + * @classdesc Represents a ConsensusParams. + * @implements IConsensusParams + * @constructor + * @param {tendermint.abci.IConsensusParams=} [properties] Properties to set + */ + function ConsensusParams(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConsensusParams block. + * @member {tendermint.abci.IBlockParams|null|undefined} block + * @memberof tendermint.abci.ConsensusParams + * @instance + */ + ConsensusParams.prototype.block = null; + + /** + * ConsensusParams evidence. + * @member {tendermint.types.IEvidenceParams|null|undefined} evidence + * @memberof tendermint.abci.ConsensusParams + * @instance + */ + ConsensusParams.prototype.evidence = null; + + /** + * ConsensusParams validator. + * @member {tendermint.types.IValidatorParams|null|undefined} validator + * @memberof tendermint.abci.ConsensusParams + * @instance + */ + ConsensusParams.prototype.validator = null; + + /** + * ConsensusParams version. + * @member {tendermint.types.IVersionParams|null|undefined} version + * @memberof tendermint.abci.ConsensusParams + * @instance + */ + ConsensusParams.prototype.version = null; + + /** + * Creates a new ConsensusParams instance using the specified properties. + * @function create + * @memberof tendermint.abci.ConsensusParams + * @static + * @param {tendermint.abci.IConsensusParams=} [properties] Properties to set + * @returns {tendermint.abci.ConsensusParams} ConsensusParams instance + */ + ConsensusParams.create = function create(properties) { + return new ConsensusParams(properties); + }; + + /** + * Encodes the specified ConsensusParams message. Does not implicitly {@link tendermint.abci.ConsensusParams.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ConsensusParams + * @static + * @param {tendermint.abci.IConsensusParams} message ConsensusParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.block != null && Object.hasOwnProperty.call(message, "block")) + $root.tendermint.abci.BlockParams.encode(message.block, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.evidence != null && Object.hasOwnProperty.call(message, "evidence")) + $root.tendermint.types.EvidenceParams.encode(message.evidence, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.validator != null && Object.hasOwnProperty.call(message, "validator")) + $root.tendermint.types.ValidatorParams.encode(message.validator, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + $root.tendermint.types.VersionParams.encode(message.version, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConsensusParams message, length delimited. Does not implicitly {@link tendermint.abci.ConsensusParams.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ConsensusParams + * @static + * @param {tendermint.abci.IConsensusParams} message ConsensusParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConsensusParams message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ConsensusParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ConsensusParams} ConsensusParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ConsensusParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.block = $root.tendermint.abci.BlockParams.decode(reader, reader.uint32()); + break; + case 2: + message.evidence = $root.tendermint.types.EvidenceParams.decode(reader, reader.uint32()); + break; + case 3: + message.validator = $root.tendermint.types.ValidatorParams.decode(reader, reader.uint32()); + break; + case 4: + message.version = $root.tendermint.types.VersionParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConsensusParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ConsensusParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ConsensusParams} ConsensusParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConsensusParams message. + * @function verify + * @memberof tendermint.abci.ConsensusParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConsensusParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.block != null && message.hasOwnProperty("block")) { + var error = $root.tendermint.abci.BlockParams.verify(message.block); + if (error) + return "block." + error; + } + if (message.evidence != null && message.hasOwnProperty("evidence")) { + var error = $root.tendermint.types.EvidenceParams.verify(message.evidence); + if (error) + return "evidence." + error; + } + if (message.validator != null && message.hasOwnProperty("validator")) { + var error = $root.tendermint.types.ValidatorParams.verify(message.validator); + if (error) + return "validator." + error; + } + if (message.version != null && message.hasOwnProperty("version")) { + var error = $root.tendermint.types.VersionParams.verify(message.version); + if (error) + return "version." + error; + } + return null; + }; + + /** + * Creates a ConsensusParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ConsensusParams + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ConsensusParams} ConsensusParams + */ + ConsensusParams.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ConsensusParams) + return object; + var message = new $root.tendermint.abci.ConsensusParams(); + if (object.block != null) { + if (typeof object.block !== "object") + throw TypeError(".tendermint.abci.ConsensusParams.block: object expected"); + message.block = $root.tendermint.abci.BlockParams.fromObject(object.block); + } + if (object.evidence != null) { + if (typeof object.evidence !== "object") + throw TypeError(".tendermint.abci.ConsensusParams.evidence: object expected"); + message.evidence = $root.tendermint.types.EvidenceParams.fromObject(object.evidence); + } + if (object.validator != null) { + if (typeof object.validator !== "object") + throw TypeError(".tendermint.abci.ConsensusParams.validator: object expected"); + message.validator = $root.tendermint.types.ValidatorParams.fromObject(object.validator); + } + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".tendermint.abci.ConsensusParams.version: object expected"); + message.version = $root.tendermint.types.VersionParams.fromObject(object.version); + } + return message; + }; + + /** + * Creates a plain object from a ConsensusParams message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ConsensusParams + * @static + * @param {tendermint.abci.ConsensusParams} message ConsensusParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConsensusParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.block = null; + object.evidence = null; + object.validator = null; + object.version = null; + } + if (message.block != null && message.hasOwnProperty("block")) + object.block = $root.tendermint.abci.BlockParams.toObject(message.block, options); + if (message.evidence != null && message.hasOwnProperty("evidence")) + object.evidence = $root.tendermint.types.EvidenceParams.toObject(message.evidence, options); + if (message.validator != null && message.hasOwnProperty("validator")) + object.validator = $root.tendermint.types.ValidatorParams.toObject(message.validator, options); + if (message.version != null && message.hasOwnProperty("version")) + object.version = $root.tendermint.types.VersionParams.toObject(message.version, options); + return object; + }; + + /** + * Converts this ConsensusParams to JSON. + * @function toJSON + * @memberof tendermint.abci.ConsensusParams + * @instance + * @returns {Object.} JSON object + */ + ConsensusParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ConsensusParams; + })(abci.ConsensusParams || {}); + + abci.BlockParams = (function(BlockParams) { + + /** + * Properties of a BlockParams. + * @memberof tendermint.abci + * @interface IBlockParams + * @property {number|Long|null} [maxBytes] BlockParams maxBytes + * @property {number|Long|null} [maxGas] BlockParams maxGas + */ + + /** + * Constructs a new BlockParams. + * @memberof tendermint.abci + * @classdesc Represents a BlockParams. + * @implements IBlockParams + * @constructor + * @param {tendermint.abci.IBlockParams=} [properties] Properties to set + */ + function BlockParams(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BlockParams maxBytes. + * @member {number|Long} maxBytes + * @memberof tendermint.abci.BlockParams + * @instance + */ + BlockParams.prototype.maxBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BlockParams maxGas. + * @member {number|Long} maxGas + * @memberof tendermint.abci.BlockParams + * @instance + */ + BlockParams.prototype.maxGas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new BlockParams instance using the specified properties. + * @function create + * @memberof tendermint.abci.BlockParams + * @static + * @param {tendermint.abci.IBlockParams=} [properties] Properties to set + * @returns {tendermint.abci.BlockParams} BlockParams instance + */ + BlockParams.create = function create(properties) { + return new BlockParams(properties); + }; + + /** + * Encodes the specified BlockParams message. Does not implicitly {@link tendermint.abci.BlockParams.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.BlockParams + * @static + * @param {tendermint.abci.IBlockParams} message BlockParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlockParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxBytes != null && Object.hasOwnProperty.call(message, "maxBytes")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.maxBytes); + if (message.maxGas != null && Object.hasOwnProperty.call(message, "maxGas")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.maxGas); + return writer; + }; + + /** + * Encodes the specified BlockParams message, length delimited. Does not implicitly {@link tendermint.abci.BlockParams.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.BlockParams + * @static + * @param {tendermint.abci.IBlockParams} message BlockParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlockParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BlockParams message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.BlockParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.BlockParams} BlockParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlockParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.BlockParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxBytes = reader.int64(); + break; + case 2: + message.maxGas = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BlockParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.BlockParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.BlockParams} BlockParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlockParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BlockParams message. + * @function verify + * @memberof tendermint.abci.BlockParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BlockParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + if (!$util.isInteger(message.maxBytes) && !(message.maxBytes && $util.isInteger(message.maxBytes.low) && $util.isInteger(message.maxBytes.high))) + return "maxBytes: integer|Long expected"; + if (message.maxGas != null && message.hasOwnProperty("maxGas")) + if (!$util.isInteger(message.maxGas) && !(message.maxGas && $util.isInteger(message.maxGas.low) && $util.isInteger(message.maxGas.high))) + return "maxGas: integer|Long expected"; + return null; + }; + + /** + * Creates a BlockParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.BlockParams + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.BlockParams} BlockParams + */ + BlockParams.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.BlockParams) + return object; + var message = new $root.tendermint.abci.BlockParams(); + if (object.maxBytes != null) + if ($util.Long) + (message.maxBytes = $util.Long.fromValue(object.maxBytes)).unsigned = false; + else if (typeof object.maxBytes === "string") + message.maxBytes = parseInt(object.maxBytes, 10); + else if (typeof object.maxBytes === "number") + message.maxBytes = object.maxBytes; + else if (typeof object.maxBytes === "object") + message.maxBytes = new $util.LongBits(object.maxBytes.low >>> 0, object.maxBytes.high >>> 0).toNumber(); + if (object.maxGas != null) + if ($util.Long) + (message.maxGas = $util.Long.fromValue(object.maxGas)).unsigned = false; + else if (typeof object.maxGas === "string") + message.maxGas = parseInt(object.maxGas, 10); + else if (typeof object.maxGas === "number") + message.maxGas = object.maxGas; + else if (typeof object.maxGas === "object") + message.maxGas = new $util.LongBits(object.maxGas.low >>> 0, object.maxGas.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a BlockParams message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.BlockParams + * @static + * @param {tendermint.abci.BlockParams} message BlockParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BlockParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxBytes = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxGas = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxGas = options.longs === String ? "0" : 0; + } + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + if (typeof message.maxBytes === "number") + object.maxBytes = options.longs === String ? String(message.maxBytes) : message.maxBytes; + else + object.maxBytes = options.longs === String ? $util.Long.prototype.toString.call(message.maxBytes) : options.longs === Number ? new $util.LongBits(message.maxBytes.low >>> 0, message.maxBytes.high >>> 0).toNumber() : message.maxBytes; + if (message.maxGas != null && message.hasOwnProperty("maxGas")) + if (typeof message.maxGas === "number") + object.maxGas = options.longs === String ? String(message.maxGas) : message.maxGas; + else + object.maxGas = options.longs === String ? $util.Long.prototype.toString.call(message.maxGas) : options.longs === Number ? new $util.LongBits(message.maxGas.low >>> 0, message.maxGas.high >>> 0).toNumber() : message.maxGas; + return object; + }; + + /** + * Converts this BlockParams to JSON. + * @function toJSON + * @memberof tendermint.abci.BlockParams + * @instance + * @returns {Object.} JSON object + */ + BlockParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BlockParams; + })(abci.BlockParams || {}); + + abci.LastCommitInfo = (function(LastCommitInfo) { + + /** + * Properties of a LastCommitInfo. + * @memberof tendermint.abci + * @interface ILastCommitInfo + * @property {number|null} [round] LastCommitInfo round + * @property {Array.|null} [votes] LastCommitInfo votes + */ + + /** + * Constructs a new LastCommitInfo. + * @memberof tendermint.abci + * @classdesc Represents a LastCommitInfo. + * @implements ILastCommitInfo + * @constructor + * @param {tendermint.abci.ILastCommitInfo=} [properties] Properties to set + */ + function LastCommitInfo(properties) { + this.votes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LastCommitInfo round. + * @member {number} round + * @memberof tendermint.abci.LastCommitInfo + * @instance + */ + LastCommitInfo.prototype.round = 0; + + /** + * LastCommitInfo votes. + * @member {Array.} votes + * @memberof tendermint.abci.LastCommitInfo + * @instance + */ + LastCommitInfo.prototype.votes = $util.emptyArray; + + /** + * Creates a new LastCommitInfo instance using the specified properties. + * @function create + * @memberof tendermint.abci.LastCommitInfo + * @static + * @param {tendermint.abci.ILastCommitInfo=} [properties] Properties to set + * @returns {tendermint.abci.LastCommitInfo} LastCommitInfo instance + */ + LastCommitInfo.create = function create(properties) { + return new LastCommitInfo(properties); + }; + + /** + * Encodes the specified LastCommitInfo message. Does not implicitly {@link tendermint.abci.LastCommitInfo.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.LastCommitInfo + * @static + * @param {tendermint.abci.ILastCommitInfo} message LastCommitInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LastCommitInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.round != null && Object.hasOwnProperty.call(message, "round")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.round); + if (message.votes != null && message.votes.length) + for (var i = 0; i < message.votes.length; ++i) + $root.tendermint.abci.VoteInfo.encode(message.votes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LastCommitInfo message, length delimited. Does not implicitly {@link tendermint.abci.LastCommitInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.LastCommitInfo + * @static + * @param {tendermint.abci.ILastCommitInfo} message LastCommitInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LastCommitInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LastCommitInfo message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.LastCommitInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.LastCommitInfo} LastCommitInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LastCommitInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.LastCommitInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.round = reader.int32(); + break; + case 2: + if (!(message.votes && message.votes.length)) + message.votes = []; + message.votes.push($root.tendermint.abci.VoteInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LastCommitInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.LastCommitInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.LastCommitInfo} LastCommitInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LastCommitInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LastCommitInfo message. + * @function verify + * @memberof tendermint.abci.LastCommitInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LastCommitInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.round != null && message.hasOwnProperty("round")) + if (!$util.isInteger(message.round)) + return "round: integer expected"; + if (message.votes != null && message.hasOwnProperty("votes")) { + if (!Array.isArray(message.votes)) + return "votes: array expected"; + for (var i = 0; i < message.votes.length; ++i) { + var error = $root.tendermint.abci.VoteInfo.verify(message.votes[i]); + if (error) + return "votes." + error; + } + } + return null; + }; + + /** + * Creates a LastCommitInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.LastCommitInfo + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.LastCommitInfo} LastCommitInfo + */ + LastCommitInfo.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.LastCommitInfo) + return object; + var message = new $root.tendermint.abci.LastCommitInfo(); + if (object.round != null) + message.round = object.round | 0; + if (object.votes) { + if (!Array.isArray(object.votes)) + throw TypeError(".tendermint.abci.LastCommitInfo.votes: array expected"); + message.votes = []; + for (var i = 0; i < object.votes.length; ++i) { + if (typeof object.votes[i] !== "object") + throw TypeError(".tendermint.abci.LastCommitInfo.votes: object expected"); + message.votes[i] = $root.tendermint.abci.VoteInfo.fromObject(object.votes[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a LastCommitInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.LastCommitInfo + * @static + * @param {tendermint.abci.LastCommitInfo} message LastCommitInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LastCommitInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.votes = []; + if (options.defaults) + object.round = 0; + if (message.round != null && message.hasOwnProperty("round")) + object.round = message.round; + if (message.votes && message.votes.length) { + object.votes = []; + for (var j = 0; j < message.votes.length; ++j) + object.votes[j] = $root.tendermint.abci.VoteInfo.toObject(message.votes[j], options); + } + return object; + }; + + /** + * Converts this LastCommitInfo to JSON. + * @function toJSON + * @memberof tendermint.abci.LastCommitInfo + * @instance + * @returns {Object.} JSON object + */ + LastCommitInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LastCommitInfo; + })(abci.LastCommitInfo || {}); + + abci.Event = (function(Event) { + + /** + * Properties of an Event. + * @memberof tendermint.abci + * @interface IEvent + * @property {string|null} [type] Event type + * @property {Array.|null} [attributes] Event attributes + */ + + /** + * Constructs a new Event. + * @memberof tendermint.abci + * @classdesc Represents an Event. + * @implements IEvent + * @constructor + * @param {tendermint.abci.IEvent=} [properties] Properties to set + */ + function Event(properties) { + this.attributes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Event type. + * @member {string} type + * @memberof tendermint.abci.Event + * @instance + */ + Event.prototype.type = ""; + + /** + * Event attributes. + * @member {Array.} attributes + * @memberof tendermint.abci.Event + * @instance + */ + Event.prototype.attributes = $util.emptyArray; + + /** + * Creates a new Event instance using the specified properties. + * @function create + * @memberof tendermint.abci.Event + * @static + * @param {tendermint.abci.IEvent=} [properties] Properties to set + * @returns {tendermint.abci.Event} Event instance + */ + Event.create = function create(properties) { + return new Event(properties); + }; + + /** + * Encodes the specified Event message. Does not implicitly {@link tendermint.abci.Event.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.Event + * @static + * @param {tendermint.abci.IEvent} message Event message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Event.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.attributes != null && message.attributes.length) + for (var i = 0; i < message.attributes.length; ++i) + $root.tendermint.abci.EventAttribute.encode(message.attributes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Event message, length delimited. Does not implicitly {@link tendermint.abci.Event.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.Event + * @static + * @param {tendermint.abci.IEvent} message Event message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Event.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Event message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.Event + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.Event} Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Event.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.Event(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + if (!(message.attributes && message.attributes.length)) + message.attributes = []; + message.attributes.push($root.tendermint.abci.EventAttribute.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Event message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.Event + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.Event} Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Event.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Event message. + * @function verify + * @memberof tendermint.abci.Event + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Event.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!Array.isArray(message.attributes)) + return "attributes: array expected"; + for (var i = 0; i < message.attributes.length; ++i) { + var error = $root.tendermint.abci.EventAttribute.verify(message.attributes[i]); + if (error) + return "attributes." + error; + } + } + return null; + }; + + /** + * Creates an Event message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.Event + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.Event} Event + */ + Event.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.Event) + return object; + var message = new $root.tendermint.abci.Event(); + if (object.type != null) + message.type = String(object.type); + if (object.attributes) { + if (!Array.isArray(object.attributes)) + throw TypeError(".tendermint.abci.Event.attributes: array expected"); + message.attributes = []; + for (var i = 0; i < object.attributes.length; ++i) { + if (typeof object.attributes[i] !== "object") + throw TypeError(".tendermint.abci.Event.attributes: object expected"); + message.attributes[i] = $root.tendermint.abci.EventAttribute.fromObject(object.attributes[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Event message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.Event + * @static + * @param {tendermint.abci.Event} message Event + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Event.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.attributes = []; + if (options.defaults) + object.type = ""; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.attributes && message.attributes.length) { + object.attributes = []; + for (var j = 0; j < message.attributes.length; ++j) + object.attributes[j] = $root.tendermint.abci.EventAttribute.toObject(message.attributes[j], options); + } + return object; + }; + + /** + * Converts this Event to JSON. + * @function toJSON + * @memberof tendermint.abci.Event + * @instance + * @returns {Object.} JSON object + */ + Event.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Event; + })(abci.Event || {}); + + abci.EventAttribute = (function(EventAttribute) { + + /** + * Properties of an EventAttribute. + * @memberof tendermint.abci + * @interface IEventAttribute + * @property {Uint8Array|null} [key] EventAttribute key + * @property {Uint8Array|null} [value] EventAttribute value + * @property {boolean|null} [index] EventAttribute index + */ + + /** + * Constructs a new EventAttribute. + * @memberof tendermint.abci + * @classdesc Represents an EventAttribute. + * @implements IEventAttribute + * @constructor + * @param {tendermint.abci.IEventAttribute=} [properties] Properties to set + */ + function EventAttribute(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EventAttribute key. + * @member {Uint8Array} key + * @memberof tendermint.abci.EventAttribute + * @instance + */ + EventAttribute.prototype.key = $util.newBuffer([]); + + /** + * EventAttribute value. + * @member {Uint8Array} value + * @memberof tendermint.abci.EventAttribute + * @instance + */ + EventAttribute.prototype.value = $util.newBuffer([]); + + /** + * EventAttribute index. + * @member {boolean} index + * @memberof tendermint.abci.EventAttribute + * @instance + */ + EventAttribute.prototype.index = false; + + /** + * Creates a new EventAttribute instance using the specified properties. + * @function create + * @memberof tendermint.abci.EventAttribute + * @static + * @param {tendermint.abci.IEventAttribute=} [properties] Properties to set + * @returns {tendermint.abci.EventAttribute} EventAttribute instance + */ + EventAttribute.create = function create(properties) { + return new EventAttribute(properties); + }; + + /** + * Encodes the specified EventAttribute message. Does not implicitly {@link tendermint.abci.EventAttribute.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.EventAttribute + * @static + * @param {tendermint.abci.IEventAttribute} message EventAttribute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventAttribute.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.index); + return writer; + }; + + /** + * Encodes the specified EventAttribute message, length delimited. Does not implicitly {@link tendermint.abci.EventAttribute.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.EventAttribute + * @static + * @param {tendermint.abci.IEventAttribute} message EventAttribute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventAttribute.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EventAttribute message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.EventAttribute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.EventAttribute} EventAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventAttribute.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.EventAttribute(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + case 3: + message.index = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EventAttribute message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.EventAttribute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.EventAttribute} EventAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventAttribute.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EventAttribute message. + * @function verify + * @memberof tendermint.abci.EventAttribute + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EventAttribute.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (typeof message.index !== "boolean") + return "index: boolean expected"; + return null; + }; + + /** + * Creates an EventAttribute message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.EventAttribute + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.EventAttribute} EventAttribute + */ + EventAttribute.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.EventAttribute) + return object; + var message = new $root.tendermint.abci.EventAttribute(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length) + message.key = object.key; + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length) + message.value = object.value; + if (object.index != null) + message.index = Boolean(object.index); + return message; + }; + + /** + * Creates a plain object from an EventAttribute message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.EventAttribute + * @static + * @param {tendermint.abci.EventAttribute} message EventAttribute + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EventAttribute.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + object.index = false; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + return object; + }; + + /** + * Converts this EventAttribute to JSON. + * @function toJSON + * @memberof tendermint.abci.EventAttribute + * @instance + * @returns {Object.} JSON object + */ + EventAttribute.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EventAttribute; + })(abci.EventAttribute || {}); + + abci.TxResult = (function(TxResult) { + + /** + * Properties of a TxResult. + * @memberof tendermint.abci + * @interface ITxResult + * @property {number|Long|null} [height] TxResult height + * @property {number|null} [index] TxResult index + * @property {Uint8Array|null} [tx] TxResult tx + * @property {tendermint.abci.IResponseDeliverTx|null} [result] TxResult result + */ + + /** + * Constructs a new TxResult. + * @memberof tendermint.abci + * @classdesc Represents a TxResult. + * @implements ITxResult + * @constructor + * @param {tendermint.abci.ITxResult=} [properties] Properties to set + */ + function TxResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TxResult height. + * @member {number|Long} height + * @memberof tendermint.abci.TxResult + * @instance + */ + TxResult.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TxResult index. + * @member {number} index + * @memberof tendermint.abci.TxResult + * @instance + */ + TxResult.prototype.index = 0; + + /** + * TxResult tx. + * @member {Uint8Array} tx + * @memberof tendermint.abci.TxResult + * @instance + */ + TxResult.prototype.tx = $util.newBuffer([]); + + /** + * TxResult result. + * @member {tendermint.abci.IResponseDeliverTx|null|undefined} result + * @memberof tendermint.abci.TxResult + * @instance + */ + TxResult.prototype.result = null; + + /** + * Creates a new TxResult instance using the specified properties. + * @function create + * @memberof tendermint.abci.TxResult + * @static + * @param {tendermint.abci.ITxResult=} [properties] Properties to set + * @returns {tendermint.abci.TxResult} TxResult instance + */ + TxResult.create = function create(properties) { + return new TxResult(properties); + }; + + /** + * Encodes the specified TxResult message. Does not implicitly {@link tendermint.abci.TxResult.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.TxResult + * @static + * @param {tendermint.abci.ITxResult} message TxResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TxResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.height); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.index); + if (message.tx != null && Object.hasOwnProperty.call(message, "tx")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.tx); + if (message.result != null && Object.hasOwnProperty.call(message, "result")) + $root.tendermint.abci.ResponseDeliverTx.encode(message.result, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TxResult message, length delimited. Does not implicitly {@link tendermint.abci.TxResult.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.TxResult + * @static + * @param {tendermint.abci.ITxResult} message TxResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TxResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TxResult message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.TxResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.TxResult} TxResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TxResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.TxResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + case 2: + message.index = reader.uint32(); + break; + case 3: + message.tx = reader.bytes(); + break; + case 4: + message.result = $root.tendermint.abci.ResponseDeliverTx.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TxResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.TxResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.TxResult} TxResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TxResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TxResult message. + * @function verify + * @memberof tendermint.abci.TxResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TxResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index)) + return "index: integer expected"; + if (message.tx != null && message.hasOwnProperty("tx")) + if (!(message.tx && typeof message.tx.length === "number" || $util.isString(message.tx))) + return "tx: buffer expected"; + if (message.result != null && message.hasOwnProperty("result")) { + var error = $root.tendermint.abci.ResponseDeliverTx.verify(message.result); + if (error) + return "result." + error; + } + return null; + }; + + /** + * Creates a TxResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.TxResult + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.TxResult} TxResult + */ + TxResult.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.TxResult) + return object; + var message = new $root.tendermint.abci.TxResult(); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + if (object.index != null) + message.index = object.index >>> 0; + if (object.tx != null) + if (typeof object.tx === "string") + $util.base64.decode(object.tx, message.tx = $util.newBuffer($util.base64.length(object.tx)), 0); + else if (object.tx.length) + message.tx = object.tx; + if (object.result != null) { + if (typeof object.result !== "object") + throw TypeError(".tendermint.abci.TxResult.result: object expected"); + message.result = $root.tendermint.abci.ResponseDeliverTx.fromObject(object.result); + } + return message; + }; + + /** + * Creates a plain object from a TxResult message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.TxResult + * @static + * @param {tendermint.abci.TxResult} message TxResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TxResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.index = 0; + if (options.bytes === String) + object.tx = ""; + else { + object.tx = []; + if (options.bytes !== Array) + object.tx = $util.newBuffer(object.tx); + } + object.result = null; + } + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + if (message.tx != null && message.hasOwnProperty("tx")) + object.tx = options.bytes === String ? $util.base64.encode(message.tx, 0, message.tx.length) : options.bytes === Array ? Array.prototype.slice.call(message.tx) : message.tx; + if (message.result != null && message.hasOwnProperty("result")) + object.result = $root.tendermint.abci.ResponseDeliverTx.toObject(message.result, options); + return object; + }; + + /** + * Converts this TxResult to JSON. + * @function toJSON + * @memberof tendermint.abci.TxResult + * @instance + * @returns {Object.} JSON object + */ + TxResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TxResult; + })(abci.TxResult || {}); + + abci.Validator = (function(Validator) { + + /** + * Properties of a Validator. + * @memberof tendermint.abci + * @interface IValidator + * @property {Uint8Array|null} [address] Validator address + * @property {number|Long|null} [power] Validator power + */ + + /** + * Constructs a new Validator. + * @memberof tendermint.abci + * @classdesc Represents a Validator. + * @implements IValidator + * @constructor + * @param {tendermint.abci.IValidator=} [properties] Properties to set + */ + function Validator(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Validator address. + * @member {Uint8Array} address + * @memberof tendermint.abci.Validator + * @instance + */ + Validator.prototype.address = $util.newBuffer([]); + + /** + * Validator power. + * @member {number|Long} power + * @memberof tendermint.abci.Validator + * @instance + */ + Validator.prototype.power = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Validator instance using the specified properties. + * @function create + * @memberof tendermint.abci.Validator + * @static + * @param {tendermint.abci.IValidator=} [properties] Properties to set + * @returns {tendermint.abci.Validator} Validator instance + */ + Validator.create = function create(properties) { + return new Validator(properties); + }; + + /** + * Encodes the specified Validator message. Does not implicitly {@link tendermint.abci.Validator.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.Validator + * @static + * @param {tendermint.abci.IValidator} message Validator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Validator.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.address); + if (message.power != null && Object.hasOwnProperty.call(message, "power")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.power); + return writer; + }; + + /** + * Encodes the specified Validator message, length delimited. Does not implicitly {@link tendermint.abci.Validator.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.Validator + * @static + * @param {tendermint.abci.IValidator} message Validator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Validator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Validator message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.Validator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.Validator} Validator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Validator.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.Validator(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.bytes(); + break; + case 3: + message.power = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Validator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.Validator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.Validator} Validator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Validator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Validator message. + * @function verify + * @memberof tendermint.abci.Validator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Validator.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!(message.address && typeof message.address.length === "number" || $util.isString(message.address))) + return "address: buffer expected"; + if (message.power != null && message.hasOwnProperty("power")) + if (!$util.isInteger(message.power) && !(message.power && $util.isInteger(message.power.low) && $util.isInteger(message.power.high))) + return "power: integer|Long expected"; + return null; + }; + + /** + * Creates a Validator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.Validator + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.Validator} Validator + */ + Validator.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.Validator) + return object; + var message = new $root.tendermint.abci.Validator(); + if (object.address != null) + if (typeof object.address === "string") + $util.base64.decode(object.address, message.address = $util.newBuffer($util.base64.length(object.address)), 0); + else if (object.address.length) + message.address = object.address; + if (object.power != null) + if ($util.Long) + (message.power = $util.Long.fromValue(object.power)).unsigned = false; + else if (typeof object.power === "string") + message.power = parseInt(object.power, 10); + else if (typeof object.power === "number") + message.power = object.power; + else if (typeof object.power === "object") + message.power = new $util.LongBits(object.power.low >>> 0, object.power.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a Validator message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.Validator + * @static + * @param {tendermint.abci.Validator} message Validator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Validator.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.address = ""; + else { + object.address = []; + if (options.bytes !== Array) + object.address = $util.newBuffer(object.address); + } + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.power = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.power = options.longs === String ? "0" : 0; + } + if (message.address != null && message.hasOwnProperty("address")) + object.address = options.bytes === String ? $util.base64.encode(message.address, 0, message.address.length) : options.bytes === Array ? Array.prototype.slice.call(message.address) : message.address; + if (message.power != null && message.hasOwnProperty("power")) + if (typeof message.power === "number") + object.power = options.longs === String ? String(message.power) : message.power; + else + object.power = options.longs === String ? $util.Long.prototype.toString.call(message.power) : options.longs === Number ? new $util.LongBits(message.power.low >>> 0, message.power.high >>> 0).toNumber() : message.power; + return object; + }; + + /** + * Converts this Validator to JSON. + * @function toJSON + * @memberof tendermint.abci.Validator + * @instance + * @returns {Object.} JSON object + */ + Validator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Validator; + })(abci.Validator || {}); + + abci.ValidatorUpdate = (function(ValidatorUpdate) { + + /** + * Properties of a ValidatorUpdate. + * @memberof tendermint.abci + * @interface IValidatorUpdate + * @property {tendermint.crypto.IPublicKey|null} [pubKey] ValidatorUpdate pubKey + * @property {number|Long|null} [power] ValidatorUpdate power + */ + + /** + * Constructs a new ValidatorUpdate. + * @memberof tendermint.abci + * @classdesc Represents a ValidatorUpdate. + * @implements IValidatorUpdate + * @constructor + * @param {tendermint.abci.IValidatorUpdate=} [properties] Properties to set + */ + function ValidatorUpdate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidatorUpdate pubKey. + * @member {tendermint.crypto.IPublicKey|null|undefined} pubKey + * @memberof tendermint.abci.ValidatorUpdate + * @instance + */ + ValidatorUpdate.prototype.pubKey = null; + + /** + * ValidatorUpdate power. + * @member {number|Long} power + * @memberof tendermint.abci.ValidatorUpdate + * @instance + */ + ValidatorUpdate.prototype.power = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ValidatorUpdate instance using the specified properties. + * @function create + * @memberof tendermint.abci.ValidatorUpdate + * @static + * @param {tendermint.abci.IValidatorUpdate=} [properties] Properties to set + * @returns {tendermint.abci.ValidatorUpdate} ValidatorUpdate instance + */ + ValidatorUpdate.create = function create(properties) { + return new ValidatorUpdate(properties); + }; + + /** + * Encodes the specified ValidatorUpdate message. Does not implicitly {@link tendermint.abci.ValidatorUpdate.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ValidatorUpdate + * @static + * @param {tendermint.abci.IValidatorUpdate} message ValidatorUpdate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorUpdate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pubKey != null && Object.hasOwnProperty.call(message, "pubKey")) + $root.tendermint.crypto.PublicKey.encode(message.pubKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.power != null && Object.hasOwnProperty.call(message, "power")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.power); + return writer; + }; + + /** + * Encodes the specified ValidatorUpdate message, length delimited. Does not implicitly {@link tendermint.abci.ValidatorUpdate.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ValidatorUpdate + * @static + * @param {tendermint.abci.IValidatorUpdate} message ValidatorUpdate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorUpdate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidatorUpdate message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ValidatorUpdate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ValidatorUpdate} ValidatorUpdate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorUpdate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ValidatorUpdate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pubKey = $root.tendermint.crypto.PublicKey.decode(reader, reader.uint32()); + break; + case 2: + message.power = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidatorUpdate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ValidatorUpdate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ValidatorUpdate} ValidatorUpdate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorUpdate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidatorUpdate message. + * @function verify + * @memberof tendermint.abci.ValidatorUpdate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidatorUpdate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pubKey != null && message.hasOwnProperty("pubKey")) { + var error = $root.tendermint.crypto.PublicKey.verify(message.pubKey); + if (error) + return "pubKey." + error; + } + if (message.power != null && message.hasOwnProperty("power")) + if (!$util.isInteger(message.power) && !(message.power && $util.isInteger(message.power.low) && $util.isInteger(message.power.high))) + return "power: integer|Long expected"; + return null; + }; + + /** + * Creates a ValidatorUpdate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ValidatorUpdate + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ValidatorUpdate} ValidatorUpdate + */ + ValidatorUpdate.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ValidatorUpdate) + return object; + var message = new $root.tendermint.abci.ValidatorUpdate(); + if (object.pubKey != null) { + if (typeof object.pubKey !== "object") + throw TypeError(".tendermint.abci.ValidatorUpdate.pubKey: object expected"); + message.pubKey = $root.tendermint.crypto.PublicKey.fromObject(object.pubKey); + } + if (object.power != null) + if ($util.Long) + (message.power = $util.Long.fromValue(object.power)).unsigned = false; + else if (typeof object.power === "string") + message.power = parseInt(object.power, 10); + else if (typeof object.power === "number") + message.power = object.power; + else if (typeof object.power === "object") + message.power = new $util.LongBits(object.power.low >>> 0, object.power.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ValidatorUpdate message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ValidatorUpdate + * @static + * @param {tendermint.abci.ValidatorUpdate} message ValidatorUpdate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidatorUpdate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pubKey = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.power = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.power = options.longs === String ? "0" : 0; + } + if (message.pubKey != null && message.hasOwnProperty("pubKey")) + object.pubKey = $root.tendermint.crypto.PublicKey.toObject(message.pubKey, options); + if (message.power != null && message.hasOwnProperty("power")) + if (typeof message.power === "number") + object.power = options.longs === String ? String(message.power) : message.power; + else + object.power = options.longs === String ? $util.Long.prototype.toString.call(message.power) : options.longs === Number ? new $util.LongBits(message.power.low >>> 0, message.power.high >>> 0).toNumber() : message.power; + return object; + }; + + /** + * Converts this ValidatorUpdate to JSON. + * @function toJSON + * @memberof tendermint.abci.ValidatorUpdate + * @instance + * @returns {Object.} JSON object + */ + ValidatorUpdate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidatorUpdate; + })(abci.ValidatorUpdate || {}); + + abci.VoteInfo = (function(VoteInfo) { + + /** + * Properties of a VoteInfo. + * @memberof tendermint.abci + * @interface IVoteInfo + * @property {tendermint.abci.IValidator|null} [validator] VoteInfo validator + * @property {boolean|null} [signedLastBlock] VoteInfo signedLastBlock + */ + + /** + * Constructs a new VoteInfo. + * @memberof tendermint.abci + * @classdesc Represents a VoteInfo. + * @implements IVoteInfo + * @constructor + * @param {tendermint.abci.IVoteInfo=} [properties] Properties to set + */ + function VoteInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VoteInfo validator. + * @member {tendermint.abci.IValidator|null|undefined} validator + * @memberof tendermint.abci.VoteInfo + * @instance + */ + VoteInfo.prototype.validator = null; + + /** + * VoteInfo signedLastBlock. + * @member {boolean} signedLastBlock + * @memberof tendermint.abci.VoteInfo + * @instance + */ + VoteInfo.prototype.signedLastBlock = false; + + /** + * Creates a new VoteInfo instance using the specified properties. + * @function create + * @memberof tendermint.abci.VoteInfo + * @static + * @param {tendermint.abci.IVoteInfo=} [properties] Properties to set + * @returns {tendermint.abci.VoteInfo} VoteInfo instance + */ + VoteInfo.create = function create(properties) { + return new VoteInfo(properties); + }; + + /** + * Encodes the specified VoteInfo message. Does not implicitly {@link tendermint.abci.VoteInfo.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.VoteInfo + * @static + * @param {tendermint.abci.IVoteInfo} message VoteInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VoteInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validator != null && Object.hasOwnProperty.call(message, "validator")) + $root.tendermint.abci.Validator.encode(message.validator, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.signedLastBlock != null && Object.hasOwnProperty.call(message, "signedLastBlock")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.signedLastBlock); + return writer; + }; + + /** + * Encodes the specified VoteInfo message, length delimited. Does not implicitly {@link tendermint.abci.VoteInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.VoteInfo + * @static + * @param {tendermint.abci.IVoteInfo} message VoteInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VoteInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VoteInfo message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.VoteInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.VoteInfo} VoteInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VoteInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.VoteInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validator = $root.tendermint.abci.Validator.decode(reader, reader.uint32()); + break; + case 2: + message.signedLastBlock = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VoteInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.VoteInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.VoteInfo} VoteInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VoteInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VoteInfo message. + * @function verify + * @memberof tendermint.abci.VoteInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VoteInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validator != null && message.hasOwnProperty("validator")) { + var error = $root.tendermint.abci.Validator.verify(message.validator); + if (error) + return "validator." + error; + } + if (message.signedLastBlock != null && message.hasOwnProperty("signedLastBlock")) + if (typeof message.signedLastBlock !== "boolean") + return "signedLastBlock: boolean expected"; + return null; + }; + + /** + * Creates a VoteInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.VoteInfo + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.VoteInfo} VoteInfo + */ + VoteInfo.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.VoteInfo) + return object; + var message = new $root.tendermint.abci.VoteInfo(); + if (object.validator != null) { + if (typeof object.validator !== "object") + throw TypeError(".tendermint.abci.VoteInfo.validator: object expected"); + message.validator = $root.tendermint.abci.Validator.fromObject(object.validator); + } + if (object.signedLastBlock != null) + message.signedLastBlock = Boolean(object.signedLastBlock); + return message; + }; + + /** + * Creates a plain object from a VoteInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.VoteInfo + * @static + * @param {tendermint.abci.VoteInfo} message VoteInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VoteInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.validator = null; + object.signedLastBlock = false; + } + if (message.validator != null && message.hasOwnProperty("validator")) + object.validator = $root.tendermint.abci.Validator.toObject(message.validator, options); + if (message.signedLastBlock != null && message.hasOwnProperty("signedLastBlock")) + object.signedLastBlock = message.signedLastBlock; + return object; + }; + + /** + * Converts this VoteInfo to JSON. + * @function toJSON + * @memberof tendermint.abci.VoteInfo + * @instance + * @returns {Object.} JSON object + */ + VoteInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VoteInfo; + })(abci.VoteInfo || {}); + + /** + * EvidenceType enum. + * @name tendermint.abci.EvidenceType + * @enum {string} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} DUPLICATE_VOTE=1 DUPLICATE_VOTE value + * @property {number} LIGHT_CLIENT_ATTACK=2 LIGHT_CLIENT_ATTACK value + */ + abci.EvidenceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "DUPLICATE_VOTE"] = 1; + values[valuesById[2] = "LIGHT_CLIENT_ATTACK"] = 2; + return values; + })(); + + abci.Evidence = (function(Evidence) { + + /** + * Properties of an Evidence. + * @memberof tendermint.abci + * @interface IEvidence + * @property {tendermint.abci.EvidenceType|null} [type] Evidence type + * @property {tendermint.abci.IValidator|null} [validator] Evidence validator + * @property {number|Long|null} [height] Evidence height + * @property {google.protobuf.ITimestamp|null} [time] Evidence time + * @property {number|Long|null} [totalVotingPower] Evidence totalVotingPower + */ + + /** + * Constructs a new Evidence. + * @memberof tendermint.abci + * @classdesc Represents an Evidence. + * @implements IEvidence + * @constructor + * @param {tendermint.abci.IEvidence=} [properties] Properties to set + */ + function Evidence(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Evidence type. + * @member {tendermint.abci.EvidenceType} type + * @memberof tendermint.abci.Evidence + * @instance + */ + Evidence.prototype.type = 0; + + /** + * Evidence validator. + * @member {tendermint.abci.IValidator|null|undefined} validator + * @memberof tendermint.abci.Evidence + * @instance + */ + Evidence.prototype.validator = null; + + /** + * Evidence height. + * @member {number|Long} height + * @memberof tendermint.abci.Evidence + * @instance + */ + Evidence.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Evidence time. + * @member {google.protobuf.ITimestamp|null|undefined} time + * @memberof tendermint.abci.Evidence + * @instance + */ + Evidence.prototype.time = null; + + /** + * Evidence totalVotingPower. + * @member {number|Long} totalVotingPower + * @memberof tendermint.abci.Evidence + * @instance + */ + Evidence.prototype.totalVotingPower = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Evidence instance using the specified properties. + * @function create + * @memberof tendermint.abci.Evidence + * @static + * @param {tendermint.abci.IEvidence=} [properties] Properties to set + * @returns {tendermint.abci.Evidence} Evidence instance + */ + Evidence.create = function create(properties) { + return new Evidence(properties); + }; + + /** + * Encodes the specified Evidence message. Does not implicitly {@link tendermint.abci.Evidence.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.Evidence + * @static + * @param {tendermint.abci.IEvidence} message Evidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Evidence.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.validator != null && Object.hasOwnProperty.call(message, "validator")) + $root.tendermint.abci.Validator.encode(message.validator, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.height); + if (message.time != null && Object.hasOwnProperty.call(message, "time")) + $root.google.protobuf.Timestamp.encode(message.time, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.totalVotingPower != null && Object.hasOwnProperty.call(message, "totalVotingPower")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.totalVotingPower); + return writer; + }; + + /** + * Encodes the specified Evidence message, length delimited. Does not implicitly {@link tendermint.abci.Evidence.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.Evidence + * @static + * @param {tendermint.abci.IEvidence} message Evidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Evidence.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Evidence message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.Evidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.Evidence} Evidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Evidence.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.Evidence(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32(); + break; + case 2: + message.validator = $root.tendermint.abci.Validator.decode(reader, reader.uint32()); + break; + case 3: + message.height = reader.int64(); + break; + case 4: + message.time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.totalVotingPower = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Evidence message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.Evidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.Evidence} Evidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Evidence.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Evidence message. + * @function verify + * @memberof tendermint.abci.Evidence + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Evidence.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.validator != null && message.hasOwnProperty("validator")) { + var error = $root.tendermint.abci.Validator.verify(message.validator); + if (error) + return "validator." + error; + } + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.time != null && message.hasOwnProperty("time")) { + var error = $root.google.protobuf.Timestamp.verify(message.time); + if (error) + return "time." + error; + } + if (message.totalVotingPower != null && message.hasOwnProperty("totalVotingPower")) + if (!$util.isInteger(message.totalVotingPower) && !(message.totalVotingPower && $util.isInteger(message.totalVotingPower.low) && $util.isInteger(message.totalVotingPower.high))) + return "totalVotingPower: integer|Long expected"; + return null; + }; + + /** + * Creates an Evidence message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.Evidence + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.Evidence} Evidence + */ + Evidence.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.Evidence) + return object; + var message = new $root.tendermint.abci.Evidence(); + switch (object.type) { + case "UNKNOWN": + case 0: + message.type = 0; + break; + case "DUPLICATE_VOTE": + case 1: + message.type = 1; + break; + case "LIGHT_CLIENT_ATTACK": + case 2: + message.type = 2; + break; + } + if (object.validator != null) { + if (typeof object.validator !== "object") + throw TypeError(".tendermint.abci.Evidence.validator: object expected"); + message.validator = $root.tendermint.abci.Validator.fromObject(object.validator); + } + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + if (object.time != null) { + if (typeof object.time !== "object") + throw TypeError(".tendermint.abci.Evidence.time: object expected"); + message.time = $root.google.protobuf.Timestamp.fromObject(object.time); + } + if (object.totalVotingPower != null) + if ($util.Long) + (message.totalVotingPower = $util.Long.fromValue(object.totalVotingPower)).unsigned = false; + else if (typeof object.totalVotingPower === "string") + message.totalVotingPower = parseInt(object.totalVotingPower, 10); + else if (typeof object.totalVotingPower === "number") + message.totalVotingPower = object.totalVotingPower; + else if (typeof object.totalVotingPower === "object") + message.totalVotingPower = new $util.LongBits(object.totalVotingPower.low >>> 0, object.totalVotingPower.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Evidence message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.Evidence + * @static + * @param {tendermint.abci.Evidence} message Evidence + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Evidence.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "UNKNOWN" : 0; + object.validator = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.time = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalVotingPower = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalVotingPower = options.longs === String ? "0" : 0; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.tendermint.abci.EvidenceType[message.type] : message.type; + if (message.validator != null && message.hasOwnProperty("validator")) + object.validator = $root.tendermint.abci.Validator.toObject(message.validator, options); + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + if (message.time != null && message.hasOwnProperty("time")) + object.time = $root.google.protobuf.Timestamp.toObject(message.time, options); + if (message.totalVotingPower != null && message.hasOwnProperty("totalVotingPower")) + if (typeof message.totalVotingPower === "number") + object.totalVotingPower = options.longs === String ? String(message.totalVotingPower) : message.totalVotingPower; + else + object.totalVotingPower = options.longs === String ? $util.Long.prototype.toString.call(message.totalVotingPower) : options.longs === Number ? new $util.LongBits(message.totalVotingPower.low >>> 0, message.totalVotingPower.high >>> 0).toNumber() : message.totalVotingPower; + return object; + }; + + /** + * Converts this Evidence to JSON. + * @function toJSON + * @memberof tendermint.abci.Evidence + * @instance + * @returns {Object.} JSON object + */ + Evidence.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Evidence; + })(abci.Evidence || {}); + + abci.Snapshot = (function(Snapshot) { + + /** + * Properties of a Snapshot. + * @memberof tendermint.abci + * @interface ISnapshot + * @property {number|Long|null} [height] Snapshot height + * @property {number|null} [format] Snapshot format + * @property {number|null} [chunks] Snapshot chunks + * @property {Uint8Array|null} [hash] Snapshot hash + * @property {Uint8Array|null} [metadata] Snapshot metadata + */ + + /** + * Constructs a new Snapshot. + * @memberof tendermint.abci + * @classdesc Represents a Snapshot. + * @implements ISnapshot + * @constructor + * @param {tendermint.abci.ISnapshot=} [properties] Properties to set + */ + function Snapshot(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Snapshot height. + * @member {number|Long} height + * @memberof tendermint.abci.Snapshot + * @instance + */ + Snapshot.prototype.height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Snapshot format. + * @member {number} format + * @memberof tendermint.abci.Snapshot + * @instance + */ + Snapshot.prototype.format = 0; + + /** + * Snapshot chunks. + * @member {number} chunks + * @memberof tendermint.abci.Snapshot + * @instance + */ + Snapshot.prototype.chunks = 0; + + /** + * Snapshot hash. + * @member {Uint8Array} hash + * @memberof tendermint.abci.Snapshot + * @instance + */ + Snapshot.prototype.hash = $util.newBuffer([]); + + /** + * Snapshot metadata. + * @member {Uint8Array} metadata + * @memberof tendermint.abci.Snapshot + * @instance + */ + Snapshot.prototype.metadata = $util.newBuffer([]); + + /** + * Creates a new Snapshot instance using the specified properties. + * @function create + * @memberof tendermint.abci.Snapshot + * @static + * @param {tendermint.abci.ISnapshot=} [properties] Properties to set + * @returns {tendermint.abci.Snapshot} Snapshot instance + */ + Snapshot.create = function create(properties) { + return new Snapshot(properties); + }; + + /** + * Encodes the specified Snapshot message. Does not implicitly {@link tendermint.abci.Snapshot.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.Snapshot + * @static + * @param {tendermint.abci.ISnapshot} message Snapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Snapshot.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.height); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.format); + if (message.chunks != null && Object.hasOwnProperty.call(message, "chunks")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.chunks); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.hash); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.metadata); + return writer; + }; + + /** + * Encodes the specified Snapshot message, length delimited. Does not implicitly {@link tendermint.abci.Snapshot.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.Snapshot + * @static + * @param {tendermint.abci.ISnapshot} message Snapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Snapshot.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Snapshot message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.Snapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.Snapshot} Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Snapshot.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.Snapshot(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.uint64(); + break; + case 2: + message.format = reader.uint32(); + break; + case 3: + message.chunks = reader.uint32(); + break; + case 4: + message.hash = reader.bytes(); + break; + case 5: + message.metadata = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Snapshot message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.Snapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.Snapshot} Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Snapshot.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Snapshot message. + * @function verify + * @memberof tendermint.abci.Snapshot + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Snapshot.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.format != null && message.hasOwnProperty("format")) + if (!$util.isInteger(message.format)) + return "format: integer expected"; + if (message.chunks != null && message.hasOwnProperty("chunks")) + if (!$util.isInteger(message.chunks)) + return "chunks: integer expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash))) + return "hash: buffer expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) + if (!(message.metadata && typeof message.metadata.length === "number" || $util.isString(message.metadata))) + return "metadata: buffer expected"; + return null; + }; + + /** + * Creates a Snapshot message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.Snapshot + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.Snapshot} Snapshot + */ + Snapshot.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.Snapshot) + return object; + var message = new $root.tendermint.abci.Snapshot(); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = true; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(true); + if (object.format != null) + message.format = object.format >>> 0; + if (object.chunks != null) + message.chunks = object.chunks >>> 0; + if (object.hash != null) + if (typeof object.hash === "string") + $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0); + else if (object.hash.length) + message.hash = object.hash; + if (object.metadata != null) + if (typeof object.metadata === "string") + $util.base64.decode(object.metadata, message.metadata = $util.newBuffer($util.base64.length(object.metadata)), 0); + else if (object.metadata.length) + message.metadata = object.metadata; + return message; + }; + + /** + * Creates a plain object from a Snapshot message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.Snapshot + * @static + * @param {tendermint.abci.Snapshot} message Snapshot + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Snapshot.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.format = 0; + object.chunks = 0; + if (options.bytes === String) + object.hash = ""; + else { + object.hash = []; + if (options.bytes !== Array) + object.hash = $util.newBuffer(object.hash); + } + if (options.bytes === String) + object.metadata = ""; + else { + object.metadata = []; + if (options.bytes !== Array) + object.metadata = $util.newBuffer(object.metadata); + } + } + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber(true) : message.height; + if (message.format != null && message.hasOwnProperty("format")) + object.format = message.format; + if (message.chunks != null && message.hasOwnProperty("chunks")) + object.chunks = message.chunks; + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = options.bytes === String ? $util.base64.encode(message.metadata, 0, message.metadata.length) : options.bytes === Array ? Array.prototype.slice.call(message.metadata) : message.metadata; + return object; + }; + + /** + * Converts this Snapshot to JSON. + * @function toJSON + * @memberof tendermint.abci.Snapshot + * @instance + * @returns {Object.} JSON object + */ + Snapshot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Snapshot; + })(abci.Snapshot || {}); + + abci.ABCIApplication = (function(ABCIApplication) { + + /** + * Constructs a new ABCIApplication service. + * @memberof tendermint.abci + * @classdesc Represents a ABCIApplication + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function ABCIApplication(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ABCIApplication.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ABCIApplication; + + /** + * Creates new ABCIApplication service using the specified rpc implementation. + * @function create + * @memberof tendermint.abci.ABCIApplication + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {ABCIApplication} RPC service. Useful where requests and/or responses are streamed. + */ + ABCIApplication.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#echo}. + * @memberof tendermint.abci.ABCIApplication + * @typedef EchoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseEcho} [response] ResponseEcho + */ + + /** + * Calls Echo. + * @function echo + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestEcho} request RequestEcho message or plain object + * @param {tendermint.abci.ABCIApplication.EchoCallback} callback Node-style callback called with the error, if any, and ResponseEcho + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.echo = function echo(request, callback) { + return this.rpcCall(echo, $root.tendermint.abci.RequestEcho, $root.tendermint.abci.ResponseEcho, request, callback); + }, "name", { value: "Echo" }); + + /** + * Calls Echo. + * @function echo + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestEcho} request RequestEcho message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#flush}. + * @memberof tendermint.abci.ABCIApplication + * @typedef FlushCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseFlush} [response] ResponseFlush + */ + + /** + * Calls Flush. + * @function flush + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestFlush} request RequestFlush message or plain object + * @param {tendermint.abci.ABCIApplication.FlushCallback} callback Node-style callback called with the error, if any, and ResponseFlush + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.flush = function flush(request, callback) { + return this.rpcCall(flush, $root.tendermint.abci.RequestFlush, $root.tendermint.abci.ResponseFlush, request, callback); + }, "name", { value: "Flush" }); + + /** + * Calls Flush. + * @function flush + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestFlush} request RequestFlush message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#info}. + * @memberof tendermint.abci.ABCIApplication + * @typedef InfoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseInfo} [response] ResponseInfo + */ + + /** + * Calls Info. + * @function info + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestInfo} request RequestInfo message or plain object + * @param {tendermint.abci.ABCIApplication.InfoCallback} callback Node-style callback called with the error, if any, and ResponseInfo + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.info = function info(request, callback) { + return this.rpcCall(info, $root.tendermint.abci.RequestInfo, $root.tendermint.abci.ResponseInfo, request, callback); + }, "name", { value: "Info" }); + + /** + * Calls Info. + * @function info + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestInfo} request RequestInfo message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#setOption}. + * @memberof tendermint.abci.ABCIApplication + * @typedef SetOptionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseSetOption} [response] ResponseSetOption + */ + + /** + * Calls SetOption. + * @function setOption + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestSetOption} request RequestSetOption message or plain object + * @param {tendermint.abci.ABCIApplication.SetOptionCallback} callback Node-style callback called with the error, if any, and ResponseSetOption + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.setOption = function setOption(request, callback) { + return this.rpcCall(setOption, $root.tendermint.abci.RequestSetOption, $root.tendermint.abci.ResponseSetOption, request, callback); + }, "name", { value: "SetOption" }); + + /** + * Calls SetOption. + * @function setOption + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestSetOption} request RequestSetOption message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#deliverTx}. + * @memberof tendermint.abci.ABCIApplication + * @typedef DeliverTxCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseDeliverTx} [response] ResponseDeliverTx + */ + + /** + * Calls DeliverTx. + * @function deliverTx + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestDeliverTx} request RequestDeliverTx message or plain object + * @param {tendermint.abci.ABCIApplication.DeliverTxCallback} callback Node-style callback called with the error, if any, and ResponseDeliverTx + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.deliverTx = function deliverTx(request, callback) { + return this.rpcCall(deliverTx, $root.tendermint.abci.RequestDeliverTx, $root.tendermint.abci.ResponseDeliverTx, request, callback); + }, "name", { value: "DeliverTx" }); + + /** + * Calls DeliverTx. + * @function deliverTx + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestDeliverTx} request RequestDeliverTx message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#checkTx}. + * @memberof tendermint.abci.ABCIApplication + * @typedef CheckTxCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseCheckTx} [response] ResponseCheckTx + */ + + /** + * Calls CheckTx. + * @function checkTx + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestCheckTx} request RequestCheckTx message or plain object + * @param {tendermint.abci.ABCIApplication.CheckTxCallback} callback Node-style callback called with the error, if any, and ResponseCheckTx + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.checkTx = function checkTx(request, callback) { + return this.rpcCall(checkTx, $root.tendermint.abci.RequestCheckTx, $root.tendermint.abci.ResponseCheckTx, request, callback); + }, "name", { value: "CheckTx" }); + + /** + * Calls CheckTx. + * @function checkTx + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestCheckTx} request RequestCheckTx message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#query}. + * @memberof tendermint.abci.ABCIApplication + * @typedef QueryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseQuery} [response] ResponseQuery + */ + + /** + * Calls Query. + * @function query + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestQuery} request RequestQuery message or plain object + * @param {tendermint.abci.ABCIApplication.QueryCallback} callback Node-style callback called with the error, if any, and ResponseQuery + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.query = function query(request, callback) { + return this.rpcCall(query, $root.tendermint.abci.RequestQuery, $root.tendermint.abci.ResponseQuery, request, callback); + }, "name", { value: "Query" }); + + /** + * Calls Query. + * @function query + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestQuery} request RequestQuery message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#commit}. + * @memberof tendermint.abci.ABCIApplication + * @typedef CommitCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseCommit} [response] ResponseCommit + */ + + /** + * Calls Commit. + * @function commit + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestCommit} request RequestCommit message or plain object + * @param {tendermint.abci.ABCIApplication.CommitCallback} callback Node-style callback called with the error, if any, and ResponseCommit + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.commit = function commit(request, callback) { + return this.rpcCall(commit, $root.tendermint.abci.RequestCommit, $root.tendermint.abci.ResponseCommit, request, callback); + }, "name", { value: "Commit" }); + + /** + * Calls Commit. + * @function commit + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestCommit} request RequestCommit message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#initChain}. + * @memberof tendermint.abci.ABCIApplication + * @typedef InitChainCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseInitChain} [response] ResponseInitChain + */ + + /** + * Calls InitChain. + * @function initChain + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestInitChain} request RequestInitChain message or plain object + * @param {tendermint.abci.ABCIApplication.InitChainCallback} callback Node-style callback called with the error, if any, and ResponseInitChain + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.initChain = function initChain(request, callback) { + return this.rpcCall(initChain, $root.tendermint.abci.RequestInitChain, $root.tendermint.abci.ResponseInitChain, request, callback); + }, "name", { value: "InitChain" }); + + /** + * Calls InitChain. + * @function initChain + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestInitChain} request RequestInitChain message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#beginBlock}. + * @memberof tendermint.abci.ABCIApplication + * @typedef BeginBlockCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseBeginBlock} [response] ResponseBeginBlock + */ + + /** + * Calls BeginBlock. + * @function beginBlock + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestBeginBlock} request RequestBeginBlock message or plain object + * @param {tendermint.abci.ABCIApplication.BeginBlockCallback} callback Node-style callback called with the error, if any, and ResponseBeginBlock + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.beginBlock = function beginBlock(request, callback) { + return this.rpcCall(beginBlock, $root.tendermint.abci.RequestBeginBlock, $root.tendermint.abci.ResponseBeginBlock, request, callback); + }, "name", { value: "BeginBlock" }); + + /** + * Calls BeginBlock. + * @function beginBlock + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestBeginBlock} request RequestBeginBlock message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#endBlock}. + * @memberof tendermint.abci.ABCIApplication + * @typedef EndBlockCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseEndBlock} [response] ResponseEndBlock + */ + + /** + * Calls EndBlock. + * @function endBlock + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestEndBlock} request RequestEndBlock message or plain object + * @param {tendermint.abci.ABCIApplication.EndBlockCallback} callback Node-style callback called with the error, if any, and ResponseEndBlock + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.endBlock = function endBlock(request, callback) { + return this.rpcCall(endBlock, $root.tendermint.abci.RequestEndBlock, $root.tendermint.abci.ResponseEndBlock, request, callback); + }, "name", { value: "EndBlock" }); + + /** + * Calls EndBlock. + * @function endBlock + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestEndBlock} request RequestEndBlock message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#listSnapshots}. + * @memberof tendermint.abci.ABCIApplication + * @typedef ListSnapshotsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseListSnapshots} [response] ResponseListSnapshots + */ + + /** + * Calls ListSnapshots. + * @function listSnapshots + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestListSnapshots} request RequestListSnapshots message or plain object + * @param {tendermint.abci.ABCIApplication.ListSnapshotsCallback} callback Node-style callback called with the error, if any, and ResponseListSnapshots + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.listSnapshots = function listSnapshots(request, callback) { + return this.rpcCall(listSnapshots, $root.tendermint.abci.RequestListSnapshots, $root.tendermint.abci.ResponseListSnapshots, request, callback); + }, "name", { value: "ListSnapshots" }); + + /** + * Calls ListSnapshots. + * @function listSnapshots + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestListSnapshots} request RequestListSnapshots message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#offerSnapshot}. + * @memberof tendermint.abci.ABCIApplication + * @typedef OfferSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseOfferSnapshot} [response] ResponseOfferSnapshot + */ + + /** + * Calls OfferSnapshot. + * @function offerSnapshot + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestOfferSnapshot} request RequestOfferSnapshot message or plain object + * @param {tendermint.abci.ABCIApplication.OfferSnapshotCallback} callback Node-style callback called with the error, if any, and ResponseOfferSnapshot + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.offerSnapshot = function offerSnapshot(request, callback) { + return this.rpcCall(offerSnapshot, $root.tendermint.abci.RequestOfferSnapshot, $root.tendermint.abci.ResponseOfferSnapshot, request, callback); + }, "name", { value: "OfferSnapshot" }); + + /** + * Calls OfferSnapshot. + * @function offerSnapshot + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestOfferSnapshot} request RequestOfferSnapshot message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#loadSnapshotChunk}. + * @memberof tendermint.abci.ABCIApplication + * @typedef LoadSnapshotChunkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseLoadSnapshotChunk} [response] ResponseLoadSnapshotChunk + */ + + /** + * Calls LoadSnapshotChunk. + * @function loadSnapshotChunk + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestLoadSnapshotChunk} request RequestLoadSnapshotChunk message or plain object + * @param {tendermint.abci.ABCIApplication.LoadSnapshotChunkCallback} callback Node-style callback called with the error, if any, and ResponseLoadSnapshotChunk + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.loadSnapshotChunk = function loadSnapshotChunk(request, callback) { + return this.rpcCall(loadSnapshotChunk, $root.tendermint.abci.RequestLoadSnapshotChunk, $root.tendermint.abci.ResponseLoadSnapshotChunk, request, callback); + }, "name", { value: "LoadSnapshotChunk" }); + + /** + * Calls LoadSnapshotChunk. + * @function loadSnapshotChunk + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestLoadSnapshotChunk} request RequestLoadSnapshotChunk message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#applySnapshotChunk}. + * @memberof tendermint.abci.ABCIApplication + * @typedef ApplySnapshotChunkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseApplySnapshotChunk} [response] ResponseApplySnapshotChunk + */ + + /** + * Calls ApplySnapshotChunk. + * @function applySnapshotChunk + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestApplySnapshotChunk} request RequestApplySnapshotChunk message or plain object + * @param {tendermint.abci.ABCIApplication.ApplySnapshotChunkCallback} callback Node-style callback called with the error, if any, and ResponseApplySnapshotChunk + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.applySnapshotChunk = function applySnapshotChunk(request, callback) { + return this.rpcCall(applySnapshotChunk, $root.tendermint.abci.RequestApplySnapshotChunk, $root.tendermint.abci.ResponseApplySnapshotChunk, request, callback); + }, "name", { value: "ApplySnapshotChunk" }); + + /** + * Calls ApplySnapshotChunk. + * @function applySnapshotChunk + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestApplySnapshotChunk} request RequestApplySnapshotChunk message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ABCIApplication; + })(abci.ABCIApplication || {}); + + return abci; + })(tendermint.abci || {}); + + /** + * Namespace crypto. + * @memberof tendermint + * @namespace + */ + + tendermint.crypto = (function(crypto) { + + crypto.PublicKey = (function(PublicKey) { + + /** + * Properties of a PublicKey. + * @memberof tendermint.crypto + * @interface IPublicKey + * @property {Uint8Array|null} [ed25519] PublicKey ed25519 + * @property {Uint8Array|null} [secp256k1] PublicKey secp256k1 + */ + + /** + * Constructs a new PublicKey. + * @memberof tendermint.crypto + * @classdesc Represents a PublicKey. + * @implements IPublicKey + * @constructor + * @param {tendermint.crypto.IPublicKey=} [properties] Properties to set + */ + function PublicKey(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PublicKey ed25519. + * @member {Uint8Array} ed25519 + * @memberof tendermint.crypto.PublicKey + * @instance + */ + PublicKey.prototype.ed25519 = $util.newBuffer([]); + + /** + * PublicKey secp256k1. + * @member {Uint8Array} secp256k1 + * @memberof tendermint.crypto.PublicKey + * @instance + */ + PublicKey.prototype.secp256k1 = $util.newBuffer([]); + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PublicKey sum. + * @member {"ed25519"|"secp256k1"|undefined} sum + * @memberof tendermint.crypto.PublicKey + * @instance + */ + Object.defineProperty(PublicKey.prototype, "sum", { + get: $util.oneOfGetter($oneOfFields = ["ed25519", "secp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PublicKey instance using the specified properties. + * @function create + * @memberof tendermint.crypto.PublicKey + * @static + * @param {tendermint.crypto.IPublicKey=} [properties] Properties to set + * @returns {tendermint.crypto.PublicKey} PublicKey instance + */ + PublicKey.create = function create(properties) { + return new PublicKey(properties); + }; + + /** + * Encodes the specified PublicKey message. Does not implicitly {@link tendermint.crypto.PublicKey.verify|verify} messages. + * @function encode + * @memberof tendermint.crypto.PublicKey + * @static + * @param {tendermint.crypto.IPublicKey} message PublicKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ed25519 != null && Object.hasOwnProperty.call(message, "ed25519")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.ed25519); + if (message.secp256k1 != null && Object.hasOwnProperty.call(message, "secp256k1")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.secp256k1); + return writer; + }; + + /** + * Encodes the specified PublicKey message, length delimited. Does not implicitly {@link tendermint.crypto.PublicKey.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.crypto.PublicKey + * @static + * @param {tendermint.crypto.IPublicKey} message PublicKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PublicKey message from the specified reader or buffer. + * @function decode + * @memberof tendermint.crypto.PublicKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.crypto.PublicKey} PublicKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicKey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.PublicKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ed25519 = reader.bytes(); + break; + case 2: + message.secp256k1 = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PublicKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.crypto.PublicKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.crypto.PublicKey} PublicKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PublicKey message. + * @function verify + * @memberof tendermint.crypto.PublicKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PublicKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.ed25519 != null && message.hasOwnProperty("ed25519")) { + properties.sum = 1; + if (!(message.ed25519 && typeof message.ed25519.length === "number" || $util.isString(message.ed25519))) + return "ed25519: buffer expected"; + } + if (message.secp256k1 != null && message.hasOwnProperty("secp256k1")) { + if (properties.sum === 1) + return "sum: multiple values"; + properties.sum = 1; + if (!(message.secp256k1 && typeof message.secp256k1.length === "number" || $util.isString(message.secp256k1))) + return "secp256k1: buffer expected"; + } + return null; + }; + + /** + * Creates a PublicKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.crypto.PublicKey + * @static + * @param {Object.} object Plain object + * @returns {tendermint.crypto.PublicKey} PublicKey + */ + PublicKey.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.crypto.PublicKey) + return object; + var message = new $root.tendermint.crypto.PublicKey(); + if (object.ed25519 != null) + if (typeof object.ed25519 === "string") + $util.base64.decode(object.ed25519, message.ed25519 = $util.newBuffer($util.base64.length(object.ed25519)), 0); + else if (object.ed25519.length) + message.ed25519 = object.ed25519; + if (object.secp256k1 != null) + if (typeof object.secp256k1 === "string") + $util.base64.decode(object.secp256k1, message.secp256k1 = $util.newBuffer($util.base64.length(object.secp256k1)), 0); + else if (object.secp256k1.length) + message.secp256k1 = object.secp256k1; + return message; + }; + + /** + * Creates a plain object from a PublicKey message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.crypto.PublicKey + * @static + * @param {tendermint.crypto.PublicKey} message PublicKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PublicKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.ed25519 != null && message.hasOwnProperty("ed25519")) { + object.ed25519 = options.bytes === String ? $util.base64.encode(message.ed25519, 0, message.ed25519.length) : options.bytes === Array ? Array.prototype.slice.call(message.ed25519) : message.ed25519; + if (options.oneofs) + object.sum = "ed25519"; + } + if (message.secp256k1 != null && message.hasOwnProperty("secp256k1")) { + object.secp256k1 = options.bytes === String ? $util.base64.encode(message.secp256k1, 0, message.secp256k1.length) : options.bytes === Array ? Array.prototype.slice.call(message.secp256k1) : message.secp256k1; + if (options.oneofs) + object.sum = "secp256k1"; + } + return object; + }; + + /** + * Converts this PublicKey to JSON. + * @function toJSON + * @memberof tendermint.crypto.PublicKey + * @instance + * @returns {Object.} JSON object + */ + PublicKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PublicKey; + })(crypto.PublicKey || {}); + + crypto.Proof = (function(Proof) { + + /** + * Properties of a Proof. + * @memberof tendermint.crypto + * @interface IProof + * @property {number|Long|null} [total] Proof total + * @property {number|Long|null} [index] Proof index + * @property {Uint8Array|null} [leafHash] Proof leafHash + * @property {Array.|null} [aunts] Proof aunts + */ + + /** + * Constructs a new Proof. + * @memberof tendermint.crypto + * @classdesc Represents a Proof. + * @implements IProof + * @constructor + * @param {tendermint.crypto.IProof=} [properties] Properties to set + */ + function Proof(properties) { + this.aunts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Proof total. + * @member {number|Long} total + * @memberof tendermint.crypto.Proof + * @instance + */ + Proof.prototype.total = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Proof index. + * @member {number|Long} index + * @memberof tendermint.crypto.Proof + * @instance + */ + Proof.prototype.index = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Proof leafHash. + * @member {Uint8Array} leafHash + * @memberof tendermint.crypto.Proof + * @instance + */ + Proof.prototype.leafHash = $util.newBuffer([]); + + /** + * Proof aunts. + * @member {Array.} aunts + * @memberof tendermint.crypto.Proof + * @instance + */ + Proof.prototype.aunts = $util.emptyArray; + + /** + * Creates a new Proof instance using the specified properties. + * @function create + * @memberof tendermint.crypto.Proof + * @static + * @param {tendermint.crypto.IProof=} [properties] Properties to set + * @returns {tendermint.crypto.Proof} Proof instance + */ + Proof.create = function create(properties) { + return new Proof(properties); + }; + + /** + * Encodes the specified Proof message. Does not implicitly {@link tendermint.crypto.Proof.verify|verify} messages. + * @function encode + * @memberof tendermint.crypto.Proof + * @static + * @param {tendermint.crypto.IProof} message Proof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proof.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.total != null && Object.hasOwnProperty.call(message, "total")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.total); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.index); + if (message.leafHash != null && Object.hasOwnProperty.call(message, "leafHash")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.leafHash); + if (message.aunts != null && message.aunts.length) + for (var i = 0; i < message.aunts.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.aunts[i]); + return writer; + }; + + /** + * Encodes the specified Proof message, length delimited. Does not implicitly {@link tendermint.crypto.Proof.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.crypto.Proof + * @static + * @param {tendermint.crypto.IProof} message Proof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proof.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Proof message from the specified reader or buffer. + * @function decode + * @memberof tendermint.crypto.Proof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.crypto.Proof} Proof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proof.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.Proof(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.total = reader.int64(); + break; + case 2: + message.index = reader.int64(); + break; + case 3: + message.leafHash = reader.bytes(); + break; + case 4: + if (!(message.aunts && message.aunts.length)) + message.aunts = []; + message.aunts.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Proof message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.crypto.Proof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.crypto.Proof} Proof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proof.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Proof message. + * @function verify + * @memberof tendermint.crypto.Proof + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Proof.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.total != null && message.hasOwnProperty("total")) + if (!$util.isInteger(message.total) && !(message.total && $util.isInteger(message.total.low) && $util.isInteger(message.total.high))) + return "total: integer|Long expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index) && !(message.index && $util.isInteger(message.index.low) && $util.isInteger(message.index.high))) + return "index: integer|Long expected"; + if (message.leafHash != null && message.hasOwnProperty("leafHash")) + if (!(message.leafHash && typeof message.leafHash.length === "number" || $util.isString(message.leafHash))) + return "leafHash: buffer expected"; + if (message.aunts != null && message.hasOwnProperty("aunts")) { + if (!Array.isArray(message.aunts)) + return "aunts: array expected"; + for (var i = 0; i < message.aunts.length; ++i) + if (!(message.aunts[i] && typeof message.aunts[i].length === "number" || $util.isString(message.aunts[i]))) + return "aunts: buffer[] expected"; + } + return null; + }; + + /** + * Creates a Proof message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.crypto.Proof + * @static + * @param {Object.} object Plain object + * @returns {tendermint.crypto.Proof} Proof + */ + Proof.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.crypto.Proof) + return object; + var message = new $root.tendermint.crypto.Proof(); + if (object.total != null) + if ($util.Long) + (message.total = $util.Long.fromValue(object.total)).unsigned = false; + else if (typeof object.total === "string") + message.total = parseInt(object.total, 10); + else if (typeof object.total === "number") + message.total = object.total; + else if (typeof object.total === "object") + message.total = new $util.LongBits(object.total.low >>> 0, object.total.high >>> 0).toNumber(); + if (object.index != null) + if ($util.Long) + (message.index = $util.Long.fromValue(object.index)).unsigned = false; + else if (typeof object.index === "string") + message.index = parseInt(object.index, 10); + else if (typeof object.index === "number") + message.index = object.index; + else if (typeof object.index === "object") + message.index = new $util.LongBits(object.index.low >>> 0, object.index.high >>> 0).toNumber(); + if (object.leafHash != null) + if (typeof object.leafHash === "string") + $util.base64.decode(object.leafHash, message.leafHash = $util.newBuffer($util.base64.length(object.leafHash)), 0); + else if (object.leafHash.length) + message.leafHash = object.leafHash; + if (object.aunts) { + if (!Array.isArray(object.aunts)) + throw TypeError(".tendermint.crypto.Proof.aunts: array expected"); + message.aunts = []; + for (var i = 0; i < object.aunts.length; ++i) + if (typeof object.aunts[i] === "string") + $util.base64.decode(object.aunts[i], message.aunts[i] = $util.newBuffer($util.base64.length(object.aunts[i])), 0); + else if (object.aunts[i].length) + message.aunts[i] = object.aunts[i]; + } + return message; + }; + + /** + * Creates a plain object from a Proof message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.crypto.Proof + * @static + * @param {tendermint.crypto.Proof} message Proof + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Proof.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.aunts = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.total = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.total = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.index = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.index = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.leafHash = ""; + else { + object.leafHash = []; + if (options.bytes !== Array) + object.leafHash = $util.newBuffer(object.leafHash); + } + } + if (message.total != null && message.hasOwnProperty("total")) + if (typeof message.total === "number") + object.total = options.longs === String ? String(message.total) : message.total; + else + object.total = options.longs === String ? $util.Long.prototype.toString.call(message.total) : options.longs === Number ? new $util.LongBits(message.total.low >>> 0, message.total.high >>> 0).toNumber() : message.total; + if (message.index != null && message.hasOwnProperty("index")) + if (typeof message.index === "number") + object.index = options.longs === String ? String(message.index) : message.index; + else + object.index = options.longs === String ? $util.Long.prototype.toString.call(message.index) : options.longs === Number ? new $util.LongBits(message.index.low >>> 0, message.index.high >>> 0).toNumber() : message.index; + if (message.leafHash != null && message.hasOwnProperty("leafHash")) + object.leafHash = options.bytes === String ? $util.base64.encode(message.leafHash, 0, message.leafHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.leafHash) : message.leafHash; + if (message.aunts && message.aunts.length) { + object.aunts = []; + for (var j = 0; j < message.aunts.length; ++j) + object.aunts[j] = options.bytes === String ? $util.base64.encode(message.aunts[j], 0, message.aunts[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.aunts[j]) : message.aunts[j]; + } + return object; + }; + + /** + * Converts this Proof to JSON. + * @function toJSON + * @memberof tendermint.crypto.Proof + * @instance + * @returns {Object.} JSON object + */ + Proof.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Proof; + })(crypto.Proof || {}); + + crypto.ValueOp = (function(ValueOp) { + + /** + * Properties of a ValueOp. + * @memberof tendermint.crypto + * @interface IValueOp + * @property {Uint8Array|null} [key] ValueOp key + * @property {tendermint.crypto.IProof|null} [proof] ValueOp proof + */ + + /** + * Constructs a new ValueOp. + * @memberof tendermint.crypto + * @classdesc Represents a ValueOp. + * @implements IValueOp + * @constructor + * @param {tendermint.crypto.IValueOp=} [properties] Properties to set + */ + function ValueOp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValueOp key. + * @member {Uint8Array} key + * @memberof tendermint.crypto.ValueOp + * @instance + */ + ValueOp.prototype.key = $util.newBuffer([]); + + /** + * ValueOp proof. + * @member {tendermint.crypto.IProof|null|undefined} proof + * @memberof tendermint.crypto.ValueOp + * @instance + */ + ValueOp.prototype.proof = null; + + /** + * Creates a new ValueOp instance using the specified properties. + * @function create + * @memberof tendermint.crypto.ValueOp + * @static + * @param {tendermint.crypto.IValueOp=} [properties] Properties to set + * @returns {tendermint.crypto.ValueOp} ValueOp instance + */ + ValueOp.create = function create(properties) { + return new ValueOp(properties); + }; + + /** + * Encodes the specified ValueOp message. Does not implicitly {@link tendermint.crypto.ValueOp.verify|verify} messages. + * @function encode + * @memberof tendermint.crypto.ValueOp + * @static + * @param {tendermint.crypto.IValueOp} message ValueOp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValueOp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.tendermint.crypto.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ValueOp message, length delimited. Does not implicitly {@link tendermint.crypto.ValueOp.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.crypto.ValueOp + * @static + * @param {tendermint.crypto.IValueOp} message ValueOp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValueOp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValueOp message from the specified reader or buffer. + * @function decode + * @memberof tendermint.crypto.ValueOp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.crypto.ValueOp} ValueOp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValueOp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.ValueOp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.proof = $root.tendermint.crypto.Proof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValueOp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.crypto.ValueOp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.crypto.ValueOp} ValueOp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValueOp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValueOp message. + * @function verify + * @memberof tendermint.crypto.ValueOp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValueOp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + if (message.proof != null && message.hasOwnProperty("proof")) { + var error = $root.tendermint.crypto.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + return null; + }; + + /** + * Creates a ValueOp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.crypto.ValueOp + * @static + * @param {Object.} object Plain object + * @returns {tendermint.crypto.ValueOp} ValueOp + */ + ValueOp.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.crypto.ValueOp) + return object; + var message = new $root.tendermint.crypto.ValueOp(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length) + message.key = object.key; + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".tendermint.crypto.ValueOp.proof: object expected"); + message.proof = $root.tendermint.crypto.Proof.fromObject(object.proof); + } + return message; + }; + + /** + * Creates a plain object from a ValueOp message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.crypto.ValueOp + * @static + * @param {tendermint.crypto.ValueOp} message ValueOp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValueOp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + object.proof = null; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.proof != null && message.hasOwnProperty("proof")) + object.proof = $root.tendermint.crypto.Proof.toObject(message.proof, options); + return object; + }; + + /** + * Converts this ValueOp to JSON. + * @function toJSON + * @memberof tendermint.crypto.ValueOp + * @instance + * @returns {Object.} JSON object + */ + ValueOp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValueOp; + })(crypto.ValueOp || {}); + + crypto.DominoOp = (function(DominoOp) { + + /** + * Properties of a DominoOp. + * @memberof tendermint.crypto + * @interface IDominoOp + * @property {string|null} [key] DominoOp key + * @property {string|null} [input] DominoOp input + * @property {string|null} [output] DominoOp output + */ + + /** + * Constructs a new DominoOp. + * @memberof tendermint.crypto + * @classdesc Represents a DominoOp. + * @implements IDominoOp + * @constructor + * @param {tendermint.crypto.IDominoOp=} [properties] Properties to set + */ + function DominoOp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DominoOp key. + * @member {string} key + * @memberof tendermint.crypto.DominoOp + * @instance + */ + DominoOp.prototype.key = ""; + + /** + * DominoOp input. + * @member {string} input + * @memberof tendermint.crypto.DominoOp + * @instance + */ + DominoOp.prototype.input = ""; + + /** + * DominoOp output. + * @member {string} output + * @memberof tendermint.crypto.DominoOp + * @instance + */ + DominoOp.prototype.output = ""; + + /** + * Creates a new DominoOp instance using the specified properties. + * @function create + * @memberof tendermint.crypto.DominoOp + * @static + * @param {tendermint.crypto.IDominoOp=} [properties] Properties to set + * @returns {tendermint.crypto.DominoOp} DominoOp instance + */ + DominoOp.create = function create(properties) { + return new DominoOp(properties); + }; + + /** + * Encodes the specified DominoOp message. Does not implicitly {@link tendermint.crypto.DominoOp.verify|verify} messages. + * @function encode + * @memberof tendermint.crypto.DominoOp + * @static + * @param {tendermint.crypto.IDominoOp} message DominoOp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DominoOp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.input != null && Object.hasOwnProperty.call(message, "input")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.input); + if (message.output != null && Object.hasOwnProperty.call(message, "output")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.output); + return writer; + }; + + /** + * Encodes the specified DominoOp message, length delimited. Does not implicitly {@link tendermint.crypto.DominoOp.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.crypto.DominoOp + * @static + * @param {tendermint.crypto.IDominoOp} message DominoOp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DominoOp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DominoOp message from the specified reader or buffer. + * @function decode + * @memberof tendermint.crypto.DominoOp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.crypto.DominoOp} DominoOp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DominoOp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.DominoOp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.input = reader.string(); + break; + case 3: + message.output = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DominoOp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.crypto.DominoOp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.crypto.DominoOp} DominoOp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DominoOp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DominoOp message. + * @function verify + * @memberof tendermint.crypto.DominoOp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DominoOp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.input != null && message.hasOwnProperty("input")) + if (!$util.isString(message.input)) + return "input: string expected"; + if (message.output != null && message.hasOwnProperty("output")) + if (!$util.isString(message.output)) + return "output: string expected"; + return null; + }; + + /** + * Creates a DominoOp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.crypto.DominoOp + * @static + * @param {Object.} object Plain object + * @returns {tendermint.crypto.DominoOp} DominoOp + */ + DominoOp.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.crypto.DominoOp) + return object; + var message = new $root.tendermint.crypto.DominoOp(); + if (object.key != null) + message.key = String(object.key); + if (object.input != null) + message.input = String(object.input); + if (object.output != null) + message.output = String(object.output); + return message; + }; + + /** + * Creates a plain object from a DominoOp message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.crypto.DominoOp + * @static + * @param {tendermint.crypto.DominoOp} message DominoOp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DominoOp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.key = ""; + object.input = ""; + object.output = ""; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.input != null && message.hasOwnProperty("input")) + object.input = message.input; + if (message.output != null && message.hasOwnProperty("output")) + object.output = message.output; + return object; + }; + + /** + * Converts this DominoOp to JSON. + * @function toJSON + * @memberof tendermint.crypto.DominoOp + * @instance + * @returns {Object.} JSON object + */ + DominoOp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DominoOp; + })(crypto.DominoOp || {}); + + crypto.ProofOp = (function(ProofOp) { + + /** + * Properties of a ProofOp. + * @memberof tendermint.crypto + * @interface IProofOp + * @property {string|null} [type] ProofOp type + * @property {Uint8Array|null} [key] ProofOp key + * @property {Uint8Array|null} [data] ProofOp data + */ + + /** + * Constructs a new ProofOp. + * @memberof tendermint.crypto + * @classdesc Represents a ProofOp. + * @implements IProofOp + * @constructor + * @param {tendermint.crypto.IProofOp=} [properties] Properties to set + */ + function ProofOp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProofOp type. + * @member {string} type + * @memberof tendermint.crypto.ProofOp + * @instance + */ + ProofOp.prototype.type = ""; + + /** + * ProofOp key. + * @member {Uint8Array} key + * @memberof tendermint.crypto.ProofOp + * @instance + */ + ProofOp.prototype.key = $util.newBuffer([]); + + /** + * ProofOp data. + * @member {Uint8Array} data + * @memberof tendermint.crypto.ProofOp + * @instance + */ + ProofOp.prototype.data = $util.newBuffer([]); + + /** + * Creates a new ProofOp instance using the specified properties. + * @function create + * @memberof tendermint.crypto.ProofOp + * @static + * @param {tendermint.crypto.IProofOp=} [properties] Properties to set + * @returns {tendermint.crypto.ProofOp} ProofOp instance + */ + ProofOp.create = function create(properties) { + return new ProofOp(properties); + }; + + /** + * Encodes the specified ProofOp message. Does not implicitly {@link tendermint.crypto.ProofOp.verify|verify} messages. + * @function encode + * @memberof tendermint.crypto.ProofOp + * @static + * @param {tendermint.crypto.IProofOp} message ProofOp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProofOp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.key); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.data); + return writer; + }; + + /** + * Encodes the specified ProofOp message, length delimited. Does not implicitly {@link tendermint.crypto.ProofOp.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.crypto.ProofOp + * @static + * @param {tendermint.crypto.IProofOp} message ProofOp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProofOp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProofOp message from the specified reader or buffer. + * @function decode + * @memberof tendermint.crypto.ProofOp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.crypto.ProofOp} ProofOp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProofOp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.ProofOp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.key = reader.bytes(); + break; + case 3: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProofOp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.crypto.ProofOp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.crypto.ProofOp} ProofOp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProofOp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProofOp message. + * @function verify + * @memberof tendermint.crypto.ProofOp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProofOp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + return null; + }; + + /** + * Creates a ProofOp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.crypto.ProofOp + * @static + * @param {Object.} object Plain object + * @returns {tendermint.crypto.ProofOp} ProofOp + */ + ProofOp.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.crypto.ProofOp) + return object; + var message = new $root.tendermint.crypto.ProofOp(); + if (object.type != null) + message.type = String(object.type); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length) + message.key = object.key; + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length) + message.data = object.data; + return message; + }; + + /** + * Creates a plain object from a ProofOp message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.crypto.ProofOp + * @static + * @param {tendermint.crypto.ProofOp} message ProofOp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProofOp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + return object; + }; + + /** + * Converts this ProofOp to JSON. + * @function toJSON + * @memberof tendermint.crypto.ProofOp + * @instance + * @returns {Object.} JSON object + */ + ProofOp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ProofOp; + })(crypto.ProofOp || {}); + + crypto.ProofOps = (function(ProofOps) { + + /** + * Properties of a ProofOps. + * @memberof tendermint.crypto + * @interface IProofOps + * @property {Array.|null} [ops] ProofOps ops + */ + + /** + * Constructs a new ProofOps. + * @memberof tendermint.crypto + * @classdesc Represents a ProofOps. + * @implements IProofOps + * @constructor + * @param {tendermint.crypto.IProofOps=} [properties] Properties to set + */ + function ProofOps(properties) { + this.ops = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProofOps ops. + * @member {Array.} ops + * @memberof tendermint.crypto.ProofOps + * @instance + */ + ProofOps.prototype.ops = $util.emptyArray; + + /** + * Creates a new ProofOps instance using the specified properties. + * @function create + * @memberof tendermint.crypto.ProofOps + * @static + * @param {tendermint.crypto.IProofOps=} [properties] Properties to set + * @returns {tendermint.crypto.ProofOps} ProofOps instance + */ + ProofOps.create = function create(properties) { + return new ProofOps(properties); + }; + + /** + * Encodes the specified ProofOps message. Does not implicitly {@link tendermint.crypto.ProofOps.verify|verify} messages. + * @function encode + * @memberof tendermint.crypto.ProofOps + * @static + * @param {tendermint.crypto.IProofOps} message ProofOps message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProofOps.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ops != null && message.ops.length) + for (var i = 0; i < message.ops.length; ++i) + $root.tendermint.crypto.ProofOp.encode(message.ops[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProofOps message, length delimited. Does not implicitly {@link tendermint.crypto.ProofOps.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.crypto.ProofOps + * @static + * @param {tendermint.crypto.IProofOps} message ProofOps message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProofOps.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProofOps message from the specified reader or buffer. + * @function decode + * @memberof tendermint.crypto.ProofOps + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.crypto.ProofOps} ProofOps + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProofOps.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.ProofOps(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.ops && message.ops.length)) + message.ops = []; + message.ops.push($root.tendermint.crypto.ProofOp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProofOps message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.crypto.ProofOps + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.crypto.ProofOps} ProofOps + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProofOps.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProofOps message. + * @function verify + * @memberof tendermint.crypto.ProofOps + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProofOps.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ops != null && message.hasOwnProperty("ops")) { + if (!Array.isArray(message.ops)) + return "ops: array expected"; + for (var i = 0; i < message.ops.length; ++i) { + var error = $root.tendermint.crypto.ProofOp.verify(message.ops[i]); + if (error) + return "ops." + error; + } + } + return null; + }; + + /** + * Creates a ProofOps message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.crypto.ProofOps + * @static + * @param {Object.} object Plain object + * @returns {tendermint.crypto.ProofOps} ProofOps + */ + ProofOps.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.crypto.ProofOps) + return object; + var message = new $root.tendermint.crypto.ProofOps(); + if (object.ops) { + if (!Array.isArray(object.ops)) + throw TypeError(".tendermint.crypto.ProofOps.ops: array expected"); + message.ops = []; + for (var i = 0; i < object.ops.length; ++i) { + if (typeof object.ops[i] !== "object") + throw TypeError(".tendermint.crypto.ProofOps.ops: object expected"); + message.ops[i] = $root.tendermint.crypto.ProofOp.fromObject(object.ops[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ProofOps message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.crypto.ProofOps + * @static + * @param {tendermint.crypto.ProofOps} message ProofOps + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProofOps.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ops = []; + if (message.ops && message.ops.length) { + object.ops = []; + for (var j = 0; j < message.ops.length; ++j) + object.ops[j] = $root.tendermint.crypto.ProofOp.toObject(message.ops[j], options); + } + return object; + }; + + /** + * Converts this ProofOps to JSON. + * @function toJSON + * @memberof tendermint.crypto.ProofOps + * @instance + * @returns {Object.} JSON object + */ + ProofOps.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ProofOps; + })(crypto.ProofOps || {}); + + return crypto; + })(tendermint.crypto || {}); + + /** + * Namespace p2p. + * @memberof tendermint + * @namespace + */ + + tendermint.p2p = (function(p2p) { + + p2p.NetAddress = (function(NetAddress) { + + /** + * Properties of a NetAddress. + * @memberof tendermint.p2p + * @interface INetAddress + * @property {string|null} [id] NetAddress id + * @property {string|null} [ip] NetAddress ip + * @property {number|null} [port] NetAddress port + */ + + /** + * Constructs a new NetAddress. + * @memberof tendermint.p2p + * @classdesc Represents a NetAddress. + * @implements INetAddress + * @constructor + * @param {tendermint.p2p.INetAddress=} [properties] Properties to set + */ + function NetAddress(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetAddress id. + * @member {string} id + * @memberof tendermint.p2p.NetAddress + * @instance + */ + NetAddress.prototype.id = ""; + + /** + * NetAddress ip. + * @member {string} ip + * @memberof tendermint.p2p.NetAddress + * @instance + */ + NetAddress.prototype.ip = ""; + + /** + * NetAddress port. + * @member {number} port + * @memberof tendermint.p2p.NetAddress + * @instance + */ + NetAddress.prototype.port = 0; + + /** + * Creates a new NetAddress instance using the specified properties. + * @function create + * @memberof tendermint.p2p.NetAddress + * @static + * @param {tendermint.p2p.INetAddress=} [properties] Properties to set + * @returns {tendermint.p2p.NetAddress} NetAddress instance + */ + NetAddress.create = function create(properties) { + return new NetAddress(properties); + }; + + /** + * Encodes the specified NetAddress message. Does not implicitly {@link tendermint.p2p.NetAddress.verify|verify} messages. + * @function encode + * @memberof tendermint.p2p.NetAddress + * @static + * @param {tendermint.p2p.INetAddress} message NetAddress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetAddress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.ip != null && Object.hasOwnProperty.call(message, "ip")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ip); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.port); + return writer; + }; + + /** + * Encodes the specified NetAddress message, length delimited. Does not implicitly {@link tendermint.p2p.NetAddress.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.p2p.NetAddress + * @static + * @param {tendermint.p2p.INetAddress} message NetAddress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetAddress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetAddress message from the specified reader or buffer. + * @function decode + * @memberof tendermint.p2p.NetAddress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.p2p.NetAddress} NetAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetAddress.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.p2p.NetAddress(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.ip = reader.string(); + break; + case 3: + message.port = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetAddress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.p2p.NetAddress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.p2p.NetAddress} NetAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetAddress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetAddress message. + * @function verify + * @memberof tendermint.p2p.NetAddress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetAddress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.ip != null && message.hasOwnProperty("ip")) + if (!$util.isString(message.ip)) + return "ip: string expected"; + if (message.port != null && message.hasOwnProperty("port")) + if (!$util.isInteger(message.port)) + return "port: integer expected"; + return null; + }; + + /** + * Creates a NetAddress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.p2p.NetAddress + * @static + * @param {Object.} object Plain object + * @returns {tendermint.p2p.NetAddress} NetAddress + */ + NetAddress.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.p2p.NetAddress) + return object; + var message = new $root.tendermint.p2p.NetAddress(); + if (object.id != null) + message.id = String(object.id); + if (object.ip != null) + message.ip = String(object.ip); + if (object.port != null) + message.port = object.port >>> 0; + return message; + }; + + /** + * Creates a plain object from a NetAddress message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.p2p.NetAddress + * @static + * @param {tendermint.p2p.NetAddress} message NetAddress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetAddress.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.ip = ""; + object.port = 0; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.ip != null && message.hasOwnProperty("ip")) + object.ip = message.ip; + if (message.port != null && message.hasOwnProperty("port")) + object.port = message.port; + return object; + }; + + /** + * Converts this NetAddress to JSON. + * @function toJSON + * @memberof tendermint.p2p.NetAddress + * @instance + * @returns {Object.} JSON object + */ + NetAddress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NetAddress; + })(p2p.NetAddress || {}); + + p2p.ProtocolVersion = (function(ProtocolVersion) { + + /** + * Properties of a ProtocolVersion. + * @memberof tendermint.p2p + * @interface IProtocolVersion + * @property {number|Long|null} [p2p] ProtocolVersion p2p + * @property {number|Long|null} [block] ProtocolVersion block + * @property {number|Long|null} [app] ProtocolVersion app + */ + + /** + * Constructs a new ProtocolVersion. + * @memberof tendermint.p2p + * @classdesc Represents a ProtocolVersion. + * @implements IProtocolVersion + * @constructor + * @param {tendermint.p2p.IProtocolVersion=} [properties] Properties to set + */ + function ProtocolVersion(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProtocolVersion p2p. + * @member {number|Long} p2p + * @memberof tendermint.p2p.ProtocolVersion + * @instance + */ + ProtocolVersion.prototype.p2p = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ProtocolVersion block. + * @member {number|Long} block + * @memberof tendermint.p2p.ProtocolVersion + * @instance + */ + ProtocolVersion.prototype.block = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ProtocolVersion app. + * @member {number|Long} app + * @memberof tendermint.p2p.ProtocolVersion + * @instance + */ + ProtocolVersion.prototype.app = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new ProtocolVersion instance using the specified properties. + * @function create + * @memberof tendermint.p2p.ProtocolVersion + * @static + * @param {tendermint.p2p.IProtocolVersion=} [properties] Properties to set + * @returns {tendermint.p2p.ProtocolVersion} ProtocolVersion instance + */ + ProtocolVersion.create = function create(properties) { + return new ProtocolVersion(properties); + }; + + /** + * Encodes the specified ProtocolVersion message. Does not implicitly {@link tendermint.p2p.ProtocolVersion.verify|verify} messages. + * @function encode + * @memberof tendermint.p2p.ProtocolVersion + * @static + * @param {tendermint.p2p.IProtocolVersion} message ProtocolVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtocolVersion.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.p2p != null && Object.hasOwnProperty.call(message, "p2p")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.p2p); + if (message.block != null && Object.hasOwnProperty.call(message, "block")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.block); + if (message.app != null && Object.hasOwnProperty.call(message, "app")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.app); + return writer; + }; + + /** + * Encodes the specified ProtocolVersion message, length delimited. Does not implicitly {@link tendermint.p2p.ProtocolVersion.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.p2p.ProtocolVersion + * @static + * @param {tendermint.p2p.IProtocolVersion} message ProtocolVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtocolVersion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProtocolVersion message from the specified reader or buffer. + * @function decode + * @memberof tendermint.p2p.ProtocolVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.p2p.ProtocolVersion} ProtocolVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtocolVersion.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.p2p.ProtocolVersion(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.p2p = reader.uint64(); + break; + case 2: + message.block = reader.uint64(); + break; + case 3: + message.app = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProtocolVersion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.p2p.ProtocolVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.p2p.ProtocolVersion} ProtocolVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtocolVersion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProtocolVersion message. + * @function verify + * @memberof tendermint.p2p.ProtocolVersion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProtocolVersion.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.p2p != null && message.hasOwnProperty("p2p")) + if (!$util.isInteger(message.p2p) && !(message.p2p && $util.isInteger(message.p2p.low) && $util.isInteger(message.p2p.high))) + return "p2p: integer|Long expected"; + if (message.block != null && message.hasOwnProperty("block")) + if (!$util.isInteger(message.block) && !(message.block && $util.isInteger(message.block.low) && $util.isInteger(message.block.high))) + return "block: integer|Long expected"; + if (message.app != null && message.hasOwnProperty("app")) + if (!$util.isInteger(message.app) && !(message.app && $util.isInteger(message.app.low) && $util.isInteger(message.app.high))) + return "app: integer|Long expected"; + return null; + }; + + /** + * Creates a ProtocolVersion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.p2p.ProtocolVersion + * @static + * @param {Object.} object Plain object + * @returns {tendermint.p2p.ProtocolVersion} ProtocolVersion + */ + ProtocolVersion.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.p2p.ProtocolVersion) + return object; + var message = new $root.tendermint.p2p.ProtocolVersion(); + if (object.p2p != null) + if ($util.Long) + (message.p2p = $util.Long.fromValue(object.p2p)).unsigned = true; + else if (typeof object.p2p === "string") + message.p2p = parseInt(object.p2p, 10); + else if (typeof object.p2p === "number") + message.p2p = object.p2p; + else if (typeof object.p2p === "object") + message.p2p = new $util.LongBits(object.p2p.low >>> 0, object.p2p.high >>> 0).toNumber(true); + if (object.block != null) + if ($util.Long) + (message.block = $util.Long.fromValue(object.block)).unsigned = true; + else if (typeof object.block === "string") + message.block = parseInt(object.block, 10); + else if (typeof object.block === "number") + message.block = object.block; + else if (typeof object.block === "object") + message.block = new $util.LongBits(object.block.low >>> 0, object.block.high >>> 0).toNumber(true); + if (object.app != null) + if ($util.Long) + (message.app = $util.Long.fromValue(object.app)).unsigned = true; + else if (typeof object.app === "string") + message.app = parseInt(object.app, 10); + else if (typeof object.app === "number") + message.app = object.app; + else if (typeof object.app === "object") + message.app = new $util.LongBits(object.app.low >>> 0, object.app.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a ProtocolVersion message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.p2p.ProtocolVersion + * @static + * @param {tendermint.p2p.ProtocolVersion} message ProtocolVersion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProtocolVersion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.p2p = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.p2p = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.block = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.block = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.app = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.app = options.longs === String ? "0" : 0; + } + if (message.p2p != null && message.hasOwnProperty("p2p")) + if (typeof message.p2p === "number") + object.p2p = options.longs === String ? String(message.p2p) : message.p2p; + else + object.p2p = options.longs === String ? $util.Long.prototype.toString.call(message.p2p) : options.longs === Number ? new $util.LongBits(message.p2p.low >>> 0, message.p2p.high >>> 0).toNumber(true) : message.p2p; + if (message.block != null && message.hasOwnProperty("block")) + if (typeof message.block === "number") + object.block = options.longs === String ? String(message.block) : message.block; + else + object.block = options.longs === String ? $util.Long.prototype.toString.call(message.block) : options.longs === Number ? new $util.LongBits(message.block.low >>> 0, message.block.high >>> 0).toNumber(true) : message.block; + if (message.app != null && message.hasOwnProperty("app")) + if (typeof message.app === "number") + object.app = options.longs === String ? String(message.app) : message.app; + else + object.app = options.longs === String ? $util.Long.prototype.toString.call(message.app) : options.longs === Number ? new $util.LongBits(message.app.low >>> 0, message.app.high >>> 0).toNumber(true) : message.app; + return object; + }; + + /** + * Converts this ProtocolVersion to JSON. + * @function toJSON + * @memberof tendermint.p2p.ProtocolVersion + * @instance + * @returns {Object.} JSON object + */ + ProtocolVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ProtocolVersion; + })(p2p.ProtocolVersion || {}); + + p2p.DefaultNodeInfo = (function(DefaultNodeInfo) { + + /** + * Properties of a DefaultNodeInfo. + * @memberof tendermint.p2p + * @interface IDefaultNodeInfo + * @property {tendermint.p2p.IProtocolVersion|null} [protocolVersion] DefaultNodeInfo protocolVersion + * @property {string|null} [defaultNodeId] DefaultNodeInfo defaultNodeId + * @property {string|null} [listenAddr] DefaultNodeInfo listenAddr + * @property {string|null} [network] DefaultNodeInfo network + * @property {string|null} [version] DefaultNodeInfo version + * @property {Uint8Array|null} [channels] DefaultNodeInfo channels + * @property {string|null} [moniker] DefaultNodeInfo moniker + * @property {tendermint.p2p.IDefaultNodeInfoOther|null} [other] DefaultNodeInfo other + */ + + /** + * Constructs a new DefaultNodeInfo. + * @memberof tendermint.p2p + * @classdesc Represents a DefaultNodeInfo. + * @implements IDefaultNodeInfo + * @constructor + * @param {tendermint.p2p.IDefaultNodeInfo=} [properties] Properties to set + */ + function DefaultNodeInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DefaultNodeInfo protocolVersion. + * @member {tendermint.p2p.IProtocolVersion|null|undefined} protocolVersion + * @memberof tendermint.p2p.DefaultNodeInfo + * @instance + */ + DefaultNodeInfo.prototype.protocolVersion = null; + + /** + * DefaultNodeInfo defaultNodeId. + * @member {string} defaultNodeId + * @memberof tendermint.p2p.DefaultNodeInfo + * @instance + */ + DefaultNodeInfo.prototype.defaultNodeId = ""; + + /** + * DefaultNodeInfo listenAddr. + * @member {string} listenAddr + * @memberof tendermint.p2p.DefaultNodeInfo + * @instance + */ + DefaultNodeInfo.prototype.listenAddr = ""; + + /** + * DefaultNodeInfo network. + * @member {string} network + * @memberof tendermint.p2p.DefaultNodeInfo + * @instance + */ + DefaultNodeInfo.prototype.network = ""; + + /** + * DefaultNodeInfo version. + * @member {string} version + * @memberof tendermint.p2p.DefaultNodeInfo + * @instance + */ + DefaultNodeInfo.prototype.version = ""; + + /** + * DefaultNodeInfo channels. + * @member {Uint8Array} channels + * @memberof tendermint.p2p.DefaultNodeInfo + * @instance + */ + DefaultNodeInfo.prototype.channels = $util.newBuffer([]); + + /** + * DefaultNodeInfo moniker. + * @member {string} moniker + * @memberof tendermint.p2p.DefaultNodeInfo + * @instance + */ + DefaultNodeInfo.prototype.moniker = ""; + + /** + * DefaultNodeInfo other. + * @member {tendermint.p2p.IDefaultNodeInfoOther|null|undefined} other + * @memberof tendermint.p2p.DefaultNodeInfo + * @instance + */ + DefaultNodeInfo.prototype.other = null; + + /** + * Creates a new DefaultNodeInfo instance using the specified properties. + * @function create + * @memberof tendermint.p2p.DefaultNodeInfo + * @static + * @param {tendermint.p2p.IDefaultNodeInfo=} [properties] Properties to set + * @returns {tendermint.p2p.DefaultNodeInfo} DefaultNodeInfo instance + */ + DefaultNodeInfo.create = function create(properties) { + return new DefaultNodeInfo(properties); + }; + + /** + * Encodes the specified DefaultNodeInfo message. Does not implicitly {@link tendermint.p2p.DefaultNodeInfo.verify|verify} messages. + * @function encode + * @memberof tendermint.p2p.DefaultNodeInfo + * @static + * @param {tendermint.p2p.IDefaultNodeInfo} message DefaultNodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DefaultNodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.protocolVersion != null && Object.hasOwnProperty.call(message, "protocolVersion")) + $root.tendermint.p2p.ProtocolVersion.encode(message.protocolVersion, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.defaultNodeId != null && Object.hasOwnProperty.call(message, "defaultNodeId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.defaultNodeId); + if (message.listenAddr != null && Object.hasOwnProperty.call(message, "listenAddr")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.listenAddr); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.network); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.version); + if (message.channels != null && Object.hasOwnProperty.call(message, "channels")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.channels); + if (message.moniker != null && Object.hasOwnProperty.call(message, "moniker")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.moniker); + if (message.other != null && Object.hasOwnProperty.call(message, "other")) + $root.tendermint.p2p.DefaultNodeInfoOther.encode(message.other, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DefaultNodeInfo message, length delimited. Does not implicitly {@link tendermint.p2p.DefaultNodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.p2p.DefaultNodeInfo + * @static + * @param {tendermint.p2p.IDefaultNodeInfo} message DefaultNodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DefaultNodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DefaultNodeInfo message from the specified reader or buffer. + * @function decode + * @memberof tendermint.p2p.DefaultNodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.p2p.DefaultNodeInfo} DefaultNodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DefaultNodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.p2p.DefaultNodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.protocolVersion = $root.tendermint.p2p.ProtocolVersion.decode(reader, reader.uint32()); + break; + case 2: + message.defaultNodeId = reader.string(); + break; + case 3: + message.listenAddr = reader.string(); + break; + case 4: + message.network = reader.string(); + break; + case 5: + message.version = reader.string(); + break; + case 6: + message.channels = reader.bytes(); + break; + case 7: + message.moniker = reader.string(); + break; + case 8: + message.other = $root.tendermint.p2p.DefaultNodeInfoOther.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DefaultNodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.p2p.DefaultNodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.p2p.DefaultNodeInfo} DefaultNodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DefaultNodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DefaultNodeInfo message. + * @function verify + * @memberof tendermint.p2p.DefaultNodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DefaultNodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) { + var error = $root.tendermint.p2p.ProtocolVersion.verify(message.protocolVersion); + if (error) + return "protocolVersion." + error; + } + if (message.defaultNodeId != null && message.hasOwnProperty("defaultNodeId")) + if (!$util.isString(message.defaultNodeId)) + return "defaultNodeId: string expected"; + if (message.listenAddr != null && message.hasOwnProperty("listenAddr")) + if (!$util.isString(message.listenAddr)) + return "listenAddr: string expected"; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.channels != null && message.hasOwnProperty("channels")) + if (!(message.channels && typeof message.channels.length === "number" || $util.isString(message.channels))) + return "channels: buffer expected"; + if (message.moniker != null && message.hasOwnProperty("moniker")) + if (!$util.isString(message.moniker)) + return "moniker: string expected"; + if (message.other != null && message.hasOwnProperty("other")) { + var error = $root.tendermint.p2p.DefaultNodeInfoOther.verify(message.other); + if (error) + return "other." + error; + } + return null; + }; + + /** + * Creates a DefaultNodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.p2p.DefaultNodeInfo + * @static + * @param {Object.} object Plain object + * @returns {tendermint.p2p.DefaultNodeInfo} DefaultNodeInfo + */ + DefaultNodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.p2p.DefaultNodeInfo) + return object; + var message = new $root.tendermint.p2p.DefaultNodeInfo(); + if (object.protocolVersion != null) { + if (typeof object.protocolVersion !== "object") + throw TypeError(".tendermint.p2p.DefaultNodeInfo.protocolVersion: object expected"); + message.protocolVersion = $root.tendermint.p2p.ProtocolVersion.fromObject(object.protocolVersion); + } + if (object.defaultNodeId != null) + message.defaultNodeId = String(object.defaultNodeId); + if (object.listenAddr != null) + message.listenAddr = String(object.listenAddr); + if (object.network != null) + message.network = String(object.network); + if (object.version != null) + message.version = String(object.version); + if (object.channels != null) + if (typeof object.channels === "string") + $util.base64.decode(object.channels, message.channels = $util.newBuffer($util.base64.length(object.channels)), 0); + else if (object.channels.length) + message.channels = object.channels; + if (object.moniker != null) + message.moniker = String(object.moniker); + if (object.other != null) { + if (typeof object.other !== "object") + throw TypeError(".tendermint.p2p.DefaultNodeInfo.other: object expected"); + message.other = $root.tendermint.p2p.DefaultNodeInfoOther.fromObject(object.other); + } + return message; + }; + + /** + * Creates a plain object from a DefaultNodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.p2p.DefaultNodeInfo + * @static + * @param {tendermint.p2p.DefaultNodeInfo} message DefaultNodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DefaultNodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.protocolVersion = null; + object.defaultNodeId = ""; + object.listenAddr = ""; + object.network = ""; + object.version = ""; + if (options.bytes === String) + object.channels = ""; + else { + object.channels = []; + if (options.bytes !== Array) + object.channels = $util.newBuffer(object.channels); + } + object.moniker = ""; + object.other = null; + } + if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) + object.protocolVersion = $root.tendermint.p2p.ProtocolVersion.toObject(message.protocolVersion, options); + if (message.defaultNodeId != null && message.hasOwnProperty("defaultNodeId")) + object.defaultNodeId = message.defaultNodeId; + if (message.listenAddr != null && message.hasOwnProperty("listenAddr")) + object.listenAddr = message.listenAddr; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.channels != null && message.hasOwnProperty("channels")) + object.channels = options.bytes === String ? $util.base64.encode(message.channels, 0, message.channels.length) : options.bytes === Array ? Array.prototype.slice.call(message.channels) : message.channels; + if (message.moniker != null && message.hasOwnProperty("moniker")) + object.moniker = message.moniker; + if (message.other != null && message.hasOwnProperty("other")) + object.other = $root.tendermint.p2p.DefaultNodeInfoOther.toObject(message.other, options); + return object; + }; + + /** + * Converts this DefaultNodeInfo to JSON. + * @function toJSON + * @memberof tendermint.p2p.DefaultNodeInfo + * @instance + * @returns {Object.} JSON object + */ + DefaultNodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DefaultNodeInfo; + })(p2p.DefaultNodeInfo || {}); + + p2p.DefaultNodeInfoOther = (function(DefaultNodeInfoOther) { + + /** + * Properties of a DefaultNodeInfoOther. + * @memberof tendermint.p2p + * @interface IDefaultNodeInfoOther + * @property {string|null} [txIndex] DefaultNodeInfoOther txIndex + * @property {string|null} [rpcAddress] DefaultNodeInfoOther rpcAddress + */ + + /** + * Constructs a new DefaultNodeInfoOther. + * @memberof tendermint.p2p + * @classdesc Represents a DefaultNodeInfoOther. + * @implements IDefaultNodeInfoOther + * @constructor + * @param {tendermint.p2p.IDefaultNodeInfoOther=} [properties] Properties to set + */ + function DefaultNodeInfoOther(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DefaultNodeInfoOther txIndex. + * @member {string} txIndex + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @instance + */ + DefaultNodeInfoOther.prototype.txIndex = ""; + + /** + * DefaultNodeInfoOther rpcAddress. + * @member {string} rpcAddress + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @instance + */ + DefaultNodeInfoOther.prototype.rpcAddress = ""; + + /** + * Creates a new DefaultNodeInfoOther instance using the specified properties. + * @function create + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @static + * @param {tendermint.p2p.IDefaultNodeInfoOther=} [properties] Properties to set + * @returns {tendermint.p2p.DefaultNodeInfoOther} DefaultNodeInfoOther instance + */ + DefaultNodeInfoOther.create = function create(properties) { + return new DefaultNodeInfoOther(properties); + }; + + /** + * Encodes the specified DefaultNodeInfoOther message. Does not implicitly {@link tendermint.p2p.DefaultNodeInfoOther.verify|verify} messages. + * @function encode + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @static + * @param {tendermint.p2p.IDefaultNodeInfoOther} message DefaultNodeInfoOther message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DefaultNodeInfoOther.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.txIndex != null && Object.hasOwnProperty.call(message, "txIndex")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.txIndex); + if (message.rpcAddress != null && Object.hasOwnProperty.call(message, "rpcAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.rpcAddress); + return writer; + }; + + /** + * Encodes the specified DefaultNodeInfoOther message, length delimited. Does not implicitly {@link tendermint.p2p.DefaultNodeInfoOther.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @static + * @param {tendermint.p2p.IDefaultNodeInfoOther} message DefaultNodeInfoOther message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DefaultNodeInfoOther.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DefaultNodeInfoOther message from the specified reader or buffer. + * @function decode + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.p2p.DefaultNodeInfoOther} DefaultNodeInfoOther + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DefaultNodeInfoOther.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.p2p.DefaultNodeInfoOther(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txIndex = reader.string(); + break; + case 2: + message.rpcAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DefaultNodeInfoOther message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.p2p.DefaultNodeInfoOther} DefaultNodeInfoOther + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DefaultNodeInfoOther.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DefaultNodeInfoOther message. + * @function verify + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DefaultNodeInfoOther.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.txIndex != null && message.hasOwnProperty("txIndex")) + if (!$util.isString(message.txIndex)) + return "txIndex: string expected"; + if (message.rpcAddress != null && message.hasOwnProperty("rpcAddress")) + if (!$util.isString(message.rpcAddress)) + return "rpcAddress: string expected"; + return null; + }; + + /** + * Creates a DefaultNodeInfoOther message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @static + * @param {Object.} object Plain object + * @returns {tendermint.p2p.DefaultNodeInfoOther} DefaultNodeInfoOther + */ + DefaultNodeInfoOther.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.p2p.DefaultNodeInfoOther) + return object; + var message = new $root.tendermint.p2p.DefaultNodeInfoOther(); + if (object.txIndex != null) + message.txIndex = String(object.txIndex); + if (object.rpcAddress != null) + message.rpcAddress = String(object.rpcAddress); + return message; + }; + + /** + * Creates a plain object from a DefaultNodeInfoOther message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @static + * @param {tendermint.p2p.DefaultNodeInfoOther} message DefaultNodeInfoOther + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DefaultNodeInfoOther.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.txIndex = ""; + object.rpcAddress = ""; + } + if (message.txIndex != null && message.hasOwnProperty("txIndex")) + object.txIndex = message.txIndex; + if (message.rpcAddress != null && message.hasOwnProperty("rpcAddress")) + object.rpcAddress = message.rpcAddress; + return object; + }; + + /** + * Converts this DefaultNodeInfoOther to JSON. + * @function toJSON + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @instance + * @returns {Object.} JSON object + */ + DefaultNodeInfoOther.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DefaultNodeInfoOther; + })(p2p.DefaultNodeInfoOther || {}); + + return p2p; + })(tendermint.p2p || {}); + + /** + * Namespace types. + * @memberof tendermint + * @namespace + */ + + tendermint.types = (function(types) { + + types.Block = (function(Block) { + + /** + * Properties of a Block. + * @memberof tendermint.types + * @interface IBlock + * @property {tendermint.types.IHeader|null} [header] Block header + * @property {tendermint.types.IData|null} [data] Block data + * @property {tendermint.types.IEvidenceList|null} [evidence] Block evidence + * @property {tendermint.types.ICommit|null} [lastCommit] Block lastCommit + */ + + /** + * Constructs a new Block. + * @memberof tendermint.types + * @classdesc Represents a Block. + * @implements IBlock + * @constructor + * @param {tendermint.types.IBlock=} [properties] Properties to set + */ + function Block(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Block header. + * @member {tendermint.types.IHeader|null|undefined} header + * @memberof tendermint.types.Block + * @instance + */ + Block.prototype.header = null; + + /** + * Block data. + * @member {tendermint.types.IData|null|undefined} data + * @memberof tendermint.types.Block + * @instance + */ + Block.prototype.data = null; + + /** + * Block evidence. + * @member {tendermint.types.IEvidenceList|null|undefined} evidence + * @memberof tendermint.types.Block + * @instance + */ + Block.prototype.evidence = null; + + /** + * Block lastCommit. + * @member {tendermint.types.ICommit|null|undefined} lastCommit + * @memberof tendermint.types.Block + * @instance + */ + Block.prototype.lastCommit = null; + + /** + * Creates a new Block instance using the specified properties. + * @function create + * @memberof tendermint.types.Block + * @static + * @param {tendermint.types.IBlock=} [properties] Properties to set + * @returns {tendermint.types.Block} Block instance + */ + Block.create = function create(properties) { + return new Block(properties); + }; + + /** + * Encodes the specified Block message. Does not implicitly {@link tendermint.types.Block.verify|verify} messages. + * @function encode + * @memberof tendermint.types.Block + * @static + * @param {tendermint.types.IBlock} message Block message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Block.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + $root.tendermint.types.Header.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + $root.tendermint.types.Data.encode(message.data, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.evidence != null && Object.hasOwnProperty.call(message, "evidence")) + $root.tendermint.types.EvidenceList.encode(message.evidence, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.lastCommit != null && Object.hasOwnProperty.call(message, "lastCommit")) + $root.tendermint.types.Commit.encode(message.lastCommit, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Block message, length delimited. Does not implicitly {@link tendermint.types.Block.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.Block + * @static + * @param {tendermint.types.IBlock} message Block message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Block.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Block message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.Block + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.Block} Block + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Block.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Block(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.header = $root.tendermint.types.Header.decode(reader, reader.uint32()); + break; + case 2: + message.data = $root.tendermint.types.Data.decode(reader, reader.uint32()); + break; + case 3: + message.evidence = $root.tendermint.types.EvidenceList.decode(reader, reader.uint32()); + break; + case 4: + message.lastCommit = $root.tendermint.types.Commit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Block message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.Block + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.Block} Block + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Block.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Block message. + * @function verify + * @memberof tendermint.types.Block + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Block.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.header != null && message.hasOwnProperty("header")) { + var error = $root.tendermint.types.Header.verify(message.header); + if (error) + return "header." + error; + } + if (message.data != null && message.hasOwnProperty("data")) { + var error = $root.tendermint.types.Data.verify(message.data); + if (error) + return "data." + error; + } + if (message.evidence != null && message.hasOwnProperty("evidence")) { + var error = $root.tendermint.types.EvidenceList.verify(message.evidence); + if (error) + return "evidence." + error; + } + if (message.lastCommit != null && message.hasOwnProperty("lastCommit")) { + var error = $root.tendermint.types.Commit.verify(message.lastCommit); + if (error) + return "lastCommit." + error; + } + return null; + }; + + /** + * Creates a Block message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.Block + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.Block} Block + */ + Block.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.Block) + return object; + var message = new $root.tendermint.types.Block(); + if (object.header != null) { + if (typeof object.header !== "object") + throw TypeError(".tendermint.types.Block.header: object expected"); + message.header = $root.tendermint.types.Header.fromObject(object.header); + } + if (object.data != null) { + if (typeof object.data !== "object") + throw TypeError(".tendermint.types.Block.data: object expected"); + message.data = $root.tendermint.types.Data.fromObject(object.data); + } + if (object.evidence != null) { + if (typeof object.evidence !== "object") + throw TypeError(".tendermint.types.Block.evidence: object expected"); + message.evidence = $root.tendermint.types.EvidenceList.fromObject(object.evidence); + } + if (object.lastCommit != null) { + if (typeof object.lastCommit !== "object") + throw TypeError(".tendermint.types.Block.lastCommit: object expected"); + message.lastCommit = $root.tendermint.types.Commit.fromObject(object.lastCommit); + } + return message; + }; + + /** + * Creates a plain object from a Block message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.Block + * @static + * @param {tendermint.types.Block} message Block + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Block.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.header = null; + object.data = null; + object.evidence = null; + object.lastCommit = null; + } + if (message.header != null && message.hasOwnProperty("header")) + object.header = $root.tendermint.types.Header.toObject(message.header, options); + if (message.data != null && message.hasOwnProperty("data")) + object.data = $root.tendermint.types.Data.toObject(message.data, options); + if (message.evidence != null && message.hasOwnProperty("evidence")) + object.evidence = $root.tendermint.types.EvidenceList.toObject(message.evidence, options); + if (message.lastCommit != null && message.hasOwnProperty("lastCommit")) + object.lastCommit = $root.tendermint.types.Commit.toObject(message.lastCommit, options); + return object; + }; + + /** + * Converts this Block to JSON. + * @function toJSON + * @memberof tendermint.types.Block + * @instance + * @returns {Object.} JSON object + */ + Block.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Block; + })(types.Block || {}); + + types.Evidence = (function(Evidence) { + + /** + * Properties of an Evidence. + * @memberof tendermint.types + * @interface IEvidence + * @property {tendermint.types.IDuplicateVoteEvidence|null} [duplicateVoteEvidence] Evidence duplicateVoteEvidence + * @property {tendermint.types.ILightClientAttackEvidence|null} [lightClientAttackEvidence] Evidence lightClientAttackEvidence + */ + + /** + * Constructs a new Evidence. + * @memberof tendermint.types + * @classdesc Represents an Evidence. + * @implements IEvidence + * @constructor + * @param {tendermint.types.IEvidence=} [properties] Properties to set + */ + function Evidence(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Evidence duplicateVoteEvidence. + * @member {tendermint.types.IDuplicateVoteEvidence|null|undefined} duplicateVoteEvidence + * @memberof tendermint.types.Evidence + * @instance + */ + Evidence.prototype.duplicateVoteEvidence = null; + + /** + * Evidence lightClientAttackEvidence. + * @member {tendermint.types.ILightClientAttackEvidence|null|undefined} lightClientAttackEvidence + * @memberof tendermint.types.Evidence + * @instance + */ + Evidence.prototype.lightClientAttackEvidence = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Evidence sum. + * @member {"duplicateVoteEvidence"|"lightClientAttackEvidence"|undefined} sum + * @memberof tendermint.types.Evidence + * @instance + */ + Object.defineProperty(Evidence.prototype, "sum", { + get: $util.oneOfGetter($oneOfFields = ["duplicateVoteEvidence", "lightClientAttackEvidence"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Evidence instance using the specified properties. + * @function create + * @memberof tendermint.types.Evidence + * @static + * @param {tendermint.types.IEvidence=} [properties] Properties to set + * @returns {tendermint.types.Evidence} Evidence instance + */ + Evidence.create = function create(properties) { + return new Evidence(properties); + }; + + /** + * Encodes the specified Evidence message. Does not implicitly {@link tendermint.types.Evidence.verify|verify} messages. + * @function encode + * @memberof tendermint.types.Evidence + * @static + * @param {tendermint.types.IEvidence} message Evidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Evidence.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.duplicateVoteEvidence != null && Object.hasOwnProperty.call(message, "duplicateVoteEvidence")) + $root.tendermint.types.DuplicateVoteEvidence.encode(message.duplicateVoteEvidence, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.lightClientAttackEvidence != null && Object.hasOwnProperty.call(message, "lightClientAttackEvidence")) + $root.tendermint.types.LightClientAttackEvidence.encode(message.lightClientAttackEvidence, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Evidence message, length delimited. Does not implicitly {@link tendermint.types.Evidence.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.Evidence + * @static + * @param {tendermint.types.IEvidence} message Evidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Evidence.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Evidence message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.Evidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.Evidence} Evidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Evidence.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Evidence(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.duplicateVoteEvidence = $root.tendermint.types.DuplicateVoteEvidence.decode(reader, reader.uint32()); + break; + case 2: + message.lightClientAttackEvidence = $root.tendermint.types.LightClientAttackEvidence.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Evidence message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.Evidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.Evidence} Evidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Evidence.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Evidence message. + * @function verify + * @memberof tendermint.types.Evidence + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Evidence.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.duplicateVoteEvidence != null && message.hasOwnProperty("duplicateVoteEvidence")) { + properties.sum = 1; + { + var error = $root.tendermint.types.DuplicateVoteEvidence.verify(message.duplicateVoteEvidence); + if (error) + return "duplicateVoteEvidence." + error; + } + } + if (message.lightClientAttackEvidence != null && message.hasOwnProperty("lightClientAttackEvidence")) { + if (properties.sum === 1) + return "sum: multiple values"; + properties.sum = 1; + { + var error = $root.tendermint.types.LightClientAttackEvidence.verify(message.lightClientAttackEvidence); + if (error) + return "lightClientAttackEvidence." + error; + } + } + return null; + }; + + /** + * Creates an Evidence message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.Evidence + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.Evidence} Evidence + */ + Evidence.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.Evidence) + return object; + var message = new $root.tendermint.types.Evidence(); + if (object.duplicateVoteEvidence != null) { + if (typeof object.duplicateVoteEvidence !== "object") + throw TypeError(".tendermint.types.Evidence.duplicateVoteEvidence: object expected"); + message.duplicateVoteEvidence = $root.tendermint.types.DuplicateVoteEvidence.fromObject(object.duplicateVoteEvidence); + } + if (object.lightClientAttackEvidence != null) { + if (typeof object.lightClientAttackEvidence !== "object") + throw TypeError(".tendermint.types.Evidence.lightClientAttackEvidence: object expected"); + message.lightClientAttackEvidence = $root.tendermint.types.LightClientAttackEvidence.fromObject(object.lightClientAttackEvidence); + } + return message; + }; + + /** + * Creates a plain object from an Evidence message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.Evidence + * @static + * @param {tendermint.types.Evidence} message Evidence + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Evidence.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.duplicateVoteEvidence != null && message.hasOwnProperty("duplicateVoteEvidence")) { + object.duplicateVoteEvidence = $root.tendermint.types.DuplicateVoteEvidence.toObject(message.duplicateVoteEvidence, options); + if (options.oneofs) + object.sum = "duplicateVoteEvidence"; + } + if (message.lightClientAttackEvidence != null && message.hasOwnProperty("lightClientAttackEvidence")) { + object.lightClientAttackEvidence = $root.tendermint.types.LightClientAttackEvidence.toObject(message.lightClientAttackEvidence, options); + if (options.oneofs) + object.sum = "lightClientAttackEvidence"; + } + return object; + }; + + /** + * Converts this Evidence to JSON. + * @function toJSON + * @memberof tendermint.types.Evidence + * @instance + * @returns {Object.} JSON object + */ + Evidence.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Evidence; + })(types.Evidence || {}); + + types.DuplicateVoteEvidence = (function(DuplicateVoteEvidence) { + + /** + * Properties of a DuplicateVoteEvidence. + * @memberof tendermint.types + * @interface IDuplicateVoteEvidence + * @property {tendermint.types.IVote|null} [voteA] DuplicateVoteEvidence voteA + * @property {tendermint.types.IVote|null} [voteB] DuplicateVoteEvidence voteB + * @property {number|Long|null} [totalVotingPower] DuplicateVoteEvidence totalVotingPower + * @property {number|Long|null} [validatorPower] DuplicateVoteEvidence validatorPower + * @property {google.protobuf.ITimestamp|null} [timestamp] DuplicateVoteEvidence timestamp + */ + + /** + * Constructs a new DuplicateVoteEvidence. + * @memberof tendermint.types + * @classdesc Represents a DuplicateVoteEvidence. + * @implements IDuplicateVoteEvidence + * @constructor + * @param {tendermint.types.IDuplicateVoteEvidence=} [properties] Properties to set + */ + function DuplicateVoteEvidence(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DuplicateVoteEvidence voteA. + * @member {tendermint.types.IVote|null|undefined} voteA + * @memberof tendermint.types.DuplicateVoteEvidence + * @instance + */ + DuplicateVoteEvidence.prototype.voteA = null; + + /** + * DuplicateVoteEvidence voteB. + * @member {tendermint.types.IVote|null|undefined} voteB + * @memberof tendermint.types.DuplicateVoteEvidence + * @instance + */ + DuplicateVoteEvidence.prototype.voteB = null; + + /** + * DuplicateVoteEvidence totalVotingPower. + * @member {number|Long} totalVotingPower + * @memberof tendermint.types.DuplicateVoteEvidence + * @instance + */ + DuplicateVoteEvidence.prototype.totalVotingPower = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DuplicateVoteEvidence validatorPower. + * @member {number|Long} validatorPower + * @memberof tendermint.types.DuplicateVoteEvidence + * @instance + */ + DuplicateVoteEvidence.prototype.validatorPower = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DuplicateVoteEvidence timestamp. + * @member {google.protobuf.ITimestamp|null|undefined} timestamp + * @memberof tendermint.types.DuplicateVoteEvidence + * @instance + */ + DuplicateVoteEvidence.prototype.timestamp = null; + + /** + * Creates a new DuplicateVoteEvidence instance using the specified properties. + * @function create + * @memberof tendermint.types.DuplicateVoteEvidence + * @static + * @param {tendermint.types.IDuplicateVoteEvidence=} [properties] Properties to set + * @returns {tendermint.types.DuplicateVoteEvidence} DuplicateVoteEvidence instance + */ + DuplicateVoteEvidence.create = function create(properties) { + return new DuplicateVoteEvidence(properties); + }; + + /** + * Encodes the specified DuplicateVoteEvidence message. Does not implicitly {@link tendermint.types.DuplicateVoteEvidence.verify|verify} messages. + * @function encode + * @memberof tendermint.types.DuplicateVoteEvidence + * @static + * @param {tendermint.types.IDuplicateVoteEvidence} message DuplicateVoteEvidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DuplicateVoteEvidence.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.voteA != null && Object.hasOwnProperty.call(message, "voteA")) + $root.tendermint.types.Vote.encode(message.voteA, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.voteB != null && Object.hasOwnProperty.call(message, "voteB")) + $root.tendermint.types.Vote.encode(message.voteB, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.totalVotingPower != null && Object.hasOwnProperty.call(message, "totalVotingPower")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.totalVotingPower); + if (message.validatorPower != null && Object.hasOwnProperty.call(message, "validatorPower")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.validatorPower); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DuplicateVoteEvidence message, length delimited. Does not implicitly {@link tendermint.types.DuplicateVoteEvidence.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.DuplicateVoteEvidence + * @static + * @param {tendermint.types.IDuplicateVoteEvidence} message DuplicateVoteEvidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DuplicateVoteEvidence.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DuplicateVoteEvidence message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.DuplicateVoteEvidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.DuplicateVoteEvidence} DuplicateVoteEvidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DuplicateVoteEvidence.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.DuplicateVoteEvidence(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.voteA = $root.tendermint.types.Vote.decode(reader, reader.uint32()); + break; + case 2: + message.voteB = $root.tendermint.types.Vote.decode(reader, reader.uint32()); + break; + case 3: + message.totalVotingPower = reader.int64(); + break; + case 4: + message.validatorPower = reader.int64(); + break; + case 5: + message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DuplicateVoteEvidence message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.DuplicateVoteEvidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.DuplicateVoteEvidence} DuplicateVoteEvidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DuplicateVoteEvidence.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DuplicateVoteEvidence message. + * @function verify + * @memberof tendermint.types.DuplicateVoteEvidence + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DuplicateVoteEvidence.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.voteA != null && message.hasOwnProperty("voteA")) { + var error = $root.tendermint.types.Vote.verify(message.voteA); + if (error) + return "voteA." + error; + } + if (message.voteB != null && message.hasOwnProperty("voteB")) { + var error = $root.tendermint.types.Vote.verify(message.voteB); + if (error) + return "voteB." + error; + } + if (message.totalVotingPower != null && message.hasOwnProperty("totalVotingPower")) + if (!$util.isInteger(message.totalVotingPower) && !(message.totalVotingPower && $util.isInteger(message.totalVotingPower.low) && $util.isInteger(message.totalVotingPower.high))) + return "totalVotingPower: integer|Long expected"; + if (message.validatorPower != null && message.hasOwnProperty("validatorPower")) + if (!$util.isInteger(message.validatorPower) && !(message.validatorPower && $util.isInteger(message.validatorPower.low) && $util.isInteger(message.validatorPower.high))) + return "validatorPower: integer|Long expected"; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.timestamp); + if (error) + return "timestamp." + error; + } + return null; + }; + + /** + * Creates a DuplicateVoteEvidence message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.DuplicateVoteEvidence + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.DuplicateVoteEvidence} DuplicateVoteEvidence + */ + DuplicateVoteEvidence.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.DuplicateVoteEvidence) + return object; + var message = new $root.tendermint.types.DuplicateVoteEvidence(); + if (object.voteA != null) { + if (typeof object.voteA !== "object") + throw TypeError(".tendermint.types.DuplicateVoteEvidence.voteA: object expected"); + message.voteA = $root.tendermint.types.Vote.fromObject(object.voteA); + } + if (object.voteB != null) { + if (typeof object.voteB !== "object") + throw TypeError(".tendermint.types.DuplicateVoteEvidence.voteB: object expected"); + message.voteB = $root.tendermint.types.Vote.fromObject(object.voteB); + } + if (object.totalVotingPower != null) + if ($util.Long) + (message.totalVotingPower = $util.Long.fromValue(object.totalVotingPower)).unsigned = false; + else if (typeof object.totalVotingPower === "string") + message.totalVotingPower = parseInt(object.totalVotingPower, 10); + else if (typeof object.totalVotingPower === "number") + message.totalVotingPower = object.totalVotingPower; + else if (typeof object.totalVotingPower === "object") + message.totalVotingPower = new $util.LongBits(object.totalVotingPower.low >>> 0, object.totalVotingPower.high >>> 0).toNumber(); + if (object.validatorPower != null) + if ($util.Long) + (message.validatorPower = $util.Long.fromValue(object.validatorPower)).unsigned = false; + else if (typeof object.validatorPower === "string") + message.validatorPower = parseInt(object.validatorPower, 10); + else if (typeof object.validatorPower === "number") + message.validatorPower = object.validatorPower; + else if (typeof object.validatorPower === "object") + message.validatorPower = new $util.LongBits(object.validatorPower.low >>> 0, object.validatorPower.high >>> 0).toNumber(); + if (object.timestamp != null) { + if (typeof object.timestamp !== "object") + throw TypeError(".tendermint.types.DuplicateVoteEvidence.timestamp: object expected"); + message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); + } + return message; + }; + + /** + * Creates a plain object from a DuplicateVoteEvidence message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.DuplicateVoteEvidence + * @static + * @param {tendermint.types.DuplicateVoteEvidence} message DuplicateVoteEvidence + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DuplicateVoteEvidence.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.voteA = null; + object.voteB = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalVotingPower = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalVotingPower = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.validatorPower = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.validatorPower = options.longs === String ? "0" : 0; + object.timestamp = null; + } + if (message.voteA != null && message.hasOwnProperty("voteA")) + object.voteA = $root.tendermint.types.Vote.toObject(message.voteA, options); + if (message.voteB != null && message.hasOwnProperty("voteB")) + object.voteB = $root.tendermint.types.Vote.toObject(message.voteB, options); + if (message.totalVotingPower != null && message.hasOwnProperty("totalVotingPower")) + if (typeof message.totalVotingPower === "number") + object.totalVotingPower = options.longs === String ? String(message.totalVotingPower) : message.totalVotingPower; + else + object.totalVotingPower = options.longs === String ? $util.Long.prototype.toString.call(message.totalVotingPower) : options.longs === Number ? new $util.LongBits(message.totalVotingPower.low >>> 0, message.totalVotingPower.high >>> 0).toNumber() : message.totalVotingPower; + if (message.validatorPower != null && message.hasOwnProperty("validatorPower")) + if (typeof message.validatorPower === "number") + object.validatorPower = options.longs === String ? String(message.validatorPower) : message.validatorPower; + else + object.validatorPower = options.longs === String ? $util.Long.prototype.toString.call(message.validatorPower) : options.longs === Number ? new $util.LongBits(message.validatorPower.low >>> 0, message.validatorPower.high >>> 0).toNumber() : message.validatorPower; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); + return object; + }; + + /** + * Converts this DuplicateVoteEvidence to JSON. + * @function toJSON + * @memberof tendermint.types.DuplicateVoteEvidence + * @instance + * @returns {Object.} JSON object + */ + DuplicateVoteEvidence.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DuplicateVoteEvidence; + })(types.DuplicateVoteEvidence || {}); + + types.LightClientAttackEvidence = (function(LightClientAttackEvidence) { + + /** + * Properties of a LightClientAttackEvidence. + * @memberof tendermint.types + * @interface ILightClientAttackEvidence + * @property {tendermint.types.ILightBlock|null} [conflictingBlock] LightClientAttackEvidence conflictingBlock + * @property {number|Long|null} [commonHeight] LightClientAttackEvidence commonHeight + * @property {Array.|null} [byzantineValidators] LightClientAttackEvidence byzantineValidators + * @property {number|Long|null} [totalVotingPower] LightClientAttackEvidence totalVotingPower + * @property {google.protobuf.ITimestamp|null} [timestamp] LightClientAttackEvidence timestamp + */ + + /** + * Constructs a new LightClientAttackEvidence. + * @memberof tendermint.types + * @classdesc Represents a LightClientAttackEvidence. + * @implements ILightClientAttackEvidence + * @constructor + * @param {tendermint.types.ILightClientAttackEvidence=} [properties] Properties to set + */ + function LightClientAttackEvidence(properties) { + this.byzantineValidators = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LightClientAttackEvidence conflictingBlock. + * @member {tendermint.types.ILightBlock|null|undefined} conflictingBlock + * @memberof tendermint.types.LightClientAttackEvidence + * @instance + */ + LightClientAttackEvidence.prototype.conflictingBlock = null; + + /** + * LightClientAttackEvidence commonHeight. + * @member {number|Long} commonHeight + * @memberof tendermint.types.LightClientAttackEvidence + * @instance + */ + LightClientAttackEvidence.prototype.commonHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * LightClientAttackEvidence byzantineValidators. + * @member {Array.} byzantineValidators + * @memberof tendermint.types.LightClientAttackEvidence + * @instance + */ + LightClientAttackEvidence.prototype.byzantineValidators = $util.emptyArray; + + /** + * LightClientAttackEvidence totalVotingPower. + * @member {number|Long} totalVotingPower + * @memberof tendermint.types.LightClientAttackEvidence + * @instance + */ + LightClientAttackEvidence.prototype.totalVotingPower = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * LightClientAttackEvidence timestamp. + * @member {google.protobuf.ITimestamp|null|undefined} timestamp + * @memberof tendermint.types.LightClientAttackEvidence + * @instance + */ + LightClientAttackEvidence.prototype.timestamp = null; + + /** + * Creates a new LightClientAttackEvidence instance using the specified properties. + * @function create + * @memberof tendermint.types.LightClientAttackEvidence + * @static + * @param {tendermint.types.ILightClientAttackEvidence=} [properties] Properties to set + * @returns {tendermint.types.LightClientAttackEvidence} LightClientAttackEvidence instance + */ + LightClientAttackEvidence.create = function create(properties) { + return new LightClientAttackEvidence(properties); + }; + + /** + * Encodes the specified LightClientAttackEvidence message. Does not implicitly {@link tendermint.types.LightClientAttackEvidence.verify|verify} messages. + * @function encode + * @memberof tendermint.types.LightClientAttackEvidence + * @static + * @param {tendermint.types.ILightClientAttackEvidence} message LightClientAttackEvidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LightClientAttackEvidence.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conflictingBlock != null && Object.hasOwnProperty.call(message, "conflictingBlock")) + $root.tendermint.types.LightBlock.encode(message.conflictingBlock, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.commonHeight != null && Object.hasOwnProperty.call(message, "commonHeight")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.commonHeight); + if (message.byzantineValidators != null && message.byzantineValidators.length) + for (var i = 0; i < message.byzantineValidators.length; ++i) + $root.tendermint.types.Validator.encode(message.byzantineValidators[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalVotingPower != null && Object.hasOwnProperty.call(message, "totalVotingPower")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.totalVotingPower); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LightClientAttackEvidence message, length delimited. Does not implicitly {@link tendermint.types.LightClientAttackEvidence.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.LightClientAttackEvidence + * @static + * @param {tendermint.types.ILightClientAttackEvidence} message LightClientAttackEvidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LightClientAttackEvidence.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LightClientAttackEvidence message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.LightClientAttackEvidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.LightClientAttackEvidence} LightClientAttackEvidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LightClientAttackEvidence.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.LightClientAttackEvidence(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.conflictingBlock = $root.tendermint.types.LightBlock.decode(reader, reader.uint32()); + break; + case 2: + message.commonHeight = reader.int64(); + break; + case 3: + if (!(message.byzantineValidators && message.byzantineValidators.length)) + message.byzantineValidators = []; + message.byzantineValidators.push($root.tendermint.types.Validator.decode(reader, reader.uint32())); + break; + case 4: + message.totalVotingPower = reader.int64(); + break; + case 5: + message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LightClientAttackEvidence message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.LightClientAttackEvidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.LightClientAttackEvidence} LightClientAttackEvidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LightClientAttackEvidence.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LightClientAttackEvidence message. + * @function verify + * @memberof tendermint.types.LightClientAttackEvidence + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LightClientAttackEvidence.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conflictingBlock != null && message.hasOwnProperty("conflictingBlock")) { + var error = $root.tendermint.types.LightBlock.verify(message.conflictingBlock); + if (error) + return "conflictingBlock." + error; + } + if (message.commonHeight != null && message.hasOwnProperty("commonHeight")) + if (!$util.isInteger(message.commonHeight) && !(message.commonHeight && $util.isInteger(message.commonHeight.low) && $util.isInteger(message.commonHeight.high))) + return "commonHeight: integer|Long expected"; + if (message.byzantineValidators != null && message.hasOwnProperty("byzantineValidators")) { + if (!Array.isArray(message.byzantineValidators)) + return "byzantineValidators: array expected"; + for (var i = 0; i < message.byzantineValidators.length; ++i) { + var error = $root.tendermint.types.Validator.verify(message.byzantineValidators[i]); + if (error) + return "byzantineValidators." + error; + } + } + if (message.totalVotingPower != null && message.hasOwnProperty("totalVotingPower")) + if (!$util.isInteger(message.totalVotingPower) && !(message.totalVotingPower && $util.isInteger(message.totalVotingPower.low) && $util.isInteger(message.totalVotingPower.high))) + return "totalVotingPower: integer|Long expected"; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.timestamp); + if (error) + return "timestamp." + error; + } + return null; + }; + + /** + * Creates a LightClientAttackEvidence message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.LightClientAttackEvidence + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.LightClientAttackEvidence} LightClientAttackEvidence + */ + LightClientAttackEvidence.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.LightClientAttackEvidence) + return object; + var message = new $root.tendermint.types.LightClientAttackEvidence(); + if (object.conflictingBlock != null) { + if (typeof object.conflictingBlock !== "object") + throw TypeError(".tendermint.types.LightClientAttackEvidence.conflictingBlock: object expected"); + message.conflictingBlock = $root.tendermint.types.LightBlock.fromObject(object.conflictingBlock); + } + if (object.commonHeight != null) + if ($util.Long) + (message.commonHeight = $util.Long.fromValue(object.commonHeight)).unsigned = false; + else if (typeof object.commonHeight === "string") + message.commonHeight = parseInt(object.commonHeight, 10); + else if (typeof object.commonHeight === "number") + message.commonHeight = object.commonHeight; + else if (typeof object.commonHeight === "object") + message.commonHeight = new $util.LongBits(object.commonHeight.low >>> 0, object.commonHeight.high >>> 0).toNumber(); + if (object.byzantineValidators) { + if (!Array.isArray(object.byzantineValidators)) + throw TypeError(".tendermint.types.LightClientAttackEvidence.byzantineValidators: array expected"); + message.byzantineValidators = []; + for (var i = 0; i < object.byzantineValidators.length; ++i) { + if (typeof object.byzantineValidators[i] !== "object") + throw TypeError(".tendermint.types.LightClientAttackEvidence.byzantineValidators: object expected"); + message.byzantineValidators[i] = $root.tendermint.types.Validator.fromObject(object.byzantineValidators[i]); + } + } + if (object.totalVotingPower != null) + if ($util.Long) + (message.totalVotingPower = $util.Long.fromValue(object.totalVotingPower)).unsigned = false; + else if (typeof object.totalVotingPower === "string") + message.totalVotingPower = parseInt(object.totalVotingPower, 10); + else if (typeof object.totalVotingPower === "number") + message.totalVotingPower = object.totalVotingPower; + else if (typeof object.totalVotingPower === "object") + message.totalVotingPower = new $util.LongBits(object.totalVotingPower.low >>> 0, object.totalVotingPower.high >>> 0).toNumber(); + if (object.timestamp != null) { + if (typeof object.timestamp !== "object") + throw TypeError(".tendermint.types.LightClientAttackEvidence.timestamp: object expected"); + message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); + } + return message; + }; + + /** + * Creates a plain object from a LightClientAttackEvidence message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.LightClientAttackEvidence + * @static + * @param {tendermint.types.LightClientAttackEvidence} message LightClientAttackEvidence + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LightClientAttackEvidence.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.byzantineValidators = []; + if (options.defaults) { + object.conflictingBlock = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.commonHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.commonHeight = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalVotingPower = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalVotingPower = options.longs === String ? "0" : 0; + object.timestamp = null; + } + if (message.conflictingBlock != null && message.hasOwnProperty("conflictingBlock")) + object.conflictingBlock = $root.tendermint.types.LightBlock.toObject(message.conflictingBlock, options); + if (message.commonHeight != null && message.hasOwnProperty("commonHeight")) + if (typeof message.commonHeight === "number") + object.commonHeight = options.longs === String ? String(message.commonHeight) : message.commonHeight; + else + object.commonHeight = options.longs === String ? $util.Long.prototype.toString.call(message.commonHeight) : options.longs === Number ? new $util.LongBits(message.commonHeight.low >>> 0, message.commonHeight.high >>> 0).toNumber() : message.commonHeight; + if (message.byzantineValidators && message.byzantineValidators.length) { + object.byzantineValidators = []; + for (var j = 0; j < message.byzantineValidators.length; ++j) + object.byzantineValidators[j] = $root.tendermint.types.Validator.toObject(message.byzantineValidators[j], options); + } + if (message.totalVotingPower != null && message.hasOwnProperty("totalVotingPower")) + if (typeof message.totalVotingPower === "number") + object.totalVotingPower = options.longs === String ? String(message.totalVotingPower) : message.totalVotingPower; + else + object.totalVotingPower = options.longs === String ? $util.Long.prototype.toString.call(message.totalVotingPower) : options.longs === Number ? new $util.LongBits(message.totalVotingPower.low >>> 0, message.totalVotingPower.high >>> 0).toNumber() : message.totalVotingPower; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); + return object; + }; + + /** + * Converts this LightClientAttackEvidence to JSON. + * @function toJSON + * @memberof tendermint.types.LightClientAttackEvidence + * @instance + * @returns {Object.} JSON object + */ + LightClientAttackEvidence.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LightClientAttackEvidence; + })(types.LightClientAttackEvidence || {}); + + types.EvidenceList = (function(EvidenceList) { + + /** + * Properties of an EvidenceList. + * @memberof tendermint.types + * @interface IEvidenceList + * @property {Array.|null} [evidence] EvidenceList evidence + */ + + /** + * Constructs a new EvidenceList. + * @memberof tendermint.types + * @classdesc Represents an EvidenceList. + * @implements IEvidenceList + * @constructor + * @param {tendermint.types.IEvidenceList=} [properties] Properties to set + */ + function EvidenceList(properties) { + this.evidence = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvidenceList evidence. + * @member {Array.} evidence + * @memberof tendermint.types.EvidenceList + * @instance + */ + EvidenceList.prototype.evidence = $util.emptyArray; + + /** + * Creates a new EvidenceList instance using the specified properties. + * @function create + * @memberof tendermint.types.EvidenceList + * @static + * @param {tendermint.types.IEvidenceList=} [properties] Properties to set + * @returns {tendermint.types.EvidenceList} EvidenceList instance + */ + EvidenceList.create = function create(properties) { + return new EvidenceList(properties); + }; + + /** + * Encodes the specified EvidenceList message. Does not implicitly {@link tendermint.types.EvidenceList.verify|verify} messages. + * @function encode + * @memberof tendermint.types.EvidenceList + * @static + * @param {tendermint.types.IEvidenceList} message EvidenceList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvidenceList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evidence != null && message.evidence.length) + for (var i = 0; i < message.evidence.length; ++i) + $root.tendermint.types.Evidence.encode(message.evidence[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EvidenceList message, length delimited. Does not implicitly {@link tendermint.types.EvidenceList.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.EvidenceList + * @static + * @param {tendermint.types.IEvidenceList} message EvidenceList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvidenceList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvidenceList message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.EvidenceList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.EvidenceList} EvidenceList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvidenceList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.EvidenceList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.evidence && message.evidence.length)) + message.evidence = []; + message.evidence.push($root.tendermint.types.Evidence.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvidenceList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.EvidenceList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.EvidenceList} EvidenceList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvidenceList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvidenceList message. + * @function verify + * @memberof tendermint.types.EvidenceList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvidenceList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evidence != null && message.hasOwnProperty("evidence")) { + if (!Array.isArray(message.evidence)) + return "evidence: array expected"; + for (var i = 0; i < message.evidence.length; ++i) { + var error = $root.tendermint.types.Evidence.verify(message.evidence[i]); + if (error) + return "evidence." + error; + } + } + return null; + }; + + /** + * Creates an EvidenceList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.EvidenceList + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.EvidenceList} EvidenceList + */ + EvidenceList.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.EvidenceList) + return object; + var message = new $root.tendermint.types.EvidenceList(); + if (object.evidence) { + if (!Array.isArray(object.evidence)) + throw TypeError(".tendermint.types.EvidenceList.evidence: array expected"); + message.evidence = []; + for (var i = 0; i < object.evidence.length; ++i) { + if (typeof object.evidence[i] !== "object") + throw TypeError(".tendermint.types.EvidenceList.evidence: object expected"); + message.evidence[i] = $root.tendermint.types.Evidence.fromObject(object.evidence[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EvidenceList message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.EvidenceList + * @static + * @param {tendermint.types.EvidenceList} message EvidenceList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvidenceList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.evidence = []; + if (message.evidence && message.evidence.length) { + object.evidence = []; + for (var j = 0; j < message.evidence.length; ++j) + object.evidence[j] = $root.tendermint.types.Evidence.toObject(message.evidence[j], options); + } + return object; + }; + + /** + * Converts this EvidenceList to JSON. + * @function toJSON + * @memberof tendermint.types.EvidenceList + * @instance + * @returns {Object.} JSON object + */ + EvidenceList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EvidenceList; + })(types.EvidenceList || {}); + + types.ConsensusParams = (function(ConsensusParams) { + + /** + * Properties of a ConsensusParams. + * @memberof tendermint.types + * @interface IConsensusParams + * @property {tendermint.types.IBlockParams|null} [block] ConsensusParams block + * @property {tendermint.types.IEvidenceParams|null} [evidence] ConsensusParams evidence + * @property {tendermint.types.IValidatorParams|null} [validator] ConsensusParams validator + * @property {tendermint.types.IVersionParams|null} [version] ConsensusParams version + */ + + /** + * Constructs a new ConsensusParams. + * @memberof tendermint.types + * @classdesc Represents a ConsensusParams. + * @implements IConsensusParams + * @constructor + * @param {tendermint.types.IConsensusParams=} [properties] Properties to set + */ + function ConsensusParams(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConsensusParams block. + * @member {tendermint.types.IBlockParams|null|undefined} block + * @memberof tendermint.types.ConsensusParams + * @instance + */ + ConsensusParams.prototype.block = null; + + /** + * ConsensusParams evidence. + * @member {tendermint.types.IEvidenceParams|null|undefined} evidence + * @memberof tendermint.types.ConsensusParams + * @instance + */ + ConsensusParams.prototype.evidence = null; + + /** + * ConsensusParams validator. + * @member {tendermint.types.IValidatorParams|null|undefined} validator + * @memberof tendermint.types.ConsensusParams + * @instance + */ + ConsensusParams.prototype.validator = null; + + /** + * ConsensusParams version. + * @member {tendermint.types.IVersionParams|null|undefined} version + * @memberof tendermint.types.ConsensusParams + * @instance + */ + ConsensusParams.prototype.version = null; + + /** + * Creates a new ConsensusParams instance using the specified properties. + * @function create + * @memberof tendermint.types.ConsensusParams + * @static + * @param {tendermint.types.IConsensusParams=} [properties] Properties to set + * @returns {tendermint.types.ConsensusParams} ConsensusParams instance + */ + ConsensusParams.create = function create(properties) { + return new ConsensusParams(properties); + }; + + /** + * Encodes the specified ConsensusParams message. Does not implicitly {@link tendermint.types.ConsensusParams.verify|verify} messages. + * @function encode + * @memberof tendermint.types.ConsensusParams + * @static + * @param {tendermint.types.IConsensusParams} message ConsensusParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.block != null && Object.hasOwnProperty.call(message, "block")) + $root.tendermint.types.BlockParams.encode(message.block, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.evidence != null && Object.hasOwnProperty.call(message, "evidence")) + $root.tendermint.types.EvidenceParams.encode(message.evidence, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.validator != null && Object.hasOwnProperty.call(message, "validator")) + $root.tendermint.types.ValidatorParams.encode(message.validator, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + $root.tendermint.types.VersionParams.encode(message.version, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConsensusParams message, length delimited. Does not implicitly {@link tendermint.types.ConsensusParams.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.ConsensusParams + * @static + * @param {tendermint.types.IConsensusParams} message ConsensusParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConsensusParams message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.ConsensusParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.ConsensusParams} ConsensusParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.ConsensusParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.block = $root.tendermint.types.BlockParams.decode(reader, reader.uint32()); + break; + case 2: + message.evidence = $root.tendermint.types.EvidenceParams.decode(reader, reader.uint32()); + break; + case 3: + message.validator = $root.tendermint.types.ValidatorParams.decode(reader, reader.uint32()); + break; + case 4: + message.version = $root.tendermint.types.VersionParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConsensusParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.ConsensusParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.ConsensusParams} ConsensusParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConsensusParams message. + * @function verify + * @memberof tendermint.types.ConsensusParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConsensusParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.block != null && message.hasOwnProperty("block")) { + var error = $root.tendermint.types.BlockParams.verify(message.block); + if (error) + return "block." + error; + } + if (message.evidence != null && message.hasOwnProperty("evidence")) { + var error = $root.tendermint.types.EvidenceParams.verify(message.evidence); + if (error) + return "evidence." + error; + } + if (message.validator != null && message.hasOwnProperty("validator")) { + var error = $root.tendermint.types.ValidatorParams.verify(message.validator); + if (error) + return "validator." + error; + } + if (message.version != null && message.hasOwnProperty("version")) { + var error = $root.tendermint.types.VersionParams.verify(message.version); + if (error) + return "version." + error; + } + return null; + }; + + /** + * Creates a ConsensusParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.ConsensusParams + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.ConsensusParams} ConsensusParams + */ + ConsensusParams.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.ConsensusParams) + return object; + var message = new $root.tendermint.types.ConsensusParams(); + if (object.block != null) { + if (typeof object.block !== "object") + throw TypeError(".tendermint.types.ConsensusParams.block: object expected"); + message.block = $root.tendermint.types.BlockParams.fromObject(object.block); + } + if (object.evidence != null) { + if (typeof object.evidence !== "object") + throw TypeError(".tendermint.types.ConsensusParams.evidence: object expected"); + message.evidence = $root.tendermint.types.EvidenceParams.fromObject(object.evidence); + } + if (object.validator != null) { + if (typeof object.validator !== "object") + throw TypeError(".tendermint.types.ConsensusParams.validator: object expected"); + message.validator = $root.tendermint.types.ValidatorParams.fromObject(object.validator); + } + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".tendermint.types.ConsensusParams.version: object expected"); + message.version = $root.tendermint.types.VersionParams.fromObject(object.version); + } + return message; + }; + + /** + * Creates a plain object from a ConsensusParams message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.ConsensusParams + * @static + * @param {tendermint.types.ConsensusParams} message ConsensusParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConsensusParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.block = null; + object.evidence = null; + object.validator = null; + object.version = null; + } + if (message.block != null && message.hasOwnProperty("block")) + object.block = $root.tendermint.types.BlockParams.toObject(message.block, options); + if (message.evidence != null && message.hasOwnProperty("evidence")) + object.evidence = $root.tendermint.types.EvidenceParams.toObject(message.evidence, options); + if (message.validator != null && message.hasOwnProperty("validator")) + object.validator = $root.tendermint.types.ValidatorParams.toObject(message.validator, options); + if (message.version != null && message.hasOwnProperty("version")) + object.version = $root.tendermint.types.VersionParams.toObject(message.version, options); + return object; + }; + + /** + * Converts this ConsensusParams to JSON. + * @function toJSON + * @memberof tendermint.types.ConsensusParams + * @instance + * @returns {Object.} JSON object + */ + ConsensusParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ConsensusParams; + })(types.ConsensusParams || {}); + + types.BlockParams = (function(BlockParams) { + + /** + * Properties of a BlockParams. + * @memberof tendermint.types + * @interface IBlockParams + * @property {number|Long|null} [maxBytes] BlockParams maxBytes + * @property {number|Long|null} [maxGas] BlockParams maxGas + * @property {number|Long|null} [timeIotaMs] BlockParams timeIotaMs + */ + + /** + * Constructs a new BlockParams. + * @memberof tendermint.types + * @classdesc Represents a BlockParams. + * @implements IBlockParams + * @constructor + * @param {tendermint.types.IBlockParams=} [properties] Properties to set + */ + function BlockParams(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BlockParams maxBytes. + * @member {number|Long} maxBytes + * @memberof tendermint.types.BlockParams + * @instance + */ + BlockParams.prototype.maxBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BlockParams maxGas. + * @member {number|Long} maxGas + * @memberof tendermint.types.BlockParams + * @instance + */ + BlockParams.prototype.maxGas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BlockParams timeIotaMs. + * @member {number|Long} timeIotaMs + * @memberof tendermint.types.BlockParams + * @instance + */ + BlockParams.prototype.timeIotaMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new BlockParams instance using the specified properties. + * @function create + * @memberof tendermint.types.BlockParams + * @static + * @param {tendermint.types.IBlockParams=} [properties] Properties to set + * @returns {tendermint.types.BlockParams} BlockParams instance + */ + BlockParams.create = function create(properties) { + return new BlockParams(properties); + }; + + /** + * Encodes the specified BlockParams message. Does not implicitly {@link tendermint.types.BlockParams.verify|verify} messages. + * @function encode + * @memberof tendermint.types.BlockParams + * @static + * @param {tendermint.types.IBlockParams} message BlockParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlockParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxBytes != null && Object.hasOwnProperty.call(message, "maxBytes")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.maxBytes); + if (message.maxGas != null && Object.hasOwnProperty.call(message, "maxGas")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.maxGas); + if (message.timeIotaMs != null && Object.hasOwnProperty.call(message, "timeIotaMs")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.timeIotaMs); + return writer; + }; + + /** + * Encodes the specified BlockParams message, length delimited. Does not implicitly {@link tendermint.types.BlockParams.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.BlockParams + * @static + * @param {tendermint.types.IBlockParams} message BlockParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlockParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BlockParams message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.BlockParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.BlockParams} BlockParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlockParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.BlockParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxBytes = reader.int64(); + break; + case 2: + message.maxGas = reader.int64(); + break; + case 3: + message.timeIotaMs = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BlockParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.BlockParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.BlockParams} BlockParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlockParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BlockParams message. + * @function verify + * @memberof tendermint.types.BlockParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BlockParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + if (!$util.isInteger(message.maxBytes) && !(message.maxBytes && $util.isInteger(message.maxBytes.low) && $util.isInteger(message.maxBytes.high))) + return "maxBytes: integer|Long expected"; + if (message.maxGas != null && message.hasOwnProperty("maxGas")) + if (!$util.isInteger(message.maxGas) && !(message.maxGas && $util.isInteger(message.maxGas.low) && $util.isInteger(message.maxGas.high))) + return "maxGas: integer|Long expected"; + if (message.timeIotaMs != null && message.hasOwnProperty("timeIotaMs")) + if (!$util.isInteger(message.timeIotaMs) && !(message.timeIotaMs && $util.isInteger(message.timeIotaMs.low) && $util.isInteger(message.timeIotaMs.high))) + return "timeIotaMs: integer|Long expected"; + return null; + }; + + /** + * Creates a BlockParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.BlockParams + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.BlockParams} BlockParams + */ + BlockParams.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.BlockParams) + return object; + var message = new $root.tendermint.types.BlockParams(); + if (object.maxBytes != null) + if ($util.Long) + (message.maxBytes = $util.Long.fromValue(object.maxBytes)).unsigned = false; + else if (typeof object.maxBytes === "string") + message.maxBytes = parseInt(object.maxBytes, 10); + else if (typeof object.maxBytes === "number") + message.maxBytes = object.maxBytes; + else if (typeof object.maxBytes === "object") + message.maxBytes = new $util.LongBits(object.maxBytes.low >>> 0, object.maxBytes.high >>> 0).toNumber(); + if (object.maxGas != null) + if ($util.Long) + (message.maxGas = $util.Long.fromValue(object.maxGas)).unsigned = false; + else if (typeof object.maxGas === "string") + message.maxGas = parseInt(object.maxGas, 10); + else if (typeof object.maxGas === "number") + message.maxGas = object.maxGas; + else if (typeof object.maxGas === "object") + message.maxGas = new $util.LongBits(object.maxGas.low >>> 0, object.maxGas.high >>> 0).toNumber(); + if (object.timeIotaMs != null) + if ($util.Long) + (message.timeIotaMs = $util.Long.fromValue(object.timeIotaMs)).unsigned = false; + else if (typeof object.timeIotaMs === "string") + message.timeIotaMs = parseInt(object.timeIotaMs, 10); + else if (typeof object.timeIotaMs === "number") + message.timeIotaMs = object.timeIotaMs; + else if (typeof object.timeIotaMs === "object") + message.timeIotaMs = new $util.LongBits(object.timeIotaMs.low >>> 0, object.timeIotaMs.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a BlockParams message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.BlockParams + * @static + * @param {tendermint.types.BlockParams} message BlockParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BlockParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxBytes = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxGas = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxGas = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.timeIotaMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timeIotaMs = options.longs === String ? "0" : 0; + } + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + if (typeof message.maxBytes === "number") + object.maxBytes = options.longs === String ? String(message.maxBytes) : message.maxBytes; + else + object.maxBytes = options.longs === String ? $util.Long.prototype.toString.call(message.maxBytes) : options.longs === Number ? new $util.LongBits(message.maxBytes.low >>> 0, message.maxBytes.high >>> 0).toNumber() : message.maxBytes; + if (message.maxGas != null && message.hasOwnProperty("maxGas")) + if (typeof message.maxGas === "number") + object.maxGas = options.longs === String ? String(message.maxGas) : message.maxGas; + else + object.maxGas = options.longs === String ? $util.Long.prototype.toString.call(message.maxGas) : options.longs === Number ? new $util.LongBits(message.maxGas.low >>> 0, message.maxGas.high >>> 0).toNumber() : message.maxGas; + if (message.timeIotaMs != null && message.hasOwnProperty("timeIotaMs")) + if (typeof message.timeIotaMs === "number") + object.timeIotaMs = options.longs === String ? String(message.timeIotaMs) : message.timeIotaMs; + else + object.timeIotaMs = options.longs === String ? $util.Long.prototype.toString.call(message.timeIotaMs) : options.longs === Number ? new $util.LongBits(message.timeIotaMs.low >>> 0, message.timeIotaMs.high >>> 0).toNumber() : message.timeIotaMs; + return object; + }; + + /** + * Converts this BlockParams to JSON. + * @function toJSON + * @memberof tendermint.types.BlockParams + * @instance + * @returns {Object.} JSON object + */ + BlockParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BlockParams; + })(types.BlockParams || {}); + + types.EvidenceParams = (function(EvidenceParams) { + + /** + * Properties of an EvidenceParams. + * @memberof tendermint.types + * @interface IEvidenceParams + * @property {number|Long|null} [maxAgeNumBlocks] EvidenceParams maxAgeNumBlocks + * @property {google.protobuf.IDuration|null} [maxAgeDuration] EvidenceParams maxAgeDuration + * @property {number|Long|null} [maxBytes] EvidenceParams maxBytes + */ + + /** + * Constructs a new EvidenceParams. + * @memberof tendermint.types + * @classdesc Represents an EvidenceParams. + * @implements IEvidenceParams + * @constructor + * @param {tendermint.types.IEvidenceParams=} [properties] Properties to set + */ + function EvidenceParams(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvidenceParams maxAgeNumBlocks. + * @member {number|Long} maxAgeNumBlocks + * @memberof tendermint.types.EvidenceParams + * @instance + */ + EvidenceParams.prototype.maxAgeNumBlocks = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * EvidenceParams maxAgeDuration. + * @member {google.protobuf.IDuration|null|undefined} maxAgeDuration + * @memberof tendermint.types.EvidenceParams + * @instance + */ + EvidenceParams.prototype.maxAgeDuration = null; + + /** + * EvidenceParams maxBytes. + * @member {number|Long} maxBytes + * @memberof tendermint.types.EvidenceParams + * @instance + */ + EvidenceParams.prototype.maxBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new EvidenceParams instance using the specified properties. + * @function create + * @memberof tendermint.types.EvidenceParams + * @static + * @param {tendermint.types.IEvidenceParams=} [properties] Properties to set + * @returns {tendermint.types.EvidenceParams} EvidenceParams instance + */ + EvidenceParams.create = function create(properties) { + return new EvidenceParams(properties); + }; + + /** + * Encodes the specified EvidenceParams message. Does not implicitly {@link tendermint.types.EvidenceParams.verify|verify} messages. + * @function encode + * @memberof tendermint.types.EvidenceParams + * @static + * @param {tendermint.types.IEvidenceParams} message EvidenceParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvidenceParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxAgeNumBlocks != null && Object.hasOwnProperty.call(message, "maxAgeNumBlocks")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.maxAgeNumBlocks); + if (message.maxAgeDuration != null && Object.hasOwnProperty.call(message, "maxAgeDuration")) + $root.google.protobuf.Duration.encode(message.maxAgeDuration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.maxBytes != null && Object.hasOwnProperty.call(message, "maxBytes")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.maxBytes); + return writer; + }; + + /** + * Encodes the specified EvidenceParams message, length delimited. Does not implicitly {@link tendermint.types.EvidenceParams.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.EvidenceParams + * @static + * @param {tendermint.types.IEvidenceParams} message EvidenceParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvidenceParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvidenceParams message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.EvidenceParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.EvidenceParams} EvidenceParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvidenceParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.EvidenceParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxAgeNumBlocks = reader.int64(); + break; + case 2: + message.maxAgeDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 3: + message.maxBytes = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvidenceParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.EvidenceParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.EvidenceParams} EvidenceParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvidenceParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvidenceParams message. + * @function verify + * @memberof tendermint.types.EvidenceParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvidenceParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maxAgeNumBlocks != null && message.hasOwnProperty("maxAgeNumBlocks")) + if (!$util.isInteger(message.maxAgeNumBlocks) && !(message.maxAgeNumBlocks && $util.isInteger(message.maxAgeNumBlocks.low) && $util.isInteger(message.maxAgeNumBlocks.high))) + return "maxAgeNumBlocks: integer|Long expected"; + if (message.maxAgeDuration != null && message.hasOwnProperty("maxAgeDuration")) { + var error = $root.google.protobuf.Duration.verify(message.maxAgeDuration); + if (error) + return "maxAgeDuration." + error; + } + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + if (!$util.isInteger(message.maxBytes) && !(message.maxBytes && $util.isInteger(message.maxBytes.low) && $util.isInteger(message.maxBytes.high))) + return "maxBytes: integer|Long expected"; + return null; + }; + + /** + * Creates an EvidenceParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.EvidenceParams + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.EvidenceParams} EvidenceParams + */ + EvidenceParams.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.EvidenceParams) + return object; + var message = new $root.tendermint.types.EvidenceParams(); + if (object.maxAgeNumBlocks != null) + if ($util.Long) + (message.maxAgeNumBlocks = $util.Long.fromValue(object.maxAgeNumBlocks)).unsigned = false; + else if (typeof object.maxAgeNumBlocks === "string") + message.maxAgeNumBlocks = parseInt(object.maxAgeNumBlocks, 10); + else if (typeof object.maxAgeNumBlocks === "number") + message.maxAgeNumBlocks = object.maxAgeNumBlocks; + else if (typeof object.maxAgeNumBlocks === "object") + message.maxAgeNumBlocks = new $util.LongBits(object.maxAgeNumBlocks.low >>> 0, object.maxAgeNumBlocks.high >>> 0).toNumber(); + if (object.maxAgeDuration != null) { + if (typeof object.maxAgeDuration !== "object") + throw TypeError(".tendermint.types.EvidenceParams.maxAgeDuration: object expected"); + message.maxAgeDuration = $root.google.protobuf.Duration.fromObject(object.maxAgeDuration); + } + if (object.maxBytes != null) + if ($util.Long) + (message.maxBytes = $util.Long.fromValue(object.maxBytes)).unsigned = false; + else if (typeof object.maxBytes === "string") + message.maxBytes = parseInt(object.maxBytes, 10); + else if (typeof object.maxBytes === "number") + message.maxBytes = object.maxBytes; + else if (typeof object.maxBytes === "object") + message.maxBytes = new $util.LongBits(object.maxBytes.low >>> 0, object.maxBytes.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an EvidenceParams message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.EvidenceParams + * @static + * @param {tendermint.types.EvidenceParams} message EvidenceParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvidenceParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxAgeNumBlocks = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxAgeNumBlocks = options.longs === String ? "0" : 0; + object.maxAgeDuration = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxBytes = options.longs === String ? "0" : 0; + } + if (message.maxAgeNumBlocks != null && message.hasOwnProperty("maxAgeNumBlocks")) + if (typeof message.maxAgeNumBlocks === "number") + object.maxAgeNumBlocks = options.longs === String ? String(message.maxAgeNumBlocks) : message.maxAgeNumBlocks; + else + object.maxAgeNumBlocks = options.longs === String ? $util.Long.prototype.toString.call(message.maxAgeNumBlocks) : options.longs === Number ? new $util.LongBits(message.maxAgeNumBlocks.low >>> 0, message.maxAgeNumBlocks.high >>> 0).toNumber() : message.maxAgeNumBlocks; + if (message.maxAgeDuration != null && message.hasOwnProperty("maxAgeDuration")) + object.maxAgeDuration = $root.google.protobuf.Duration.toObject(message.maxAgeDuration, options); + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + if (typeof message.maxBytes === "number") + object.maxBytes = options.longs === String ? String(message.maxBytes) : message.maxBytes; + else + object.maxBytes = options.longs === String ? $util.Long.prototype.toString.call(message.maxBytes) : options.longs === Number ? new $util.LongBits(message.maxBytes.low >>> 0, message.maxBytes.high >>> 0).toNumber() : message.maxBytes; + return object; + }; + + /** + * Converts this EvidenceParams to JSON. + * @function toJSON + * @memberof tendermint.types.EvidenceParams + * @instance + * @returns {Object.} JSON object + */ + EvidenceParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EvidenceParams; + })(types.EvidenceParams || {}); + + types.ValidatorParams = (function(ValidatorParams) { + + /** + * Properties of a ValidatorParams. + * @memberof tendermint.types + * @interface IValidatorParams + * @property {Array.|null} [pubKeyTypes] ValidatorParams pubKeyTypes + */ + + /** + * Constructs a new ValidatorParams. + * @memberof tendermint.types + * @classdesc Represents a ValidatorParams. + * @implements IValidatorParams + * @constructor + * @param {tendermint.types.IValidatorParams=} [properties] Properties to set + */ + function ValidatorParams(properties) { + this.pubKeyTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidatorParams pubKeyTypes. + * @member {Array.} pubKeyTypes + * @memberof tendermint.types.ValidatorParams + * @instance + */ + ValidatorParams.prototype.pubKeyTypes = $util.emptyArray; + + /** + * Creates a new ValidatorParams instance using the specified properties. + * @function create + * @memberof tendermint.types.ValidatorParams + * @static + * @param {tendermint.types.IValidatorParams=} [properties] Properties to set + * @returns {tendermint.types.ValidatorParams} ValidatorParams instance + */ + ValidatorParams.create = function create(properties) { + return new ValidatorParams(properties); + }; + + /** + * Encodes the specified ValidatorParams message. Does not implicitly {@link tendermint.types.ValidatorParams.verify|verify} messages. + * @function encode + * @memberof tendermint.types.ValidatorParams + * @static + * @param {tendermint.types.IValidatorParams} message ValidatorParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pubKeyTypes != null && message.pubKeyTypes.length) + for (var i = 0; i < message.pubKeyTypes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pubKeyTypes[i]); + return writer; + }; + + /** + * Encodes the specified ValidatorParams message, length delimited. Does not implicitly {@link tendermint.types.ValidatorParams.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.ValidatorParams + * @static + * @param {tendermint.types.IValidatorParams} message ValidatorParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidatorParams message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.ValidatorParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.ValidatorParams} ValidatorParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.ValidatorParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.pubKeyTypes && message.pubKeyTypes.length)) + message.pubKeyTypes = []; + message.pubKeyTypes.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidatorParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.ValidatorParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.ValidatorParams} ValidatorParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidatorParams message. + * @function verify + * @memberof tendermint.types.ValidatorParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidatorParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pubKeyTypes != null && message.hasOwnProperty("pubKeyTypes")) { + if (!Array.isArray(message.pubKeyTypes)) + return "pubKeyTypes: array expected"; + for (var i = 0; i < message.pubKeyTypes.length; ++i) + if (!$util.isString(message.pubKeyTypes[i])) + return "pubKeyTypes: string[] expected"; + } + return null; + }; + + /** + * Creates a ValidatorParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.ValidatorParams + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.ValidatorParams} ValidatorParams + */ + ValidatorParams.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.ValidatorParams) + return object; + var message = new $root.tendermint.types.ValidatorParams(); + if (object.pubKeyTypes) { + if (!Array.isArray(object.pubKeyTypes)) + throw TypeError(".tendermint.types.ValidatorParams.pubKeyTypes: array expected"); + message.pubKeyTypes = []; + for (var i = 0; i < object.pubKeyTypes.length; ++i) + message.pubKeyTypes[i] = String(object.pubKeyTypes[i]); + } + return message; + }; + + /** + * Creates a plain object from a ValidatorParams message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.ValidatorParams + * @static + * @param {tendermint.types.ValidatorParams} message ValidatorParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidatorParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pubKeyTypes = []; + if (message.pubKeyTypes && message.pubKeyTypes.length) { + object.pubKeyTypes = []; + for (var j = 0; j < message.pubKeyTypes.length; ++j) + object.pubKeyTypes[j] = message.pubKeyTypes[j]; + } + return object; + }; + + /** + * Converts this ValidatorParams to JSON. + * @function toJSON + * @memberof tendermint.types.ValidatorParams + * @instance + * @returns {Object.} JSON object + */ + ValidatorParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidatorParams; + })(types.ValidatorParams || {}); + + types.VersionParams = (function(VersionParams) { + + /** + * Properties of a VersionParams. + * @memberof tendermint.types + * @interface IVersionParams + * @property {number|Long|null} [appVersion] VersionParams appVersion + */ + + /** + * Constructs a new VersionParams. + * @memberof tendermint.types + * @classdesc Represents a VersionParams. + * @implements IVersionParams + * @constructor + * @param {tendermint.types.IVersionParams=} [properties] Properties to set + */ + function VersionParams(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VersionParams appVersion. + * @member {number|Long} appVersion + * @memberof tendermint.types.VersionParams + * @instance + */ + VersionParams.prototype.appVersion = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new VersionParams instance using the specified properties. + * @function create + * @memberof tendermint.types.VersionParams + * @static + * @param {tendermint.types.IVersionParams=} [properties] Properties to set + * @returns {tendermint.types.VersionParams} VersionParams instance + */ + VersionParams.create = function create(properties) { + return new VersionParams(properties); + }; + + /** + * Encodes the specified VersionParams message. Does not implicitly {@link tendermint.types.VersionParams.verify|verify} messages. + * @function encode + * @memberof tendermint.types.VersionParams + * @static + * @param {tendermint.types.IVersionParams} message VersionParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.appVersion); + return writer; + }; + + /** + * Encodes the specified VersionParams message, length delimited. Does not implicitly {@link tendermint.types.VersionParams.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.VersionParams + * @static + * @param {tendermint.types.IVersionParams} message VersionParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VersionParams message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.VersionParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.VersionParams} VersionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.VersionParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.appVersion = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VersionParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.VersionParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.VersionParams} VersionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VersionParams message. + * @function verify + * @memberof tendermint.types.VersionParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VersionParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + if (!$util.isInteger(message.appVersion) && !(message.appVersion && $util.isInteger(message.appVersion.low) && $util.isInteger(message.appVersion.high))) + return "appVersion: integer|Long expected"; + return null; + }; + + /** + * Creates a VersionParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.VersionParams + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.VersionParams} VersionParams + */ + VersionParams.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.VersionParams) + return object; + var message = new $root.tendermint.types.VersionParams(); + if (object.appVersion != null) + if ($util.Long) + (message.appVersion = $util.Long.fromValue(object.appVersion)).unsigned = true; + else if (typeof object.appVersion === "string") + message.appVersion = parseInt(object.appVersion, 10); + else if (typeof object.appVersion === "number") + message.appVersion = object.appVersion; + else if (typeof object.appVersion === "object") + message.appVersion = new $util.LongBits(object.appVersion.low >>> 0, object.appVersion.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a VersionParams message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.VersionParams + * @static + * @param {tendermint.types.VersionParams} message VersionParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VersionParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.appVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.appVersion = options.longs === String ? "0" : 0; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + if (typeof message.appVersion === "number") + object.appVersion = options.longs === String ? String(message.appVersion) : message.appVersion; + else + object.appVersion = options.longs === String ? $util.Long.prototype.toString.call(message.appVersion) : options.longs === Number ? new $util.LongBits(message.appVersion.low >>> 0, message.appVersion.high >>> 0).toNumber(true) : message.appVersion; + return object; + }; + + /** + * Converts this VersionParams to JSON. + * @function toJSON + * @memberof tendermint.types.VersionParams + * @instance + * @returns {Object.} JSON object + */ + VersionParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VersionParams; + })(types.VersionParams || {}); + + types.HashedParams = (function(HashedParams) { + + /** + * Properties of a HashedParams. + * @memberof tendermint.types + * @interface IHashedParams + * @property {number|Long|null} [blockMaxBytes] HashedParams blockMaxBytes + * @property {number|Long|null} [blockMaxGas] HashedParams blockMaxGas + */ + + /** + * Constructs a new HashedParams. + * @memberof tendermint.types + * @classdesc Represents a HashedParams. + * @implements IHashedParams + * @constructor + * @param {tendermint.types.IHashedParams=} [properties] Properties to set + */ + function HashedParams(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HashedParams blockMaxBytes. + * @member {number|Long} blockMaxBytes + * @memberof tendermint.types.HashedParams + * @instance + */ + HashedParams.prototype.blockMaxBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * HashedParams blockMaxGas. + * @member {number|Long} blockMaxGas + * @memberof tendermint.types.HashedParams + * @instance + */ + HashedParams.prototype.blockMaxGas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new HashedParams instance using the specified properties. + * @function create + * @memberof tendermint.types.HashedParams + * @static + * @param {tendermint.types.IHashedParams=} [properties] Properties to set + * @returns {tendermint.types.HashedParams} HashedParams instance + */ + HashedParams.create = function create(properties) { + return new HashedParams(properties); + }; + + /** + * Encodes the specified HashedParams message. Does not implicitly {@link tendermint.types.HashedParams.verify|verify} messages. + * @function encode + * @memberof tendermint.types.HashedParams + * @static + * @param {tendermint.types.IHashedParams} message HashedParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HashedParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.blockMaxBytes != null && Object.hasOwnProperty.call(message, "blockMaxBytes")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.blockMaxBytes); + if (message.blockMaxGas != null && Object.hasOwnProperty.call(message, "blockMaxGas")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.blockMaxGas); + return writer; + }; + + /** + * Encodes the specified HashedParams message, length delimited. Does not implicitly {@link tendermint.types.HashedParams.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.HashedParams + * @static + * @param {tendermint.types.IHashedParams} message HashedParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HashedParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HashedParams message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.HashedParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.HashedParams} HashedParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HashedParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.HashedParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockMaxBytes = reader.int64(); + break; + case 2: + message.blockMaxGas = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HashedParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.HashedParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.HashedParams} HashedParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HashedParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HashedParams message. + * @function verify + * @memberof tendermint.types.HashedParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HashedParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.blockMaxBytes != null && message.hasOwnProperty("blockMaxBytes")) + if (!$util.isInteger(message.blockMaxBytes) && !(message.blockMaxBytes && $util.isInteger(message.blockMaxBytes.low) && $util.isInteger(message.blockMaxBytes.high))) + return "blockMaxBytes: integer|Long expected"; + if (message.blockMaxGas != null && message.hasOwnProperty("blockMaxGas")) + if (!$util.isInteger(message.blockMaxGas) && !(message.blockMaxGas && $util.isInteger(message.blockMaxGas.low) && $util.isInteger(message.blockMaxGas.high))) + return "blockMaxGas: integer|Long expected"; + return null; + }; + + /** + * Creates a HashedParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.HashedParams + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.HashedParams} HashedParams + */ + HashedParams.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.HashedParams) + return object; + var message = new $root.tendermint.types.HashedParams(); + if (object.blockMaxBytes != null) + if ($util.Long) + (message.blockMaxBytes = $util.Long.fromValue(object.blockMaxBytes)).unsigned = false; + else if (typeof object.blockMaxBytes === "string") + message.blockMaxBytes = parseInt(object.blockMaxBytes, 10); + else if (typeof object.blockMaxBytes === "number") + message.blockMaxBytes = object.blockMaxBytes; + else if (typeof object.blockMaxBytes === "object") + message.blockMaxBytes = new $util.LongBits(object.blockMaxBytes.low >>> 0, object.blockMaxBytes.high >>> 0).toNumber(); + if (object.blockMaxGas != null) + if ($util.Long) + (message.blockMaxGas = $util.Long.fromValue(object.blockMaxGas)).unsigned = false; + else if (typeof object.blockMaxGas === "string") + message.blockMaxGas = parseInt(object.blockMaxGas, 10); + else if (typeof object.blockMaxGas === "number") + message.blockMaxGas = object.blockMaxGas; + else if (typeof object.blockMaxGas === "object") + message.blockMaxGas = new $util.LongBits(object.blockMaxGas.low >>> 0, object.blockMaxGas.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a HashedParams message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.HashedParams + * @static + * @param {tendermint.types.HashedParams} message HashedParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HashedParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.blockMaxBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.blockMaxBytes = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.blockMaxGas = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.blockMaxGas = options.longs === String ? "0" : 0; + } + if (message.blockMaxBytes != null && message.hasOwnProperty("blockMaxBytes")) + if (typeof message.blockMaxBytes === "number") + object.blockMaxBytes = options.longs === String ? String(message.blockMaxBytes) : message.blockMaxBytes; + else + object.blockMaxBytes = options.longs === String ? $util.Long.prototype.toString.call(message.blockMaxBytes) : options.longs === Number ? new $util.LongBits(message.blockMaxBytes.low >>> 0, message.blockMaxBytes.high >>> 0).toNumber() : message.blockMaxBytes; + if (message.blockMaxGas != null && message.hasOwnProperty("blockMaxGas")) + if (typeof message.blockMaxGas === "number") + object.blockMaxGas = options.longs === String ? String(message.blockMaxGas) : message.blockMaxGas; + else + object.blockMaxGas = options.longs === String ? $util.Long.prototype.toString.call(message.blockMaxGas) : options.longs === Number ? new $util.LongBits(message.blockMaxGas.low >>> 0, message.blockMaxGas.high >>> 0).toNumber() : message.blockMaxGas; + return object; + }; + + /** + * Converts this HashedParams to JSON. + * @function toJSON + * @memberof tendermint.types.HashedParams + * @instance + * @returns {Object.} JSON object + */ + HashedParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HashedParams; + })(types.HashedParams || {}); + + /** + * BlockIDFlag enum. + * @name tendermint.types.BlockIDFlag + * @enum {string} + * @property {number} BLOCK_ID_FLAG_UNKNOWN=0 BLOCK_ID_FLAG_UNKNOWN value + * @property {number} BLOCK_ID_FLAG_ABSENT=1 BLOCK_ID_FLAG_ABSENT value + * @property {number} BLOCK_ID_FLAG_COMMIT=2 BLOCK_ID_FLAG_COMMIT value + * @property {number} BLOCK_ID_FLAG_NIL=3 BLOCK_ID_FLAG_NIL value + */ + types.BlockIDFlag = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BLOCK_ID_FLAG_UNKNOWN"] = 0; + values[valuesById[1] = "BLOCK_ID_FLAG_ABSENT"] = 1; + values[valuesById[2] = "BLOCK_ID_FLAG_COMMIT"] = 2; + values[valuesById[3] = "BLOCK_ID_FLAG_NIL"] = 3; + return values; + })(); + + /** + * SignedMsgType enum. + * @name tendermint.types.SignedMsgType + * @enum {string} + * @property {number} SIGNED_MSG_TYPE_UNKNOWN=0 SIGNED_MSG_TYPE_UNKNOWN value + * @property {number} SIGNED_MSG_TYPE_PREVOTE=1 SIGNED_MSG_TYPE_PREVOTE value + * @property {number} SIGNED_MSG_TYPE_PRECOMMIT=2 SIGNED_MSG_TYPE_PRECOMMIT value + * @property {number} SIGNED_MSG_TYPE_PROPOSAL=32 SIGNED_MSG_TYPE_PROPOSAL value + */ + types.SignedMsgType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SIGNED_MSG_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "SIGNED_MSG_TYPE_PREVOTE"] = 1; + values[valuesById[2] = "SIGNED_MSG_TYPE_PRECOMMIT"] = 2; + values[valuesById[32] = "SIGNED_MSG_TYPE_PROPOSAL"] = 32; + return values; + })(); + + types.PartSetHeader = (function(PartSetHeader) { + + /** + * Properties of a PartSetHeader. + * @memberof tendermint.types + * @interface IPartSetHeader + * @property {number|null} [total] PartSetHeader total + * @property {Uint8Array|null} [hash] PartSetHeader hash + */ + + /** + * Constructs a new PartSetHeader. + * @memberof tendermint.types + * @classdesc Represents a PartSetHeader. + * @implements IPartSetHeader + * @constructor + * @param {tendermint.types.IPartSetHeader=} [properties] Properties to set + */ + function PartSetHeader(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartSetHeader total. + * @member {number} total + * @memberof tendermint.types.PartSetHeader + * @instance + */ + PartSetHeader.prototype.total = 0; + + /** + * PartSetHeader hash. + * @member {Uint8Array} hash + * @memberof tendermint.types.PartSetHeader + * @instance + */ + PartSetHeader.prototype.hash = $util.newBuffer([]); + + /** + * Creates a new PartSetHeader instance using the specified properties. + * @function create + * @memberof tendermint.types.PartSetHeader + * @static + * @param {tendermint.types.IPartSetHeader=} [properties] Properties to set + * @returns {tendermint.types.PartSetHeader} PartSetHeader instance + */ + PartSetHeader.create = function create(properties) { + return new PartSetHeader(properties); + }; + + /** + * Encodes the specified PartSetHeader message. Does not implicitly {@link tendermint.types.PartSetHeader.verify|verify} messages. + * @function encode + * @memberof tendermint.types.PartSetHeader + * @static + * @param {tendermint.types.IPartSetHeader} message PartSetHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartSetHeader.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.total != null && Object.hasOwnProperty.call(message, "total")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.total); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.hash); + return writer; + }; + + /** + * Encodes the specified PartSetHeader message, length delimited. Does not implicitly {@link tendermint.types.PartSetHeader.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.PartSetHeader + * @static + * @param {tendermint.types.IPartSetHeader} message PartSetHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartSetHeader.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartSetHeader message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.PartSetHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.PartSetHeader} PartSetHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartSetHeader.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.PartSetHeader(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.total = reader.uint32(); + break; + case 2: + message.hash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartSetHeader message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.PartSetHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.PartSetHeader} PartSetHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartSetHeader.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartSetHeader message. + * @function verify + * @memberof tendermint.types.PartSetHeader + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartSetHeader.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.total != null && message.hasOwnProperty("total")) + if (!$util.isInteger(message.total)) + return "total: integer expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash))) + return "hash: buffer expected"; + return null; + }; + + /** + * Creates a PartSetHeader message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.PartSetHeader + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.PartSetHeader} PartSetHeader + */ + PartSetHeader.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.PartSetHeader) + return object; + var message = new $root.tendermint.types.PartSetHeader(); + if (object.total != null) + message.total = object.total >>> 0; + if (object.hash != null) + if (typeof object.hash === "string") + $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0); + else if (object.hash.length) + message.hash = object.hash; + return message; + }; + + /** + * Creates a plain object from a PartSetHeader message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.PartSetHeader + * @static + * @param {tendermint.types.PartSetHeader} message PartSetHeader + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartSetHeader.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.total = 0; + if (options.bytes === String) + object.hash = ""; + else { + object.hash = []; + if (options.bytes !== Array) + object.hash = $util.newBuffer(object.hash); + } + } + if (message.total != null && message.hasOwnProperty("total")) + object.total = message.total; + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash; + return object; + }; + + /** + * Converts this PartSetHeader to JSON. + * @function toJSON + * @memberof tendermint.types.PartSetHeader + * @instance + * @returns {Object.} JSON object + */ + PartSetHeader.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PartSetHeader; + })(types.PartSetHeader || {}); + + types.Part = (function(Part) { + + /** + * Properties of a Part. + * @memberof tendermint.types + * @interface IPart + * @property {number|null} [index] Part index + * @property {Uint8Array|null} [bytes] Part bytes + * @property {tendermint.crypto.IProof|null} [proof] Part proof + */ + + /** + * Constructs a new Part. + * @memberof tendermint.types + * @classdesc Represents a Part. + * @implements IPart + * @constructor + * @param {tendermint.types.IPart=} [properties] Properties to set + */ + function Part(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Part index. + * @member {number} index + * @memberof tendermint.types.Part + * @instance + */ + Part.prototype.index = 0; + + /** + * Part bytes. + * @member {Uint8Array} bytes + * @memberof tendermint.types.Part + * @instance + */ + Part.prototype.bytes = $util.newBuffer([]); + + /** + * Part proof. + * @member {tendermint.crypto.IProof|null|undefined} proof + * @memberof tendermint.types.Part + * @instance + */ + Part.prototype.proof = null; + + /** + * Creates a new Part instance using the specified properties. + * @function create + * @memberof tendermint.types.Part + * @static + * @param {tendermint.types.IPart=} [properties] Properties to set + * @returns {tendermint.types.Part} Part instance + */ + Part.create = function create(properties) { + return new Part(properties); + }; + + /** + * Encodes the specified Part message. Does not implicitly {@link tendermint.types.Part.verify|verify} messages. + * @function encode + * @memberof tendermint.types.Part + * @static + * @param {tendermint.types.IPart} message Part message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Part.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.index); + if (message.bytes != null && Object.hasOwnProperty.call(message, "bytes")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.bytes); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.tendermint.crypto.Proof.encode(message.proof, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Part message, length delimited. Does not implicitly {@link tendermint.types.Part.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.Part + * @static + * @param {tendermint.types.IPart} message Part message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Part.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Part message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.Part + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.Part} Part + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Part.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Part(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.uint32(); + break; + case 2: + message.bytes = reader.bytes(); + break; + case 3: + message.proof = $root.tendermint.crypto.Proof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Part message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.Part + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.Part} Part + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Part.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Part message. + * @function verify + * @memberof tendermint.types.Part + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Part.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index)) + return "index: integer expected"; + if (message.bytes != null && message.hasOwnProperty("bytes")) + if (!(message.bytes && typeof message.bytes.length === "number" || $util.isString(message.bytes))) + return "bytes: buffer expected"; + if (message.proof != null && message.hasOwnProperty("proof")) { + var error = $root.tendermint.crypto.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + return null; + }; + + /** + * Creates a Part message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.Part + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.Part} Part + */ + Part.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.Part) + return object; + var message = new $root.tendermint.types.Part(); + if (object.index != null) + message.index = object.index >>> 0; + if (object.bytes != null) + if (typeof object.bytes === "string") + $util.base64.decode(object.bytes, message.bytes = $util.newBuffer($util.base64.length(object.bytes)), 0); + else if (object.bytes.length) + message.bytes = object.bytes; + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".tendermint.types.Part.proof: object expected"); + message.proof = $root.tendermint.crypto.Proof.fromObject(object.proof); + } + return message; + }; + + /** + * Creates a plain object from a Part message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.Part + * @static + * @param {tendermint.types.Part} message Part + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Part.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.index = 0; + if (options.bytes === String) + object.bytes = ""; + else { + object.bytes = []; + if (options.bytes !== Array) + object.bytes = $util.newBuffer(object.bytes); + } + object.proof = null; + } + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + if (message.bytes != null && message.hasOwnProperty("bytes")) + object.bytes = options.bytes === String ? $util.base64.encode(message.bytes, 0, message.bytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.bytes) : message.bytes; + if (message.proof != null && message.hasOwnProperty("proof")) + object.proof = $root.tendermint.crypto.Proof.toObject(message.proof, options); + return object; + }; + + /** + * Converts this Part to JSON. + * @function toJSON + * @memberof tendermint.types.Part + * @instance + * @returns {Object.} JSON object + */ + Part.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Part; + })(types.Part || {}); + + types.BlockID = (function(BlockID) { + + /** + * Properties of a BlockID. + * @memberof tendermint.types + * @interface IBlockID + * @property {Uint8Array|null} [hash] BlockID hash + * @property {tendermint.types.IPartSetHeader|null} [partSetHeader] BlockID partSetHeader + */ + + /** + * Constructs a new BlockID. + * @memberof tendermint.types + * @classdesc Represents a BlockID. + * @implements IBlockID + * @constructor + * @param {tendermint.types.IBlockID=} [properties] Properties to set + */ + function BlockID(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BlockID hash. + * @member {Uint8Array} hash + * @memberof tendermint.types.BlockID + * @instance + */ + BlockID.prototype.hash = $util.newBuffer([]); + + /** + * BlockID partSetHeader. + * @member {tendermint.types.IPartSetHeader|null|undefined} partSetHeader + * @memberof tendermint.types.BlockID + * @instance + */ + BlockID.prototype.partSetHeader = null; + + /** + * Creates a new BlockID instance using the specified properties. + * @function create + * @memberof tendermint.types.BlockID + * @static + * @param {tendermint.types.IBlockID=} [properties] Properties to set + * @returns {tendermint.types.BlockID} BlockID instance + */ + BlockID.create = function create(properties) { + return new BlockID(properties); + }; + + /** + * Encodes the specified BlockID message. Does not implicitly {@link tendermint.types.BlockID.verify|verify} messages. + * @function encode + * @memberof tendermint.types.BlockID + * @static + * @param {tendermint.types.IBlockID} message BlockID message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlockID.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.hash); + if (message.partSetHeader != null && Object.hasOwnProperty.call(message, "partSetHeader")) + $root.tendermint.types.PartSetHeader.encode(message.partSetHeader, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BlockID message, length delimited. Does not implicitly {@link tendermint.types.BlockID.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.BlockID + * @static + * @param {tendermint.types.IBlockID} message BlockID message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlockID.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BlockID message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.BlockID + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.BlockID} BlockID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlockID.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.BlockID(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.bytes(); + break; + case 2: + message.partSetHeader = $root.tendermint.types.PartSetHeader.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BlockID message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.BlockID + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.BlockID} BlockID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlockID.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BlockID message. + * @function verify + * @memberof tendermint.types.BlockID + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BlockID.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash))) + return "hash: buffer expected"; + if (message.partSetHeader != null && message.hasOwnProperty("partSetHeader")) { + var error = $root.tendermint.types.PartSetHeader.verify(message.partSetHeader); + if (error) + return "partSetHeader." + error; + } + return null; + }; + + /** + * Creates a BlockID message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.BlockID + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.BlockID} BlockID + */ + BlockID.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.BlockID) + return object; + var message = new $root.tendermint.types.BlockID(); + if (object.hash != null) + if (typeof object.hash === "string") + $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0); + else if (object.hash.length) + message.hash = object.hash; + if (object.partSetHeader != null) { + if (typeof object.partSetHeader !== "object") + throw TypeError(".tendermint.types.BlockID.partSetHeader: object expected"); + message.partSetHeader = $root.tendermint.types.PartSetHeader.fromObject(object.partSetHeader); + } + return message; + }; + + /** + * Creates a plain object from a BlockID message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.BlockID + * @static + * @param {tendermint.types.BlockID} message BlockID + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BlockID.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.hash = ""; + else { + object.hash = []; + if (options.bytes !== Array) + object.hash = $util.newBuffer(object.hash); + } + object.partSetHeader = null; + } + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash; + if (message.partSetHeader != null && message.hasOwnProperty("partSetHeader")) + object.partSetHeader = $root.tendermint.types.PartSetHeader.toObject(message.partSetHeader, options); + return object; + }; + + /** + * Converts this BlockID to JSON. + * @function toJSON + * @memberof tendermint.types.BlockID + * @instance + * @returns {Object.} JSON object + */ + BlockID.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BlockID; + })(types.BlockID || {}); + + types.Header = (function(Header) { + + /** + * Properties of a Header. + * @memberof tendermint.types + * @interface IHeader + * @property {tendermint.version.IConsensus|null} [version] Header version + * @property {string|null} [chainId] Header chainId + * @property {number|Long|null} [height] Header height + * @property {google.protobuf.ITimestamp|null} [time] Header time + * @property {tendermint.types.IBlockID|null} [lastBlockId] Header lastBlockId + * @property {Uint8Array|null} [lastCommitHash] Header lastCommitHash + * @property {Uint8Array|null} [dataHash] Header dataHash + * @property {Uint8Array|null} [validatorsHash] Header validatorsHash + * @property {Uint8Array|null} [nextValidatorsHash] Header nextValidatorsHash + * @property {Uint8Array|null} [consensusHash] Header consensusHash + * @property {Uint8Array|null} [appHash] Header appHash + * @property {Uint8Array|null} [lastResultsHash] Header lastResultsHash + * @property {Uint8Array|null} [evidenceHash] Header evidenceHash + * @property {Uint8Array|null} [proposerAddress] Header proposerAddress + */ + + /** + * Constructs a new Header. + * @memberof tendermint.types + * @classdesc Represents a Header. + * @implements IHeader + * @constructor + * @param {tendermint.types.IHeader=} [properties] Properties to set + */ + function Header(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Header version. + * @member {tendermint.version.IConsensus|null|undefined} version + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.version = null; + + /** + * Header chainId. + * @member {string} chainId + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.chainId = ""; + + /** + * Header height. + * @member {number|Long} height + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Header time. + * @member {google.protobuf.ITimestamp|null|undefined} time + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.time = null; + + /** + * Header lastBlockId. + * @member {tendermint.types.IBlockID|null|undefined} lastBlockId + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.lastBlockId = null; + + /** + * Header lastCommitHash. + * @member {Uint8Array} lastCommitHash + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.lastCommitHash = $util.newBuffer([]); + + /** + * Header dataHash. + * @member {Uint8Array} dataHash + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.dataHash = $util.newBuffer([]); + + /** + * Header validatorsHash. + * @member {Uint8Array} validatorsHash + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.validatorsHash = $util.newBuffer([]); + + /** + * Header nextValidatorsHash. + * @member {Uint8Array} nextValidatorsHash + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.nextValidatorsHash = $util.newBuffer([]); + + /** + * Header consensusHash. + * @member {Uint8Array} consensusHash + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.consensusHash = $util.newBuffer([]); + + /** + * Header appHash. + * @member {Uint8Array} appHash + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.appHash = $util.newBuffer([]); + + /** + * Header lastResultsHash. + * @member {Uint8Array} lastResultsHash + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.lastResultsHash = $util.newBuffer([]); + + /** + * Header evidenceHash. + * @member {Uint8Array} evidenceHash + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.evidenceHash = $util.newBuffer([]); + + /** + * Header proposerAddress. + * @member {Uint8Array} proposerAddress + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.proposerAddress = $util.newBuffer([]); + + /** + * Creates a new Header instance using the specified properties. + * @function create + * @memberof tendermint.types.Header + * @static + * @param {tendermint.types.IHeader=} [properties] Properties to set + * @returns {tendermint.types.Header} Header instance + */ + Header.create = function create(properties) { + return new Header(properties); + }; + + /** + * Encodes the specified Header message. Does not implicitly {@link tendermint.types.Header.verify|verify} messages. + * @function encode + * @memberof tendermint.types.Header + * @static + * @param {tendermint.types.IHeader} message Header message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Header.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + $root.tendermint.version.Consensus.encode(message.version, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.chainId != null && Object.hasOwnProperty.call(message, "chainId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.chainId); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.height); + if (message.time != null && Object.hasOwnProperty.call(message, "time")) + $root.google.protobuf.Timestamp.encode(message.time, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.lastBlockId != null && Object.hasOwnProperty.call(message, "lastBlockId")) + $root.tendermint.types.BlockID.encode(message.lastBlockId, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.lastCommitHash != null && Object.hasOwnProperty.call(message, "lastCommitHash")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.lastCommitHash); + if (message.dataHash != null && Object.hasOwnProperty.call(message, "dataHash")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.dataHash); + if (message.validatorsHash != null && Object.hasOwnProperty.call(message, "validatorsHash")) + writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.validatorsHash); + if (message.nextValidatorsHash != null && Object.hasOwnProperty.call(message, "nextValidatorsHash")) + writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.nextValidatorsHash); + if (message.consensusHash != null && Object.hasOwnProperty.call(message, "consensusHash")) + writer.uint32(/* id 10, wireType 2 =*/82).bytes(message.consensusHash); + if (message.appHash != null && Object.hasOwnProperty.call(message, "appHash")) + writer.uint32(/* id 11, wireType 2 =*/90).bytes(message.appHash); + if (message.lastResultsHash != null && Object.hasOwnProperty.call(message, "lastResultsHash")) + writer.uint32(/* id 12, wireType 2 =*/98).bytes(message.lastResultsHash); + if (message.evidenceHash != null && Object.hasOwnProperty.call(message, "evidenceHash")) + writer.uint32(/* id 13, wireType 2 =*/106).bytes(message.evidenceHash); + if (message.proposerAddress != null && Object.hasOwnProperty.call(message, "proposerAddress")) + writer.uint32(/* id 14, wireType 2 =*/114).bytes(message.proposerAddress); + return writer; + }; + + /** + * Encodes the specified Header message, length delimited. Does not implicitly {@link tendermint.types.Header.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.Header + * @static + * @param {tendermint.types.IHeader} message Header message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Header.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Header message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.Header + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.Header} Header + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Header.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Header(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = $root.tendermint.version.Consensus.decode(reader, reader.uint32()); + break; + case 2: + message.chainId = reader.string(); + break; + case 3: + message.height = reader.int64(); + break; + case 4: + message.time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.lastBlockId = $root.tendermint.types.BlockID.decode(reader, reader.uint32()); + break; + case 6: + message.lastCommitHash = reader.bytes(); + break; + case 7: + message.dataHash = reader.bytes(); + break; + case 8: + message.validatorsHash = reader.bytes(); + break; + case 9: + message.nextValidatorsHash = reader.bytes(); + break; + case 10: + message.consensusHash = reader.bytes(); + break; + case 11: + message.appHash = reader.bytes(); + break; + case 12: + message.lastResultsHash = reader.bytes(); + break; + case 13: + message.evidenceHash = reader.bytes(); + break; + case 14: + message.proposerAddress = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Header message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.Header + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.Header} Header + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Header.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Header message. + * @function verify + * @memberof tendermint.types.Header + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Header.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) { + var error = $root.tendermint.version.Consensus.verify(message.version); + if (error) + return "version." + error; + } + if (message.chainId != null && message.hasOwnProperty("chainId")) + if (!$util.isString(message.chainId)) + return "chainId: string expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.time != null && message.hasOwnProperty("time")) { + var error = $root.google.protobuf.Timestamp.verify(message.time); + if (error) + return "time." + error; + } + if (message.lastBlockId != null && message.hasOwnProperty("lastBlockId")) { + var error = $root.tendermint.types.BlockID.verify(message.lastBlockId); + if (error) + return "lastBlockId." + error; + } + if (message.lastCommitHash != null && message.hasOwnProperty("lastCommitHash")) + if (!(message.lastCommitHash && typeof message.lastCommitHash.length === "number" || $util.isString(message.lastCommitHash))) + return "lastCommitHash: buffer expected"; + if (message.dataHash != null && message.hasOwnProperty("dataHash")) + if (!(message.dataHash && typeof message.dataHash.length === "number" || $util.isString(message.dataHash))) + return "dataHash: buffer expected"; + if (message.validatorsHash != null && message.hasOwnProperty("validatorsHash")) + if (!(message.validatorsHash && typeof message.validatorsHash.length === "number" || $util.isString(message.validatorsHash))) + return "validatorsHash: buffer expected"; + if (message.nextValidatorsHash != null && message.hasOwnProperty("nextValidatorsHash")) + if (!(message.nextValidatorsHash && typeof message.nextValidatorsHash.length === "number" || $util.isString(message.nextValidatorsHash))) + return "nextValidatorsHash: buffer expected"; + if (message.consensusHash != null && message.hasOwnProperty("consensusHash")) + if (!(message.consensusHash && typeof message.consensusHash.length === "number" || $util.isString(message.consensusHash))) + return "consensusHash: buffer expected"; + if (message.appHash != null && message.hasOwnProperty("appHash")) + if (!(message.appHash && typeof message.appHash.length === "number" || $util.isString(message.appHash))) + return "appHash: buffer expected"; + if (message.lastResultsHash != null && message.hasOwnProperty("lastResultsHash")) + if (!(message.lastResultsHash && typeof message.lastResultsHash.length === "number" || $util.isString(message.lastResultsHash))) + return "lastResultsHash: buffer expected"; + if (message.evidenceHash != null && message.hasOwnProperty("evidenceHash")) + if (!(message.evidenceHash && typeof message.evidenceHash.length === "number" || $util.isString(message.evidenceHash))) + return "evidenceHash: buffer expected"; + if (message.proposerAddress != null && message.hasOwnProperty("proposerAddress")) + if (!(message.proposerAddress && typeof message.proposerAddress.length === "number" || $util.isString(message.proposerAddress))) + return "proposerAddress: buffer expected"; + return null; + }; + + /** + * Creates a Header message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.Header + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.Header} Header + */ + Header.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.Header) + return object; + var message = new $root.tendermint.types.Header(); + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".tendermint.types.Header.version: object expected"); + message.version = $root.tendermint.version.Consensus.fromObject(object.version); + } + if (object.chainId != null) + message.chainId = String(object.chainId); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + if (object.time != null) { + if (typeof object.time !== "object") + throw TypeError(".tendermint.types.Header.time: object expected"); + message.time = $root.google.protobuf.Timestamp.fromObject(object.time); + } + if (object.lastBlockId != null) { + if (typeof object.lastBlockId !== "object") + throw TypeError(".tendermint.types.Header.lastBlockId: object expected"); + message.lastBlockId = $root.tendermint.types.BlockID.fromObject(object.lastBlockId); + } + if (object.lastCommitHash != null) + if (typeof object.lastCommitHash === "string") + $util.base64.decode(object.lastCommitHash, message.lastCommitHash = $util.newBuffer($util.base64.length(object.lastCommitHash)), 0); + else if (object.lastCommitHash.length) + message.lastCommitHash = object.lastCommitHash; + if (object.dataHash != null) + if (typeof object.dataHash === "string") + $util.base64.decode(object.dataHash, message.dataHash = $util.newBuffer($util.base64.length(object.dataHash)), 0); + else if (object.dataHash.length) + message.dataHash = object.dataHash; + if (object.validatorsHash != null) + if (typeof object.validatorsHash === "string") + $util.base64.decode(object.validatorsHash, message.validatorsHash = $util.newBuffer($util.base64.length(object.validatorsHash)), 0); + else if (object.validatorsHash.length) + message.validatorsHash = object.validatorsHash; + if (object.nextValidatorsHash != null) + if (typeof object.nextValidatorsHash === "string") + $util.base64.decode(object.nextValidatorsHash, message.nextValidatorsHash = $util.newBuffer($util.base64.length(object.nextValidatorsHash)), 0); + else if (object.nextValidatorsHash.length) + message.nextValidatorsHash = object.nextValidatorsHash; + if (object.consensusHash != null) + if (typeof object.consensusHash === "string") + $util.base64.decode(object.consensusHash, message.consensusHash = $util.newBuffer($util.base64.length(object.consensusHash)), 0); + else if (object.consensusHash.length) + message.consensusHash = object.consensusHash; + if (object.appHash != null) + if (typeof object.appHash === "string") + $util.base64.decode(object.appHash, message.appHash = $util.newBuffer($util.base64.length(object.appHash)), 0); + else if (object.appHash.length) + message.appHash = object.appHash; + if (object.lastResultsHash != null) + if (typeof object.lastResultsHash === "string") + $util.base64.decode(object.lastResultsHash, message.lastResultsHash = $util.newBuffer($util.base64.length(object.lastResultsHash)), 0); + else if (object.lastResultsHash.length) + message.lastResultsHash = object.lastResultsHash; + if (object.evidenceHash != null) + if (typeof object.evidenceHash === "string") + $util.base64.decode(object.evidenceHash, message.evidenceHash = $util.newBuffer($util.base64.length(object.evidenceHash)), 0); + else if (object.evidenceHash.length) + message.evidenceHash = object.evidenceHash; + if (object.proposerAddress != null) + if (typeof object.proposerAddress === "string") + $util.base64.decode(object.proposerAddress, message.proposerAddress = $util.newBuffer($util.base64.length(object.proposerAddress)), 0); + else if (object.proposerAddress.length) + message.proposerAddress = object.proposerAddress; + return message; + }; + + /** + * Creates a plain object from a Header message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.Header + * @static + * @param {tendermint.types.Header} message Header + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Header.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = null; + object.chainId = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.time = null; + object.lastBlockId = null; + if (options.bytes === String) + object.lastCommitHash = ""; + else { + object.lastCommitHash = []; + if (options.bytes !== Array) + object.lastCommitHash = $util.newBuffer(object.lastCommitHash); + } + if (options.bytes === String) + object.dataHash = ""; + else { + object.dataHash = []; + if (options.bytes !== Array) + object.dataHash = $util.newBuffer(object.dataHash); + } + if (options.bytes === String) + object.validatorsHash = ""; + else { + object.validatorsHash = []; + if (options.bytes !== Array) + object.validatorsHash = $util.newBuffer(object.validatorsHash); + } + if (options.bytes === String) + object.nextValidatorsHash = ""; + else { + object.nextValidatorsHash = []; + if (options.bytes !== Array) + object.nextValidatorsHash = $util.newBuffer(object.nextValidatorsHash); + } + if (options.bytes === String) + object.consensusHash = ""; + else { + object.consensusHash = []; + if (options.bytes !== Array) + object.consensusHash = $util.newBuffer(object.consensusHash); + } + if (options.bytes === String) + object.appHash = ""; + else { + object.appHash = []; + if (options.bytes !== Array) + object.appHash = $util.newBuffer(object.appHash); + } + if (options.bytes === String) + object.lastResultsHash = ""; + else { + object.lastResultsHash = []; + if (options.bytes !== Array) + object.lastResultsHash = $util.newBuffer(object.lastResultsHash); + } + if (options.bytes === String) + object.evidenceHash = ""; + else { + object.evidenceHash = []; + if (options.bytes !== Array) + object.evidenceHash = $util.newBuffer(object.evidenceHash); + } + if (options.bytes === String) + object.proposerAddress = ""; + else { + object.proposerAddress = []; + if (options.bytes !== Array) + object.proposerAddress = $util.newBuffer(object.proposerAddress); + } + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = $root.tendermint.version.Consensus.toObject(message.version, options); + if (message.chainId != null && message.hasOwnProperty("chainId")) + object.chainId = message.chainId; + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + if (message.time != null && message.hasOwnProperty("time")) + object.time = $root.google.protobuf.Timestamp.toObject(message.time, options); + if (message.lastBlockId != null && message.hasOwnProperty("lastBlockId")) + object.lastBlockId = $root.tendermint.types.BlockID.toObject(message.lastBlockId, options); + if (message.lastCommitHash != null && message.hasOwnProperty("lastCommitHash")) + object.lastCommitHash = options.bytes === String ? $util.base64.encode(message.lastCommitHash, 0, message.lastCommitHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.lastCommitHash) : message.lastCommitHash; + if (message.dataHash != null && message.hasOwnProperty("dataHash")) + object.dataHash = options.bytes === String ? $util.base64.encode(message.dataHash, 0, message.dataHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.dataHash) : message.dataHash; + if (message.validatorsHash != null && message.hasOwnProperty("validatorsHash")) + object.validatorsHash = options.bytes === String ? $util.base64.encode(message.validatorsHash, 0, message.validatorsHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.validatorsHash) : message.validatorsHash; + if (message.nextValidatorsHash != null && message.hasOwnProperty("nextValidatorsHash")) + object.nextValidatorsHash = options.bytes === String ? $util.base64.encode(message.nextValidatorsHash, 0, message.nextValidatorsHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.nextValidatorsHash) : message.nextValidatorsHash; + if (message.consensusHash != null && message.hasOwnProperty("consensusHash")) + object.consensusHash = options.bytes === String ? $util.base64.encode(message.consensusHash, 0, message.consensusHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.consensusHash) : message.consensusHash; + if (message.appHash != null && message.hasOwnProperty("appHash")) + object.appHash = options.bytes === String ? $util.base64.encode(message.appHash, 0, message.appHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.appHash) : message.appHash; + if (message.lastResultsHash != null && message.hasOwnProperty("lastResultsHash")) + object.lastResultsHash = options.bytes === String ? $util.base64.encode(message.lastResultsHash, 0, message.lastResultsHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.lastResultsHash) : message.lastResultsHash; + if (message.evidenceHash != null && message.hasOwnProperty("evidenceHash")) + object.evidenceHash = options.bytes === String ? $util.base64.encode(message.evidenceHash, 0, message.evidenceHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.evidenceHash) : message.evidenceHash; + if (message.proposerAddress != null && message.hasOwnProperty("proposerAddress")) + object.proposerAddress = options.bytes === String ? $util.base64.encode(message.proposerAddress, 0, message.proposerAddress.length) : options.bytes === Array ? Array.prototype.slice.call(message.proposerAddress) : message.proposerAddress; + return object; + }; + + /** + * Converts this Header to JSON. + * @function toJSON + * @memberof tendermint.types.Header + * @instance + * @returns {Object.} JSON object + */ + Header.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Header; + })(types.Header || {}); + + types.Data = (function(Data) { + + /** + * Properties of a Data. + * @memberof tendermint.types + * @interface IData + * @property {Array.|null} [txs] Data txs + */ + + /** + * Constructs a new Data. + * @memberof tendermint.types + * @classdesc Represents a Data. + * @implements IData + * @constructor + * @param {tendermint.types.IData=} [properties] Properties to set + */ + function Data(properties) { + this.txs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Data txs. + * @member {Array.} txs + * @memberof tendermint.types.Data + * @instance + */ + Data.prototype.txs = $util.emptyArray; + + /** + * Creates a new Data instance using the specified properties. + * @function create + * @memberof tendermint.types.Data + * @static + * @param {tendermint.types.IData=} [properties] Properties to set + * @returns {tendermint.types.Data} Data instance + */ + Data.create = function create(properties) { + return new Data(properties); + }; + + /** + * Encodes the specified Data message. Does not implicitly {@link tendermint.types.Data.verify|verify} messages. + * @function encode + * @memberof tendermint.types.Data + * @static + * @param {tendermint.types.IData} message Data message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Data.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.txs != null && message.txs.length) + for (var i = 0; i < message.txs.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.txs[i]); + return writer; + }; + + /** + * Encodes the specified Data message, length delimited. Does not implicitly {@link tendermint.types.Data.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.Data + * @static + * @param {tendermint.types.IData} message Data message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Data.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Data message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.Data + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.Data} Data + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Data.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Data(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.txs && message.txs.length)) + message.txs = []; + message.txs.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Data message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.Data + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.Data} Data + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Data.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Data message. + * @function verify + * @memberof tendermint.types.Data + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Data.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.txs != null && message.hasOwnProperty("txs")) { + if (!Array.isArray(message.txs)) + return "txs: array expected"; + for (var i = 0; i < message.txs.length; ++i) + if (!(message.txs[i] && typeof message.txs[i].length === "number" || $util.isString(message.txs[i]))) + return "txs: buffer[] expected"; + } + return null; + }; + + /** + * Creates a Data message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.Data + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.Data} Data + */ + Data.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.Data) + return object; + var message = new $root.tendermint.types.Data(); + if (object.txs) { + if (!Array.isArray(object.txs)) + throw TypeError(".tendermint.types.Data.txs: array expected"); + message.txs = []; + for (var i = 0; i < object.txs.length; ++i) + if (typeof object.txs[i] === "string") + $util.base64.decode(object.txs[i], message.txs[i] = $util.newBuffer($util.base64.length(object.txs[i])), 0); + else if (object.txs[i].length) + message.txs[i] = object.txs[i]; + } + return message; + }; + + /** + * Creates a plain object from a Data message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.Data + * @static + * @param {tendermint.types.Data} message Data + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Data.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.txs = []; + if (message.txs && message.txs.length) { + object.txs = []; + for (var j = 0; j < message.txs.length; ++j) + object.txs[j] = options.bytes === String ? $util.base64.encode(message.txs[j], 0, message.txs[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.txs[j]) : message.txs[j]; + } + return object; + }; + + /** + * Converts this Data to JSON. + * @function toJSON + * @memberof tendermint.types.Data + * @instance + * @returns {Object.} JSON object + */ + Data.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Data; + })(types.Data || {}); + + types.Vote = (function(Vote) { + + /** + * Properties of a Vote. + * @memberof tendermint.types + * @interface IVote + * @property {tendermint.types.SignedMsgType|null} [type] Vote type + * @property {number|Long|null} [height] Vote height + * @property {number|null} [round] Vote round + * @property {tendermint.types.IBlockID|null} [blockId] Vote blockId + * @property {google.protobuf.ITimestamp|null} [timestamp] Vote timestamp + * @property {Uint8Array|null} [validatorAddress] Vote validatorAddress + * @property {number|null} [validatorIndex] Vote validatorIndex + * @property {Uint8Array|null} [signature] Vote signature + */ + + /** + * Constructs a new Vote. + * @memberof tendermint.types + * @classdesc Represents a Vote. + * @implements IVote + * @constructor + * @param {tendermint.types.IVote=} [properties] Properties to set + */ + function Vote(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Vote type. + * @member {tendermint.types.SignedMsgType} type + * @memberof tendermint.types.Vote + * @instance + */ + Vote.prototype.type = 0; + + /** + * Vote height. + * @member {number|Long} height + * @memberof tendermint.types.Vote + * @instance + */ + Vote.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Vote round. + * @member {number} round + * @memberof tendermint.types.Vote + * @instance + */ + Vote.prototype.round = 0; + + /** + * Vote blockId. + * @member {tendermint.types.IBlockID|null|undefined} blockId + * @memberof tendermint.types.Vote + * @instance + */ + Vote.prototype.blockId = null; + + /** + * Vote timestamp. + * @member {google.protobuf.ITimestamp|null|undefined} timestamp + * @memberof tendermint.types.Vote + * @instance + */ + Vote.prototype.timestamp = null; + + /** + * Vote validatorAddress. + * @member {Uint8Array} validatorAddress + * @memberof tendermint.types.Vote + * @instance + */ + Vote.prototype.validatorAddress = $util.newBuffer([]); + + /** + * Vote validatorIndex. + * @member {number} validatorIndex + * @memberof tendermint.types.Vote + * @instance + */ + Vote.prototype.validatorIndex = 0; + + /** + * Vote signature. + * @member {Uint8Array} signature + * @memberof tendermint.types.Vote + * @instance + */ + Vote.prototype.signature = $util.newBuffer([]); + + /** + * Creates a new Vote instance using the specified properties. + * @function create + * @memberof tendermint.types.Vote + * @static + * @param {tendermint.types.IVote=} [properties] Properties to set + * @returns {tendermint.types.Vote} Vote instance + */ + Vote.create = function create(properties) { + return new Vote(properties); + }; + + /** + * Encodes the specified Vote message. Does not implicitly {@link tendermint.types.Vote.verify|verify} messages. + * @function encode + * @memberof tendermint.types.Vote + * @static + * @param {tendermint.types.IVote} message Vote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vote.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.height); + if (message.round != null && Object.hasOwnProperty.call(message, "round")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.round); + if (message.blockId != null && Object.hasOwnProperty.call(message, "blockId")) + $root.tendermint.types.BlockID.encode(message.blockId, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.validatorAddress); + if (message.validatorIndex != null && Object.hasOwnProperty.call(message, "validatorIndex")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.validatorIndex); + if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) + writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.signature); + return writer; + }; + + /** + * Encodes the specified Vote message, length delimited. Does not implicitly {@link tendermint.types.Vote.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.Vote + * @static + * @param {tendermint.types.IVote} message Vote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vote.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Vote message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.Vote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.Vote} Vote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vote.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Vote(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32(); + break; + case 2: + message.height = reader.int64(); + break; + case 3: + message.round = reader.int32(); + break; + case 4: + message.blockId = $root.tendermint.types.BlockID.decode(reader, reader.uint32()); + break; + case 5: + message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.validatorAddress = reader.bytes(); + break; + case 7: + message.validatorIndex = reader.int32(); + break; + case 8: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Vote message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.Vote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.Vote} Vote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vote.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Vote message. + * @function verify + * @memberof tendermint.types.Vote + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Vote.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 32: + break; + } + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.round != null && message.hasOwnProperty("round")) + if (!$util.isInteger(message.round)) + return "round: integer expected"; + if (message.blockId != null && message.hasOwnProperty("blockId")) { + var error = $root.tendermint.types.BlockID.verify(message.blockId); + if (error) + return "blockId." + error; + } + if (message.timestamp != null && message.hasOwnProperty("timestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.timestamp); + if (error) + return "timestamp." + error; + } + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!(message.validatorAddress && typeof message.validatorAddress.length === "number" || $util.isString(message.validatorAddress))) + return "validatorAddress: buffer expected"; + if (message.validatorIndex != null && message.hasOwnProperty("validatorIndex")) + if (!$util.isInteger(message.validatorIndex)) + return "validatorIndex: integer expected"; + if (message.signature != null && message.hasOwnProperty("signature")) + if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) + return "signature: buffer expected"; + return null; + }; + + /** + * Creates a Vote message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.Vote + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.Vote} Vote + */ + Vote.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.Vote) + return object; + var message = new $root.tendermint.types.Vote(); + switch (object.type) { + case "SIGNED_MSG_TYPE_UNKNOWN": + case 0: + message.type = 0; + break; + case "SIGNED_MSG_TYPE_PREVOTE": + case 1: + message.type = 1; + break; + case "SIGNED_MSG_TYPE_PRECOMMIT": + case 2: + message.type = 2; + break; + case "SIGNED_MSG_TYPE_PROPOSAL": + case 32: + message.type = 32; + break; + } + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + if (object.round != null) + message.round = object.round | 0; + if (object.blockId != null) { + if (typeof object.blockId !== "object") + throw TypeError(".tendermint.types.Vote.blockId: object expected"); + message.blockId = $root.tendermint.types.BlockID.fromObject(object.blockId); + } + if (object.timestamp != null) { + if (typeof object.timestamp !== "object") + throw TypeError(".tendermint.types.Vote.timestamp: object expected"); + message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); + } + if (object.validatorAddress != null) + if (typeof object.validatorAddress === "string") + $util.base64.decode(object.validatorAddress, message.validatorAddress = $util.newBuffer($util.base64.length(object.validatorAddress)), 0); + else if (object.validatorAddress.length) + message.validatorAddress = object.validatorAddress; + if (object.validatorIndex != null) + message.validatorIndex = object.validatorIndex | 0; + if (object.signature != null) + if (typeof object.signature === "string") + $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); + else if (object.signature.length) + message.signature = object.signature; + return message; + }; + + /** + * Creates a plain object from a Vote message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.Vote + * @static + * @param {tendermint.types.Vote} message Vote + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Vote.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "SIGNED_MSG_TYPE_UNKNOWN" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.round = 0; + object.blockId = null; + object.timestamp = null; + if (options.bytes === String) + object.validatorAddress = ""; + else { + object.validatorAddress = []; + if (options.bytes !== Array) + object.validatorAddress = $util.newBuffer(object.validatorAddress); + } + object.validatorIndex = 0; + if (options.bytes === String) + object.signature = ""; + else { + object.signature = []; + if (options.bytes !== Array) + object.signature = $util.newBuffer(object.signature); + } + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.tendermint.types.SignedMsgType[message.type] : message.type; + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + if (message.round != null && message.hasOwnProperty("round")) + object.round = message.round; + if (message.blockId != null && message.hasOwnProperty("blockId")) + object.blockId = $root.tendermint.types.BlockID.toObject(message.blockId, options); + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = options.bytes === String ? $util.base64.encode(message.validatorAddress, 0, message.validatorAddress.length) : options.bytes === Array ? Array.prototype.slice.call(message.validatorAddress) : message.validatorAddress; + if (message.validatorIndex != null && message.hasOwnProperty("validatorIndex")) + object.validatorIndex = message.validatorIndex; + if (message.signature != null && message.hasOwnProperty("signature")) + object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; + return object; + }; + + /** + * Converts this Vote to JSON. + * @function toJSON + * @memberof tendermint.types.Vote + * @instance + * @returns {Object.} JSON object + */ + Vote.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Vote; + })(types.Vote || {}); + + types.Commit = (function(Commit) { + + /** + * Properties of a Commit. + * @memberof tendermint.types + * @interface ICommit + * @property {number|Long|null} [height] Commit height + * @property {number|null} [round] Commit round + * @property {tendermint.types.IBlockID|null} [blockId] Commit blockId + * @property {Array.|null} [signatures] Commit signatures + */ + + /** + * Constructs a new Commit. + * @memberof tendermint.types + * @classdesc Represents a Commit. + * @implements ICommit + * @constructor + * @param {tendermint.types.ICommit=} [properties] Properties to set + */ + function Commit(properties) { + this.signatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Commit height. + * @member {number|Long} height + * @memberof tendermint.types.Commit + * @instance + */ + Commit.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Commit round. + * @member {number} round + * @memberof tendermint.types.Commit + * @instance + */ + Commit.prototype.round = 0; + + /** + * Commit blockId. + * @member {tendermint.types.IBlockID|null|undefined} blockId + * @memberof tendermint.types.Commit + * @instance + */ + Commit.prototype.blockId = null; + + /** + * Commit signatures. + * @member {Array.} signatures + * @memberof tendermint.types.Commit + * @instance + */ + Commit.prototype.signatures = $util.emptyArray; + + /** + * Creates a new Commit instance using the specified properties. + * @function create + * @memberof tendermint.types.Commit + * @static + * @param {tendermint.types.ICommit=} [properties] Properties to set + * @returns {tendermint.types.Commit} Commit instance + */ + Commit.create = function create(properties) { + return new Commit(properties); + }; + + /** + * Encodes the specified Commit message. Does not implicitly {@link tendermint.types.Commit.verify|verify} messages. + * @function encode + * @memberof tendermint.types.Commit + * @static + * @param {tendermint.types.ICommit} message Commit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Commit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.height); + if (message.round != null && Object.hasOwnProperty.call(message, "round")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.round); + if (message.blockId != null && Object.hasOwnProperty.call(message, "blockId")) + $root.tendermint.types.BlockID.encode(message.blockId, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.signatures != null && message.signatures.length) + for (var i = 0; i < message.signatures.length; ++i) + $root.tendermint.types.CommitSig.encode(message.signatures[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Commit message, length delimited. Does not implicitly {@link tendermint.types.Commit.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.Commit + * @static + * @param {tendermint.types.ICommit} message Commit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Commit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Commit message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.Commit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.Commit} Commit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Commit.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Commit(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + case 2: + message.round = reader.int32(); + break; + case 3: + message.blockId = $root.tendermint.types.BlockID.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.signatures && message.signatures.length)) + message.signatures = []; + message.signatures.push($root.tendermint.types.CommitSig.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Commit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.Commit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.Commit} Commit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Commit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Commit message. + * @function verify + * @memberof tendermint.types.Commit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Commit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.round != null && message.hasOwnProperty("round")) + if (!$util.isInteger(message.round)) + return "round: integer expected"; + if (message.blockId != null && message.hasOwnProperty("blockId")) { + var error = $root.tendermint.types.BlockID.verify(message.blockId); + if (error) + return "blockId." + error; + } + if (message.signatures != null && message.hasOwnProperty("signatures")) { + if (!Array.isArray(message.signatures)) + return "signatures: array expected"; + for (var i = 0; i < message.signatures.length; ++i) { + var error = $root.tendermint.types.CommitSig.verify(message.signatures[i]); + if (error) + return "signatures." + error; + } + } + return null; + }; + + /** + * Creates a Commit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.Commit + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.Commit} Commit + */ + Commit.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.Commit) + return object; + var message = new $root.tendermint.types.Commit(); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + if (object.round != null) + message.round = object.round | 0; + if (object.blockId != null) { + if (typeof object.blockId !== "object") + throw TypeError(".tendermint.types.Commit.blockId: object expected"); + message.blockId = $root.tendermint.types.BlockID.fromObject(object.blockId); + } + if (object.signatures) { + if (!Array.isArray(object.signatures)) + throw TypeError(".tendermint.types.Commit.signatures: array expected"); + message.signatures = []; + for (var i = 0; i < object.signatures.length; ++i) { + if (typeof object.signatures[i] !== "object") + throw TypeError(".tendermint.types.Commit.signatures: object expected"); + message.signatures[i] = $root.tendermint.types.CommitSig.fromObject(object.signatures[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Commit message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.Commit + * @static + * @param {tendermint.types.Commit} message Commit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Commit.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.signatures = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.round = 0; + object.blockId = null; + } + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + if (message.round != null && message.hasOwnProperty("round")) + object.round = message.round; + if (message.blockId != null && message.hasOwnProperty("blockId")) + object.blockId = $root.tendermint.types.BlockID.toObject(message.blockId, options); + if (message.signatures && message.signatures.length) { + object.signatures = []; + for (var j = 0; j < message.signatures.length; ++j) + object.signatures[j] = $root.tendermint.types.CommitSig.toObject(message.signatures[j], options); + } + return object; + }; + + /** + * Converts this Commit to JSON. + * @function toJSON + * @memberof tendermint.types.Commit + * @instance + * @returns {Object.} JSON object + */ + Commit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Commit; + })(types.Commit || {}); + + types.CommitSig = (function(CommitSig) { + + /** + * Properties of a CommitSig. + * @memberof tendermint.types + * @interface ICommitSig + * @property {tendermint.types.BlockIDFlag|null} [blockIdFlag] CommitSig blockIdFlag + * @property {Uint8Array|null} [validatorAddress] CommitSig validatorAddress + * @property {google.protobuf.ITimestamp|null} [timestamp] CommitSig timestamp + * @property {Uint8Array|null} [signature] CommitSig signature + */ + + /** + * Constructs a new CommitSig. + * @memberof tendermint.types + * @classdesc Represents a CommitSig. + * @implements ICommitSig + * @constructor + * @param {tendermint.types.ICommitSig=} [properties] Properties to set + */ + function CommitSig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommitSig blockIdFlag. + * @member {tendermint.types.BlockIDFlag} blockIdFlag + * @memberof tendermint.types.CommitSig + * @instance + */ + CommitSig.prototype.blockIdFlag = 0; + + /** + * CommitSig validatorAddress. + * @member {Uint8Array} validatorAddress + * @memberof tendermint.types.CommitSig + * @instance + */ + CommitSig.prototype.validatorAddress = $util.newBuffer([]); + + /** + * CommitSig timestamp. + * @member {google.protobuf.ITimestamp|null|undefined} timestamp + * @memberof tendermint.types.CommitSig + * @instance + */ + CommitSig.prototype.timestamp = null; + + /** + * CommitSig signature. + * @member {Uint8Array} signature + * @memberof tendermint.types.CommitSig + * @instance + */ + CommitSig.prototype.signature = $util.newBuffer([]); + + /** + * Creates a new CommitSig instance using the specified properties. + * @function create + * @memberof tendermint.types.CommitSig + * @static + * @param {tendermint.types.ICommitSig=} [properties] Properties to set + * @returns {tendermint.types.CommitSig} CommitSig instance + */ + CommitSig.create = function create(properties) { + return new CommitSig(properties); + }; + + /** + * Encodes the specified CommitSig message. Does not implicitly {@link tendermint.types.CommitSig.verify|verify} messages. + * @function encode + * @memberof tendermint.types.CommitSig + * @static + * @param {tendermint.types.ICommitSig} message CommitSig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitSig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.blockIdFlag != null && Object.hasOwnProperty.call(message, "blockIdFlag")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.blockIdFlag); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.validatorAddress); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.signature); + return writer; + }; + + /** + * Encodes the specified CommitSig message, length delimited. Does not implicitly {@link tendermint.types.CommitSig.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.CommitSig + * @static + * @param {tendermint.types.ICommitSig} message CommitSig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitSig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommitSig message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.CommitSig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.CommitSig} CommitSig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitSig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.CommitSig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockIdFlag = reader.int32(); + break; + case 2: + message.validatorAddress = reader.bytes(); + break; + case 3: + message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 4: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommitSig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.CommitSig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.CommitSig} CommitSig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitSig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommitSig message. + * @function verify + * @memberof tendermint.types.CommitSig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommitSig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.blockIdFlag != null && message.hasOwnProperty("blockIdFlag")) + switch (message.blockIdFlag) { + default: + return "blockIdFlag: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!(message.validatorAddress && typeof message.validatorAddress.length === "number" || $util.isString(message.validatorAddress))) + return "validatorAddress: buffer expected"; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.timestamp); + if (error) + return "timestamp." + error; + } + if (message.signature != null && message.hasOwnProperty("signature")) + if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) + return "signature: buffer expected"; + return null; + }; + + /** + * Creates a CommitSig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.CommitSig + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.CommitSig} CommitSig + */ + CommitSig.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.CommitSig) + return object; + var message = new $root.tendermint.types.CommitSig(); + switch (object.blockIdFlag) { + case "BLOCK_ID_FLAG_UNKNOWN": + case 0: + message.blockIdFlag = 0; + break; + case "BLOCK_ID_FLAG_ABSENT": + case 1: + message.blockIdFlag = 1; + break; + case "BLOCK_ID_FLAG_COMMIT": + case 2: + message.blockIdFlag = 2; + break; + case "BLOCK_ID_FLAG_NIL": + case 3: + message.blockIdFlag = 3; + break; + } + if (object.validatorAddress != null) + if (typeof object.validatorAddress === "string") + $util.base64.decode(object.validatorAddress, message.validatorAddress = $util.newBuffer($util.base64.length(object.validatorAddress)), 0); + else if (object.validatorAddress.length) + message.validatorAddress = object.validatorAddress; + if (object.timestamp != null) { + if (typeof object.timestamp !== "object") + throw TypeError(".tendermint.types.CommitSig.timestamp: object expected"); + message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); + } + if (object.signature != null) + if (typeof object.signature === "string") + $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); + else if (object.signature.length) + message.signature = object.signature; + return message; + }; + + /** + * Creates a plain object from a CommitSig message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.CommitSig + * @static + * @param {tendermint.types.CommitSig} message CommitSig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommitSig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.blockIdFlag = options.enums === String ? "BLOCK_ID_FLAG_UNKNOWN" : 0; + if (options.bytes === String) + object.validatorAddress = ""; + else { + object.validatorAddress = []; + if (options.bytes !== Array) + object.validatorAddress = $util.newBuffer(object.validatorAddress); + } + object.timestamp = null; + if (options.bytes === String) + object.signature = ""; + else { + object.signature = []; + if (options.bytes !== Array) + object.signature = $util.newBuffer(object.signature); + } + } + if (message.blockIdFlag != null && message.hasOwnProperty("blockIdFlag")) + object.blockIdFlag = options.enums === String ? $root.tendermint.types.BlockIDFlag[message.blockIdFlag] : message.blockIdFlag; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = options.bytes === String ? $util.base64.encode(message.validatorAddress, 0, message.validatorAddress.length) : options.bytes === Array ? Array.prototype.slice.call(message.validatorAddress) : message.validatorAddress; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); + if (message.signature != null && message.hasOwnProperty("signature")) + object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; + return object; + }; + + /** + * Converts this CommitSig to JSON. + * @function toJSON + * @memberof tendermint.types.CommitSig + * @instance + * @returns {Object.} JSON object + */ + CommitSig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CommitSig; + })(types.CommitSig || {}); + + types.Proposal = (function(Proposal) { + + /** + * Properties of a Proposal. + * @memberof tendermint.types + * @interface IProposal + * @property {tendermint.types.SignedMsgType|null} [type] Proposal type + * @property {number|Long|null} [height] Proposal height + * @property {number|null} [round] Proposal round + * @property {number|null} [polRound] Proposal polRound + * @property {tendermint.types.IBlockID|null} [blockId] Proposal blockId + * @property {google.protobuf.ITimestamp|null} [timestamp] Proposal timestamp + * @property {Uint8Array|null} [signature] Proposal signature + */ + + /** + * Constructs a new Proposal. + * @memberof tendermint.types + * @classdesc Represents a Proposal. + * @implements IProposal + * @constructor + * @param {tendermint.types.IProposal=} [properties] Properties to set + */ + function Proposal(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Proposal type. + * @member {tendermint.types.SignedMsgType} type + * @memberof tendermint.types.Proposal + * @instance + */ + Proposal.prototype.type = 0; + + /** + * Proposal height. + * @member {number|Long} height + * @memberof tendermint.types.Proposal + * @instance + */ + Proposal.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Proposal round. + * @member {number} round + * @memberof tendermint.types.Proposal + * @instance + */ + Proposal.prototype.round = 0; + + /** + * Proposal polRound. + * @member {number} polRound + * @memberof tendermint.types.Proposal + * @instance + */ + Proposal.prototype.polRound = 0; + + /** + * Proposal blockId. + * @member {tendermint.types.IBlockID|null|undefined} blockId + * @memberof tendermint.types.Proposal + * @instance + */ + Proposal.prototype.blockId = null; + + /** + * Proposal timestamp. + * @member {google.protobuf.ITimestamp|null|undefined} timestamp + * @memberof tendermint.types.Proposal + * @instance + */ + Proposal.prototype.timestamp = null; + + /** + * Proposal signature. + * @member {Uint8Array} signature + * @memberof tendermint.types.Proposal + * @instance + */ + Proposal.prototype.signature = $util.newBuffer([]); + + /** + * Creates a new Proposal instance using the specified properties. + * @function create + * @memberof tendermint.types.Proposal + * @static + * @param {tendermint.types.IProposal=} [properties] Properties to set + * @returns {tendermint.types.Proposal} Proposal instance + */ + Proposal.create = function create(properties) { + return new Proposal(properties); + }; + + /** + * Encodes the specified Proposal message. Does not implicitly {@link tendermint.types.Proposal.verify|verify} messages. + * @function encode + * @memberof tendermint.types.Proposal + * @static + * @param {tendermint.types.IProposal} message Proposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proposal.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.height); + if (message.round != null && Object.hasOwnProperty.call(message, "round")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.round); + if (message.polRound != null && Object.hasOwnProperty.call(message, "polRound")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.polRound); + if (message.blockId != null && Object.hasOwnProperty.call(message, "blockId")) + $root.tendermint.types.BlockID.encode(message.blockId, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.signature); + return writer; + }; + + /** + * Encodes the specified Proposal message, length delimited. Does not implicitly {@link tendermint.types.Proposal.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.Proposal + * @static + * @param {tendermint.types.IProposal} message Proposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proposal.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Proposal message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.Proposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.Proposal} Proposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proposal.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Proposal(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32(); + break; + case 2: + message.height = reader.int64(); + break; + case 3: + message.round = reader.int32(); + break; + case 4: + message.polRound = reader.int32(); + break; + case 5: + message.blockId = $root.tendermint.types.BlockID.decode(reader, reader.uint32()); + break; + case 6: + message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 7: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Proposal message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.Proposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.Proposal} Proposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proposal.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Proposal message. + * @function verify + * @memberof tendermint.types.Proposal + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Proposal.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 32: + break; + } + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.round != null && message.hasOwnProperty("round")) + if (!$util.isInteger(message.round)) + return "round: integer expected"; + if (message.polRound != null && message.hasOwnProperty("polRound")) + if (!$util.isInteger(message.polRound)) + return "polRound: integer expected"; + if (message.blockId != null && message.hasOwnProperty("blockId")) { + var error = $root.tendermint.types.BlockID.verify(message.blockId); + if (error) + return "blockId." + error; + } + if (message.timestamp != null && message.hasOwnProperty("timestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.timestamp); + if (error) + return "timestamp." + error; + } + if (message.signature != null && message.hasOwnProperty("signature")) + if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) + return "signature: buffer expected"; + return null; + }; + + /** + * Creates a Proposal message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.Proposal + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.Proposal} Proposal + */ + Proposal.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.Proposal) + return object; + var message = new $root.tendermint.types.Proposal(); + switch (object.type) { + case "SIGNED_MSG_TYPE_UNKNOWN": + case 0: + message.type = 0; + break; + case "SIGNED_MSG_TYPE_PREVOTE": + case 1: + message.type = 1; + break; + case "SIGNED_MSG_TYPE_PRECOMMIT": + case 2: + message.type = 2; + break; + case "SIGNED_MSG_TYPE_PROPOSAL": + case 32: + message.type = 32; + break; + } + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + if (object.round != null) + message.round = object.round | 0; + if (object.polRound != null) + message.polRound = object.polRound | 0; + if (object.blockId != null) { + if (typeof object.blockId !== "object") + throw TypeError(".tendermint.types.Proposal.blockId: object expected"); + message.blockId = $root.tendermint.types.BlockID.fromObject(object.blockId); + } + if (object.timestamp != null) { + if (typeof object.timestamp !== "object") + throw TypeError(".tendermint.types.Proposal.timestamp: object expected"); + message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); + } + if (object.signature != null) + if (typeof object.signature === "string") + $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); + else if (object.signature.length) + message.signature = object.signature; + return message; + }; + + /** + * Creates a plain object from a Proposal message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.Proposal + * @static + * @param {tendermint.types.Proposal} message Proposal + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Proposal.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "SIGNED_MSG_TYPE_UNKNOWN" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.round = 0; + object.polRound = 0; + object.blockId = null; + object.timestamp = null; + if (options.bytes === String) + object.signature = ""; + else { + object.signature = []; + if (options.bytes !== Array) + object.signature = $util.newBuffer(object.signature); + } + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.tendermint.types.SignedMsgType[message.type] : message.type; + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + if (message.round != null && message.hasOwnProperty("round")) + object.round = message.round; + if (message.polRound != null && message.hasOwnProperty("polRound")) + object.polRound = message.polRound; + if (message.blockId != null && message.hasOwnProperty("blockId")) + object.blockId = $root.tendermint.types.BlockID.toObject(message.blockId, options); + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); + if (message.signature != null && message.hasOwnProperty("signature")) + object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; + return object; + }; + + /** + * Converts this Proposal to JSON. + * @function toJSON + * @memberof tendermint.types.Proposal + * @instance + * @returns {Object.} JSON object + */ + Proposal.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Proposal; + })(types.Proposal || {}); + + types.SignedHeader = (function(SignedHeader) { + + /** + * Properties of a SignedHeader. + * @memberof tendermint.types + * @interface ISignedHeader + * @property {tendermint.types.IHeader|null} [header] SignedHeader header + * @property {tendermint.types.ICommit|null} [commit] SignedHeader commit + */ + + /** + * Constructs a new SignedHeader. + * @memberof tendermint.types + * @classdesc Represents a SignedHeader. + * @implements ISignedHeader + * @constructor + * @param {tendermint.types.ISignedHeader=} [properties] Properties to set + */ + function SignedHeader(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SignedHeader header. + * @member {tendermint.types.IHeader|null|undefined} header + * @memberof tendermint.types.SignedHeader + * @instance + */ + SignedHeader.prototype.header = null; + + /** + * SignedHeader commit. + * @member {tendermint.types.ICommit|null|undefined} commit + * @memberof tendermint.types.SignedHeader + * @instance + */ + SignedHeader.prototype.commit = null; + + /** + * Creates a new SignedHeader instance using the specified properties. + * @function create + * @memberof tendermint.types.SignedHeader + * @static + * @param {tendermint.types.ISignedHeader=} [properties] Properties to set + * @returns {tendermint.types.SignedHeader} SignedHeader instance + */ + SignedHeader.create = function create(properties) { + return new SignedHeader(properties); + }; + + /** + * Encodes the specified SignedHeader message. Does not implicitly {@link tendermint.types.SignedHeader.verify|verify} messages. + * @function encode + * @memberof tendermint.types.SignedHeader + * @static + * @param {tendermint.types.ISignedHeader} message SignedHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignedHeader.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + $root.tendermint.types.Header.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.commit != null && Object.hasOwnProperty.call(message, "commit")) + $root.tendermint.types.Commit.encode(message.commit, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SignedHeader message, length delimited. Does not implicitly {@link tendermint.types.SignedHeader.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.SignedHeader + * @static + * @param {tendermint.types.ISignedHeader} message SignedHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignedHeader.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SignedHeader message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.SignedHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.SignedHeader} SignedHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignedHeader.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.SignedHeader(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.header = $root.tendermint.types.Header.decode(reader, reader.uint32()); + break; + case 2: + message.commit = $root.tendermint.types.Commit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SignedHeader message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.SignedHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.SignedHeader} SignedHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignedHeader.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SignedHeader message. + * @function verify + * @memberof tendermint.types.SignedHeader + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SignedHeader.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.header != null && message.hasOwnProperty("header")) { + var error = $root.tendermint.types.Header.verify(message.header); + if (error) + return "header." + error; + } + if (message.commit != null && message.hasOwnProperty("commit")) { + var error = $root.tendermint.types.Commit.verify(message.commit); + if (error) + return "commit." + error; + } + return null; + }; + + /** + * Creates a SignedHeader message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.SignedHeader + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.SignedHeader} SignedHeader + */ + SignedHeader.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.SignedHeader) + return object; + var message = new $root.tendermint.types.SignedHeader(); + if (object.header != null) { + if (typeof object.header !== "object") + throw TypeError(".tendermint.types.SignedHeader.header: object expected"); + message.header = $root.tendermint.types.Header.fromObject(object.header); + } + if (object.commit != null) { + if (typeof object.commit !== "object") + throw TypeError(".tendermint.types.SignedHeader.commit: object expected"); + message.commit = $root.tendermint.types.Commit.fromObject(object.commit); + } + return message; + }; + + /** + * Creates a plain object from a SignedHeader message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.SignedHeader + * @static + * @param {tendermint.types.SignedHeader} message SignedHeader + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SignedHeader.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.header = null; + object.commit = null; + } + if (message.header != null && message.hasOwnProperty("header")) + object.header = $root.tendermint.types.Header.toObject(message.header, options); + if (message.commit != null && message.hasOwnProperty("commit")) + object.commit = $root.tendermint.types.Commit.toObject(message.commit, options); + return object; + }; + + /** + * Converts this SignedHeader to JSON. + * @function toJSON + * @memberof tendermint.types.SignedHeader + * @instance + * @returns {Object.} JSON object + */ + SignedHeader.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SignedHeader; + })(types.SignedHeader || {}); + + types.LightBlock = (function(LightBlock) { + + /** + * Properties of a LightBlock. + * @memberof tendermint.types + * @interface ILightBlock + * @property {tendermint.types.ISignedHeader|null} [signedHeader] LightBlock signedHeader + * @property {tendermint.types.IValidatorSet|null} [validatorSet] LightBlock validatorSet + */ + + /** + * Constructs a new LightBlock. + * @memberof tendermint.types + * @classdesc Represents a LightBlock. + * @implements ILightBlock + * @constructor + * @param {tendermint.types.ILightBlock=} [properties] Properties to set + */ + function LightBlock(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LightBlock signedHeader. + * @member {tendermint.types.ISignedHeader|null|undefined} signedHeader + * @memberof tendermint.types.LightBlock + * @instance + */ + LightBlock.prototype.signedHeader = null; + + /** + * LightBlock validatorSet. + * @member {tendermint.types.IValidatorSet|null|undefined} validatorSet + * @memberof tendermint.types.LightBlock + * @instance + */ + LightBlock.prototype.validatorSet = null; + + /** + * Creates a new LightBlock instance using the specified properties. + * @function create + * @memberof tendermint.types.LightBlock + * @static + * @param {tendermint.types.ILightBlock=} [properties] Properties to set + * @returns {tendermint.types.LightBlock} LightBlock instance + */ + LightBlock.create = function create(properties) { + return new LightBlock(properties); + }; + + /** + * Encodes the specified LightBlock message. Does not implicitly {@link tendermint.types.LightBlock.verify|verify} messages. + * @function encode + * @memberof tendermint.types.LightBlock + * @static + * @param {tendermint.types.ILightBlock} message LightBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LightBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.signedHeader != null && Object.hasOwnProperty.call(message, "signedHeader")) + $root.tendermint.types.SignedHeader.encode(message.signedHeader, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.validatorSet != null && Object.hasOwnProperty.call(message, "validatorSet")) + $root.tendermint.types.ValidatorSet.encode(message.validatorSet, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LightBlock message, length delimited. Does not implicitly {@link tendermint.types.LightBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.LightBlock + * @static + * @param {tendermint.types.ILightBlock} message LightBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LightBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LightBlock message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.LightBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.LightBlock} LightBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LightBlock.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.LightBlock(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signedHeader = $root.tendermint.types.SignedHeader.decode(reader, reader.uint32()); + break; + case 2: + message.validatorSet = $root.tendermint.types.ValidatorSet.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LightBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.LightBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.LightBlock} LightBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LightBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LightBlock message. + * @function verify + * @memberof tendermint.types.LightBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LightBlock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.signedHeader != null && message.hasOwnProperty("signedHeader")) { + var error = $root.tendermint.types.SignedHeader.verify(message.signedHeader); + if (error) + return "signedHeader." + error; + } + if (message.validatorSet != null && message.hasOwnProperty("validatorSet")) { + var error = $root.tendermint.types.ValidatorSet.verify(message.validatorSet); + if (error) + return "validatorSet." + error; + } + return null; + }; + + /** + * Creates a LightBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.LightBlock + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.LightBlock} LightBlock + */ + LightBlock.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.LightBlock) + return object; + var message = new $root.tendermint.types.LightBlock(); + if (object.signedHeader != null) { + if (typeof object.signedHeader !== "object") + throw TypeError(".tendermint.types.LightBlock.signedHeader: object expected"); + message.signedHeader = $root.tendermint.types.SignedHeader.fromObject(object.signedHeader); + } + if (object.validatorSet != null) { + if (typeof object.validatorSet !== "object") + throw TypeError(".tendermint.types.LightBlock.validatorSet: object expected"); + message.validatorSet = $root.tendermint.types.ValidatorSet.fromObject(object.validatorSet); + } + return message; + }; + + /** + * Creates a plain object from a LightBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.LightBlock + * @static + * @param {tendermint.types.LightBlock} message LightBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LightBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.signedHeader = null; + object.validatorSet = null; + } + if (message.signedHeader != null && message.hasOwnProperty("signedHeader")) + object.signedHeader = $root.tendermint.types.SignedHeader.toObject(message.signedHeader, options); + if (message.validatorSet != null && message.hasOwnProperty("validatorSet")) + object.validatorSet = $root.tendermint.types.ValidatorSet.toObject(message.validatorSet, options); + return object; + }; + + /** + * Converts this LightBlock to JSON. + * @function toJSON + * @memberof tendermint.types.LightBlock + * @instance + * @returns {Object.} JSON object + */ + LightBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LightBlock; + })(types.LightBlock || {}); + + types.BlockMeta = (function(BlockMeta) { + + /** + * Properties of a BlockMeta. + * @memberof tendermint.types + * @interface IBlockMeta + * @property {tendermint.types.IBlockID|null} [blockId] BlockMeta blockId + * @property {number|Long|null} [blockSize] BlockMeta blockSize + * @property {tendermint.types.IHeader|null} [header] BlockMeta header + * @property {number|Long|null} [numTxs] BlockMeta numTxs + */ + + /** + * Constructs a new BlockMeta. + * @memberof tendermint.types + * @classdesc Represents a BlockMeta. + * @implements IBlockMeta + * @constructor + * @param {tendermint.types.IBlockMeta=} [properties] Properties to set + */ + function BlockMeta(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BlockMeta blockId. + * @member {tendermint.types.IBlockID|null|undefined} blockId + * @memberof tendermint.types.BlockMeta + * @instance + */ + BlockMeta.prototype.blockId = null; + + /** + * BlockMeta blockSize. + * @member {number|Long} blockSize + * @memberof tendermint.types.BlockMeta + * @instance + */ + BlockMeta.prototype.blockSize = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BlockMeta header. + * @member {tendermint.types.IHeader|null|undefined} header + * @memberof tendermint.types.BlockMeta + * @instance + */ + BlockMeta.prototype.header = null; + + /** + * BlockMeta numTxs. + * @member {number|Long} numTxs + * @memberof tendermint.types.BlockMeta + * @instance + */ + BlockMeta.prototype.numTxs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new BlockMeta instance using the specified properties. + * @function create + * @memberof tendermint.types.BlockMeta + * @static + * @param {tendermint.types.IBlockMeta=} [properties] Properties to set + * @returns {tendermint.types.BlockMeta} BlockMeta instance + */ + BlockMeta.create = function create(properties) { + return new BlockMeta(properties); + }; + + /** + * Encodes the specified BlockMeta message. Does not implicitly {@link tendermint.types.BlockMeta.verify|verify} messages. + * @function encode + * @memberof tendermint.types.BlockMeta + * @static + * @param {tendermint.types.IBlockMeta} message BlockMeta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlockMeta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.blockId != null && Object.hasOwnProperty.call(message, "blockId")) + $root.tendermint.types.BlockID.encode(message.blockId, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.blockSize != null && Object.hasOwnProperty.call(message, "blockSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.blockSize); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + $root.tendermint.types.Header.encode(message.header, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.numTxs != null && Object.hasOwnProperty.call(message, "numTxs")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.numTxs); + return writer; + }; + + /** + * Encodes the specified BlockMeta message, length delimited. Does not implicitly {@link tendermint.types.BlockMeta.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.BlockMeta + * @static + * @param {tendermint.types.IBlockMeta} message BlockMeta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlockMeta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BlockMeta message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.BlockMeta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.BlockMeta} BlockMeta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlockMeta.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.BlockMeta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockId = $root.tendermint.types.BlockID.decode(reader, reader.uint32()); + break; + case 2: + message.blockSize = reader.int64(); + break; + case 3: + message.header = $root.tendermint.types.Header.decode(reader, reader.uint32()); + break; + case 4: + message.numTxs = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BlockMeta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.BlockMeta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.BlockMeta} BlockMeta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlockMeta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BlockMeta message. + * @function verify + * @memberof tendermint.types.BlockMeta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BlockMeta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.blockId != null && message.hasOwnProperty("blockId")) { + var error = $root.tendermint.types.BlockID.verify(message.blockId); + if (error) + return "blockId." + error; + } + if (message.blockSize != null && message.hasOwnProperty("blockSize")) + if (!$util.isInteger(message.blockSize) && !(message.blockSize && $util.isInteger(message.blockSize.low) && $util.isInteger(message.blockSize.high))) + return "blockSize: integer|Long expected"; + if (message.header != null && message.hasOwnProperty("header")) { + var error = $root.tendermint.types.Header.verify(message.header); + if (error) + return "header." + error; + } + if (message.numTxs != null && message.hasOwnProperty("numTxs")) + if (!$util.isInteger(message.numTxs) && !(message.numTxs && $util.isInteger(message.numTxs.low) && $util.isInteger(message.numTxs.high))) + return "numTxs: integer|Long expected"; + return null; + }; + + /** + * Creates a BlockMeta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.BlockMeta + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.BlockMeta} BlockMeta + */ + BlockMeta.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.BlockMeta) + return object; + var message = new $root.tendermint.types.BlockMeta(); + if (object.blockId != null) { + if (typeof object.blockId !== "object") + throw TypeError(".tendermint.types.BlockMeta.blockId: object expected"); + message.blockId = $root.tendermint.types.BlockID.fromObject(object.blockId); + } + if (object.blockSize != null) + if ($util.Long) + (message.blockSize = $util.Long.fromValue(object.blockSize)).unsigned = false; + else if (typeof object.blockSize === "string") + message.blockSize = parseInt(object.blockSize, 10); + else if (typeof object.blockSize === "number") + message.blockSize = object.blockSize; + else if (typeof object.blockSize === "object") + message.blockSize = new $util.LongBits(object.blockSize.low >>> 0, object.blockSize.high >>> 0).toNumber(); + if (object.header != null) { + if (typeof object.header !== "object") + throw TypeError(".tendermint.types.BlockMeta.header: object expected"); + message.header = $root.tendermint.types.Header.fromObject(object.header); + } + if (object.numTxs != null) + if ($util.Long) + (message.numTxs = $util.Long.fromValue(object.numTxs)).unsigned = false; + else if (typeof object.numTxs === "string") + message.numTxs = parseInt(object.numTxs, 10); + else if (typeof object.numTxs === "number") + message.numTxs = object.numTxs; + else if (typeof object.numTxs === "object") + message.numTxs = new $util.LongBits(object.numTxs.low >>> 0, object.numTxs.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a BlockMeta message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.BlockMeta + * @static + * @param {tendermint.types.BlockMeta} message BlockMeta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BlockMeta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.blockId = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.blockSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.blockSize = options.longs === String ? "0" : 0; + object.header = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.numTxs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.numTxs = options.longs === String ? "0" : 0; + } + if (message.blockId != null && message.hasOwnProperty("blockId")) + object.blockId = $root.tendermint.types.BlockID.toObject(message.blockId, options); + if (message.blockSize != null && message.hasOwnProperty("blockSize")) + if (typeof message.blockSize === "number") + object.blockSize = options.longs === String ? String(message.blockSize) : message.blockSize; + else + object.blockSize = options.longs === String ? $util.Long.prototype.toString.call(message.blockSize) : options.longs === Number ? new $util.LongBits(message.blockSize.low >>> 0, message.blockSize.high >>> 0).toNumber() : message.blockSize; + if (message.header != null && message.hasOwnProperty("header")) + object.header = $root.tendermint.types.Header.toObject(message.header, options); + if (message.numTxs != null && message.hasOwnProperty("numTxs")) + if (typeof message.numTxs === "number") + object.numTxs = options.longs === String ? String(message.numTxs) : message.numTxs; + else + object.numTxs = options.longs === String ? $util.Long.prototype.toString.call(message.numTxs) : options.longs === Number ? new $util.LongBits(message.numTxs.low >>> 0, message.numTxs.high >>> 0).toNumber() : message.numTxs; + return object; + }; + + /** + * Converts this BlockMeta to JSON. + * @function toJSON + * @memberof tendermint.types.BlockMeta + * @instance + * @returns {Object.} JSON object + */ + BlockMeta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BlockMeta; + })(types.BlockMeta || {}); + + types.TxProof = (function(TxProof) { + + /** + * Properties of a TxProof. + * @memberof tendermint.types + * @interface ITxProof + * @property {Uint8Array|null} [rootHash] TxProof rootHash + * @property {Uint8Array|null} [data] TxProof data + * @property {tendermint.crypto.IProof|null} [proof] TxProof proof + */ + + /** + * Constructs a new TxProof. + * @memberof tendermint.types + * @classdesc Represents a TxProof. + * @implements ITxProof + * @constructor + * @param {tendermint.types.ITxProof=} [properties] Properties to set + */ + function TxProof(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TxProof rootHash. + * @member {Uint8Array} rootHash + * @memberof tendermint.types.TxProof + * @instance + */ + TxProof.prototype.rootHash = $util.newBuffer([]); + + /** + * TxProof data. + * @member {Uint8Array} data + * @memberof tendermint.types.TxProof + * @instance + */ + TxProof.prototype.data = $util.newBuffer([]); + + /** + * TxProof proof. + * @member {tendermint.crypto.IProof|null|undefined} proof + * @memberof tendermint.types.TxProof + * @instance + */ + TxProof.prototype.proof = null; + + /** + * Creates a new TxProof instance using the specified properties. + * @function create + * @memberof tendermint.types.TxProof + * @static + * @param {tendermint.types.ITxProof=} [properties] Properties to set + * @returns {tendermint.types.TxProof} TxProof instance + */ + TxProof.create = function create(properties) { + return new TxProof(properties); + }; + + /** + * Encodes the specified TxProof message. Does not implicitly {@link tendermint.types.TxProof.verify|verify} messages. + * @function encode + * @memberof tendermint.types.TxProof + * @static + * @param {tendermint.types.ITxProof} message TxProof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TxProof.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rootHash != null && Object.hasOwnProperty.call(message, "rootHash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.rootHash); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.tendermint.crypto.Proof.encode(message.proof, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TxProof message, length delimited. Does not implicitly {@link tendermint.types.TxProof.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.TxProof + * @static + * @param {tendermint.types.ITxProof} message TxProof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TxProof.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TxProof message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.TxProof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.TxProof} TxProof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TxProof.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.TxProof(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rootHash = reader.bytes(); + break; + case 2: + message.data = reader.bytes(); + break; + case 3: + message.proof = $root.tendermint.crypto.Proof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TxProof message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.TxProof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.TxProof} TxProof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TxProof.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TxProof message. + * @function verify + * @memberof tendermint.types.TxProof + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TxProof.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rootHash != null && message.hasOwnProperty("rootHash")) + if (!(message.rootHash && typeof message.rootHash.length === "number" || $util.isString(message.rootHash))) + return "rootHash: buffer expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + if (message.proof != null && message.hasOwnProperty("proof")) { + var error = $root.tendermint.crypto.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + return null; + }; + + /** + * Creates a TxProof message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.TxProof + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.TxProof} TxProof + */ + TxProof.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.TxProof) + return object; + var message = new $root.tendermint.types.TxProof(); + if (object.rootHash != null) + if (typeof object.rootHash === "string") + $util.base64.decode(object.rootHash, message.rootHash = $util.newBuffer($util.base64.length(object.rootHash)), 0); + else if (object.rootHash.length) + message.rootHash = object.rootHash; + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length) + message.data = object.data; + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".tendermint.types.TxProof.proof: object expected"); + message.proof = $root.tendermint.crypto.Proof.fromObject(object.proof); + } + return message; + }; + + /** + * Creates a plain object from a TxProof message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.TxProof + * @static + * @param {tendermint.types.TxProof} message TxProof + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TxProof.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.rootHash = ""; + else { + object.rootHash = []; + if (options.bytes !== Array) + object.rootHash = $util.newBuffer(object.rootHash); + } + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + object.proof = null; + } + if (message.rootHash != null && message.hasOwnProperty("rootHash")) + object.rootHash = options.bytes === String ? $util.base64.encode(message.rootHash, 0, message.rootHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.rootHash) : message.rootHash; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + if (message.proof != null && message.hasOwnProperty("proof")) + object.proof = $root.tendermint.crypto.Proof.toObject(message.proof, options); + return object; + }; + + /** + * Converts this TxProof to JSON. + * @function toJSON + * @memberof tendermint.types.TxProof + * @instance + * @returns {Object.} JSON object + */ + TxProof.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TxProof; + })(types.TxProof || {}); + + types.ValidatorSet = (function(ValidatorSet) { + + /** + * Properties of a ValidatorSet. + * @memberof tendermint.types + * @interface IValidatorSet + * @property {Array.|null} [validators] ValidatorSet validators + * @property {tendermint.types.IValidator|null} [proposer] ValidatorSet proposer + * @property {number|Long|null} [totalVotingPower] ValidatorSet totalVotingPower + */ + + /** + * Constructs a new ValidatorSet. + * @memberof tendermint.types + * @classdesc Represents a ValidatorSet. + * @implements IValidatorSet + * @constructor + * @param {tendermint.types.IValidatorSet=} [properties] Properties to set + */ + function ValidatorSet(properties) { + this.validators = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidatorSet validators. + * @member {Array.} validators + * @memberof tendermint.types.ValidatorSet + * @instance + */ + ValidatorSet.prototype.validators = $util.emptyArray; + + /** + * ValidatorSet proposer. + * @member {tendermint.types.IValidator|null|undefined} proposer + * @memberof tendermint.types.ValidatorSet + * @instance + */ + ValidatorSet.prototype.proposer = null; + + /** + * ValidatorSet totalVotingPower. + * @member {number|Long} totalVotingPower + * @memberof tendermint.types.ValidatorSet + * @instance + */ + ValidatorSet.prototype.totalVotingPower = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ValidatorSet instance using the specified properties. + * @function create + * @memberof tendermint.types.ValidatorSet + * @static + * @param {tendermint.types.IValidatorSet=} [properties] Properties to set + * @returns {tendermint.types.ValidatorSet} ValidatorSet instance + */ + ValidatorSet.create = function create(properties) { + return new ValidatorSet(properties); + }; + + /** + * Encodes the specified ValidatorSet message. Does not implicitly {@link tendermint.types.ValidatorSet.verify|verify} messages. + * @function encode + * @memberof tendermint.types.ValidatorSet + * @static + * @param {tendermint.types.IValidatorSet} message ValidatorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validators != null && message.validators.length) + for (var i = 0; i < message.validators.length; ++i) + $root.tendermint.types.Validator.encode(message.validators[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proposer != null && Object.hasOwnProperty.call(message, "proposer")) + $root.tendermint.types.Validator.encode(message.proposer, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.totalVotingPower != null && Object.hasOwnProperty.call(message, "totalVotingPower")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.totalVotingPower); + return writer; + }; + + /** + * Encodes the specified ValidatorSet message, length delimited. Does not implicitly {@link tendermint.types.ValidatorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.ValidatorSet + * @static + * @param {tendermint.types.IValidatorSet} message ValidatorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidatorSet message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.ValidatorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.ValidatorSet} ValidatorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.ValidatorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.validators && message.validators.length)) + message.validators = []; + message.validators.push($root.tendermint.types.Validator.decode(reader, reader.uint32())); + break; + case 2: + message.proposer = $root.tendermint.types.Validator.decode(reader, reader.uint32()); + break; + case 3: + message.totalVotingPower = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidatorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.ValidatorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.ValidatorSet} ValidatorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidatorSet message. + * @function verify + * @memberof tendermint.types.ValidatorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidatorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validators != null && message.hasOwnProperty("validators")) { + if (!Array.isArray(message.validators)) + return "validators: array expected"; + for (var i = 0; i < message.validators.length; ++i) { + var error = $root.tendermint.types.Validator.verify(message.validators[i]); + if (error) + return "validators." + error; + } + } + if (message.proposer != null && message.hasOwnProperty("proposer")) { + var error = $root.tendermint.types.Validator.verify(message.proposer); + if (error) + return "proposer." + error; + } + if (message.totalVotingPower != null && message.hasOwnProperty("totalVotingPower")) + if (!$util.isInteger(message.totalVotingPower) && !(message.totalVotingPower && $util.isInteger(message.totalVotingPower.low) && $util.isInteger(message.totalVotingPower.high))) + return "totalVotingPower: integer|Long expected"; + return null; + }; + + /** + * Creates a ValidatorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.ValidatorSet + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.ValidatorSet} ValidatorSet + */ + ValidatorSet.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.ValidatorSet) + return object; + var message = new $root.tendermint.types.ValidatorSet(); + if (object.validators) { + if (!Array.isArray(object.validators)) + throw TypeError(".tendermint.types.ValidatorSet.validators: array expected"); + message.validators = []; + for (var i = 0; i < object.validators.length; ++i) { + if (typeof object.validators[i] !== "object") + throw TypeError(".tendermint.types.ValidatorSet.validators: object expected"); + message.validators[i] = $root.tendermint.types.Validator.fromObject(object.validators[i]); + } + } + if (object.proposer != null) { + if (typeof object.proposer !== "object") + throw TypeError(".tendermint.types.ValidatorSet.proposer: object expected"); + message.proposer = $root.tendermint.types.Validator.fromObject(object.proposer); + } + if (object.totalVotingPower != null) + if ($util.Long) + (message.totalVotingPower = $util.Long.fromValue(object.totalVotingPower)).unsigned = false; + else if (typeof object.totalVotingPower === "string") + message.totalVotingPower = parseInt(object.totalVotingPower, 10); + else if (typeof object.totalVotingPower === "number") + message.totalVotingPower = object.totalVotingPower; + else if (typeof object.totalVotingPower === "object") + message.totalVotingPower = new $util.LongBits(object.totalVotingPower.low >>> 0, object.totalVotingPower.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ValidatorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.ValidatorSet + * @static + * @param {tendermint.types.ValidatorSet} message ValidatorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidatorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.validators = []; + if (options.defaults) { + object.proposer = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalVotingPower = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalVotingPower = options.longs === String ? "0" : 0; + } + if (message.validators && message.validators.length) { + object.validators = []; + for (var j = 0; j < message.validators.length; ++j) + object.validators[j] = $root.tendermint.types.Validator.toObject(message.validators[j], options); + } + if (message.proposer != null && message.hasOwnProperty("proposer")) + object.proposer = $root.tendermint.types.Validator.toObject(message.proposer, options); + if (message.totalVotingPower != null && message.hasOwnProperty("totalVotingPower")) + if (typeof message.totalVotingPower === "number") + object.totalVotingPower = options.longs === String ? String(message.totalVotingPower) : message.totalVotingPower; + else + object.totalVotingPower = options.longs === String ? $util.Long.prototype.toString.call(message.totalVotingPower) : options.longs === Number ? new $util.LongBits(message.totalVotingPower.low >>> 0, message.totalVotingPower.high >>> 0).toNumber() : message.totalVotingPower; + return object; + }; + + /** + * Converts this ValidatorSet to JSON. + * @function toJSON + * @memberof tendermint.types.ValidatorSet + * @instance + * @returns {Object.} JSON object + */ + ValidatorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidatorSet; + })(types.ValidatorSet || {}); + + types.Validator = (function(Validator) { + + /** + * Properties of a Validator. + * @memberof tendermint.types + * @interface IValidator + * @property {Uint8Array|null} [address] Validator address + * @property {tendermint.crypto.IPublicKey|null} [pubKey] Validator pubKey + * @property {number|Long|null} [votingPower] Validator votingPower + * @property {number|Long|null} [proposerPriority] Validator proposerPriority + */ + + /** + * Constructs a new Validator. + * @memberof tendermint.types + * @classdesc Represents a Validator. + * @implements IValidator + * @constructor + * @param {tendermint.types.IValidator=} [properties] Properties to set + */ + function Validator(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Validator address. + * @member {Uint8Array} address + * @memberof tendermint.types.Validator + * @instance + */ + Validator.prototype.address = $util.newBuffer([]); + + /** + * Validator pubKey. + * @member {tendermint.crypto.IPublicKey|null|undefined} pubKey + * @memberof tendermint.types.Validator + * @instance + */ + Validator.prototype.pubKey = null; + + /** + * Validator votingPower. + * @member {number|Long} votingPower + * @memberof tendermint.types.Validator + * @instance + */ + Validator.prototype.votingPower = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Validator proposerPriority. + * @member {number|Long} proposerPriority + * @memberof tendermint.types.Validator + * @instance + */ + Validator.prototype.proposerPriority = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Validator instance using the specified properties. + * @function create + * @memberof tendermint.types.Validator + * @static + * @param {tendermint.types.IValidator=} [properties] Properties to set + * @returns {tendermint.types.Validator} Validator instance + */ + Validator.create = function create(properties) { + return new Validator(properties); + }; + + /** + * Encodes the specified Validator message. Does not implicitly {@link tendermint.types.Validator.verify|verify} messages. + * @function encode + * @memberof tendermint.types.Validator + * @static + * @param {tendermint.types.IValidator} message Validator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Validator.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.address); + if (message.pubKey != null && Object.hasOwnProperty.call(message, "pubKey")) + $root.tendermint.crypto.PublicKey.encode(message.pubKey, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.votingPower != null && Object.hasOwnProperty.call(message, "votingPower")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.votingPower); + if (message.proposerPriority != null && Object.hasOwnProperty.call(message, "proposerPriority")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.proposerPriority); + return writer; + }; + + /** + * Encodes the specified Validator message, length delimited. Does not implicitly {@link tendermint.types.Validator.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.Validator + * @static + * @param {tendermint.types.IValidator} message Validator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Validator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Validator message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.Validator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.Validator} Validator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Validator.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Validator(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.bytes(); + break; + case 2: + message.pubKey = $root.tendermint.crypto.PublicKey.decode(reader, reader.uint32()); + break; + case 3: + message.votingPower = reader.int64(); + break; + case 4: + message.proposerPriority = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Validator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.Validator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.Validator} Validator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Validator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Validator message. + * @function verify + * @memberof tendermint.types.Validator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Validator.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!(message.address && typeof message.address.length === "number" || $util.isString(message.address))) + return "address: buffer expected"; + if (message.pubKey != null && message.hasOwnProperty("pubKey")) { + var error = $root.tendermint.crypto.PublicKey.verify(message.pubKey); + if (error) + return "pubKey." + error; + } + if (message.votingPower != null && message.hasOwnProperty("votingPower")) + if (!$util.isInteger(message.votingPower) && !(message.votingPower && $util.isInteger(message.votingPower.low) && $util.isInteger(message.votingPower.high))) + return "votingPower: integer|Long expected"; + if (message.proposerPriority != null && message.hasOwnProperty("proposerPriority")) + if (!$util.isInteger(message.proposerPriority) && !(message.proposerPriority && $util.isInteger(message.proposerPriority.low) && $util.isInteger(message.proposerPriority.high))) + return "proposerPriority: integer|Long expected"; + return null; + }; + + /** + * Creates a Validator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.Validator + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.Validator} Validator + */ + Validator.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.Validator) + return object; + var message = new $root.tendermint.types.Validator(); + if (object.address != null) + if (typeof object.address === "string") + $util.base64.decode(object.address, message.address = $util.newBuffer($util.base64.length(object.address)), 0); + else if (object.address.length) + message.address = object.address; + if (object.pubKey != null) { + if (typeof object.pubKey !== "object") + throw TypeError(".tendermint.types.Validator.pubKey: object expected"); + message.pubKey = $root.tendermint.crypto.PublicKey.fromObject(object.pubKey); + } + if (object.votingPower != null) + if ($util.Long) + (message.votingPower = $util.Long.fromValue(object.votingPower)).unsigned = false; + else if (typeof object.votingPower === "string") + message.votingPower = parseInt(object.votingPower, 10); + else if (typeof object.votingPower === "number") + message.votingPower = object.votingPower; + else if (typeof object.votingPower === "object") + message.votingPower = new $util.LongBits(object.votingPower.low >>> 0, object.votingPower.high >>> 0).toNumber(); + if (object.proposerPriority != null) + if ($util.Long) + (message.proposerPriority = $util.Long.fromValue(object.proposerPriority)).unsigned = false; + else if (typeof object.proposerPriority === "string") + message.proposerPriority = parseInt(object.proposerPriority, 10); + else if (typeof object.proposerPriority === "number") + message.proposerPriority = object.proposerPriority; + else if (typeof object.proposerPriority === "object") + message.proposerPriority = new $util.LongBits(object.proposerPriority.low >>> 0, object.proposerPriority.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a Validator message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.Validator + * @static + * @param {tendermint.types.Validator} message Validator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Validator.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.address = ""; + else { + object.address = []; + if (options.bytes !== Array) + object.address = $util.newBuffer(object.address); + } + object.pubKey = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.votingPower = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.votingPower = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.proposerPriority = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.proposerPriority = options.longs === String ? "0" : 0; + } + if (message.address != null && message.hasOwnProperty("address")) + object.address = options.bytes === String ? $util.base64.encode(message.address, 0, message.address.length) : options.bytes === Array ? Array.prototype.slice.call(message.address) : message.address; + if (message.pubKey != null && message.hasOwnProperty("pubKey")) + object.pubKey = $root.tendermint.crypto.PublicKey.toObject(message.pubKey, options); + if (message.votingPower != null && message.hasOwnProperty("votingPower")) + if (typeof message.votingPower === "number") + object.votingPower = options.longs === String ? String(message.votingPower) : message.votingPower; + else + object.votingPower = options.longs === String ? $util.Long.prototype.toString.call(message.votingPower) : options.longs === Number ? new $util.LongBits(message.votingPower.low >>> 0, message.votingPower.high >>> 0).toNumber() : message.votingPower; + if (message.proposerPriority != null && message.hasOwnProperty("proposerPriority")) + if (typeof message.proposerPriority === "number") + object.proposerPriority = options.longs === String ? String(message.proposerPriority) : message.proposerPriority; + else + object.proposerPriority = options.longs === String ? $util.Long.prototype.toString.call(message.proposerPriority) : options.longs === Number ? new $util.LongBits(message.proposerPriority.low >>> 0, message.proposerPriority.high >>> 0).toNumber() : message.proposerPriority; + return object; + }; + + /** + * Converts this Validator to JSON. + * @function toJSON + * @memberof tendermint.types.Validator + * @instance + * @returns {Object.} JSON object + */ + Validator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Validator; + })(types.Validator || {}); + + types.SimpleValidator = (function(SimpleValidator) { + + /** + * Properties of a SimpleValidator. + * @memberof tendermint.types + * @interface ISimpleValidator + * @property {tendermint.crypto.IPublicKey|null} [pubKey] SimpleValidator pubKey + * @property {number|Long|null} [votingPower] SimpleValidator votingPower + */ + + /** + * Constructs a new SimpleValidator. + * @memberof tendermint.types + * @classdesc Represents a SimpleValidator. + * @implements ISimpleValidator + * @constructor + * @param {tendermint.types.ISimpleValidator=} [properties] Properties to set + */ + function SimpleValidator(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SimpleValidator pubKey. + * @member {tendermint.crypto.IPublicKey|null|undefined} pubKey + * @memberof tendermint.types.SimpleValidator + * @instance + */ + SimpleValidator.prototype.pubKey = null; + + /** + * SimpleValidator votingPower. + * @member {number|Long} votingPower + * @memberof tendermint.types.SimpleValidator + * @instance + */ + SimpleValidator.prototype.votingPower = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new SimpleValidator instance using the specified properties. + * @function create + * @memberof tendermint.types.SimpleValidator + * @static + * @param {tendermint.types.ISimpleValidator=} [properties] Properties to set + * @returns {tendermint.types.SimpleValidator} SimpleValidator instance + */ + SimpleValidator.create = function create(properties) { + return new SimpleValidator(properties); + }; + + /** + * Encodes the specified SimpleValidator message. Does not implicitly {@link tendermint.types.SimpleValidator.verify|verify} messages. + * @function encode + * @memberof tendermint.types.SimpleValidator + * @static + * @param {tendermint.types.ISimpleValidator} message SimpleValidator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SimpleValidator.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pubKey != null && Object.hasOwnProperty.call(message, "pubKey")) + $root.tendermint.crypto.PublicKey.encode(message.pubKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.votingPower != null && Object.hasOwnProperty.call(message, "votingPower")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.votingPower); + return writer; + }; + + /** + * Encodes the specified SimpleValidator message, length delimited. Does not implicitly {@link tendermint.types.SimpleValidator.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.SimpleValidator + * @static + * @param {tendermint.types.ISimpleValidator} message SimpleValidator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SimpleValidator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SimpleValidator message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.SimpleValidator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.SimpleValidator} SimpleValidator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SimpleValidator.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.SimpleValidator(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pubKey = $root.tendermint.crypto.PublicKey.decode(reader, reader.uint32()); + break; + case 2: + message.votingPower = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SimpleValidator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.SimpleValidator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.SimpleValidator} SimpleValidator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SimpleValidator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SimpleValidator message. + * @function verify + * @memberof tendermint.types.SimpleValidator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SimpleValidator.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pubKey != null && message.hasOwnProperty("pubKey")) { + var error = $root.tendermint.crypto.PublicKey.verify(message.pubKey); + if (error) + return "pubKey." + error; + } + if (message.votingPower != null && message.hasOwnProperty("votingPower")) + if (!$util.isInteger(message.votingPower) && !(message.votingPower && $util.isInteger(message.votingPower.low) && $util.isInteger(message.votingPower.high))) + return "votingPower: integer|Long expected"; + return null; + }; + + /** + * Creates a SimpleValidator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.SimpleValidator + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.SimpleValidator} SimpleValidator + */ + SimpleValidator.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.SimpleValidator) + return object; + var message = new $root.tendermint.types.SimpleValidator(); + if (object.pubKey != null) { + if (typeof object.pubKey !== "object") + throw TypeError(".tendermint.types.SimpleValidator.pubKey: object expected"); + message.pubKey = $root.tendermint.crypto.PublicKey.fromObject(object.pubKey); + } + if (object.votingPower != null) + if ($util.Long) + (message.votingPower = $util.Long.fromValue(object.votingPower)).unsigned = false; + else if (typeof object.votingPower === "string") + message.votingPower = parseInt(object.votingPower, 10); + else if (typeof object.votingPower === "number") + message.votingPower = object.votingPower; + else if (typeof object.votingPower === "object") + message.votingPower = new $util.LongBits(object.votingPower.low >>> 0, object.votingPower.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a SimpleValidator message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.SimpleValidator + * @static + * @param {tendermint.types.SimpleValidator} message SimpleValidator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SimpleValidator.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pubKey = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.votingPower = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.votingPower = options.longs === String ? "0" : 0; + } + if (message.pubKey != null && message.hasOwnProperty("pubKey")) + object.pubKey = $root.tendermint.crypto.PublicKey.toObject(message.pubKey, options); + if (message.votingPower != null && message.hasOwnProperty("votingPower")) + if (typeof message.votingPower === "number") + object.votingPower = options.longs === String ? String(message.votingPower) : message.votingPower; + else + object.votingPower = options.longs === String ? $util.Long.prototype.toString.call(message.votingPower) : options.longs === Number ? new $util.LongBits(message.votingPower.low >>> 0, message.votingPower.high >>> 0).toNumber() : message.votingPower; + return object; + }; + + /** + * Converts this SimpleValidator to JSON. + * @function toJSON + * @memberof tendermint.types.SimpleValidator + * @instance + * @returns {Object.} JSON object + */ + SimpleValidator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SimpleValidator; + })(types.SimpleValidator || {}); + + return types; + })(tendermint.types || {}); + + /** + * Namespace version. + * @memberof tendermint + * @namespace + */ + + tendermint.version = (function(version) { + + version.App = (function(App) { + + /** + * Properties of an App. + * @memberof tendermint.version + * @interface IApp + * @property {number|Long|null} [protocol] App protocol + * @property {string|null} [software] App software + */ + + /** + * Constructs a new App. + * @memberof tendermint.version + * @classdesc Represents an App. + * @implements IApp + * @constructor + * @param {tendermint.version.IApp=} [properties] Properties to set + */ + function App(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * App protocol. + * @member {number|Long} protocol + * @memberof tendermint.version.App + * @instance + */ + App.prototype.protocol = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * App software. + * @member {string} software + * @memberof tendermint.version.App + * @instance + */ + App.prototype.software = ""; + + /** + * Creates a new App instance using the specified properties. + * @function create + * @memberof tendermint.version.App + * @static + * @param {tendermint.version.IApp=} [properties] Properties to set + * @returns {tendermint.version.App} App instance + */ + App.create = function create(properties) { + return new App(properties); + }; + + /** + * Encodes the specified App message. Does not implicitly {@link tendermint.version.App.verify|verify} messages. + * @function encode + * @memberof tendermint.version.App + * @static + * @param {tendermint.version.IApp} message App message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + App.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.protocol != null && Object.hasOwnProperty.call(message, "protocol")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.protocol); + if (message.software != null && Object.hasOwnProperty.call(message, "software")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.software); + return writer; + }; + + /** + * Encodes the specified App message, length delimited. Does not implicitly {@link tendermint.version.App.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.version.App + * @static + * @param {tendermint.version.IApp} message App message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + App.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an App message from the specified reader or buffer. + * @function decode + * @memberof tendermint.version.App + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.version.App} App + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + App.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.version.App(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.protocol = reader.uint64(); + break; + case 2: + message.software = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an App message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.version.App + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.version.App} App + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + App.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an App message. + * @function verify + * @memberof tendermint.version.App + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + App.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.protocol != null && message.hasOwnProperty("protocol")) + if (!$util.isInteger(message.protocol) && !(message.protocol && $util.isInteger(message.protocol.low) && $util.isInteger(message.protocol.high))) + return "protocol: integer|Long expected"; + if (message.software != null && message.hasOwnProperty("software")) + if (!$util.isString(message.software)) + return "software: string expected"; + return null; + }; + + /** + * Creates an App message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.version.App + * @static + * @param {Object.} object Plain object + * @returns {tendermint.version.App} App + */ + App.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.version.App) + return object; + var message = new $root.tendermint.version.App(); + if (object.protocol != null) + if ($util.Long) + (message.protocol = $util.Long.fromValue(object.protocol)).unsigned = true; + else if (typeof object.protocol === "string") + message.protocol = parseInt(object.protocol, 10); + else if (typeof object.protocol === "number") + message.protocol = object.protocol; + else if (typeof object.protocol === "object") + message.protocol = new $util.LongBits(object.protocol.low >>> 0, object.protocol.high >>> 0).toNumber(true); + if (object.software != null) + message.software = String(object.software); + return message; + }; + + /** + * Creates a plain object from an App message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.version.App + * @static + * @param {tendermint.version.App} message App + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + App.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.protocol = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.protocol = options.longs === String ? "0" : 0; + object.software = ""; + } + if (message.protocol != null && message.hasOwnProperty("protocol")) + if (typeof message.protocol === "number") + object.protocol = options.longs === String ? String(message.protocol) : message.protocol; + else + object.protocol = options.longs === String ? $util.Long.prototype.toString.call(message.protocol) : options.longs === Number ? new $util.LongBits(message.protocol.low >>> 0, message.protocol.high >>> 0).toNumber(true) : message.protocol; + if (message.software != null && message.hasOwnProperty("software")) + object.software = message.software; + return object; + }; + + /** + * Converts this App to JSON. + * @function toJSON + * @memberof tendermint.version.App + * @instance + * @returns {Object.} JSON object + */ + App.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return App; + })(version.App || {}); + + version.Consensus = (function(Consensus) { + + /** + * Properties of a Consensus. + * @memberof tendermint.version + * @interface IConsensus + * @property {number|Long|null} [block] Consensus block + * @property {number|Long|null} [app] Consensus app + */ + + /** + * Constructs a new Consensus. + * @memberof tendermint.version + * @classdesc Represents a Consensus. + * @implements IConsensus + * @constructor + * @param {tendermint.version.IConsensus=} [properties] Properties to set + */ + function Consensus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Consensus block. + * @member {number|Long} block + * @memberof tendermint.version.Consensus + * @instance + */ + Consensus.prototype.block = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Consensus app. + * @member {number|Long} app + * @memberof tendermint.version.Consensus + * @instance + */ + Consensus.prototype.app = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new Consensus instance using the specified properties. + * @function create + * @memberof tendermint.version.Consensus + * @static + * @param {tendermint.version.IConsensus=} [properties] Properties to set + * @returns {tendermint.version.Consensus} Consensus instance + */ + Consensus.create = function create(properties) { + return new Consensus(properties); + }; + + /** + * Encodes the specified Consensus message. Does not implicitly {@link tendermint.version.Consensus.verify|verify} messages. + * @function encode + * @memberof tendermint.version.Consensus + * @static + * @param {tendermint.version.IConsensus} message Consensus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Consensus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.block != null && Object.hasOwnProperty.call(message, "block")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.block); + if (message.app != null && Object.hasOwnProperty.call(message, "app")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.app); + return writer; + }; + + /** + * Encodes the specified Consensus message, length delimited. Does not implicitly {@link tendermint.version.Consensus.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.version.Consensus + * @static + * @param {tendermint.version.IConsensus} message Consensus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Consensus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Consensus message from the specified reader or buffer. + * @function decode + * @memberof tendermint.version.Consensus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.version.Consensus} Consensus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Consensus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.version.Consensus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.block = reader.uint64(); + break; + case 2: + message.app = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Consensus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.version.Consensus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.version.Consensus} Consensus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Consensus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Consensus message. + * @function verify + * @memberof tendermint.version.Consensus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Consensus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.block != null && message.hasOwnProperty("block")) + if (!$util.isInteger(message.block) && !(message.block && $util.isInteger(message.block.low) && $util.isInteger(message.block.high))) + return "block: integer|Long expected"; + if (message.app != null && message.hasOwnProperty("app")) + if (!$util.isInteger(message.app) && !(message.app && $util.isInteger(message.app.low) && $util.isInteger(message.app.high))) + return "app: integer|Long expected"; + return null; + }; + + /** + * Creates a Consensus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.version.Consensus + * @static + * @param {Object.} object Plain object + * @returns {tendermint.version.Consensus} Consensus + */ + Consensus.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.version.Consensus) + return object; + var message = new $root.tendermint.version.Consensus(); + if (object.block != null) + if ($util.Long) + (message.block = $util.Long.fromValue(object.block)).unsigned = true; + else if (typeof object.block === "string") + message.block = parseInt(object.block, 10); + else if (typeof object.block === "number") + message.block = object.block; + else if (typeof object.block === "object") + message.block = new $util.LongBits(object.block.low >>> 0, object.block.high >>> 0).toNumber(true); + if (object.app != null) + if ($util.Long) + (message.app = $util.Long.fromValue(object.app)).unsigned = true; + else if (typeof object.app === "string") + message.app = parseInt(object.app, 10); + else if (typeof object.app === "number") + message.app = object.app; + else if (typeof object.app === "object") + message.app = new $util.LongBits(object.app.low >>> 0, object.app.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a Consensus message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.version.Consensus + * @static + * @param {tendermint.version.Consensus} message Consensus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Consensus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.block = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.block = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.app = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.app = options.longs === String ? "0" : 0; + } + if (message.block != null && message.hasOwnProperty("block")) + if (typeof message.block === "number") + object.block = options.longs === String ? String(message.block) : message.block; + else + object.block = options.longs === String ? $util.Long.prototype.toString.call(message.block) : options.longs === Number ? new $util.LongBits(message.block.low >>> 0, message.block.high >>> 0).toNumber(true) : message.block; + if (message.app != null && message.hasOwnProperty("app")) + if (typeof message.app === "number") + object.app = options.longs === String ? String(message.app) : message.app; + else + object.app = options.longs === String ? $util.Long.prototype.toString.call(message.app) : options.longs === Number ? new $util.LongBits(message.app.low >>> 0, message.app.high >>> 0).toNumber(true) : message.app; + return object; + }; + + /** + * Converts this Consensus to JSON. + * @function toJSON + * @memberof tendermint.version.Consensus + * @instance + * @returns {Object.} JSON object + */ + Consensus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Consensus; + })(version.Consensus || {}); + + return version; + })(tendermint.version || {}); + + return tendermint; +})($root.tendermint || {}); + +module.exports = $root; diff --git a/src/libs/data/aminotypes.js b/src/libs/data/aminotypes.js new file mode 100644 index 00000000..a26c10e3 --- /dev/null +++ b/src/libs/data/aminotypes.js @@ -0,0 +1,414 @@ +/* eslint-disable */ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AminoTypes = void 0; +const amino_1 = require("@cosmjs/amino"); +const encoding_1 = require("@cosmjs/encoding"); +const utils_1 = require("@cosmjs/utils"); +const gov_1 = require("cosmjs-types/cosmos/gov/v1beta1/gov"); +const any_1 = require("cosmjs-types/google/protobuf/any"); +const long_1 = __importDefault(require("long")); +function omitDefault(input) { + if (typeof input === "string") { + return input === "" ? undefined : input; + } + if (typeof input === "number") { + return input === 0 ? undefined : input; + } + if (long_1.default.isLong(input)) { + return input.isZero() ? undefined : input; + } + throw new Error(`Got unsupported type '${typeof input}'`); +} +function createDefaultTypes(prefix) { + return { + // bank + "/cosmos.bank.v1beta1.MsgSend": { + aminoType: "cosmos-sdk/MsgSend", + toAmino: ({ fromAddress, toAddress, amount }) => ({ + from_address: fromAddress, + to_address: toAddress, + amount: [...amount], + }), + fromAmino: ({ from_address, to_address, amount }) => ({ + fromAddress: from_address, + toAddress: to_address, + amount: [...amount], + }), + }, + "/cosmos.bank.v1beta1.MsgMultiSend": { + aminoType: "cosmos-sdk/MsgMultiSend", + toAmino: ({ inputs, outputs }) => ({ + inputs: inputs.map((input) => ({ + address: input.address, + coins: [...input.coins], + })), + outputs: outputs.map((output) => ({ + address: output.address, + coins: [...output.coins], + })), + }), + fromAmino: ({ inputs, outputs }) => ({ + inputs: inputs.map((input) => ({ + address: input.address, + coins: [...input.coins], + })), + outputs: outputs.map((output) => ({ + address: output.address, + coins: [...output.coins], + })), + }), + }, + // distribution + "/cosmos.distribution.v1beta1.MsgFundCommunityPool": { + aminoType: "cosmos-sdk/MsgFundCommunityPool", + toAmino: ({ amount, depositor }) => ({ + amount: [...amount], + depositor: depositor, + }), + fromAmino: ({ amount, depositor }) => ({ + amount: [...amount], + depositor: depositor, + }), + }, + "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress": { + aminoType: "cosmos-sdk/MsgModifyWithdrawAddress", + toAmino: ({ delegatorAddress, withdrawAddress, }) => ({ + delegator_address: delegatorAddress, + withdraw_address: withdrawAddress, + }), + fromAmino: ({ delegator_address, withdraw_address, }) => ({ + delegatorAddress: delegator_address, + withdrawAddress: withdraw_address, + }), + }, + "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward": { + aminoType: "cosmos-sdk/MsgWithdrawDelegationReward", + toAmino: ({ delegatorAddress, validatorAddress, }) => ({ + delegator_address: delegatorAddress, + validator_address: validatorAddress, + }), + fromAmino: ({ delegator_address, validator_address, }) => ({ + delegatorAddress: delegator_address, + validatorAddress: validator_address, + }), + }, + "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission": { + aminoType: "cosmos-sdk/MsgWithdrawValidatorCommission", + toAmino: ({ validatorAddress, }) => ({ + validator_address: validatorAddress, + }), + fromAmino: ({ validator_address, }) => ({ + validatorAddress: validator_address, + }), + }, + // gov + "/cosmos.gov.v1beta1.MsgDeposit": { + aminoType: "cosmos-sdk/MsgDeposit", + toAmino: ({ amount, depositor, proposalId }) => { + return { + amount, + depositor, + proposal_id: proposalId.toString(), + }; + }, + fromAmino: ({ amount, depositor, proposal_id }) => { + return { + amount: Array.from(amount), + depositor, + proposalId: long_1.default.fromString(proposal_id), + }; + }, + }, + "/cosmos.gov.v1beta1.MsgVote": { + aminoType: "cosmos-sdk/MsgVote", + toAmino: ({ option, proposalId, voter }) => { + return { + option: option, + proposal_id: proposalId.toString(), + voter: voter, + }; + }, + fromAmino: ({ option, proposal_id, voter }) => { + return { + option: gov_1.voteOptionFromJSON(option), + proposalId: long_1.default.fromString(proposal_id), + voter: voter, + }; + }, + }, + "/cosmos.gov.v1beta1.MsgSubmitProposal": { + aminoType: "cosmos-sdk/MsgSubmitProposal", + toAmino: ({ initialDeposit, proposer, content, }) => { + utils_1.assertDefinedAndNotNull(content); + let proposal; + switch (content.typeUrl) { + case "/cosmos.gov.v1beta1.TextProposal": { + const textProposal = gov_1.TextProposal.decode(content.value); + proposal = { + type: "cosmos-sdk/TextProposal", + value: { + description: textProposal.description, + title: textProposal.title, + }, + }; + break; + } + default: + throw new Error(`Unsupported proposal type: '${content.typeUrl}'`); + } + return { + initial_deposit: initialDeposit, + proposer: proposer, + content: proposal, + }; + }, + fromAmino: ({ initial_deposit, proposer, content, }) => { + let any_content; + switch (content.type) { + case "cosmos-sdk/TextProposal": { + const { value } = content; + utils_1.assert(utils_1.isNonNullObject(value)); + const { title, description } = value; + utils_1.assert(typeof title === "string"); + utils_1.assert(typeof description === "string"); + any_content = any_1.Any.fromPartial({ + typeUrl: "/cosmos.gov.v1beta1.TextProposal", + value: gov_1.TextProposal.encode(gov_1.TextProposal.fromPartial({ + title: title, + description: description, + })).finish(), + }); + break; + } + default: + throw new Error(`Unsupported proposal type: '${content.type}'`); + } + return { + initialDeposit: Array.from(initial_deposit), + proposer: proposer, + content: any_content, + }; + }, + }, + // staking + "/cosmos.staking.v1beta1.MsgBeginRedelegate": { + aminoType: "cosmos-sdk/MsgBeginRedelegate", + toAmino: ({ delegatorAddress, validatorSrcAddress, validatorDstAddress, amount, }) => { + utils_1.assertDefinedAndNotNull(amount, "missing amount"); + return { + delegator_address: delegatorAddress, + validator_src_address: validatorSrcAddress, + validator_dst_address: validatorDstAddress, + amount: amount, + }; + }, + fromAmino: ({ delegator_address, validator_src_address, validator_dst_address, amount, }) => ({ + delegatorAddress: delegator_address, + validatorSrcAddress: validator_src_address, + validatorDstAddress: validator_dst_address, + amount: amount, + }), + }, + "/cosmos.staking.v1beta1.MsgCreateValidator": { + aminoType: "cosmos-sdk/MsgCreateValidator", + toAmino: ({ description, commission, minSelfDelegation, delegatorAddress, validatorAddress, pubkey, value, }) => { + utils_1.assertDefinedAndNotNull(description, "missing description"); + utils_1.assertDefinedAndNotNull(commission, "missing commission"); + utils_1.assertDefinedAndNotNull(pubkey, "missing pubkey"); + utils_1.assertDefinedAndNotNull(value, "missing value"); + return { + description: { + moniker: description.moniker, + identity: description.identity, + website: description.website, + security_contact: description.securityContact, + details: description.details, + }, + commission: { + rate: commission.rate, + max_rate: commission.maxRate, + max_change_rate: commission.maxChangeRate, + }, + min_self_delegation: minSelfDelegation, + delegator_address: delegatorAddress, + validator_address: validatorAddress, + pubkey: amino_1.encodeBech32Pubkey({ + type: "tendermint/PubKeySecp256k1", + value: encoding_1.toBase64(pubkey.value), + }, prefix), + value: value, + }; + }, + fromAmino: ({ description, commission, min_self_delegation, delegator_address, validator_address, pubkey, value, }) => { + const decodedPubkey = amino_1.decodeBech32Pubkey(pubkey); + if (decodedPubkey.type !== "tendermint/PubKeySecp256k1") { + throw new Error("Only Secp256k1 public keys are supported"); + } + return { + description: { + moniker: description.moniker, + identity: description.identity, + website: description.website, + securityContact: description.security_contact, + details: description.details, + }, + commission: { + rate: commission.rate, + maxRate: commission.max_rate, + maxChangeRate: commission.max_change_rate, + }, + minSelfDelegation: min_self_delegation, + delegatorAddress: delegator_address, + validatorAddress: validator_address, + pubkey: { + typeUrl: "/cosmos.crypto.secp256k1.PubKey", + value: encoding_1.fromBase64(decodedPubkey.value), + }, + value: value, + }; + }, + }, + "/cosmos.staking.v1beta1.MsgDelegate": { + aminoType: "cosmos-sdk/MsgDelegate", + toAmino: ({ delegatorAddress, validatorAddress, amount }) => { + utils_1.assertDefinedAndNotNull(amount, "missing amount"); + return { + delegator_address: delegatorAddress, + validator_address: validatorAddress, + amount: amount, + }; + }, + fromAmino: ({ delegator_address, validator_address, amount, }) => ({ + delegatorAddress: delegator_address, + validatorAddress: validator_address, + amount: amount, + }), + }, + "/cosmos.staking.v1beta1.MsgEditValidator": { + aminoType: "cosmos-sdk/MsgEditValidator", + toAmino: ({ description, commissionRate, minSelfDelegation, validatorAddress, }) => { + utils_1.assertDefinedAndNotNull(description, "missing description"); + return { + description: { + moniker: description.moniker, + identity: description.identity, + website: description.website, + security_contact: description.securityContact, + details: description.details, + }, + commission_rate: commissionRate, + min_self_delegation: minSelfDelegation, + validator_address: validatorAddress, + }; + }, + fromAmino: ({ description, commission_rate, min_self_delegation, validator_address, }) => ({ + description: { + moniker: description.moniker, + identity: description.identity, + website: description.website, + securityContact: description.security_contact, + details: description.details, + }, + commissionRate: commission_rate, + minSelfDelegation: min_self_delegation, + validatorAddress: validator_address, + }), + }, + "/cosmos.staking.v1beta1.MsgUndelegate": { + aminoType: "cosmos-sdk/MsgUndelegate", + toAmino: ({ delegatorAddress, validatorAddress, amount, }) => { + utils_1.assertDefinedAndNotNull(amount, "missing amount"); + return { + delegator_address: delegatorAddress, + validator_address: validatorAddress, + amount: amount, + }; + }, + fromAmino: ({ delegator_address, validator_address, amount, }) => ({ + delegatorAddress: delegator_address, + validatorAddress: validator_address, + amount: amount, + }), + }, + // ibc + "/ibc.applications.transfer.v1.MsgTransfer": { + aminoType: "cosmos-sdk/MsgTransfer", + toAmino: ({ sourcePort, sourceChannel, token, sender, receiver, timeoutHeight, timeoutTimestamp, }) => { + console.log('toAmino', sourceChannel, sourcePort) + var _a, _b, _c; + return ({ + source_port: sourcePort, + source_channel: sourceChannel, + token: token, + sender: sender, + receiver: receiver, + timeout_height: timeoutHeight + ? { + revision_height: (_a = omitDefault(timeoutHeight.revisionHeight)) === null || _a === void 0 ? void 0 : _a.toString(), + revision_number: (_b = omitDefault(timeoutHeight.revisionNumber)) === null || _b === void 0 ? void 0 : _b.toString(), + } + : {}, + timeout_timestamp: (_c = omitDefault(timeoutTimestamp)) === null || _c === void 0 ? void 0 : _c.toString(), + }); + }, + fromAmino: ({ source_port, source_channel, token, sender, receiver, timeout_height, timeout_timestamp, }) => ({ + sourcePort: source_port, + sourceChannel: source_channel, + token: token, + sender: sender, + receiver: receiver, + timeoutHeight: timeout_height + ? { + revisionHeight: timeout_height.revision_height, + revisionNumber: timeout_height.revision_number, + } + : undefined, + timeoutTimestamp: long_1.default.fromString(timeout_timestamp || "0", true), + }), + }, + }; +} +/** + * A map from Stargate message types as used in the messages's `Any` type + * to Amino types. + */ +class AminoTypes { + constructor({ additions = {}, prefix = "cosmos" } = {}) { + const additionalAminoTypes = Object.values(additions); + const filteredDefaultTypes = Object.entries(createDefaultTypes(prefix)).reduce((acc, [key, value]) => additionalAminoTypes.find(({ aminoType }) => value.aminoType === aminoType) + ? acc + : Object.assign(Object.assign({}, acc), { [key]: value }), {}); + this.register = Object.assign(Object.assign({}, filteredDefaultTypes), additions); + } + toAmino({ typeUrl, value }) { + const converter = this.register[typeUrl]; + if (!converter) { + throw new Error("Type URL does not exist in the Amino message type register. " + + "If you need support for this message type, you can pass in additional entries to the AminoTypes constructor. " + + "If you think this message type should be included by default, please open an issue at https://github.com/cosmos/cosmjs/issues."); + } + return { + type: converter.aminoType, + value: converter.toAmino(value), + }; + } + fromAmino({ type, value }) { + const result = Object.entries(this.register).find(([_typeUrl, { aminoType }]) => aminoType === type); + if (!result) { + throw new Error("Type does not exist in the Amino message type register. " + + "If you need support for this message type, you can pass in additional entries to the AminoTypes constructor. " + + "If you think this message type should be included by default, please open an issue at https://github.com/cosmos/cosmjs/issues."); + } + const [typeUrl, converter] = result; + return { + typeUrl: typeUrl, + value: converter.fromAmino(value), + }; + } +} +exports.AminoTypes = AminoTypes; +//# sourceMappingURL=aminotypes.js.map \ No newline at end of file diff --git a/src/libs/data/data.js b/src/libs/data/data.js index a4924cb5..8c9a5999 100644 --- a/src/libs/data/data.js +++ b/src/libs/data/data.js @@ -5,19 +5,21 @@ import { sha256, stringToPath } from '@cosmjs/crypto' // ledger import TransportWebBLE from '@ledgerhq/hw-transport-web-ble' import TransportWebUSB from '@ledgerhq/hw-transport-webusb' -import { SigningStargateClient } from '@cosmjs/stargate' import CosmosApp from 'ledger-cosmos-js' import { LedgerSigner } from '@cosmjs/ledger-amino' import dayjs from 'dayjs' import duration from 'dayjs/plugin/duration' import relativeTime from 'dayjs/plugin/relativeTime' +import utc from 'dayjs/plugin/utc' import localeData from 'dayjs/plugin/localeData' import { $themeColors } from '@themeConfig' +import PingWalletClient from './signing' dayjs.extend(localeData) dayjs.extend(duration) dayjs.extend(relativeTime) +dayjs.extend(utc) export function getLocalObject(name) { const text = localStorage.getItem(name) @@ -142,7 +144,6 @@ function getHdPath(address) { } export async function sign(device, chainId, signerAddress, messages, fee, memo, signerData) { - console.log(device, signerData) let transport let signer switch (device) { @@ -164,9 +165,11 @@ export async function sign(device, chainId, signerAddress, messages, fee, memo, // signer = window.getOfflineSignerOnlyAmino(chainId) } + // if (signer) return signAmino(signer, signerAddress, messages, fee, memo, signerData) + // Ensure the address has some tokens to spend - const client = await SigningStargateClient.offline(signer) - return client.sign(device === 'keplr' ? signerAddress : toSignAddress(signerAddress), messages, fee, memo, signerData) + const client = await PingWalletClient.offline(signer) + return client.signAmino(device === 'keplr' ? signerAddress : toSignAddress(signerAddress), messages, fee, memo, signerData) // return signDirect(signer, signerAddress, messages, fee, memo, signerData) } diff --git a/src/libs/data/msg-transfer.js b/src/libs/data/msg-transfer.js new file mode 100644 index 00000000..e4a5a1b6 --- /dev/null +++ b/src/libs/data/msg-transfer.js @@ -0,0 +1,166 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +const long1 = require('long') +const minimal1 = require('protobufjs-dbx/minimal') +const coin1 = require('cosmjs-types/cosmos/base/v1beta1/coin') +const client1 = require('cosmjs-types/ibc/core/client/v1/client') + +const baseMsgTransfer = { + sourcePort: '', + sourceChannel: '', + sender: '', + receiver: '', + timeoutTimestamp: '0', +} + +exports.MsgTransfer = { + encode(message, writer = minimal1.default.Writer.create()) { + if (message.sourcePort !== '') { + writer.uint32(10).string(message.sourcePort) + } + if (message.sourceChannel !== '') { + writer.uint32(18).string(message.sourceChannel) + } + if (message.token !== undefined) { + coin1.Coin.encode(message.token, writer.uint32(26).fork()).ldelim() + } + if (message.sender !== '') { + writer.uint32(34).string(message.sender) + } + if (message.receiver !== '') { + writer.uint32(42).string(message.receiver) + } + if (message.timeoutHeight !== undefined) { + client1.Height.encode(message.timeoutHeight, writer.uint32(50).fork()).ldelim() + } + if (!message.timeoutTimestamp.isZero()) { + writer.uint32(56).uint64(message.timeoutTimestamp) + } + return writer + }, + decode(input, length) { + const reader = input instanceof minimal1.default.Reader ? input : new minimal1.default.Reader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = { ...baseMsgTransfer } + while (reader.pos < end) { + const tag = reader.uint32() + // eslint-disable-next-line no-bitwise + switch (tag >>> 3) { + case 1: + message.sourcePort = reader.string() + break + case 2: + message.sourceChannel = reader.string() + break + case 3: + message.token = coin1.Coin.decode(reader, reader.uint32()) + break + case 4: + message.sender = reader.string() + break + case 5: + message.receiver = reader.string() + break + case 6: + message.timeoutHeight = client1.Height.decode(reader, reader.uint32()) + break + case 7: + message.timeoutTimestamp = reader.uint64() + break + default: + // eslint-disable-next-line no-bitwise + reader.skipType(tag & 7) + break + } + } + return message + }, + fromJSON(object) { + const message = { ...baseMsgTransfer } + if (object.sourcePort !== undefined && object.sourcePort !== null) { + message.sourcePort = String(object.sourcePort) + } else { + message.sourcePort = '' + } + if (object.sourceChannel !== undefined && object.sourceChannel !== null) { + message.sourceChannel = String(object.sourceChannel) + } else { + message.sourceChannel = '' + } + if (object.token !== undefined && object.token !== null) { + message.token = coin1.Coin.fromJSON(object.token) + } else { + message.token = undefined + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = String(object.sender) + } else { + message.sender = '' + } + if (object.receiver !== undefined && object.receiver !== null) { + message.receiver = String(object.receiver) + } else { + message.receiver = '' + } + if (object.timeoutHeight !== undefined && object.timeoutHeight !== null) { + message.timeoutHeight = client1.Height.fromJSON(object.timeoutHeight) + } else { + message.timeoutHeight = undefined + } + if (object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null) { + message.timeoutTimestamp = long1.default.fromString(object.timeoutTimestamp) + } else { + message.timeoutTimestamp = long1.default.UZERO + } + return message + }, + toJSON(message) { + const obj = {} + if (message.sourcePort !== undefined) obj.sourcePort = message.sourcePort + if (message.sourceChannel !== undefined) obj.sourceChannel = message.sourceChannel + if (message.token !== undefined) obj.token = message.token ? coin1.Coin.toJSON(message.token) : undefined + if (message.sender !== undefined) obj.sender = message.sender + if (message.receiver !== undefined) obj.receiver = message.receiver + if (message.timeoutHeight !== undefined) obj.timeoutHeight = message.timeoutHeight ? client1.Height.toJSON(message.timeoutHeight) : undefined + if (message.timeoutTimestamp !== undefined) obj.timeoutTimestamp = (message.timeoutTimestamp || '0').toString() + return obj + }, + fromPartial(object) { + const message = { ...baseMsgTransfer } + if (object.sourcePort !== undefined && object.sourcePort !== null) { + message.sourcePort = object.sourcePort + } else { + message.sourcePort = '' + } + if (object.sourceChannel !== undefined && object.sourceChannel !== null) { + message.sourceChannel = object.sourceChannel + } else { + message.sourceChannel = '' + } + if (object.token !== undefined && object.token !== null) { + message.token = coin1.Coin.fromPartial(object.token) + } else { + message.token = undefined + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender + } else { + message.sender = '' + } + if (object.receiver !== undefined && object.receiver !== null) { + message.receiver = object.receiver + } else { + message.receiver = '' + } + if (object.timeoutHeight !== undefined && object.timeoutHeight !== null) { + message.timeoutHeight = client1.Height.fromPartial(object.timeoutHeight) + } else { + message.timeoutHeight = undefined + } + if (object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null) { + message.timeoutTimestamp = object.timeoutTimestamp + } else { + message.timeoutTimestamp = long1.default.UZERO + } + return message + }, +} diff --git a/src/libs/data/signing.js b/src/libs/data/signing.js new file mode 100644 index 00000000..34efbda7 --- /dev/null +++ b/src/libs/data/signing.js @@ -0,0 +1,56 @@ +/* eslint-disable camelcase */ + +import { SigningStargateClient } from '@cosmjs/stargate' +import { MsgTransfer } from './msg-transfer' +// import { AminoTypes } from './aminotypes' + +const amino_1 = require('@cosmjs/amino') +const encoding_1 = require('@cosmjs/encoding') +const math_1 = require('@cosmjs/math') +const proto_signing_1 = require('@cosmjs/proto-signing') +const tx_5 = require('cosmjs-types/cosmos/tx/v1beta1/tx') +const signing_1 = require('cosmjs-types/cosmos/tx/signing/v1beta1/signing') + +export default class PingWalletClient extends SigningStargateClient { + static async offline(signer, options = {}) { + const instance = new PingWalletClient(undefined, signer, options) + + instance.registry.register('/ibc.applications.transfer.v1.MsgTransfer', MsgTransfer) + + // console.log('registory:', instance.registry, AminoTypes) + // const { aminoTypes = new AminoTypes({ prefix: options.prefix }) } = options + // instance.aminoTypes = aminoTypes + // console.log('aminoType:', instance.aminoTypes) + return instance + } + + async signAmino2(signerAddress, messages, fee, memo, { accountNumber, sequence, chainId }) { + // utils_1.assert(!proto_signing_1.isOfflineDirectSigner(this.signer)) + const accountFromSigner = (await this.signer.getAccounts()).find(account => account.address === signerAddress) + if (!accountFromSigner) { + throw new Error('Failed to retrieve account from signer') + } + const pubkey = proto_signing_1.encodePubkey(amino_1.encodeSecp256k1Pubkey(accountFromSigner.pubkey)) + const signMode = signing_1.SignMode.SIGN_MODE_LEGACY_AMINO_JSON + const msgs = messages.map(msg => this.aminoTypes.toAmino(msg)) + const signDoc = amino_1.makeSignDoc(msgs, fee, chainId, memo, accountNumber, sequence) + const { signature, signed } = await this.signer.signAmino(signerAddress, signDoc) + const signedTxBody = { + messages: signed.msgs.map(msg => this.aminoTypes.fromAmino(msg)), + memo: signed.memo, + } + const signedTxBodyEncodeObject = { + typeUrl: '/cosmos.tx.v1beta1.TxBody', + value: signedTxBody, + } + const signedTxBodyBytes = this.registry.encode(signedTxBodyEncodeObject) + const signedGasLimit = math_1.Int53.fromString(signed.fee.gas).toNumber() + const signedSequence = math_1.Int53.fromString(signed.sequence).toNumber() + const signedAuthInfoBytes = proto_signing_1.makeAuthInfoBytes([{ pubkey, sequence: signedSequence }], signed.fee.amount, signedGasLimit, signMode) + return tx_5.TxRaw.fromPartial({ + bodyBytes: signedTxBodyBytes, + authInfoBytes: signedAuthInfoBytes, + signatures: [encoding_1.fromBase64(signature.signature)], + }) + } +} diff --git a/src/libs/es6.js b/src/libs/es6.js new file mode 100644 index 00000000..823704bf --- /dev/null +++ b/src/libs/es6.js @@ -0,0 +1,133168 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs-dbx/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); + +/** + * Namespace cosmos. + * @exports cosmos + * @namespace + */ + +export const cosmos = $root.cosmos = ((cosmos) => { + + /** + * Namespace auth. + * @memberof cosmos + * @namespace + */ + + cosmos.auth = (function(auth) { + + /** + * Namespace v1beta1. + * @memberof cosmos.auth + * @namespace + */ + + auth.v1beta1 = (function(v1beta1) { + + v1beta1.BaseAccount = (function(BaseAccount) { + + /** + * Properties of a BaseAccount. + * @memberof cosmos.auth.v1beta1 + * @interface IBaseAccount + * @property {string|null} [address] BaseAccount address + * @property {google.protobuf.IAny|null} [pubKey] BaseAccount pubKey + * @property {number|Long|null} [accountNumber] BaseAccount accountNumber + * @property {number|Long|null} [sequence] BaseAccount sequence + */ + + /** + * Constructs a new BaseAccount. + * @memberof cosmos.auth.v1beta1 + * @classdesc Represents a BaseAccount. + * @implements IBaseAccount + * @constructor + * @param {cosmos.auth.v1beta1.IBaseAccount=} [properties] Properties to set + */ + function BaseAccount(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BaseAccount address. + * @member {string} address + * @memberof cosmos.auth.v1beta1.BaseAccount + * @instance + */ + BaseAccount.prototype.address = ""; + + /** + * BaseAccount pubKey. + * @member {google.protobuf.IAny|null|undefined} pubKey + * @memberof cosmos.auth.v1beta1.BaseAccount + * @instance + */ + BaseAccount.prototype.pubKey = null; + + /** + * BaseAccount accountNumber. + * @member {number|Long} accountNumber + * @memberof cosmos.auth.v1beta1.BaseAccount + * @instance + */ + BaseAccount.prototype.accountNumber = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * BaseAccount sequence. + * @member {number|Long} sequence + * @memberof cosmos.auth.v1beta1.BaseAccount + * @instance + */ + BaseAccount.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new BaseAccount instance using the specified properties. + * @function create + * @memberof cosmos.auth.v1beta1.BaseAccount + * @static + * @param {cosmos.auth.v1beta1.IBaseAccount=} [properties] Properties to set + * @returns {cosmos.auth.v1beta1.BaseAccount} BaseAccount instance + */ + BaseAccount.create = function create(properties) { + return new BaseAccount(properties); + }; + + /** + * Encodes the specified BaseAccount message. Does not implicitly {@link cosmos.auth.v1beta1.BaseAccount.verify|verify} messages. + * @function encode + * @memberof cosmos.auth.v1beta1.BaseAccount + * @static + * @param {cosmos.auth.v1beta1.IBaseAccount} message BaseAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BaseAccount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.address); + if (message.pubKey != null && Object.hasOwnProperty.call(message, "pubKey")) + $root.google.protobuf.Any.encode(message.pubKey, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.accountNumber != null && Object.hasOwnProperty.call(message, "accountNumber")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.accountNumber); + if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.sequence); + return writer; + }; + + /** + * Encodes the specified BaseAccount message, length delimited. Does not implicitly {@link cosmos.auth.v1beta1.BaseAccount.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.auth.v1beta1.BaseAccount + * @static + * @param {cosmos.auth.v1beta1.IBaseAccount} message BaseAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BaseAccount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BaseAccount message from the specified reader or buffer. + * @function decode + * @memberof cosmos.auth.v1beta1.BaseAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.auth.v1beta1.BaseAccount} BaseAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BaseAccount.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.auth.v1beta1.BaseAccount(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.pubKey = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 3: + message.accountNumber = reader.uint64(); + break; + case 4: + message.sequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BaseAccount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.auth.v1beta1.BaseAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.auth.v1beta1.BaseAccount} BaseAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BaseAccount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BaseAccount message. + * @function verify + * @memberof cosmos.auth.v1beta1.BaseAccount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BaseAccount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.pubKey != null && message.hasOwnProperty("pubKey")) { + let error = $root.google.protobuf.Any.verify(message.pubKey); + if (error) + return "pubKey." + error; + } + if (message.accountNumber != null && message.hasOwnProperty("accountNumber")) + if (!$util.isInteger(message.accountNumber) && !(message.accountNumber && $util.isInteger(message.accountNumber.low) && $util.isInteger(message.accountNumber.high))) + return "accountNumber: integer|Long expected"; + if (message.sequence != null && message.hasOwnProperty("sequence")) + if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) + return "sequence: integer|Long expected"; + return null; + }; + + /** + * Creates a BaseAccount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.auth.v1beta1.BaseAccount + * @static + * @param {Object.} object Plain object + * @returns {cosmos.auth.v1beta1.BaseAccount} BaseAccount + */ + BaseAccount.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.auth.v1beta1.BaseAccount) + return object; + let message = new $root.cosmos.auth.v1beta1.BaseAccount(); + if (object.address != null) + message.address = String(object.address); + if (object.pubKey != null) { + if (typeof object.pubKey !== "object") + throw TypeError(".cosmos.auth.v1beta1.BaseAccount.pubKey: object expected"); + message.pubKey = $root.google.protobuf.Any.fromObject(object.pubKey); + } + if (object.accountNumber != null) + if ($util.Long) + (message.accountNumber = $util.Long.fromValue(object.accountNumber)).unsigned = true; + else if (typeof object.accountNumber === "string") + message.accountNumber = parseInt(object.accountNumber, 10); + else if (typeof object.accountNumber === "number") + message.accountNumber = object.accountNumber; + else if (typeof object.accountNumber === "object") + message.accountNumber = new $util.LongBits(object.accountNumber.low >>> 0, object.accountNumber.high >>> 0).toNumber(true); + if (object.sequence != null) + if ($util.Long) + (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; + else if (typeof object.sequence === "string") + message.sequence = parseInt(object.sequence, 10); + else if (typeof object.sequence === "number") + message.sequence = object.sequence; + else if (typeof object.sequence === "object") + message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a BaseAccount message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.auth.v1beta1.BaseAccount + * @static + * @param {cosmos.auth.v1beta1.BaseAccount} message BaseAccount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BaseAccount.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.address = ""; + object.pubKey = null; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.accountNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.accountNumber = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sequence = options.longs === String ? "0" : 0; + } + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + if (message.pubKey != null && message.hasOwnProperty("pubKey")) + object.pubKey = $root.google.protobuf.Any.toObject(message.pubKey, options); + if (message.accountNumber != null && message.hasOwnProperty("accountNumber")) + if (typeof message.accountNumber === "number") + object.accountNumber = options.longs === String ? String(message.accountNumber) : message.accountNumber; + else + object.accountNumber = options.longs === String ? $util.Long.prototype.toString.call(message.accountNumber) : options.longs === Number ? new $util.LongBits(message.accountNumber.low >>> 0, message.accountNumber.high >>> 0).toNumber(true) : message.accountNumber; + if (message.sequence != null && message.hasOwnProperty("sequence")) + if (typeof message.sequence === "number") + object.sequence = options.longs === String ? String(message.sequence) : message.sequence; + else + object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; + return object; + }; + + /** + * Converts this BaseAccount to JSON. + * @function toJSON + * @memberof cosmos.auth.v1beta1.BaseAccount + * @instance + * @returns {Object.} JSON object + */ + BaseAccount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BaseAccount; + })(v1beta1.BaseAccount || {}); + + v1beta1.ModuleAccount = (function(ModuleAccount) { + + /** + * Properties of a ModuleAccount. + * @memberof cosmos.auth.v1beta1 + * @interface IModuleAccount + * @property {cosmos.auth.v1beta1.IBaseAccount|null} [baseAccount] ModuleAccount baseAccount + * @property {string|null} [name] ModuleAccount name + * @property {Array.|null} [permissions] ModuleAccount permissions + */ + + /** + * Constructs a new ModuleAccount. + * @memberof cosmos.auth.v1beta1 + * @classdesc Represents a ModuleAccount. + * @implements IModuleAccount + * @constructor + * @param {cosmos.auth.v1beta1.IModuleAccount=} [properties] Properties to set + */ + function ModuleAccount(properties) { + this.permissions = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModuleAccount baseAccount. + * @member {cosmos.auth.v1beta1.IBaseAccount|null|undefined} baseAccount + * @memberof cosmos.auth.v1beta1.ModuleAccount + * @instance + */ + ModuleAccount.prototype.baseAccount = null; + + /** + * ModuleAccount name. + * @member {string} name + * @memberof cosmos.auth.v1beta1.ModuleAccount + * @instance + */ + ModuleAccount.prototype.name = ""; + + /** + * ModuleAccount permissions. + * @member {Array.} permissions + * @memberof cosmos.auth.v1beta1.ModuleAccount + * @instance + */ + ModuleAccount.prototype.permissions = $util.emptyArray; + + /** + * Creates a new ModuleAccount instance using the specified properties. + * @function create + * @memberof cosmos.auth.v1beta1.ModuleAccount + * @static + * @param {cosmos.auth.v1beta1.IModuleAccount=} [properties] Properties to set + * @returns {cosmos.auth.v1beta1.ModuleAccount} ModuleAccount instance + */ + ModuleAccount.create = function create(properties) { + return new ModuleAccount(properties); + }; + + /** + * Encodes the specified ModuleAccount message. Does not implicitly {@link cosmos.auth.v1beta1.ModuleAccount.verify|verify} messages. + * @function encode + * @memberof cosmos.auth.v1beta1.ModuleAccount + * @static + * @param {cosmos.auth.v1beta1.IModuleAccount} message ModuleAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModuleAccount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.baseAccount != null && Object.hasOwnProperty.call(message, "baseAccount")) + $root.cosmos.auth.v1beta1.BaseAccount.encode(message.baseAccount, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.permissions != null && message.permissions.length) + for (let i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified ModuleAccount message, length delimited. Does not implicitly {@link cosmos.auth.v1beta1.ModuleAccount.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.auth.v1beta1.ModuleAccount + * @static + * @param {cosmos.auth.v1beta1.IModuleAccount} message ModuleAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModuleAccount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModuleAccount message from the specified reader or buffer. + * @function decode + * @memberof cosmos.auth.v1beta1.ModuleAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.auth.v1beta1.ModuleAccount} ModuleAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModuleAccount.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.auth.v1beta1.ModuleAccount(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseAccount = $root.cosmos.auth.v1beta1.BaseAccount.decode(reader, reader.uint32()); + break; + case 2: + message.name = reader.string(); + break; + case 3: + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModuleAccount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.auth.v1beta1.ModuleAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.auth.v1beta1.ModuleAccount} ModuleAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModuleAccount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModuleAccount message. + * @function verify + * @memberof cosmos.auth.v1beta1.ModuleAccount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModuleAccount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.baseAccount != null && message.hasOwnProperty("baseAccount")) { + let error = $root.cosmos.auth.v1beta1.BaseAccount.verify(message.baseAccount); + if (error) + return "baseAccount." + error; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (let i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a ModuleAccount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.auth.v1beta1.ModuleAccount + * @static + * @param {Object.} object Plain object + * @returns {cosmos.auth.v1beta1.ModuleAccount} ModuleAccount + */ + ModuleAccount.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.auth.v1beta1.ModuleAccount) + return object; + let message = new $root.cosmos.auth.v1beta1.ModuleAccount(); + if (object.baseAccount != null) { + if (typeof object.baseAccount !== "object") + throw TypeError(".cosmos.auth.v1beta1.ModuleAccount.baseAccount: object expected"); + message.baseAccount = $root.cosmos.auth.v1beta1.BaseAccount.fromObject(object.baseAccount); + } + if (object.name != null) + message.name = String(object.name); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".cosmos.auth.v1beta1.ModuleAccount.permissions: array expected"); + message.permissions = []; + for (let i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a ModuleAccount message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.auth.v1beta1.ModuleAccount + * @static + * @param {cosmos.auth.v1beta1.ModuleAccount} message ModuleAccount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModuleAccount.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (options.defaults) { + object.baseAccount = null; + object.name = ""; + } + if (message.baseAccount != null && message.hasOwnProperty("baseAccount")) + object.baseAccount = $root.cosmos.auth.v1beta1.BaseAccount.toObject(message.baseAccount, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (let j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this ModuleAccount to JSON. + * @function toJSON + * @memberof cosmos.auth.v1beta1.ModuleAccount + * @instance + * @returns {Object.} JSON object + */ + ModuleAccount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ModuleAccount; + })(v1beta1.ModuleAccount || {}); + + v1beta1.Params = (function(Params) { + + /** + * Properties of a Params. + * @memberof cosmos.auth.v1beta1 + * @interface IParams + * @property {number|Long|null} [maxMemoCharacters] Params maxMemoCharacters + * @property {number|Long|null} [txSigLimit] Params txSigLimit + * @property {number|Long|null} [txSizeCostPerByte] Params txSizeCostPerByte + * @property {number|Long|null} [sigVerifyCostEd25519] Params sigVerifyCostEd25519 + * @property {number|Long|null} [sigVerifyCostSecp256k1] Params sigVerifyCostSecp256k1 + */ + + /** + * Constructs a new Params. + * @memberof cosmos.auth.v1beta1 + * @classdesc Represents a Params. + * @implements IParams + * @constructor + * @param {cosmos.auth.v1beta1.IParams=} [properties] Properties to set + */ + function Params(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Params maxMemoCharacters. + * @member {number|Long} maxMemoCharacters + * @memberof cosmos.auth.v1beta1.Params + * @instance + */ + Params.prototype.maxMemoCharacters = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Params txSigLimit. + * @member {number|Long} txSigLimit + * @memberof cosmos.auth.v1beta1.Params + * @instance + */ + Params.prototype.txSigLimit = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Params txSizeCostPerByte. + * @member {number|Long} txSizeCostPerByte + * @memberof cosmos.auth.v1beta1.Params + * @instance + */ + Params.prototype.txSizeCostPerByte = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Params sigVerifyCostEd25519. + * @member {number|Long} sigVerifyCostEd25519 + * @memberof cosmos.auth.v1beta1.Params + * @instance + */ + Params.prototype.sigVerifyCostEd25519 = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Params sigVerifyCostSecp256k1. + * @member {number|Long} sigVerifyCostSecp256k1 + * @memberof cosmos.auth.v1beta1.Params + * @instance + */ + Params.prototype.sigVerifyCostSecp256k1 = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new Params instance using the specified properties. + * @function create + * @memberof cosmos.auth.v1beta1.Params + * @static + * @param {cosmos.auth.v1beta1.IParams=} [properties] Properties to set + * @returns {cosmos.auth.v1beta1.Params} Params instance + */ + Params.create = function create(properties) { + return new Params(properties); + }; + + /** + * Encodes the specified Params message. Does not implicitly {@link cosmos.auth.v1beta1.Params.verify|verify} messages. + * @function encode + * @memberof cosmos.auth.v1beta1.Params + * @static + * @param {cosmos.auth.v1beta1.IParams} message Params message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Params.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxMemoCharacters != null && Object.hasOwnProperty.call(message, "maxMemoCharacters")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.maxMemoCharacters); + if (message.txSigLimit != null && Object.hasOwnProperty.call(message, "txSigLimit")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.txSigLimit); + if (message.txSizeCostPerByte != null && Object.hasOwnProperty.call(message, "txSizeCostPerByte")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.txSizeCostPerByte); + if (message.sigVerifyCostEd25519 != null && Object.hasOwnProperty.call(message, "sigVerifyCostEd25519")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.sigVerifyCostEd25519); + if (message.sigVerifyCostSecp256k1 != null && Object.hasOwnProperty.call(message, "sigVerifyCostSecp256k1")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.sigVerifyCostSecp256k1); + return writer; + }; + + /** + * Encodes the specified Params message, length delimited. Does not implicitly {@link cosmos.auth.v1beta1.Params.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.auth.v1beta1.Params + * @static + * @param {cosmos.auth.v1beta1.IParams} message Params message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Params.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Params message from the specified reader or buffer. + * @function decode + * @memberof cosmos.auth.v1beta1.Params + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.auth.v1beta1.Params} Params + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Params.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.auth.v1beta1.Params(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxMemoCharacters = reader.uint64(); + break; + case 2: + message.txSigLimit = reader.uint64(); + break; + case 3: + message.txSizeCostPerByte = reader.uint64(); + break; + case 4: + message.sigVerifyCostEd25519 = reader.uint64(); + break; + case 5: + message.sigVerifyCostSecp256k1 = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Params message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.auth.v1beta1.Params + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.auth.v1beta1.Params} Params + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Params.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Params message. + * @function verify + * @memberof cosmos.auth.v1beta1.Params + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Params.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maxMemoCharacters != null && message.hasOwnProperty("maxMemoCharacters")) + if (!$util.isInteger(message.maxMemoCharacters) && !(message.maxMemoCharacters && $util.isInteger(message.maxMemoCharacters.low) && $util.isInteger(message.maxMemoCharacters.high))) + return "maxMemoCharacters: integer|Long expected"; + if (message.txSigLimit != null && message.hasOwnProperty("txSigLimit")) + if (!$util.isInteger(message.txSigLimit) && !(message.txSigLimit && $util.isInteger(message.txSigLimit.low) && $util.isInteger(message.txSigLimit.high))) + return "txSigLimit: integer|Long expected"; + if (message.txSizeCostPerByte != null && message.hasOwnProperty("txSizeCostPerByte")) + if (!$util.isInteger(message.txSizeCostPerByte) && !(message.txSizeCostPerByte && $util.isInteger(message.txSizeCostPerByte.low) && $util.isInteger(message.txSizeCostPerByte.high))) + return "txSizeCostPerByte: integer|Long expected"; + if (message.sigVerifyCostEd25519 != null && message.hasOwnProperty("sigVerifyCostEd25519")) + if (!$util.isInteger(message.sigVerifyCostEd25519) && !(message.sigVerifyCostEd25519 && $util.isInteger(message.sigVerifyCostEd25519.low) && $util.isInteger(message.sigVerifyCostEd25519.high))) + return "sigVerifyCostEd25519: integer|Long expected"; + if (message.sigVerifyCostSecp256k1 != null && message.hasOwnProperty("sigVerifyCostSecp256k1")) + if (!$util.isInteger(message.sigVerifyCostSecp256k1) && !(message.sigVerifyCostSecp256k1 && $util.isInteger(message.sigVerifyCostSecp256k1.low) && $util.isInteger(message.sigVerifyCostSecp256k1.high))) + return "sigVerifyCostSecp256k1: integer|Long expected"; + return null; + }; + + /** + * Creates a Params message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.auth.v1beta1.Params + * @static + * @param {Object.} object Plain object + * @returns {cosmos.auth.v1beta1.Params} Params + */ + Params.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.auth.v1beta1.Params) + return object; + let message = new $root.cosmos.auth.v1beta1.Params(); + if (object.maxMemoCharacters != null) + if ($util.Long) + (message.maxMemoCharacters = $util.Long.fromValue(object.maxMemoCharacters)).unsigned = true; + else if (typeof object.maxMemoCharacters === "string") + message.maxMemoCharacters = parseInt(object.maxMemoCharacters, 10); + else if (typeof object.maxMemoCharacters === "number") + message.maxMemoCharacters = object.maxMemoCharacters; + else if (typeof object.maxMemoCharacters === "object") + message.maxMemoCharacters = new $util.LongBits(object.maxMemoCharacters.low >>> 0, object.maxMemoCharacters.high >>> 0).toNumber(true); + if (object.txSigLimit != null) + if ($util.Long) + (message.txSigLimit = $util.Long.fromValue(object.txSigLimit)).unsigned = true; + else if (typeof object.txSigLimit === "string") + message.txSigLimit = parseInt(object.txSigLimit, 10); + else if (typeof object.txSigLimit === "number") + message.txSigLimit = object.txSigLimit; + else if (typeof object.txSigLimit === "object") + message.txSigLimit = new $util.LongBits(object.txSigLimit.low >>> 0, object.txSigLimit.high >>> 0).toNumber(true); + if (object.txSizeCostPerByte != null) + if ($util.Long) + (message.txSizeCostPerByte = $util.Long.fromValue(object.txSizeCostPerByte)).unsigned = true; + else if (typeof object.txSizeCostPerByte === "string") + message.txSizeCostPerByte = parseInt(object.txSizeCostPerByte, 10); + else if (typeof object.txSizeCostPerByte === "number") + message.txSizeCostPerByte = object.txSizeCostPerByte; + else if (typeof object.txSizeCostPerByte === "object") + message.txSizeCostPerByte = new $util.LongBits(object.txSizeCostPerByte.low >>> 0, object.txSizeCostPerByte.high >>> 0).toNumber(true); + if (object.sigVerifyCostEd25519 != null) + if ($util.Long) + (message.sigVerifyCostEd25519 = $util.Long.fromValue(object.sigVerifyCostEd25519)).unsigned = true; + else if (typeof object.sigVerifyCostEd25519 === "string") + message.sigVerifyCostEd25519 = parseInt(object.sigVerifyCostEd25519, 10); + else if (typeof object.sigVerifyCostEd25519 === "number") + message.sigVerifyCostEd25519 = object.sigVerifyCostEd25519; + else if (typeof object.sigVerifyCostEd25519 === "object") + message.sigVerifyCostEd25519 = new $util.LongBits(object.sigVerifyCostEd25519.low >>> 0, object.sigVerifyCostEd25519.high >>> 0).toNumber(true); + if (object.sigVerifyCostSecp256k1 != null) + if ($util.Long) + (message.sigVerifyCostSecp256k1 = $util.Long.fromValue(object.sigVerifyCostSecp256k1)).unsigned = true; + else if (typeof object.sigVerifyCostSecp256k1 === "string") + message.sigVerifyCostSecp256k1 = parseInt(object.sigVerifyCostSecp256k1, 10); + else if (typeof object.sigVerifyCostSecp256k1 === "number") + message.sigVerifyCostSecp256k1 = object.sigVerifyCostSecp256k1; + else if (typeof object.sigVerifyCostSecp256k1 === "object") + message.sigVerifyCostSecp256k1 = new $util.LongBits(object.sigVerifyCostSecp256k1.low >>> 0, object.sigVerifyCostSecp256k1.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a Params message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.auth.v1beta1.Params + * @static + * @param {cosmos.auth.v1beta1.Params} message Params + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Params.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.maxMemoCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxMemoCharacters = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.txSigLimit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.txSigLimit = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.txSizeCostPerByte = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.txSizeCostPerByte = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.sigVerifyCostEd25519 = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sigVerifyCostEd25519 = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.sigVerifyCostSecp256k1 = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sigVerifyCostSecp256k1 = options.longs === String ? "0" : 0; + } + if (message.maxMemoCharacters != null && message.hasOwnProperty("maxMemoCharacters")) + if (typeof message.maxMemoCharacters === "number") + object.maxMemoCharacters = options.longs === String ? String(message.maxMemoCharacters) : message.maxMemoCharacters; + else + object.maxMemoCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.maxMemoCharacters) : options.longs === Number ? new $util.LongBits(message.maxMemoCharacters.low >>> 0, message.maxMemoCharacters.high >>> 0).toNumber(true) : message.maxMemoCharacters; + if (message.txSigLimit != null && message.hasOwnProperty("txSigLimit")) + if (typeof message.txSigLimit === "number") + object.txSigLimit = options.longs === String ? String(message.txSigLimit) : message.txSigLimit; + else + object.txSigLimit = options.longs === String ? $util.Long.prototype.toString.call(message.txSigLimit) : options.longs === Number ? new $util.LongBits(message.txSigLimit.low >>> 0, message.txSigLimit.high >>> 0).toNumber(true) : message.txSigLimit; + if (message.txSizeCostPerByte != null && message.hasOwnProperty("txSizeCostPerByte")) + if (typeof message.txSizeCostPerByte === "number") + object.txSizeCostPerByte = options.longs === String ? String(message.txSizeCostPerByte) : message.txSizeCostPerByte; + else + object.txSizeCostPerByte = options.longs === String ? $util.Long.prototype.toString.call(message.txSizeCostPerByte) : options.longs === Number ? new $util.LongBits(message.txSizeCostPerByte.low >>> 0, message.txSizeCostPerByte.high >>> 0).toNumber(true) : message.txSizeCostPerByte; + if (message.sigVerifyCostEd25519 != null && message.hasOwnProperty("sigVerifyCostEd25519")) + if (typeof message.sigVerifyCostEd25519 === "number") + object.sigVerifyCostEd25519 = options.longs === String ? String(message.sigVerifyCostEd25519) : message.sigVerifyCostEd25519; + else + object.sigVerifyCostEd25519 = options.longs === String ? $util.Long.prototype.toString.call(message.sigVerifyCostEd25519) : options.longs === Number ? new $util.LongBits(message.sigVerifyCostEd25519.low >>> 0, message.sigVerifyCostEd25519.high >>> 0).toNumber(true) : message.sigVerifyCostEd25519; + if (message.sigVerifyCostSecp256k1 != null && message.hasOwnProperty("sigVerifyCostSecp256k1")) + if (typeof message.sigVerifyCostSecp256k1 === "number") + object.sigVerifyCostSecp256k1 = options.longs === String ? String(message.sigVerifyCostSecp256k1) : message.sigVerifyCostSecp256k1; + else + object.sigVerifyCostSecp256k1 = options.longs === String ? $util.Long.prototype.toString.call(message.sigVerifyCostSecp256k1) : options.longs === Number ? new $util.LongBits(message.sigVerifyCostSecp256k1.low >>> 0, message.sigVerifyCostSecp256k1.high >>> 0).toNumber(true) : message.sigVerifyCostSecp256k1; + return object; + }; + + /** + * Converts this Params to JSON. + * @function toJSON + * @memberof cosmos.auth.v1beta1.Params + * @instance + * @returns {Object.} JSON object + */ + Params.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Params; + })(v1beta1.Params || {}); + + v1beta1.GenesisState = (function(GenesisState) { + + /** + * Properties of a GenesisState. + * @memberof cosmos.auth.v1beta1 + * @interface IGenesisState + * @property {cosmos.auth.v1beta1.IParams|null} [params] GenesisState params + * @property {Array.|null} [accounts] GenesisState accounts + */ + + /** + * Constructs a new GenesisState. + * @memberof cosmos.auth.v1beta1 + * @classdesc Represents a GenesisState. + * @implements IGenesisState + * @constructor + * @param {cosmos.auth.v1beta1.IGenesisState=} [properties] Properties to set + */ + function GenesisState(properties) { + this.accounts = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenesisState params. + * @member {cosmos.auth.v1beta1.IParams|null|undefined} params + * @memberof cosmos.auth.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.params = null; + + /** + * GenesisState accounts. + * @member {Array.} accounts + * @memberof cosmos.auth.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.accounts = $util.emptyArray; + + /** + * Creates a new GenesisState instance using the specified properties. + * @function create + * @memberof cosmos.auth.v1beta1.GenesisState + * @static + * @param {cosmos.auth.v1beta1.IGenesisState=} [properties] Properties to set + * @returns {cosmos.auth.v1beta1.GenesisState} GenesisState instance + */ + GenesisState.create = function create(properties) { + return new GenesisState(properties); + }; + + /** + * Encodes the specified GenesisState message. Does not implicitly {@link cosmos.auth.v1beta1.GenesisState.verify|verify} messages. + * @function encode + * @memberof cosmos.auth.v1beta1.GenesisState + * @static + * @param {cosmos.auth.v1beta1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.cosmos.auth.v1beta1.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.accounts != null && message.accounts.length) + for (let i = 0; i < message.accounts.length; ++i) + $root.google.protobuf.Any.encode(message.accounts[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link cosmos.auth.v1beta1.GenesisState.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.auth.v1beta1.GenesisState + * @static + * @param {cosmos.auth.v1beta1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer. + * @function decode + * @memberof cosmos.auth.v1beta1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.auth.v1beta1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.auth.v1beta1.GenesisState(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = $root.cosmos.auth.v1beta1.Params.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.accounts && message.accounts.length)) + message.accounts = []; + message.accounts.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.auth.v1beta1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.auth.v1beta1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenesisState message. + * @function verify + * @memberof cosmos.auth.v1beta1.GenesisState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenesisState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.params != null && message.hasOwnProperty("params")) { + let error = $root.cosmos.auth.v1beta1.Params.verify(message.params); + if (error) + return "params." + error; + } + if (message.accounts != null && message.hasOwnProperty("accounts")) { + if (!Array.isArray(message.accounts)) + return "accounts: array expected"; + for (let i = 0; i < message.accounts.length; ++i) { + let error = $root.google.protobuf.Any.verify(message.accounts[i]); + if (error) + return "accounts." + error; + } + } + return null; + }; + + /** + * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.auth.v1beta1.GenesisState + * @static + * @param {Object.} object Plain object + * @returns {cosmos.auth.v1beta1.GenesisState} GenesisState + */ + GenesisState.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.auth.v1beta1.GenesisState) + return object; + let message = new $root.cosmos.auth.v1beta1.GenesisState(); + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".cosmos.auth.v1beta1.GenesisState.params: object expected"); + message.params = $root.cosmos.auth.v1beta1.Params.fromObject(object.params); + } + if (object.accounts) { + if (!Array.isArray(object.accounts)) + throw TypeError(".cosmos.auth.v1beta1.GenesisState.accounts: array expected"); + message.accounts = []; + for (let i = 0; i < object.accounts.length; ++i) { + if (typeof object.accounts[i] !== "object") + throw TypeError(".cosmos.auth.v1beta1.GenesisState.accounts: object expected"); + message.accounts[i] = $root.google.protobuf.Any.fromObject(object.accounts[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GenesisState message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.auth.v1beta1.GenesisState + * @static + * @param {cosmos.auth.v1beta1.GenesisState} message GenesisState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenesisState.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.accounts = []; + if (options.defaults) + object.params = null; + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.cosmos.auth.v1beta1.Params.toObject(message.params, options); + if (message.accounts && message.accounts.length) { + object.accounts = []; + for (let j = 0; j < message.accounts.length; ++j) + object.accounts[j] = $root.google.protobuf.Any.toObject(message.accounts[j], options); + } + return object; + }; + + /** + * Converts this GenesisState to JSON. + * @function toJSON + * @memberof cosmos.auth.v1beta1.GenesisState + * @instance + * @returns {Object.} JSON object + */ + GenesisState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GenesisState; + })(v1beta1.GenesisState || {}); + + v1beta1.Query = (function(Query) { + + /** + * Constructs a new Query service. + * @memberof cosmos.auth.v1beta1 + * @classdesc Represents a Query + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Query(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; + + /** + * Creates new Query service using the specified rpc implementation. + * @function create + * @memberof cosmos.auth.v1beta1.Query + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Query} RPC service. Useful where requests and/or responses are streamed. + */ + Query.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.auth.v1beta1.Query#account}. + * @memberof cosmos.auth.v1beta1.Query + * @typedef AccountCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.auth.v1beta1.IQueryAccountResponse} [response] QueryAccountResponse + */ + + /** + * Calls Account. + * @function account + * @memberof cosmos.auth.v1beta1.Query + * @instance + * @param {cosmos.auth.v1beta1.IQueryAccountRequest} request QueryAccountRequest message or plain object + * @param {cosmos.auth.v1beta1.Query.AccountCallback} callback Node-style callback called with the error, if any, and QueryAccountResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.account = function account(request, callback) { + return this.rpcCall(account, $root.cosmos.auth.v1beta1.QueryAccountRequest, $root.cosmos.auth.v1beta1.QueryAccountResponse, request, callback); + }, "name", { value: "Account" }); + + /** + * Calls Account. + * @function account + * @memberof cosmos.auth.v1beta1.Query + * @instance + * @param {cosmos.auth.v1beta1.IQueryAccountRequest} request QueryAccountRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.auth.v1beta1.Query#params}. + * @memberof cosmos.auth.v1beta1.Query + * @typedef ParamsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.auth.v1beta1.IQueryParamsResponse} [response] QueryParamsResponse + */ + + /** + * Calls Params. + * @function params + * @memberof cosmos.auth.v1beta1.Query + * @instance + * @param {cosmos.auth.v1beta1.IQueryParamsRequest} request QueryParamsRequest message or plain object + * @param {cosmos.auth.v1beta1.Query.ParamsCallback} callback Node-style callback called with the error, if any, and QueryParamsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.params = function params(request, callback) { + return this.rpcCall(params, $root.cosmos.auth.v1beta1.QueryParamsRequest, $root.cosmos.auth.v1beta1.QueryParamsResponse, request, callback); + }, "name", { value: "Params" }); + + /** + * Calls Params. + * @function params + * @memberof cosmos.auth.v1beta1.Query + * @instance + * @param {cosmos.auth.v1beta1.IQueryParamsRequest} request QueryParamsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Query; + })(v1beta1.Query || {}); + + v1beta1.QueryAccountRequest = (function(QueryAccountRequest) { + + /** + * Properties of a QueryAccountRequest. + * @memberof cosmos.auth.v1beta1 + * @interface IQueryAccountRequest + * @property {string|null} [address] QueryAccountRequest address + */ + + /** + * Constructs a new QueryAccountRequest. + * @memberof cosmos.auth.v1beta1 + * @classdesc Represents a QueryAccountRequest. + * @implements IQueryAccountRequest + * @constructor + * @param {cosmos.auth.v1beta1.IQueryAccountRequest=} [properties] Properties to set + */ + function QueryAccountRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryAccountRequest address. + * @member {string} address + * @memberof cosmos.auth.v1beta1.QueryAccountRequest + * @instance + */ + QueryAccountRequest.prototype.address = ""; + + /** + * Creates a new QueryAccountRequest instance using the specified properties. + * @function create + * @memberof cosmos.auth.v1beta1.QueryAccountRequest + * @static + * @param {cosmos.auth.v1beta1.IQueryAccountRequest=} [properties] Properties to set + * @returns {cosmos.auth.v1beta1.QueryAccountRequest} QueryAccountRequest instance + */ + QueryAccountRequest.create = function create(properties) { + return new QueryAccountRequest(properties); + }; + + /** + * Encodes the specified QueryAccountRequest message. Does not implicitly {@link cosmos.auth.v1beta1.QueryAccountRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.auth.v1beta1.QueryAccountRequest + * @static + * @param {cosmos.auth.v1beta1.IQueryAccountRequest} message QueryAccountRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAccountRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.address); + return writer; + }; + + /** + * Encodes the specified QueryAccountRequest message, length delimited. Does not implicitly {@link cosmos.auth.v1beta1.QueryAccountRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.auth.v1beta1.QueryAccountRequest + * @static + * @param {cosmos.auth.v1beta1.IQueryAccountRequest} message QueryAccountRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAccountRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryAccountRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.auth.v1beta1.QueryAccountRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.auth.v1beta1.QueryAccountRequest} QueryAccountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAccountRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.auth.v1beta1.QueryAccountRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryAccountRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.auth.v1beta1.QueryAccountRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.auth.v1beta1.QueryAccountRequest} QueryAccountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAccountRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryAccountRequest message. + * @function verify + * @memberof cosmos.auth.v1beta1.QueryAccountRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryAccountRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + return null; + }; + + /** + * Creates a QueryAccountRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.auth.v1beta1.QueryAccountRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.auth.v1beta1.QueryAccountRequest} QueryAccountRequest + */ + QueryAccountRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.auth.v1beta1.QueryAccountRequest) + return object; + let message = new $root.cosmos.auth.v1beta1.QueryAccountRequest(); + if (object.address != null) + message.address = String(object.address); + return message; + }; + + /** + * Creates a plain object from a QueryAccountRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.auth.v1beta1.QueryAccountRequest + * @static + * @param {cosmos.auth.v1beta1.QueryAccountRequest} message QueryAccountRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryAccountRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.address = ""; + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + return object; + }; + + /** + * Converts this QueryAccountRequest to JSON. + * @function toJSON + * @memberof cosmos.auth.v1beta1.QueryAccountRequest + * @instance + * @returns {Object.} JSON object + */ + QueryAccountRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryAccountRequest; + })(v1beta1.QueryAccountRequest || {}); + + v1beta1.QueryAccountResponse = (function(QueryAccountResponse) { + + /** + * Properties of a QueryAccountResponse. + * @memberof cosmos.auth.v1beta1 + * @interface IQueryAccountResponse + * @property {google.protobuf.IAny|null} [account] QueryAccountResponse account + */ + + /** + * Constructs a new QueryAccountResponse. + * @memberof cosmos.auth.v1beta1 + * @classdesc Represents a QueryAccountResponse. + * @implements IQueryAccountResponse + * @constructor + * @param {cosmos.auth.v1beta1.IQueryAccountResponse=} [properties] Properties to set + */ + function QueryAccountResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryAccountResponse account. + * @member {google.protobuf.IAny|null|undefined} account + * @memberof cosmos.auth.v1beta1.QueryAccountResponse + * @instance + */ + QueryAccountResponse.prototype.account = null; + + /** + * Creates a new QueryAccountResponse instance using the specified properties. + * @function create + * @memberof cosmos.auth.v1beta1.QueryAccountResponse + * @static + * @param {cosmos.auth.v1beta1.IQueryAccountResponse=} [properties] Properties to set + * @returns {cosmos.auth.v1beta1.QueryAccountResponse} QueryAccountResponse instance + */ + QueryAccountResponse.create = function create(properties) { + return new QueryAccountResponse(properties); + }; + + /** + * Encodes the specified QueryAccountResponse message. Does not implicitly {@link cosmos.auth.v1beta1.QueryAccountResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.auth.v1beta1.QueryAccountResponse + * @static + * @param {cosmos.auth.v1beta1.IQueryAccountResponse} message QueryAccountResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAccountResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.account != null && Object.hasOwnProperty.call(message, "account")) + $root.google.protobuf.Any.encode(message.account, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryAccountResponse message, length delimited. Does not implicitly {@link cosmos.auth.v1beta1.QueryAccountResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.auth.v1beta1.QueryAccountResponse + * @static + * @param {cosmos.auth.v1beta1.IQueryAccountResponse} message QueryAccountResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAccountResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryAccountResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.auth.v1beta1.QueryAccountResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.auth.v1beta1.QueryAccountResponse} QueryAccountResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAccountResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.auth.v1beta1.QueryAccountResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryAccountResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.auth.v1beta1.QueryAccountResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.auth.v1beta1.QueryAccountResponse} QueryAccountResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAccountResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryAccountResponse message. + * @function verify + * @memberof cosmos.auth.v1beta1.QueryAccountResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryAccountResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.account != null && message.hasOwnProperty("account")) { + let error = $root.google.protobuf.Any.verify(message.account); + if (error) + return "account." + error; + } + return null; + }; + + /** + * Creates a QueryAccountResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.auth.v1beta1.QueryAccountResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.auth.v1beta1.QueryAccountResponse} QueryAccountResponse + */ + QueryAccountResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.auth.v1beta1.QueryAccountResponse) + return object; + let message = new $root.cosmos.auth.v1beta1.QueryAccountResponse(); + if (object.account != null) { + if (typeof object.account !== "object") + throw TypeError(".cosmos.auth.v1beta1.QueryAccountResponse.account: object expected"); + message.account = $root.google.protobuf.Any.fromObject(object.account); + } + return message; + }; + + /** + * Creates a plain object from a QueryAccountResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.auth.v1beta1.QueryAccountResponse + * @static + * @param {cosmos.auth.v1beta1.QueryAccountResponse} message QueryAccountResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryAccountResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.account = null; + if (message.account != null && message.hasOwnProperty("account")) + object.account = $root.google.protobuf.Any.toObject(message.account, options); + return object; + }; + + /** + * Converts this QueryAccountResponse to JSON. + * @function toJSON + * @memberof cosmos.auth.v1beta1.QueryAccountResponse + * @instance + * @returns {Object.} JSON object + */ + QueryAccountResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryAccountResponse; + })(v1beta1.QueryAccountResponse || {}); + + v1beta1.QueryParamsRequest = (function(QueryParamsRequest) { + + /** + * Properties of a QueryParamsRequest. + * @memberof cosmos.auth.v1beta1 + * @interface IQueryParamsRequest + */ + + /** + * Constructs a new QueryParamsRequest. + * @memberof cosmos.auth.v1beta1 + * @classdesc Represents a QueryParamsRequest. + * @implements IQueryParamsRequest + * @constructor + * @param {cosmos.auth.v1beta1.IQueryParamsRequest=} [properties] Properties to set + */ + function QueryParamsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new QueryParamsRequest instance using the specified properties. + * @function create + * @memberof cosmos.auth.v1beta1.QueryParamsRequest + * @static + * @param {cosmos.auth.v1beta1.IQueryParamsRequest=} [properties] Properties to set + * @returns {cosmos.auth.v1beta1.QueryParamsRequest} QueryParamsRequest instance + */ + QueryParamsRequest.create = function create(properties) { + return new QueryParamsRequest(properties); + }; + + /** + * Encodes the specified QueryParamsRequest message. Does not implicitly {@link cosmos.auth.v1beta1.QueryParamsRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.auth.v1beta1.QueryParamsRequest + * @static + * @param {cosmos.auth.v1beta1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link cosmos.auth.v1beta1.QueryParamsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.auth.v1beta1.QueryParamsRequest + * @static + * @param {cosmos.auth.v1beta1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryParamsRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.auth.v1beta1.QueryParamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.auth.v1beta1.QueryParamsRequest} QueryParamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.auth.v1beta1.QueryParamsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.auth.v1beta1.QueryParamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.auth.v1beta1.QueryParamsRequest} QueryParamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryParamsRequest message. + * @function verify + * @memberof cosmos.auth.v1beta1.QueryParamsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryParamsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.auth.v1beta1.QueryParamsRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.auth.v1beta1.QueryParamsRequest} QueryParamsRequest + */ + QueryParamsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.auth.v1beta1.QueryParamsRequest) + return object; + return new $root.cosmos.auth.v1beta1.QueryParamsRequest(); + }; + + /** + * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.auth.v1beta1.QueryParamsRequest + * @static + * @param {cosmos.auth.v1beta1.QueryParamsRequest} message QueryParamsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryParamsRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this QueryParamsRequest to JSON. + * @function toJSON + * @memberof cosmos.auth.v1beta1.QueryParamsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryParamsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryParamsRequest; + })(v1beta1.QueryParamsRequest || {}); + + v1beta1.QueryParamsResponse = (function(QueryParamsResponse) { + + /** + * Properties of a QueryParamsResponse. + * @memberof cosmos.auth.v1beta1 + * @interface IQueryParamsResponse + * @property {cosmos.auth.v1beta1.IParams|null} [params] QueryParamsResponse params + */ + + /** + * Constructs a new QueryParamsResponse. + * @memberof cosmos.auth.v1beta1 + * @classdesc Represents a QueryParamsResponse. + * @implements IQueryParamsResponse + * @constructor + * @param {cosmos.auth.v1beta1.IQueryParamsResponse=} [properties] Properties to set + */ + function QueryParamsResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryParamsResponse params. + * @member {cosmos.auth.v1beta1.IParams|null|undefined} params + * @memberof cosmos.auth.v1beta1.QueryParamsResponse + * @instance + */ + QueryParamsResponse.prototype.params = null; + + /** + * Creates a new QueryParamsResponse instance using the specified properties. + * @function create + * @memberof cosmos.auth.v1beta1.QueryParamsResponse + * @static + * @param {cosmos.auth.v1beta1.IQueryParamsResponse=} [properties] Properties to set + * @returns {cosmos.auth.v1beta1.QueryParamsResponse} QueryParamsResponse instance + */ + QueryParamsResponse.create = function create(properties) { + return new QueryParamsResponse(properties); + }; + + /** + * Encodes the specified QueryParamsResponse message. Does not implicitly {@link cosmos.auth.v1beta1.QueryParamsResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.auth.v1beta1.QueryParamsResponse + * @static + * @param {cosmos.auth.v1beta1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.cosmos.auth.v1beta1.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link cosmos.auth.v1beta1.QueryParamsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.auth.v1beta1.QueryParamsResponse + * @static + * @param {cosmos.auth.v1beta1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryParamsResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.auth.v1beta1.QueryParamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.auth.v1beta1.QueryParamsResponse} QueryParamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.auth.v1beta1.QueryParamsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = $root.cosmos.auth.v1beta1.Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.auth.v1beta1.QueryParamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.auth.v1beta1.QueryParamsResponse} QueryParamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryParamsResponse message. + * @function verify + * @memberof cosmos.auth.v1beta1.QueryParamsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryParamsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.params != null && message.hasOwnProperty("params")) { + let error = $root.cosmos.auth.v1beta1.Params.verify(message.params); + if (error) + return "params." + error; + } + return null; + }; + + /** + * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.auth.v1beta1.QueryParamsResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.auth.v1beta1.QueryParamsResponse} QueryParamsResponse + */ + QueryParamsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.auth.v1beta1.QueryParamsResponse) + return object; + let message = new $root.cosmos.auth.v1beta1.QueryParamsResponse(); + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".cosmos.auth.v1beta1.QueryParamsResponse.params: object expected"); + message.params = $root.cosmos.auth.v1beta1.Params.fromObject(object.params); + } + return message; + }; + + /** + * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.auth.v1beta1.QueryParamsResponse + * @static + * @param {cosmos.auth.v1beta1.QueryParamsResponse} message QueryParamsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryParamsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.params = null; + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.cosmos.auth.v1beta1.Params.toObject(message.params, options); + return object; + }; + + /** + * Converts this QueryParamsResponse to JSON. + * @function toJSON + * @memberof cosmos.auth.v1beta1.QueryParamsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryParamsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryParamsResponse; + })(v1beta1.QueryParamsResponse || {}); + + return v1beta1; + })(auth.v1beta1 || {}); + + return auth; + })(cosmos.auth || {}); + + /** + * Namespace bank. + * @memberof cosmos + * @namespace + */ + + cosmos.bank = (function(bank) { + + /** + * Namespace v1beta1. + * @memberof cosmos.bank + * @namespace + */ + + bank.v1beta1 = (function(v1beta1) { + + v1beta1.Params = (function(Params) { + + /** + * Properties of a Params. + * @memberof cosmos.bank.v1beta1 + * @interface IParams + * @property {Array.|null} [sendEnabled] Params sendEnabled + * @property {boolean|null} [defaultSendEnabled] Params defaultSendEnabled + */ + + /** + * Constructs a new Params. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a Params. + * @implements IParams + * @constructor + * @param {cosmos.bank.v1beta1.IParams=} [properties] Properties to set + */ + function Params(properties) { + this.sendEnabled = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Params sendEnabled. + * @member {Array.} sendEnabled + * @memberof cosmos.bank.v1beta1.Params + * @instance + */ + Params.prototype.sendEnabled = $util.emptyArray; + + /** + * Params defaultSendEnabled. + * @member {boolean} defaultSendEnabled + * @memberof cosmos.bank.v1beta1.Params + * @instance + */ + Params.prototype.defaultSendEnabled = false; + + /** + * Creates a new Params instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.Params + * @static + * @param {cosmos.bank.v1beta1.IParams=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.Params} Params instance + */ + Params.create = function create(properties) { + return new Params(properties); + }; + + /** + * Encodes the specified Params message. Does not implicitly {@link cosmos.bank.v1beta1.Params.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.Params + * @static + * @param {cosmos.bank.v1beta1.IParams} message Params message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Params.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sendEnabled != null && message.sendEnabled.length) + for (let i = 0; i < message.sendEnabled.length; ++i) + $root.cosmos.bank.v1beta1.SendEnabled.encode(message.sendEnabled[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.defaultSendEnabled != null && Object.hasOwnProperty.call(message, "defaultSendEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.defaultSendEnabled); + return writer; + }; + + /** + * Encodes the specified Params message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.Params.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.Params + * @static + * @param {cosmos.bank.v1beta1.IParams} message Params message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Params.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Params message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.Params + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.Params} Params + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Params.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.Params(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.sendEnabled && message.sendEnabled.length)) + message.sendEnabled = []; + message.sendEnabled.push($root.cosmos.bank.v1beta1.SendEnabled.decode(reader, reader.uint32())); + break; + case 2: + message.defaultSendEnabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Params message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.Params + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.Params} Params + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Params.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Params message. + * @function verify + * @memberof cosmos.bank.v1beta1.Params + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Params.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sendEnabled != null && message.hasOwnProperty("sendEnabled")) { + if (!Array.isArray(message.sendEnabled)) + return "sendEnabled: array expected"; + for (let i = 0; i < message.sendEnabled.length; ++i) { + let error = $root.cosmos.bank.v1beta1.SendEnabled.verify(message.sendEnabled[i]); + if (error) + return "sendEnabled." + error; + } + } + if (message.defaultSendEnabled != null && message.hasOwnProperty("defaultSendEnabled")) + if (typeof message.defaultSendEnabled !== "boolean") + return "defaultSendEnabled: boolean expected"; + return null; + }; + + /** + * Creates a Params message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.Params + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.Params} Params + */ + Params.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.Params) + return object; + let message = new $root.cosmos.bank.v1beta1.Params(); + if (object.sendEnabled) { + if (!Array.isArray(object.sendEnabled)) + throw TypeError(".cosmos.bank.v1beta1.Params.sendEnabled: array expected"); + message.sendEnabled = []; + for (let i = 0; i < object.sendEnabled.length; ++i) { + if (typeof object.sendEnabled[i] !== "object") + throw TypeError(".cosmos.bank.v1beta1.Params.sendEnabled: object expected"); + message.sendEnabled[i] = $root.cosmos.bank.v1beta1.SendEnabled.fromObject(object.sendEnabled[i]); + } + } + if (object.defaultSendEnabled != null) + message.defaultSendEnabled = Boolean(object.defaultSendEnabled); + return message; + }; + + /** + * Creates a plain object from a Params message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.Params + * @static + * @param {cosmos.bank.v1beta1.Params} message Params + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Params.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.sendEnabled = []; + if (options.defaults) + object.defaultSendEnabled = false; + if (message.sendEnabled && message.sendEnabled.length) { + object.sendEnabled = []; + for (let j = 0; j < message.sendEnabled.length; ++j) + object.sendEnabled[j] = $root.cosmos.bank.v1beta1.SendEnabled.toObject(message.sendEnabled[j], options); + } + if (message.defaultSendEnabled != null && message.hasOwnProperty("defaultSendEnabled")) + object.defaultSendEnabled = message.defaultSendEnabled; + return object; + }; + + /** + * Converts this Params to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.Params + * @instance + * @returns {Object.} JSON object + */ + Params.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Params; + })(v1beta1.Params || {}); + + v1beta1.SendEnabled = (function(SendEnabled) { + + /** + * Properties of a SendEnabled. + * @memberof cosmos.bank.v1beta1 + * @interface ISendEnabled + * @property {string|null} [denom] SendEnabled denom + * @property {boolean|null} [enabled] SendEnabled enabled + */ + + /** + * Constructs a new SendEnabled. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a SendEnabled. + * @implements ISendEnabled + * @constructor + * @param {cosmos.bank.v1beta1.ISendEnabled=} [properties] Properties to set + */ + function SendEnabled(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SendEnabled denom. + * @member {string} denom + * @memberof cosmos.bank.v1beta1.SendEnabled + * @instance + */ + SendEnabled.prototype.denom = ""; + + /** + * SendEnabled enabled. + * @member {boolean} enabled + * @memberof cosmos.bank.v1beta1.SendEnabled + * @instance + */ + SendEnabled.prototype.enabled = false; + + /** + * Creates a new SendEnabled instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.SendEnabled + * @static + * @param {cosmos.bank.v1beta1.ISendEnabled=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.SendEnabled} SendEnabled instance + */ + SendEnabled.create = function create(properties) { + return new SendEnabled(properties); + }; + + /** + * Encodes the specified SendEnabled message. Does not implicitly {@link cosmos.bank.v1beta1.SendEnabled.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.SendEnabled + * @static + * @param {cosmos.bank.v1beta1.ISendEnabled} message SendEnabled message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SendEnabled.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enabled); + return writer; + }; + + /** + * Encodes the specified SendEnabled message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.SendEnabled.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.SendEnabled + * @static + * @param {cosmos.bank.v1beta1.ISendEnabled} message SendEnabled message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SendEnabled.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SendEnabled message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.SendEnabled + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.SendEnabled} SendEnabled + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SendEnabled.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.SendEnabled(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.enabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SendEnabled message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.SendEnabled + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.SendEnabled} SendEnabled + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SendEnabled.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SendEnabled message. + * @function verify + * @memberof cosmos.bank.v1beta1.SendEnabled + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SendEnabled.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.denom != null && message.hasOwnProperty("denom")) + if (!$util.isString(message.denom)) + return "denom: string expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + return null; + }; + + /** + * Creates a SendEnabled message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.SendEnabled + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.SendEnabled} SendEnabled + */ + SendEnabled.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.SendEnabled) + return object; + let message = new $root.cosmos.bank.v1beta1.SendEnabled(); + if (object.denom != null) + message.denom = String(object.denom); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + return message; + }; + + /** + * Creates a plain object from a SendEnabled message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.SendEnabled + * @static + * @param {cosmos.bank.v1beta1.SendEnabled} message SendEnabled + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SendEnabled.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.denom = ""; + object.enabled = false; + } + if (message.denom != null && message.hasOwnProperty("denom")) + object.denom = message.denom; + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + return object; + }; + + /** + * Converts this SendEnabled to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.SendEnabled + * @instance + * @returns {Object.} JSON object + */ + SendEnabled.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SendEnabled; + })(v1beta1.SendEnabled || {}); + + v1beta1.Input = (function(Input) { + + /** + * Properties of an Input. + * @memberof cosmos.bank.v1beta1 + * @interface IInput + * @property {string|null} [address] Input address + * @property {Array.|null} [coins] Input coins + */ + + /** + * Constructs a new Input. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents an Input. + * @implements IInput + * @constructor + * @param {cosmos.bank.v1beta1.IInput=} [properties] Properties to set + */ + function Input(properties) { + this.coins = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Input address. + * @member {string} address + * @memberof cosmos.bank.v1beta1.Input + * @instance + */ + Input.prototype.address = ""; + + /** + * Input coins. + * @member {Array.} coins + * @memberof cosmos.bank.v1beta1.Input + * @instance + */ + Input.prototype.coins = $util.emptyArray; + + /** + * Creates a new Input instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.Input + * @static + * @param {cosmos.bank.v1beta1.IInput=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.Input} Input instance + */ + Input.create = function create(properties) { + return new Input(properties); + }; + + /** + * Encodes the specified Input message. Does not implicitly {@link cosmos.bank.v1beta1.Input.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.Input + * @static + * @param {cosmos.bank.v1beta1.IInput} message Input message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Input.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.address); + if (message.coins != null && message.coins.length) + for (let i = 0; i < message.coins.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.coins[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Input message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.Input.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.Input + * @static + * @param {cosmos.bank.v1beta1.IInput} message Input message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Input.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Input message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.Input + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.Input} Input + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Input.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.Input(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + if (!(message.coins && message.coins.length)) + message.coins = []; + message.coins.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Input message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.Input + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.Input} Input + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Input.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Input message. + * @function verify + * @memberof cosmos.bank.v1beta1.Input + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Input.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.coins != null && message.hasOwnProperty("coins")) { + if (!Array.isArray(message.coins)) + return "coins: array expected"; + for (let i = 0; i < message.coins.length; ++i) { + let error = $root.cosmos.base.v1beta1.Coin.verify(message.coins[i]); + if (error) + return "coins." + error; + } + } + return null; + }; + + /** + * Creates an Input message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.Input + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.Input} Input + */ + Input.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.Input) + return object; + let message = new $root.cosmos.bank.v1beta1.Input(); + if (object.address != null) + message.address = String(object.address); + if (object.coins) { + if (!Array.isArray(object.coins)) + throw TypeError(".cosmos.bank.v1beta1.Input.coins: array expected"); + message.coins = []; + for (let i = 0; i < object.coins.length; ++i) { + if (typeof object.coins[i] !== "object") + throw TypeError(".cosmos.bank.v1beta1.Input.coins: object expected"); + message.coins[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.coins[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Input message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.Input + * @static + * @param {cosmos.bank.v1beta1.Input} message Input + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Input.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.coins = []; + if (options.defaults) + object.address = ""; + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + if (message.coins && message.coins.length) { + object.coins = []; + for (let j = 0; j < message.coins.length; ++j) + object.coins[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.coins[j], options); + } + return object; + }; + + /** + * Converts this Input to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.Input + * @instance + * @returns {Object.} JSON object + */ + Input.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Input; + })(v1beta1.Input || {}); + + v1beta1.Output = (function(Output) { + + /** + * Properties of an Output. + * @memberof cosmos.bank.v1beta1 + * @interface IOutput + * @property {string|null} [address] Output address + * @property {Array.|null} [coins] Output coins + */ + + /** + * Constructs a new Output. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents an Output. + * @implements IOutput + * @constructor + * @param {cosmos.bank.v1beta1.IOutput=} [properties] Properties to set + */ + function Output(properties) { + this.coins = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Output address. + * @member {string} address + * @memberof cosmos.bank.v1beta1.Output + * @instance + */ + Output.prototype.address = ""; + + /** + * Output coins. + * @member {Array.} coins + * @memberof cosmos.bank.v1beta1.Output + * @instance + */ + Output.prototype.coins = $util.emptyArray; + + /** + * Creates a new Output instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.Output + * @static + * @param {cosmos.bank.v1beta1.IOutput=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.Output} Output instance + */ + Output.create = function create(properties) { + return new Output(properties); + }; + + /** + * Encodes the specified Output message. Does not implicitly {@link cosmos.bank.v1beta1.Output.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.Output + * @static + * @param {cosmos.bank.v1beta1.IOutput} message Output message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Output.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.address); + if (message.coins != null && message.coins.length) + for (let i = 0; i < message.coins.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.coins[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Output message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.Output.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.Output + * @static + * @param {cosmos.bank.v1beta1.IOutput} message Output message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Output.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Output message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.Output + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.Output} Output + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Output.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.Output(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + if (!(message.coins && message.coins.length)) + message.coins = []; + message.coins.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Output message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.Output + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.Output} Output + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Output.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Output message. + * @function verify + * @memberof cosmos.bank.v1beta1.Output + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Output.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.coins != null && message.hasOwnProperty("coins")) { + if (!Array.isArray(message.coins)) + return "coins: array expected"; + for (let i = 0; i < message.coins.length; ++i) { + let error = $root.cosmos.base.v1beta1.Coin.verify(message.coins[i]); + if (error) + return "coins." + error; + } + } + return null; + }; + + /** + * Creates an Output message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.Output + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.Output} Output + */ + Output.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.Output) + return object; + let message = new $root.cosmos.bank.v1beta1.Output(); + if (object.address != null) + message.address = String(object.address); + if (object.coins) { + if (!Array.isArray(object.coins)) + throw TypeError(".cosmos.bank.v1beta1.Output.coins: array expected"); + message.coins = []; + for (let i = 0; i < object.coins.length; ++i) { + if (typeof object.coins[i] !== "object") + throw TypeError(".cosmos.bank.v1beta1.Output.coins: object expected"); + message.coins[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.coins[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Output message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.Output + * @static + * @param {cosmos.bank.v1beta1.Output} message Output + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Output.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.coins = []; + if (options.defaults) + object.address = ""; + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + if (message.coins && message.coins.length) { + object.coins = []; + for (let j = 0; j < message.coins.length; ++j) + object.coins[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.coins[j], options); + } + return object; + }; + + /** + * Converts this Output to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.Output + * @instance + * @returns {Object.} JSON object + */ + Output.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Output; + })(v1beta1.Output || {}); + + v1beta1.Supply = (function(Supply) { + + /** + * Properties of a Supply. + * @memberof cosmos.bank.v1beta1 + * @interface ISupply + * @property {Array.|null} [total] Supply total + */ + + /** + * Constructs a new Supply. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a Supply. + * @implements ISupply + * @constructor + * @param {cosmos.bank.v1beta1.ISupply=} [properties] Properties to set + */ + function Supply(properties) { + this.total = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Supply total. + * @member {Array.} total + * @memberof cosmos.bank.v1beta1.Supply + * @instance + */ + Supply.prototype.total = $util.emptyArray; + + /** + * Creates a new Supply instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.Supply + * @static + * @param {cosmos.bank.v1beta1.ISupply=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.Supply} Supply instance + */ + Supply.create = function create(properties) { + return new Supply(properties); + }; + + /** + * Encodes the specified Supply message. Does not implicitly {@link cosmos.bank.v1beta1.Supply.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.Supply + * @static + * @param {cosmos.bank.v1beta1.ISupply} message Supply message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Supply.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.total != null && message.total.length) + for (let i = 0; i < message.total.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.total[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Supply message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.Supply.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.Supply + * @static + * @param {cosmos.bank.v1beta1.ISupply} message Supply message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Supply.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Supply message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.Supply + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.Supply} Supply + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Supply.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.Supply(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.total && message.total.length)) + message.total = []; + message.total.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Supply message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.Supply + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.Supply} Supply + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Supply.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Supply message. + * @function verify + * @memberof cosmos.bank.v1beta1.Supply + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Supply.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.total != null && message.hasOwnProperty("total")) { + if (!Array.isArray(message.total)) + return "total: array expected"; + for (let i = 0; i < message.total.length; ++i) { + let error = $root.cosmos.base.v1beta1.Coin.verify(message.total[i]); + if (error) + return "total." + error; + } + } + return null; + }; + + /** + * Creates a Supply message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.Supply + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.Supply} Supply + */ + Supply.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.Supply) + return object; + let message = new $root.cosmos.bank.v1beta1.Supply(); + if (object.total) { + if (!Array.isArray(object.total)) + throw TypeError(".cosmos.bank.v1beta1.Supply.total: array expected"); + message.total = []; + for (let i = 0; i < object.total.length; ++i) { + if (typeof object.total[i] !== "object") + throw TypeError(".cosmos.bank.v1beta1.Supply.total: object expected"); + message.total[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.total[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Supply message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.Supply + * @static + * @param {cosmos.bank.v1beta1.Supply} message Supply + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Supply.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.total = []; + if (message.total && message.total.length) { + object.total = []; + for (let j = 0; j < message.total.length; ++j) + object.total[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.total[j], options); + } + return object; + }; + + /** + * Converts this Supply to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.Supply + * @instance + * @returns {Object.} JSON object + */ + Supply.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Supply; + })(v1beta1.Supply || {}); + + v1beta1.DenomUnit = (function(DenomUnit) { + + /** + * Properties of a DenomUnit. + * @memberof cosmos.bank.v1beta1 + * @interface IDenomUnit + * @property {string|null} [denom] DenomUnit denom + * @property {number|null} [exponent] DenomUnit exponent + * @property {Array.|null} [aliases] DenomUnit aliases + */ + + /** + * Constructs a new DenomUnit. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a DenomUnit. + * @implements IDenomUnit + * @constructor + * @param {cosmos.bank.v1beta1.IDenomUnit=} [properties] Properties to set + */ + function DenomUnit(properties) { + this.aliases = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DenomUnit denom. + * @member {string} denom + * @memberof cosmos.bank.v1beta1.DenomUnit + * @instance + */ + DenomUnit.prototype.denom = ""; + + /** + * DenomUnit exponent. + * @member {number} exponent + * @memberof cosmos.bank.v1beta1.DenomUnit + * @instance + */ + DenomUnit.prototype.exponent = 0; + + /** + * DenomUnit aliases. + * @member {Array.} aliases + * @memberof cosmos.bank.v1beta1.DenomUnit + * @instance + */ + DenomUnit.prototype.aliases = $util.emptyArray; + + /** + * Creates a new DenomUnit instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.DenomUnit + * @static + * @param {cosmos.bank.v1beta1.IDenomUnit=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.DenomUnit} DenomUnit instance + */ + DenomUnit.create = function create(properties) { + return new DenomUnit(properties); + }; + + /** + * Encodes the specified DenomUnit message. Does not implicitly {@link cosmos.bank.v1beta1.DenomUnit.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.DenomUnit + * @static + * @param {cosmos.bank.v1beta1.IDenomUnit} message DenomUnit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DenomUnit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); + if (message.exponent != null && Object.hasOwnProperty.call(message, "exponent")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.exponent); + if (message.aliases != null && message.aliases.length) + for (let i = 0; i < message.aliases.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.aliases[i]); + return writer; + }; + + /** + * Encodes the specified DenomUnit message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.DenomUnit.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.DenomUnit + * @static + * @param {cosmos.bank.v1beta1.IDenomUnit} message DenomUnit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DenomUnit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DenomUnit message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.DenomUnit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.DenomUnit} DenomUnit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DenomUnit.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.DenomUnit(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.exponent = reader.uint32(); + break; + case 3: + if (!(message.aliases && message.aliases.length)) + message.aliases = []; + message.aliases.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DenomUnit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.DenomUnit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.DenomUnit} DenomUnit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DenomUnit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DenomUnit message. + * @function verify + * @memberof cosmos.bank.v1beta1.DenomUnit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DenomUnit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.denom != null && message.hasOwnProperty("denom")) + if (!$util.isString(message.denom)) + return "denom: string expected"; + if (message.exponent != null && message.hasOwnProperty("exponent")) + if (!$util.isInteger(message.exponent)) + return "exponent: integer expected"; + if (message.aliases != null && message.hasOwnProperty("aliases")) { + if (!Array.isArray(message.aliases)) + return "aliases: array expected"; + for (let i = 0; i < message.aliases.length; ++i) + if (!$util.isString(message.aliases[i])) + return "aliases: string[] expected"; + } + return null; + }; + + /** + * Creates a DenomUnit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.DenomUnit + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.DenomUnit} DenomUnit + */ + DenomUnit.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.DenomUnit) + return object; + let message = new $root.cosmos.bank.v1beta1.DenomUnit(); + if (object.denom != null) + message.denom = String(object.denom); + if (object.exponent != null) + message.exponent = object.exponent >>> 0; + if (object.aliases) { + if (!Array.isArray(object.aliases)) + throw TypeError(".cosmos.bank.v1beta1.DenomUnit.aliases: array expected"); + message.aliases = []; + for (let i = 0; i < object.aliases.length; ++i) + message.aliases[i] = String(object.aliases[i]); + } + return message; + }; + + /** + * Creates a plain object from a DenomUnit message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.DenomUnit + * @static + * @param {cosmos.bank.v1beta1.DenomUnit} message DenomUnit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DenomUnit.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.aliases = []; + if (options.defaults) { + object.denom = ""; + object.exponent = 0; + } + if (message.denom != null && message.hasOwnProperty("denom")) + object.denom = message.denom; + if (message.exponent != null && message.hasOwnProperty("exponent")) + object.exponent = message.exponent; + if (message.aliases && message.aliases.length) { + object.aliases = []; + for (let j = 0; j < message.aliases.length; ++j) + object.aliases[j] = message.aliases[j]; + } + return object; + }; + + /** + * Converts this DenomUnit to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.DenomUnit + * @instance + * @returns {Object.} JSON object + */ + DenomUnit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DenomUnit; + })(v1beta1.DenomUnit || {}); + + v1beta1.Metadata = (function(Metadata) { + + /** + * Properties of a Metadata. + * @memberof cosmos.bank.v1beta1 + * @interface IMetadata + * @property {string|null} [description] Metadata description + * @property {Array.|null} [denomUnits] Metadata denomUnits + * @property {string|null} [base] Metadata base + * @property {string|null} [display] Metadata display + */ + + /** + * Constructs a new Metadata. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a Metadata. + * @implements IMetadata + * @constructor + * @param {cosmos.bank.v1beta1.IMetadata=} [properties] Properties to set + */ + function Metadata(properties) { + this.denomUnits = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Metadata description. + * @member {string} description + * @memberof cosmos.bank.v1beta1.Metadata + * @instance + */ + Metadata.prototype.description = ""; + + /** + * Metadata denomUnits. + * @member {Array.} denomUnits + * @memberof cosmos.bank.v1beta1.Metadata + * @instance + */ + Metadata.prototype.denomUnits = $util.emptyArray; + + /** + * Metadata base. + * @member {string} base + * @memberof cosmos.bank.v1beta1.Metadata + * @instance + */ + Metadata.prototype.base = ""; + + /** + * Metadata display. + * @member {string} display + * @memberof cosmos.bank.v1beta1.Metadata + * @instance + */ + Metadata.prototype.display = ""; + + /** + * Creates a new Metadata instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.Metadata + * @static + * @param {cosmos.bank.v1beta1.IMetadata=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.Metadata} Metadata instance + */ + Metadata.create = function create(properties) { + return new Metadata(properties); + }; + + /** + * Encodes the specified Metadata message. Does not implicitly {@link cosmos.bank.v1beta1.Metadata.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.Metadata + * @static + * @param {cosmos.bank.v1beta1.IMetadata} message Metadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); + if (message.denomUnits != null && message.denomUnits.length) + for (let i = 0; i < message.denomUnits.length; ++i) + $root.cosmos.bank.v1beta1.DenomUnit.encode(message.denomUnits[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.base != null && Object.hasOwnProperty.call(message, "base")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.base); + if (message.display != null && Object.hasOwnProperty.call(message, "display")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.display); + return writer; + }; + + /** + * Encodes the specified Metadata message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.Metadata.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.Metadata + * @static + * @param {cosmos.bank.v1beta1.IMetadata} message Metadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Metadata message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.Metadata(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.description = reader.string(); + break; + case 2: + if (!(message.denomUnits && message.denomUnits.length)) + message.denomUnits = []; + message.denomUnits.push($root.cosmos.bank.v1beta1.DenomUnit.decode(reader, reader.uint32())); + break; + case 3: + message.base = reader.string(); + break; + case 4: + message.display = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Metadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Metadata message. + * @function verify + * @memberof cosmos.bank.v1beta1.Metadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Metadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.denomUnits != null && message.hasOwnProperty("denomUnits")) { + if (!Array.isArray(message.denomUnits)) + return "denomUnits: array expected"; + for (let i = 0; i < message.denomUnits.length; ++i) { + let error = $root.cosmos.bank.v1beta1.DenomUnit.verify(message.denomUnits[i]); + if (error) + return "denomUnits." + error; + } + } + if (message.base != null && message.hasOwnProperty("base")) + if (!$util.isString(message.base)) + return "base: string expected"; + if (message.display != null && message.hasOwnProperty("display")) + if (!$util.isString(message.display)) + return "display: string expected"; + return null; + }; + + /** + * Creates a Metadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.Metadata + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.Metadata} Metadata + */ + Metadata.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.Metadata) + return object; + let message = new $root.cosmos.bank.v1beta1.Metadata(); + if (object.description != null) + message.description = String(object.description); + if (object.denomUnits) { + if (!Array.isArray(object.denomUnits)) + throw TypeError(".cosmos.bank.v1beta1.Metadata.denomUnits: array expected"); + message.denomUnits = []; + for (let i = 0; i < object.denomUnits.length; ++i) { + if (typeof object.denomUnits[i] !== "object") + throw TypeError(".cosmos.bank.v1beta1.Metadata.denomUnits: object expected"); + message.denomUnits[i] = $root.cosmos.bank.v1beta1.DenomUnit.fromObject(object.denomUnits[i]); + } + } + if (object.base != null) + message.base = String(object.base); + if (object.display != null) + message.display = String(object.display); + return message; + }; + + /** + * Creates a plain object from a Metadata message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.Metadata + * @static + * @param {cosmos.bank.v1beta1.Metadata} message Metadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Metadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.denomUnits = []; + if (options.defaults) { + object.description = ""; + object.base = ""; + object.display = ""; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.denomUnits && message.denomUnits.length) { + object.denomUnits = []; + for (let j = 0; j < message.denomUnits.length; ++j) + object.denomUnits[j] = $root.cosmos.bank.v1beta1.DenomUnit.toObject(message.denomUnits[j], options); + } + if (message.base != null && message.hasOwnProperty("base")) + object.base = message.base; + if (message.display != null && message.hasOwnProperty("display")) + object.display = message.display; + return object; + }; + + /** + * Converts this Metadata to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.Metadata + * @instance + * @returns {Object.} JSON object + */ + Metadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Metadata; + })(v1beta1.Metadata || {}); + + v1beta1.GenesisState = (function(GenesisState) { + + /** + * Properties of a GenesisState. + * @memberof cosmos.bank.v1beta1 + * @interface IGenesisState + * @property {cosmos.bank.v1beta1.IParams|null} [params] GenesisState params + * @property {Array.|null} [balances] GenesisState balances + * @property {Array.|null} [supply] GenesisState supply + * @property {Array.|null} [denomMetadata] GenesisState denomMetadata + */ + + /** + * Constructs a new GenesisState. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a GenesisState. + * @implements IGenesisState + * @constructor + * @param {cosmos.bank.v1beta1.IGenesisState=} [properties] Properties to set + */ + function GenesisState(properties) { + this.balances = []; + this.supply = []; + this.denomMetadata = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenesisState params. + * @member {cosmos.bank.v1beta1.IParams|null|undefined} params + * @memberof cosmos.bank.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.params = null; + + /** + * GenesisState balances. + * @member {Array.} balances + * @memberof cosmos.bank.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.balances = $util.emptyArray; + + /** + * GenesisState supply. + * @member {Array.} supply + * @memberof cosmos.bank.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.supply = $util.emptyArray; + + /** + * GenesisState denomMetadata. + * @member {Array.} denomMetadata + * @memberof cosmos.bank.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.denomMetadata = $util.emptyArray; + + /** + * Creates a new GenesisState instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.GenesisState + * @static + * @param {cosmos.bank.v1beta1.IGenesisState=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.GenesisState} GenesisState instance + */ + GenesisState.create = function create(properties) { + return new GenesisState(properties); + }; + + /** + * Encodes the specified GenesisState message. Does not implicitly {@link cosmos.bank.v1beta1.GenesisState.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.GenesisState + * @static + * @param {cosmos.bank.v1beta1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.cosmos.bank.v1beta1.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.balances != null && message.balances.length) + for (let i = 0; i < message.balances.length; ++i) + $root.cosmos.bank.v1beta1.Balance.encode(message.balances[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.supply != null && message.supply.length) + for (let i = 0; i < message.supply.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.supply[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.denomMetadata != null && message.denomMetadata.length) + for (let i = 0; i < message.denomMetadata.length; ++i) + $root.cosmos.bank.v1beta1.Metadata.encode(message.denomMetadata[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.GenesisState.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.GenesisState + * @static + * @param {cosmos.bank.v1beta1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.GenesisState(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = $root.cosmos.bank.v1beta1.Params.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.balances && message.balances.length)) + message.balances = []; + message.balances.push($root.cosmos.bank.v1beta1.Balance.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.supply && message.supply.length)) + message.supply = []; + message.supply.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.denomMetadata && message.denomMetadata.length)) + message.denomMetadata = []; + message.denomMetadata.push($root.cosmos.bank.v1beta1.Metadata.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenesisState message. + * @function verify + * @memberof cosmos.bank.v1beta1.GenesisState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenesisState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.params != null && message.hasOwnProperty("params")) { + let error = $root.cosmos.bank.v1beta1.Params.verify(message.params); + if (error) + return "params." + error; + } + if (message.balances != null && message.hasOwnProperty("balances")) { + if (!Array.isArray(message.balances)) + return "balances: array expected"; + for (let i = 0; i < message.balances.length; ++i) { + let error = $root.cosmos.bank.v1beta1.Balance.verify(message.balances[i]); + if (error) + return "balances." + error; + } + } + if (message.supply != null && message.hasOwnProperty("supply")) { + if (!Array.isArray(message.supply)) + return "supply: array expected"; + for (let i = 0; i < message.supply.length; ++i) { + let error = $root.cosmos.base.v1beta1.Coin.verify(message.supply[i]); + if (error) + return "supply." + error; + } + } + if (message.denomMetadata != null && message.hasOwnProperty("denomMetadata")) { + if (!Array.isArray(message.denomMetadata)) + return "denomMetadata: array expected"; + for (let i = 0; i < message.denomMetadata.length; ++i) { + let error = $root.cosmos.bank.v1beta1.Metadata.verify(message.denomMetadata[i]); + if (error) + return "denomMetadata." + error; + } + } + return null; + }; + + /** + * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.GenesisState + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.GenesisState} GenesisState + */ + GenesisState.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.GenesisState) + return object; + let message = new $root.cosmos.bank.v1beta1.GenesisState(); + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".cosmos.bank.v1beta1.GenesisState.params: object expected"); + message.params = $root.cosmos.bank.v1beta1.Params.fromObject(object.params); + } + if (object.balances) { + if (!Array.isArray(object.balances)) + throw TypeError(".cosmos.bank.v1beta1.GenesisState.balances: array expected"); + message.balances = []; + for (let i = 0; i < object.balances.length; ++i) { + if (typeof object.balances[i] !== "object") + throw TypeError(".cosmos.bank.v1beta1.GenesisState.balances: object expected"); + message.balances[i] = $root.cosmos.bank.v1beta1.Balance.fromObject(object.balances[i]); + } + } + if (object.supply) { + if (!Array.isArray(object.supply)) + throw TypeError(".cosmos.bank.v1beta1.GenesisState.supply: array expected"); + message.supply = []; + for (let i = 0; i < object.supply.length; ++i) { + if (typeof object.supply[i] !== "object") + throw TypeError(".cosmos.bank.v1beta1.GenesisState.supply: object expected"); + message.supply[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.supply[i]); + } + } + if (object.denomMetadata) { + if (!Array.isArray(object.denomMetadata)) + throw TypeError(".cosmos.bank.v1beta1.GenesisState.denomMetadata: array expected"); + message.denomMetadata = []; + for (let i = 0; i < object.denomMetadata.length; ++i) { + if (typeof object.denomMetadata[i] !== "object") + throw TypeError(".cosmos.bank.v1beta1.GenesisState.denomMetadata: object expected"); + message.denomMetadata[i] = $root.cosmos.bank.v1beta1.Metadata.fromObject(object.denomMetadata[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GenesisState message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.GenesisState + * @static + * @param {cosmos.bank.v1beta1.GenesisState} message GenesisState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenesisState.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) { + object.balances = []; + object.supply = []; + object.denomMetadata = []; + } + if (options.defaults) + object.params = null; + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.cosmos.bank.v1beta1.Params.toObject(message.params, options); + if (message.balances && message.balances.length) { + object.balances = []; + for (let j = 0; j < message.balances.length; ++j) + object.balances[j] = $root.cosmos.bank.v1beta1.Balance.toObject(message.balances[j], options); + } + if (message.supply && message.supply.length) { + object.supply = []; + for (let j = 0; j < message.supply.length; ++j) + object.supply[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.supply[j], options); + } + if (message.denomMetadata && message.denomMetadata.length) { + object.denomMetadata = []; + for (let j = 0; j < message.denomMetadata.length; ++j) + object.denomMetadata[j] = $root.cosmos.bank.v1beta1.Metadata.toObject(message.denomMetadata[j], options); + } + return object; + }; + + /** + * Converts this GenesisState to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.GenesisState + * @instance + * @returns {Object.} JSON object + */ + GenesisState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GenesisState; + })(v1beta1.GenesisState || {}); + + v1beta1.Balance = (function(Balance) { + + /** + * Properties of a Balance. + * @memberof cosmos.bank.v1beta1 + * @interface IBalance + * @property {string|null} [address] Balance address + * @property {Array.|null} [coins] Balance coins + */ + + /** + * Constructs a new Balance. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a Balance. + * @implements IBalance + * @constructor + * @param {cosmos.bank.v1beta1.IBalance=} [properties] Properties to set + */ + function Balance(properties) { + this.coins = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Balance address. + * @member {string} address + * @memberof cosmos.bank.v1beta1.Balance + * @instance + */ + Balance.prototype.address = ""; + + /** + * Balance coins. + * @member {Array.} coins + * @memberof cosmos.bank.v1beta1.Balance + * @instance + */ + Balance.prototype.coins = $util.emptyArray; + + /** + * Creates a new Balance instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.Balance + * @static + * @param {cosmos.bank.v1beta1.IBalance=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.Balance} Balance instance + */ + Balance.create = function create(properties) { + return new Balance(properties); + }; + + /** + * Encodes the specified Balance message. Does not implicitly {@link cosmos.bank.v1beta1.Balance.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.Balance + * @static + * @param {cosmos.bank.v1beta1.IBalance} message Balance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Balance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.address); + if (message.coins != null && message.coins.length) + for (let i = 0; i < message.coins.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.coins[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Balance message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.Balance.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.Balance + * @static + * @param {cosmos.bank.v1beta1.IBalance} message Balance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Balance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Balance message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.Balance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.Balance} Balance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Balance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.Balance(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + if (!(message.coins && message.coins.length)) + message.coins = []; + message.coins.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Balance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.Balance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.Balance} Balance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Balance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Balance message. + * @function verify + * @memberof cosmos.bank.v1beta1.Balance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Balance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.coins != null && message.hasOwnProperty("coins")) { + if (!Array.isArray(message.coins)) + return "coins: array expected"; + for (let i = 0; i < message.coins.length; ++i) { + let error = $root.cosmos.base.v1beta1.Coin.verify(message.coins[i]); + if (error) + return "coins." + error; + } + } + return null; + }; + + /** + * Creates a Balance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.Balance + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.Balance} Balance + */ + Balance.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.Balance) + return object; + let message = new $root.cosmos.bank.v1beta1.Balance(); + if (object.address != null) + message.address = String(object.address); + if (object.coins) { + if (!Array.isArray(object.coins)) + throw TypeError(".cosmos.bank.v1beta1.Balance.coins: array expected"); + message.coins = []; + for (let i = 0; i < object.coins.length; ++i) { + if (typeof object.coins[i] !== "object") + throw TypeError(".cosmos.bank.v1beta1.Balance.coins: object expected"); + message.coins[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.coins[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Balance message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.Balance + * @static + * @param {cosmos.bank.v1beta1.Balance} message Balance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Balance.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.coins = []; + if (options.defaults) + object.address = ""; + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + if (message.coins && message.coins.length) { + object.coins = []; + for (let j = 0; j < message.coins.length; ++j) + object.coins[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.coins[j], options); + } + return object; + }; + + /** + * Converts this Balance to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.Balance + * @instance + * @returns {Object.} JSON object + */ + Balance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Balance; + })(v1beta1.Balance || {}); + + v1beta1.Query = (function(Query) { + + /** + * Constructs a new Query service. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a Query + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Query(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; + + /** + * Creates new Query service using the specified rpc implementation. + * @function create + * @memberof cosmos.bank.v1beta1.Query + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Query} RPC service. Useful where requests and/or responses are streamed. + */ + Query.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.bank.v1beta1.Query#balance}. + * @memberof cosmos.bank.v1beta1.Query + * @typedef BalanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.bank.v1beta1.IQueryBalanceResponse} [response] QueryBalanceResponse + */ + + /** + * Calls Balance. + * @function balance + * @memberof cosmos.bank.v1beta1.Query + * @instance + * @param {cosmos.bank.v1beta1.IQueryBalanceRequest} request QueryBalanceRequest message or plain object + * @param {cosmos.bank.v1beta1.Query.BalanceCallback} callback Node-style callback called with the error, if any, and QueryBalanceResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.balance = function balance(request, callback) { + return this.rpcCall(balance, $root.cosmos.bank.v1beta1.QueryBalanceRequest, $root.cosmos.bank.v1beta1.QueryBalanceResponse, request, callback); + }, "name", { value: "Balance" }); + + /** + * Calls Balance. + * @function balance + * @memberof cosmos.bank.v1beta1.Query + * @instance + * @param {cosmos.bank.v1beta1.IQueryBalanceRequest} request QueryBalanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.bank.v1beta1.Query#allBalances}. + * @memberof cosmos.bank.v1beta1.Query + * @typedef AllBalancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.bank.v1beta1.IQueryAllBalancesResponse} [response] QueryAllBalancesResponse + */ + + /** + * Calls AllBalances. + * @function allBalances + * @memberof cosmos.bank.v1beta1.Query + * @instance + * @param {cosmos.bank.v1beta1.IQueryAllBalancesRequest} request QueryAllBalancesRequest message or plain object + * @param {cosmos.bank.v1beta1.Query.AllBalancesCallback} callback Node-style callback called with the error, if any, and QueryAllBalancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.allBalances = function allBalances(request, callback) { + return this.rpcCall(allBalances, $root.cosmos.bank.v1beta1.QueryAllBalancesRequest, $root.cosmos.bank.v1beta1.QueryAllBalancesResponse, request, callback); + }, "name", { value: "AllBalances" }); + + /** + * Calls AllBalances. + * @function allBalances + * @memberof cosmos.bank.v1beta1.Query + * @instance + * @param {cosmos.bank.v1beta1.IQueryAllBalancesRequest} request QueryAllBalancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.bank.v1beta1.Query#totalSupply}. + * @memberof cosmos.bank.v1beta1.Query + * @typedef TotalSupplyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.bank.v1beta1.IQueryTotalSupplyResponse} [response] QueryTotalSupplyResponse + */ + + /** + * Calls TotalSupply. + * @function totalSupply + * @memberof cosmos.bank.v1beta1.Query + * @instance + * @param {cosmos.bank.v1beta1.IQueryTotalSupplyRequest} request QueryTotalSupplyRequest message or plain object + * @param {cosmos.bank.v1beta1.Query.TotalSupplyCallback} callback Node-style callback called with the error, if any, and QueryTotalSupplyResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.totalSupply = function totalSupply(request, callback) { + return this.rpcCall(totalSupply, $root.cosmos.bank.v1beta1.QueryTotalSupplyRequest, $root.cosmos.bank.v1beta1.QueryTotalSupplyResponse, request, callback); + }, "name", { value: "TotalSupply" }); + + /** + * Calls TotalSupply. + * @function totalSupply + * @memberof cosmos.bank.v1beta1.Query + * @instance + * @param {cosmos.bank.v1beta1.IQueryTotalSupplyRequest} request QueryTotalSupplyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.bank.v1beta1.Query#supplyOf}. + * @memberof cosmos.bank.v1beta1.Query + * @typedef SupplyOfCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.bank.v1beta1.IQuerySupplyOfResponse} [response] QuerySupplyOfResponse + */ + + /** + * Calls SupplyOf. + * @function supplyOf + * @memberof cosmos.bank.v1beta1.Query + * @instance + * @param {cosmos.bank.v1beta1.IQuerySupplyOfRequest} request QuerySupplyOfRequest message or plain object + * @param {cosmos.bank.v1beta1.Query.SupplyOfCallback} callback Node-style callback called with the error, if any, and QuerySupplyOfResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.supplyOf = function supplyOf(request, callback) { + return this.rpcCall(supplyOf, $root.cosmos.bank.v1beta1.QuerySupplyOfRequest, $root.cosmos.bank.v1beta1.QuerySupplyOfResponse, request, callback); + }, "name", { value: "SupplyOf" }); + + /** + * Calls SupplyOf. + * @function supplyOf + * @memberof cosmos.bank.v1beta1.Query + * @instance + * @param {cosmos.bank.v1beta1.IQuerySupplyOfRequest} request QuerySupplyOfRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.bank.v1beta1.Query#params}. + * @memberof cosmos.bank.v1beta1.Query + * @typedef ParamsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.bank.v1beta1.IQueryParamsResponse} [response] QueryParamsResponse + */ + + /** + * Calls Params. + * @function params + * @memberof cosmos.bank.v1beta1.Query + * @instance + * @param {cosmos.bank.v1beta1.IQueryParamsRequest} request QueryParamsRequest message or plain object + * @param {cosmos.bank.v1beta1.Query.ParamsCallback} callback Node-style callback called with the error, if any, and QueryParamsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.params = function params(request, callback) { + return this.rpcCall(params, $root.cosmos.bank.v1beta1.QueryParamsRequest, $root.cosmos.bank.v1beta1.QueryParamsResponse, request, callback); + }, "name", { value: "Params" }); + + /** + * Calls Params. + * @function params + * @memberof cosmos.bank.v1beta1.Query + * @instance + * @param {cosmos.bank.v1beta1.IQueryParamsRequest} request QueryParamsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.bank.v1beta1.Query#denomMetadata}. + * @memberof cosmos.bank.v1beta1.Query + * @typedef DenomMetadataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.bank.v1beta1.IQueryDenomMetadataResponse} [response] QueryDenomMetadataResponse + */ + + /** + * Calls DenomMetadata. + * @function denomMetadata + * @memberof cosmos.bank.v1beta1.Query + * @instance + * @param {cosmos.bank.v1beta1.IQueryDenomMetadataRequest} request QueryDenomMetadataRequest message or plain object + * @param {cosmos.bank.v1beta1.Query.DenomMetadataCallback} callback Node-style callback called with the error, if any, and QueryDenomMetadataResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.denomMetadata = function denomMetadata(request, callback) { + return this.rpcCall(denomMetadata, $root.cosmos.bank.v1beta1.QueryDenomMetadataRequest, $root.cosmos.bank.v1beta1.QueryDenomMetadataResponse, request, callback); + }, "name", { value: "DenomMetadata" }); + + /** + * Calls DenomMetadata. + * @function denomMetadata + * @memberof cosmos.bank.v1beta1.Query + * @instance + * @param {cosmos.bank.v1beta1.IQueryDenomMetadataRequest} request QueryDenomMetadataRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.bank.v1beta1.Query#denomsMetadata}. + * @memberof cosmos.bank.v1beta1.Query + * @typedef DenomsMetadataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.bank.v1beta1.IQueryDenomsMetadataResponse} [response] QueryDenomsMetadataResponse + */ + + /** + * Calls DenomsMetadata. + * @function denomsMetadata + * @memberof cosmos.bank.v1beta1.Query + * @instance + * @param {cosmos.bank.v1beta1.IQueryDenomsMetadataRequest} request QueryDenomsMetadataRequest message or plain object + * @param {cosmos.bank.v1beta1.Query.DenomsMetadataCallback} callback Node-style callback called with the error, if any, and QueryDenomsMetadataResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.denomsMetadata = function denomsMetadata(request, callback) { + return this.rpcCall(denomsMetadata, $root.cosmos.bank.v1beta1.QueryDenomsMetadataRequest, $root.cosmos.bank.v1beta1.QueryDenomsMetadataResponse, request, callback); + }, "name", { value: "DenomsMetadata" }); + + /** + * Calls DenomsMetadata. + * @function denomsMetadata + * @memberof cosmos.bank.v1beta1.Query + * @instance + * @param {cosmos.bank.v1beta1.IQueryDenomsMetadataRequest} request QueryDenomsMetadataRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Query; + })(v1beta1.Query || {}); + + v1beta1.QueryBalanceRequest = (function(QueryBalanceRequest) { + + /** + * Properties of a QueryBalanceRequest. + * @memberof cosmos.bank.v1beta1 + * @interface IQueryBalanceRequest + * @property {string|null} [address] QueryBalanceRequest address + * @property {string|null} [denom] QueryBalanceRequest denom + */ + + /** + * Constructs a new QueryBalanceRequest. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a QueryBalanceRequest. + * @implements IQueryBalanceRequest + * @constructor + * @param {cosmos.bank.v1beta1.IQueryBalanceRequest=} [properties] Properties to set + */ + function QueryBalanceRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryBalanceRequest address. + * @member {string} address + * @memberof cosmos.bank.v1beta1.QueryBalanceRequest + * @instance + */ + QueryBalanceRequest.prototype.address = ""; + + /** + * QueryBalanceRequest denom. + * @member {string} denom + * @memberof cosmos.bank.v1beta1.QueryBalanceRequest + * @instance + */ + QueryBalanceRequest.prototype.denom = ""; + + /** + * Creates a new QueryBalanceRequest instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.QueryBalanceRequest + * @static + * @param {cosmos.bank.v1beta1.IQueryBalanceRequest=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.QueryBalanceRequest} QueryBalanceRequest instance + */ + QueryBalanceRequest.create = function create(properties) { + return new QueryBalanceRequest(properties); + }; + + /** + * Encodes the specified QueryBalanceRequest message. Does not implicitly {@link cosmos.bank.v1beta1.QueryBalanceRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.QueryBalanceRequest + * @static + * @param {cosmos.bank.v1beta1.IQueryBalanceRequest} message QueryBalanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryBalanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.address); + if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.denom); + return writer; + }; + + /** + * Encodes the specified QueryBalanceRequest message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.QueryBalanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.QueryBalanceRequest + * @static + * @param {cosmos.bank.v1beta1.IQueryBalanceRequest} message QueryBalanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryBalanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryBalanceRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.QueryBalanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.QueryBalanceRequest} QueryBalanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryBalanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.QueryBalanceRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryBalanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.QueryBalanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.QueryBalanceRequest} QueryBalanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryBalanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryBalanceRequest message. + * @function verify + * @memberof cosmos.bank.v1beta1.QueryBalanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryBalanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.denom != null && message.hasOwnProperty("denom")) + if (!$util.isString(message.denom)) + return "denom: string expected"; + return null; + }; + + /** + * Creates a QueryBalanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.QueryBalanceRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.QueryBalanceRequest} QueryBalanceRequest + */ + QueryBalanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.QueryBalanceRequest) + return object; + let message = new $root.cosmos.bank.v1beta1.QueryBalanceRequest(); + if (object.address != null) + message.address = String(object.address); + if (object.denom != null) + message.denom = String(object.denom); + return message; + }; + + /** + * Creates a plain object from a QueryBalanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.QueryBalanceRequest + * @static + * @param {cosmos.bank.v1beta1.QueryBalanceRequest} message QueryBalanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryBalanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.address = ""; + object.denom = ""; + } + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + if (message.denom != null && message.hasOwnProperty("denom")) + object.denom = message.denom; + return object; + }; + + /** + * Converts this QueryBalanceRequest to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.QueryBalanceRequest + * @instance + * @returns {Object.} JSON object + */ + QueryBalanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryBalanceRequest; + })(v1beta1.QueryBalanceRequest || {}); + + v1beta1.QueryBalanceResponse = (function(QueryBalanceResponse) { + + /** + * Properties of a QueryBalanceResponse. + * @memberof cosmos.bank.v1beta1 + * @interface IQueryBalanceResponse + * @property {cosmos.base.v1beta1.ICoin|null} [balance] QueryBalanceResponse balance + */ + + /** + * Constructs a new QueryBalanceResponse. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a QueryBalanceResponse. + * @implements IQueryBalanceResponse + * @constructor + * @param {cosmos.bank.v1beta1.IQueryBalanceResponse=} [properties] Properties to set + */ + function QueryBalanceResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryBalanceResponse balance. + * @member {cosmos.base.v1beta1.ICoin|null|undefined} balance + * @memberof cosmos.bank.v1beta1.QueryBalanceResponse + * @instance + */ + QueryBalanceResponse.prototype.balance = null; + + /** + * Creates a new QueryBalanceResponse instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.QueryBalanceResponse + * @static + * @param {cosmos.bank.v1beta1.IQueryBalanceResponse=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.QueryBalanceResponse} QueryBalanceResponse instance + */ + QueryBalanceResponse.create = function create(properties) { + return new QueryBalanceResponse(properties); + }; + + /** + * Encodes the specified QueryBalanceResponse message. Does not implicitly {@link cosmos.bank.v1beta1.QueryBalanceResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.QueryBalanceResponse + * @static + * @param {cosmos.bank.v1beta1.IQueryBalanceResponse} message QueryBalanceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryBalanceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) + $root.cosmos.base.v1beta1.Coin.encode(message.balance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryBalanceResponse message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.QueryBalanceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.QueryBalanceResponse + * @static + * @param {cosmos.bank.v1beta1.IQueryBalanceResponse} message QueryBalanceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryBalanceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryBalanceResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.QueryBalanceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.QueryBalanceResponse} QueryBalanceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryBalanceResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.QueryBalanceResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balance = $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryBalanceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.QueryBalanceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.QueryBalanceResponse} QueryBalanceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryBalanceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryBalanceResponse message. + * @function verify + * @memberof cosmos.bank.v1beta1.QueryBalanceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryBalanceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.balance != null && message.hasOwnProperty("balance")) { + let error = $root.cosmos.base.v1beta1.Coin.verify(message.balance); + if (error) + return "balance." + error; + } + return null; + }; + + /** + * Creates a QueryBalanceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.QueryBalanceResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.QueryBalanceResponse} QueryBalanceResponse + */ + QueryBalanceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.QueryBalanceResponse) + return object; + let message = new $root.cosmos.bank.v1beta1.QueryBalanceResponse(); + if (object.balance != null) { + if (typeof object.balance !== "object") + throw TypeError(".cosmos.bank.v1beta1.QueryBalanceResponse.balance: object expected"); + message.balance = $root.cosmos.base.v1beta1.Coin.fromObject(object.balance); + } + return message; + }; + + /** + * Creates a plain object from a QueryBalanceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.QueryBalanceResponse + * @static + * @param {cosmos.bank.v1beta1.QueryBalanceResponse} message QueryBalanceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryBalanceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.balance = null; + if (message.balance != null && message.hasOwnProperty("balance")) + object.balance = $root.cosmos.base.v1beta1.Coin.toObject(message.balance, options); + return object; + }; + + /** + * Converts this QueryBalanceResponse to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.QueryBalanceResponse + * @instance + * @returns {Object.} JSON object + */ + QueryBalanceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryBalanceResponse; + })(v1beta1.QueryBalanceResponse || {}); + + v1beta1.QueryAllBalancesRequest = (function(QueryAllBalancesRequest) { + + /** + * Properties of a QueryAllBalancesRequest. + * @memberof cosmos.bank.v1beta1 + * @interface IQueryAllBalancesRequest + * @property {string|null} [address] QueryAllBalancesRequest address + * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryAllBalancesRequest pagination + */ + + /** + * Constructs a new QueryAllBalancesRequest. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a QueryAllBalancesRequest. + * @implements IQueryAllBalancesRequest + * @constructor + * @param {cosmos.bank.v1beta1.IQueryAllBalancesRequest=} [properties] Properties to set + */ + function QueryAllBalancesRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryAllBalancesRequest address. + * @member {string} address + * @memberof cosmos.bank.v1beta1.QueryAllBalancesRequest + * @instance + */ + QueryAllBalancesRequest.prototype.address = ""; + + /** + * QueryAllBalancesRequest pagination. + * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination + * @memberof cosmos.bank.v1beta1.QueryAllBalancesRequest + * @instance + */ + QueryAllBalancesRequest.prototype.pagination = null; + + /** + * Creates a new QueryAllBalancesRequest instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.QueryAllBalancesRequest + * @static + * @param {cosmos.bank.v1beta1.IQueryAllBalancesRequest=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.QueryAllBalancesRequest} QueryAllBalancesRequest instance + */ + QueryAllBalancesRequest.create = function create(properties) { + return new QueryAllBalancesRequest(properties); + }; + + /** + * Encodes the specified QueryAllBalancesRequest message. Does not implicitly {@link cosmos.bank.v1beta1.QueryAllBalancesRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.QueryAllBalancesRequest + * @static + * @param {cosmos.bank.v1beta1.IQueryAllBalancesRequest} message QueryAllBalancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAllBalancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.address); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryAllBalancesRequest message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.QueryAllBalancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.QueryAllBalancesRequest + * @static + * @param {cosmos.bank.v1beta1.IQueryAllBalancesRequest} message QueryAllBalancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAllBalancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryAllBalancesRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.QueryAllBalancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.QueryAllBalancesRequest} QueryAllBalancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAllBalancesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.QueryAllBalancesRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryAllBalancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.QueryAllBalancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.QueryAllBalancesRequest} QueryAllBalancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAllBalancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryAllBalancesRequest message. + * @function verify + * @memberof cosmos.bank.v1beta1.QueryAllBalancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryAllBalancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryAllBalancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.QueryAllBalancesRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.QueryAllBalancesRequest} QueryAllBalancesRequest + */ + QueryAllBalancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.QueryAllBalancesRequest) + return object; + let message = new $root.cosmos.bank.v1beta1.QueryAllBalancesRequest(); + if (object.address != null) + message.address = String(object.address); + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.bank.v1beta1.QueryAllBalancesRequest.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryAllBalancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.QueryAllBalancesRequest + * @static + * @param {cosmos.bank.v1beta1.QueryAllBalancesRequest} message QueryAllBalancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryAllBalancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.address = ""; + object.pagination = null; + } + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryAllBalancesRequest to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.QueryAllBalancesRequest + * @instance + * @returns {Object.} JSON object + */ + QueryAllBalancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryAllBalancesRequest; + })(v1beta1.QueryAllBalancesRequest || {}); + + v1beta1.QueryAllBalancesResponse = (function(QueryAllBalancesResponse) { + + /** + * Properties of a QueryAllBalancesResponse. + * @memberof cosmos.bank.v1beta1 + * @interface IQueryAllBalancesResponse + * @property {Array.|null} [balances] QueryAllBalancesResponse balances + * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryAllBalancesResponse pagination + */ + + /** + * Constructs a new QueryAllBalancesResponse. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a QueryAllBalancesResponse. + * @implements IQueryAllBalancesResponse + * @constructor + * @param {cosmos.bank.v1beta1.IQueryAllBalancesResponse=} [properties] Properties to set + */ + function QueryAllBalancesResponse(properties) { + this.balances = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryAllBalancesResponse balances. + * @member {Array.} balances + * @memberof cosmos.bank.v1beta1.QueryAllBalancesResponse + * @instance + */ + QueryAllBalancesResponse.prototype.balances = $util.emptyArray; + + /** + * QueryAllBalancesResponse pagination. + * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination + * @memberof cosmos.bank.v1beta1.QueryAllBalancesResponse + * @instance + */ + QueryAllBalancesResponse.prototype.pagination = null; + + /** + * Creates a new QueryAllBalancesResponse instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.QueryAllBalancesResponse + * @static + * @param {cosmos.bank.v1beta1.IQueryAllBalancesResponse=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.QueryAllBalancesResponse} QueryAllBalancesResponse instance + */ + QueryAllBalancesResponse.create = function create(properties) { + return new QueryAllBalancesResponse(properties); + }; + + /** + * Encodes the specified QueryAllBalancesResponse message. Does not implicitly {@link cosmos.bank.v1beta1.QueryAllBalancesResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.QueryAllBalancesResponse + * @static + * @param {cosmos.bank.v1beta1.IQueryAllBalancesResponse} message QueryAllBalancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAllBalancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.balances != null && message.balances.length) + for (let i = 0; i < message.balances.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.balances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryAllBalancesResponse message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.QueryAllBalancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.QueryAllBalancesResponse + * @static + * @param {cosmos.bank.v1beta1.IQueryAllBalancesResponse} message QueryAllBalancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAllBalancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryAllBalancesResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.QueryAllBalancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.QueryAllBalancesResponse} QueryAllBalancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAllBalancesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.QueryAllBalancesResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.balances && message.balances.length)) + message.balances = []; + message.balances.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryAllBalancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.QueryAllBalancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.QueryAllBalancesResponse} QueryAllBalancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAllBalancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryAllBalancesResponse message. + * @function verify + * @memberof cosmos.bank.v1beta1.QueryAllBalancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryAllBalancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.balances != null && message.hasOwnProperty("balances")) { + if (!Array.isArray(message.balances)) + return "balances: array expected"; + for (let i = 0; i < message.balances.length; ++i) { + let error = $root.cosmos.base.v1beta1.Coin.verify(message.balances[i]); + if (error) + return "balances." + error; + } + } + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryAllBalancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.QueryAllBalancesResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.QueryAllBalancesResponse} QueryAllBalancesResponse + */ + QueryAllBalancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.QueryAllBalancesResponse) + return object; + let message = new $root.cosmos.bank.v1beta1.QueryAllBalancesResponse(); + if (object.balances) { + if (!Array.isArray(object.balances)) + throw TypeError(".cosmos.bank.v1beta1.QueryAllBalancesResponse.balances: array expected"); + message.balances = []; + for (let i = 0; i < object.balances.length; ++i) { + if (typeof object.balances[i] !== "object") + throw TypeError(".cosmos.bank.v1beta1.QueryAllBalancesResponse.balances: object expected"); + message.balances[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.balances[i]); + } + } + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.bank.v1beta1.QueryAllBalancesResponse.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryAllBalancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.QueryAllBalancesResponse + * @static + * @param {cosmos.bank.v1beta1.QueryAllBalancesResponse} message QueryAllBalancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryAllBalancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.balances = []; + if (options.defaults) + object.pagination = null; + if (message.balances && message.balances.length) { + object.balances = []; + for (let j = 0; j < message.balances.length; ++j) + object.balances[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.balances[j], options); + } + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryAllBalancesResponse to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.QueryAllBalancesResponse + * @instance + * @returns {Object.} JSON object + */ + QueryAllBalancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryAllBalancesResponse; + })(v1beta1.QueryAllBalancesResponse || {}); + + v1beta1.QueryTotalSupplyRequest = (function(QueryTotalSupplyRequest) { + + /** + * Properties of a QueryTotalSupplyRequest. + * @memberof cosmos.bank.v1beta1 + * @interface IQueryTotalSupplyRequest + */ + + /** + * Constructs a new QueryTotalSupplyRequest. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a QueryTotalSupplyRequest. + * @implements IQueryTotalSupplyRequest + * @constructor + * @param {cosmos.bank.v1beta1.IQueryTotalSupplyRequest=} [properties] Properties to set + */ + function QueryTotalSupplyRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new QueryTotalSupplyRequest instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.QueryTotalSupplyRequest + * @static + * @param {cosmos.bank.v1beta1.IQueryTotalSupplyRequest=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.QueryTotalSupplyRequest} QueryTotalSupplyRequest instance + */ + QueryTotalSupplyRequest.create = function create(properties) { + return new QueryTotalSupplyRequest(properties); + }; + + /** + * Encodes the specified QueryTotalSupplyRequest message. Does not implicitly {@link cosmos.bank.v1beta1.QueryTotalSupplyRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.QueryTotalSupplyRequest + * @static + * @param {cosmos.bank.v1beta1.IQueryTotalSupplyRequest} message QueryTotalSupplyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryTotalSupplyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified QueryTotalSupplyRequest message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.QueryTotalSupplyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.QueryTotalSupplyRequest + * @static + * @param {cosmos.bank.v1beta1.IQueryTotalSupplyRequest} message QueryTotalSupplyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryTotalSupplyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryTotalSupplyRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.QueryTotalSupplyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.QueryTotalSupplyRequest} QueryTotalSupplyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryTotalSupplyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.QueryTotalSupplyRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryTotalSupplyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.QueryTotalSupplyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.QueryTotalSupplyRequest} QueryTotalSupplyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryTotalSupplyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryTotalSupplyRequest message. + * @function verify + * @memberof cosmos.bank.v1beta1.QueryTotalSupplyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryTotalSupplyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a QueryTotalSupplyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.QueryTotalSupplyRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.QueryTotalSupplyRequest} QueryTotalSupplyRequest + */ + QueryTotalSupplyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.QueryTotalSupplyRequest) + return object; + return new $root.cosmos.bank.v1beta1.QueryTotalSupplyRequest(); + }; + + /** + * Creates a plain object from a QueryTotalSupplyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.QueryTotalSupplyRequest + * @static + * @param {cosmos.bank.v1beta1.QueryTotalSupplyRequest} message QueryTotalSupplyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryTotalSupplyRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this QueryTotalSupplyRequest to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.QueryTotalSupplyRequest + * @instance + * @returns {Object.} JSON object + */ + QueryTotalSupplyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryTotalSupplyRequest; + })(v1beta1.QueryTotalSupplyRequest || {}); + + v1beta1.QueryTotalSupplyResponse = (function(QueryTotalSupplyResponse) { + + /** + * Properties of a QueryTotalSupplyResponse. + * @memberof cosmos.bank.v1beta1 + * @interface IQueryTotalSupplyResponse + * @property {Array.|null} [supply] QueryTotalSupplyResponse supply + */ + + /** + * Constructs a new QueryTotalSupplyResponse. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a QueryTotalSupplyResponse. + * @implements IQueryTotalSupplyResponse + * @constructor + * @param {cosmos.bank.v1beta1.IQueryTotalSupplyResponse=} [properties] Properties to set + */ + function QueryTotalSupplyResponse(properties) { + this.supply = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryTotalSupplyResponse supply. + * @member {Array.} supply + * @memberof cosmos.bank.v1beta1.QueryTotalSupplyResponse + * @instance + */ + QueryTotalSupplyResponse.prototype.supply = $util.emptyArray; + + /** + * Creates a new QueryTotalSupplyResponse instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.QueryTotalSupplyResponse + * @static + * @param {cosmos.bank.v1beta1.IQueryTotalSupplyResponse=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.QueryTotalSupplyResponse} QueryTotalSupplyResponse instance + */ + QueryTotalSupplyResponse.create = function create(properties) { + return new QueryTotalSupplyResponse(properties); + }; + + /** + * Encodes the specified QueryTotalSupplyResponse message. Does not implicitly {@link cosmos.bank.v1beta1.QueryTotalSupplyResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.QueryTotalSupplyResponse + * @static + * @param {cosmos.bank.v1beta1.IQueryTotalSupplyResponse} message QueryTotalSupplyResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryTotalSupplyResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.supply != null && message.supply.length) + for (let i = 0; i < message.supply.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.supply[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryTotalSupplyResponse message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.QueryTotalSupplyResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.QueryTotalSupplyResponse + * @static + * @param {cosmos.bank.v1beta1.IQueryTotalSupplyResponse} message QueryTotalSupplyResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryTotalSupplyResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryTotalSupplyResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.QueryTotalSupplyResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.QueryTotalSupplyResponse} QueryTotalSupplyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryTotalSupplyResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.QueryTotalSupplyResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.supply && message.supply.length)) + message.supply = []; + message.supply.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryTotalSupplyResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.QueryTotalSupplyResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.QueryTotalSupplyResponse} QueryTotalSupplyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryTotalSupplyResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryTotalSupplyResponse message. + * @function verify + * @memberof cosmos.bank.v1beta1.QueryTotalSupplyResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryTotalSupplyResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.supply != null && message.hasOwnProperty("supply")) { + if (!Array.isArray(message.supply)) + return "supply: array expected"; + for (let i = 0; i < message.supply.length; ++i) { + let error = $root.cosmos.base.v1beta1.Coin.verify(message.supply[i]); + if (error) + return "supply." + error; + } + } + return null; + }; + + /** + * Creates a QueryTotalSupplyResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.QueryTotalSupplyResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.QueryTotalSupplyResponse} QueryTotalSupplyResponse + */ + QueryTotalSupplyResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.QueryTotalSupplyResponse) + return object; + let message = new $root.cosmos.bank.v1beta1.QueryTotalSupplyResponse(); + if (object.supply) { + if (!Array.isArray(object.supply)) + throw TypeError(".cosmos.bank.v1beta1.QueryTotalSupplyResponse.supply: array expected"); + message.supply = []; + for (let i = 0; i < object.supply.length; ++i) { + if (typeof object.supply[i] !== "object") + throw TypeError(".cosmos.bank.v1beta1.QueryTotalSupplyResponse.supply: object expected"); + message.supply[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.supply[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a QueryTotalSupplyResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.QueryTotalSupplyResponse + * @static + * @param {cosmos.bank.v1beta1.QueryTotalSupplyResponse} message QueryTotalSupplyResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryTotalSupplyResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.supply = []; + if (message.supply && message.supply.length) { + object.supply = []; + for (let j = 0; j < message.supply.length; ++j) + object.supply[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.supply[j], options); + } + return object; + }; + + /** + * Converts this QueryTotalSupplyResponse to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.QueryTotalSupplyResponse + * @instance + * @returns {Object.} JSON object + */ + QueryTotalSupplyResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryTotalSupplyResponse; + })(v1beta1.QueryTotalSupplyResponse || {}); + + v1beta1.QuerySupplyOfRequest = (function(QuerySupplyOfRequest) { + + /** + * Properties of a QuerySupplyOfRequest. + * @memberof cosmos.bank.v1beta1 + * @interface IQuerySupplyOfRequest + * @property {string|null} [denom] QuerySupplyOfRequest denom + */ + + /** + * Constructs a new QuerySupplyOfRequest. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a QuerySupplyOfRequest. + * @implements IQuerySupplyOfRequest + * @constructor + * @param {cosmos.bank.v1beta1.IQuerySupplyOfRequest=} [properties] Properties to set + */ + function QuerySupplyOfRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuerySupplyOfRequest denom. + * @member {string} denom + * @memberof cosmos.bank.v1beta1.QuerySupplyOfRequest + * @instance + */ + QuerySupplyOfRequest.prototype.denom = ""; + + /** + * Creates a new QuerySupplyOfRequest instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.QuerySupplyOfRequest + * @static + * @param {cosmos.bank.v1beta1.IQuerySupplyOfRequest=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.QuerySupplyOfRequest} QuerySupplyOfRequest instance + */ + QuerySupplyOfRequest.create = function create(properties) { + return new QuerySupplyOfRequest(properties); + }; + + /** + * Encodes the specified QuerySupplyOfRequest message. Does not implicitly {@link cosmos.bank.v1beta1.QuerySupplyOfRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.QuerySupplyOfRequest + * @static + * @param {cosmos.bank.v1beta1.IQuerySupplyOfRequest} message QuerySupplyOfRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuerySupplyOfRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); + return writer; + }; + + /** + * Encodes the specified QuerySupplyOfRequest message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.QuerySupplyOfRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.QuerySupplyOfRequest + * @static + * @param {cosmos.bank.v1beta1.IQuerySupplyOfRequest} message QuerySupplyOfRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuerySupplyOfRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuerySupplyOfRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.QuerySupplyOfRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.QuerySupplyOfRequest} QuerySupplyOfRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuerySupplyOfRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.QuerySupplyOfRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuerySupplyOfRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.QuerySupplyOfRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.QuerySupplyOfRequest} QuerySupplyOfRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuerySupplyOfRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuerySupplyOfRequest message. + * @function verify + * @memberof cosmos.bank.v1beta1.QuerySupplyOfRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuerySupplyOfRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.denom != null && message.hasOwnProperty("denom")) + if (!$util.isString(message.denom)) + return "denom: string expected"; + return null; + }; + + /** + * Creates a QuerySupplyOfRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.QuerySupplyOfRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.QuerySupplyOfRequest} QuerySupplyOfRequest + */ + QuerySupplyOfRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.QuerySupplyOfRequest) + return object; + let message = new $root.cosmos.bank.v1beta1.QuerySupplyOfRequest(); + if (object.denom != null) + message.denom = String(object.denom); + return message; + }; + + /** + * Creates a plain object from a QuerySupplyOfRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.QuerySupplyOfRequest + * @static + * @param {cosmos.bank.v1beta1.QuerySupplyOfRequest} message QuerySupplyOfRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuerySupplyOfRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.denom = ""; + if (message.denom != null && message.hasOwnProperty("denom")) + object.denom = message.denom; + return object; + }; + + /** + * Converts this QuerySupplyOfRequest to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.QuerySupplyOfRequest + * @instance + * @returns {Object.} JSON object + */ + QuerySupplyOfRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QuerySupplyOfRequest; + })(v1beta1.QuerySupplyOfRequest || {}); + + v1beta1.QuerySupplyOfResponse = (function(QuerySupplyOfResponse) { + + /** + * Properties of a QuerySupplyOfResponse. + * @memberof cosmos.bank.v1beta1 + * @interface IQuerySupplyOfResponse + * @property {cosmos.base.v1beta1.ICoin|null} [amount] QuerySupplyOfResponse amount + */ + + /** + * Constructs a new QuerySupplyOfResponse. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a QuerySupplyOfResponse. + * @implements IQuerySupplyOfResponse + * @constructor + * @param {cosmos.bank.v1beta1.IQuerySupplyOfResponse=} [properties] Properties to set + */ + function QuerySupplyOfResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuerySupplyOfResponse amount. + * @member {cosmos.base.v1beta1.ICoin|null|undefined} amount + * @memberof cosmos.bank.v1beta1.QuerySupplyOfResponse + * @instance + */ + QuerySupplyOfResponse.prototype.amount = null; + + /** + * Creates a new QuerySupplyOfResponse instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.QuerySupplyOfResponse + * @static + * @param {cosmos.bank.v1beta1.IQuerySupplyOfResponse=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.QuerySupplyOfResponse} QuerySupplyOfResponse instance + */ + QuerySupplyOfResponse.create = function create(properties) { + return new QuerySupplyOfResponse(properties); + }; + + /** + * Encodes the specified QuerySupplyOfResponse message. Does not implicitly {@link cosmos.bank.v1beta1.QuerySupplyOfResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.QuerySupplyOfResponse + * @static + * @param {cosmos.bank.v1beta1.IQuerySupplyOfResponse} message QuerySupplyOfResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuerySupplyOfResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + $root.cosmos.base.v1beta1.Coin.encode(message.amount, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QuerySupplyOfResponse message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.QuerySupplyOfResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.QuerySupplyOfResponse + * @static + * @param {cosmos.bank.v1beta1.IQuerySupplyOfResponse} message QuerySupplyOfResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuerySupplyOfResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuerySupplyOfResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.QuerySupplyOfResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.QuerySupplyOfResponse} QuerySupplyOfResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuerySupplyOfResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.QuerySupplyOfResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount = $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuerySupplyOfResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.QuerySupplyOfResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.QuerySupplyOfResponse} QuerySupplyOfResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuerySupplyOfResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuerySupplyOfResponse message. + * @function verify + * @memberof cosmos.bank.v1beta1.QuerySupplyOfResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuerySupplyOfResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + let error = $root.cosmos.base.v1beta1.Coin.verify(message.amount); + if (error) + return "amount." + error; + } + return null; + }; + + /** + * Creates a QuerySupplyOfResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.QuerySupplyOfResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.QuerySupplyOfResponse} QuerySupplyOfResponse + */ + QuerySupplyOfResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.QuerySupplyOfResponse) + return object; + let message = new $root.cosmos.bank.v1beta1.QuerySupplyOfResponse(); + if (object.amount != null) { + if (typeof object.amount !== "object") + throw TypeError(".cosmos.bank.v1beta1.QuerySupplyOfResponse.amount: object expected"); + message.amount = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount); + } + return message; + }; + + /** + * Creates a plain object from a QuerySupplyOfResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.QuerySupplyOfResponse + * @static + * @param {cosmos.bank.v1beta1.QuerySupplyOfResponse} message QuerySupplyOfResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuerySupplyOfResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.amount = null; + if (message.amount != null && message.hasOwnProperty("amount")) + object.amount = $root.cosmos.base.v1beta1.Coin.toObject(message.amount, options); + return object; + }; + + /** + * Converts this QuerySupplyOfResponse to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.QuerySupplyOfResponse + * @instance + * @returns {Object.} JSON object + */ + QuerySupplyOfResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QuerySupplyOfResponse; + })(v1beta1.QuerySupplyOfResponse || {}); + + v1beta1.QueryParamsRequest = (function(QueryParamsRequest) { + + /** + * Properties of a QueryParamsRequest. + * @memberof cosmos.bank.v1beta1 + * @interface IQueryParamsRequest + */ + + /** + * Constructs a new QueryParamsRequest. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a QueryParamsRequest. + * @implements IQueryParamsRequest + * @constructor + * @param {cosmos.bank.v1beta1.IQueryParamsRequest=} [properties] Properties to set + */ + function QueryParamsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new QueryParamsRequest instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.QueryParamsRequest + * @static + * @param {cosmos.bank.v1beta1.IQueryParamsRequest=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.QueryParamsRequest} QueryParamsRequest instance + */ + QueryParamsRequest.create = function create(properties) { + return new QueryParamsRequest(properties); + }; + + /** + * Encodes the specified QueryParamsRequest message. Does not implicitly {@link cosmos.bank.v1beta1.QueryParamsRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.QueryParamsRequest + * @static + * @param {cosmos.bank.v1beta1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.QueryParamsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.QueryParamsRequest + * @static + * @param {cosmos.bank.v1beta1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryParamsRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.QueryParamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.QueryParamsRequest} QueryParamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.QueryParamsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.QueryParamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.QueryParamsRequest} QueryParamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryParamsRequest message. + * @function verify + * @memberof cosmos.bank.v1beta1.QueryParamsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryParamsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.QueryParamsRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.QueryParamsRequest} QueryParamsRequest + */ + QueryParamsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.QueryParamsRequest) + return object; + return new $root.cosmos.bank.v1beta1.QueryParamsRequest(); + }; + + /** + * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.QueryParamsRequest + * @static + * @param {cosmos.bank.v1beta1.QueryParamsRequest} message QueryParamsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryParamsRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this QueryParamsRequest to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.QueryParamsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryParamsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryParamsRequest; + })(v1beta1.QueryParamsRequest || {}); + + v1beta1.QueryParamsResponse = (function(QueryParamsResponse) { + + /** + * Properties of a QueryParamsResponse. + * @memberof cosmos.bank.v1beta1 + * @interface IQueryParamsResponse + * @property {cosmos.bank.v1beta1.IParams|null} [params] QueryParamsResponse params + */ + + /** + * Constructs a new QueryParamsResponse. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a QueryParamsResponse. + * @implements IQueryParamsResponse + * @constructor + * @param {cosmos.bank.v1beta1.IQueryParamsResponse=} [properties] Properties to set + */ + function QueryParamsResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryParamsResponse params. + * @member {cosmos.bank.v1beta1.IParams|null|undefined} params + * @memberof cosmos.bank.v1beta1.QueryParamsResponse + * @instance + */ + QueryParamsResponse.prototype.params = null; + + /** + * Creates a new QueryParamsResponse instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.QueryParamsResponse + * @static + * @param {cosmos.bank.v1beta1.IQueryParamsResponse=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.QueryParamsResponse} QueryParamsResponse instance + */ + QueryParamsResponse.create = function create(properties) { + return new QueryParamsResponse(properties); + }; + + /** + * Encodes the specified QueryParamsResponse message. Does not implicitly {@link cosmos.bank.v1beta1.QueryParamsResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.QueryParamsResponse + * @static + * @param {cosmos.bank.v1beta1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.cosmos.bank.v1beta1.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.QueryParamsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.QueryParamsResponse + * @static + * @param {cosmos.bank.v1beta1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryParamsResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.QueryParamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.QueryParamsResponse} QueryParamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.QueryParamsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = $root.cosmos.bank.v1beta1.Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.QueryParamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.QueryParamsResponse} QueryParamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryParamsResponse message. + * @function verify + * @memberof cosmos.bank.v1beta1.QueryParamsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryParamsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.params != null && message.hasOwnProperty("params")) { + let error = $root.cosmos.bank.v1beta1.Params.verify(message.params); + if (error) + return "params." + error; + } + return null; + }; + + /** + * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.QueryParamsResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.QueryParamsResponse} QueryParamsResponse + */ + QueryParamsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.QueryParamsResponse) + return object; + let message = new $root.cosmos.bank.v1beta1.QueryParamsResponse(); + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".cosmos.bank.v1beta1.QueryParamsResponse.params: object expected"); + message.params = $root.cosmos.bank.v1beta1.Params.fromObject(object.params); + } + return message; + }; + + /** + * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.QueryParamsResponse + * @static + * @param {cosmos.bank.v1beta1.QueryParamsResponse} message QueryParamsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryParamsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.params = null; + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.cosmos.bank.v1beta1.Params.toObject(message.params, options); + return object; + }; + + /** + * Converts this QueryParamsResponse to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.QueryParamsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryParamsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryParamsResponse; + })(v1beta1.QueryParamsResponse || {}); + + v1beta1.QueryDenomsMetadataRequest = (function(QueryDenomsMetadataRequest) { + + /** + * Properties of a QueryDenomsMetadataRequest. + * @memberof cosmos.bank.v1beta1 + * @interface IQueryDenomsMetadataRequest + * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryDenomsMetadataRequest pagination + */ + + /** + * Constructs a new QueryDenomsMetadataRequest. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a QueryDenomsMetadataRequest. + * @implements IQueryDenomsMetadataRequest + * @constructor + * @param {cosmos.bank.v1beta1.IQueryDenomsMetadataRequest=} [properties] Properties to set + */ + function QueryDenomsMetadataRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryDenomsMetadataRequest pagination. + * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination + * @memberof cosmos.bank.v1beta1.QueryDenomsMetadataRequest + * @instance + */ + QueryDenomsMetadataRequest.prototype.pagination = null; + + /** + * Creates a new QueryDenomsMetadataRequest instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.QueryDenomsMetadataRequest + * @static + * @param {cosmos.bank.v1beta1.IQueryDenomsMetadataRequest=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.QueryDenomsMetadataRequest} QueryDenomsMetadataRequest instance + */ + QueryDenomsMetadataRequest.create = function create(properties) { + return new QueryDenomsMetadataRequest(properties); + }; + + /** + * Encodes the specified QueryDenomsMetadataRequest message. Does not implicitly {@link cosmos.bank.v1beta1.QueryDenomsMetadataRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.QueryDenomsMetadataRequest + * @static + * @param {cosmos.bank.v1beta1.IQueryDenomsMetadataRequest} message QueryDenomsMetadataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDenomsMetadataRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryDenomsMetadataRequest message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.QueryDenomsMetadataRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.QueryDenomsMetadataRequest + * @static + * @param {cosmos.bank.v1beta1.IQueryDenomsMetadataRequest} message QueryDenomsMetadataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDenomsMetadataRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDenomsMetadataRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.QueryDenomsMetadataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.QueryDenomsMetadataRequest} QueryDenomsMetadataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDenomsMetadataRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.QueryDenomsMetadataRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDenomsMetadataRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.QueryDenomsMetadataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.QueryDenomsMetadataRequest} QueryDenomsMetadataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDenomsMetadataRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDenomsMetadataRequest message. + * @function verify + * @memberof cosmos.bank.v1beta1.QueryDenomsMetadataRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDenomsMetadataRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryDenomsMetadataRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.QueryDenomsMetadataRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.QueryDenomsMetadataRequest} QueryDenomsMetadataRequest + */ + QueryDenomsMetadataRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.QueryDenomsMetadataRequest) + return object; + let message = new $root.cosmos.bank.v1beta1.QueryDenomsMetadataRequest(); + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.bank.v1beta1.QueryDenomsMetadataRequest.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryDenomsMetadataRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.QueryDenomsMetadataRequest + * @static + * @param {cosmos.bank.v1beta1.QueryDenomsMetadataRequest} message QueryDenomsMetadataRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDenomsMetadataRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.pagination = null; + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryDenomsMetadataRequest to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.QueryDenomsMetadataRequest + * @instance + * @returns {Object.} JSON object + */ + QueryDenomsMetadataRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryDenomsMetadataRequest; + })(v1beta1.QueryDenomsMetadataRequest || {}); + + v1beta1.QueryDenomsMetadataResponse = (function(QueryDenomsMetadataResponse) { + + /** + * Properties of a QueryDenomsMetadataResponse. + * @memberof cosmos.bank.v1beta1 + * @interface IQueryDenomsMetadataResponse + * @property {Array.|null} [metadatas] QueryDenomsMetadataResponse metadatas + * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryDenomsMetadataResponse pagination + */ + + /** + * Constructs a new QueryDenomsMetadataResponse. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a QueryDenomsMetadataResponse. + * @implements IQueryDenomsMetadataResponse + * @constructor + * @param {cosmos.bank.v1beta1.IQueryDenomsMetadataResponse=} [properties] Properties to set + */ + function QueryDenomsMetadataResponse(properties) { + this.metadatas = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryDenomsMetadataResponse metadatas. + * @member {Array.} metadatas + * @memberof cosmos.bank.v1beta1.QueryDenomsMetadataResponse + * @instance + */ + QueryDenomsMetadataResponse.prototype.metadatas = $util.emptyArray; + + /** + * QueryDenomsMetadataResponse pagination. + * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination + * @memberof cosmos.bank.v1beta1.QueryDenomsMetadataResponse + * @instance + */ + QueryDenomsMetadataResponse.prototype.pagination = null; + + /** + * Creates a new QueryDenomsMetadataResponse instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.QueryDenomsMetadataResponse + * @static + * @param {cosmos.bank.v1beta1.IQueryDenomsMetadataResponse=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.QueryDenomsMetadataResponse} QueryDenomsMetadataResponse instance + */ + QueryDenomsMetadataResponse.create = function create(properties) { + return new QueryDenomsMetadataResponse(properties); + }; + + /** + * Encodes the specified QueryDenomsMetadataResponse message. Does not implicitly {@link cosmos.bank.v1beta1.QueryDenomsMetadataResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.QueryDenomsMetadataResponse + * @static + * @param {cosmos.bank.v1beta1.IQueryDenomsMetadataResponse} message QueryDenomsMetadataResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDenomsMetadataResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadatas != null && message.metadatas.length) + for (let i = 0; i < message.metadatas.length; ++i) + $root.cosmos.bank.v1beta1.Metadata.encode(message.metadatas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryDenomsMetadataResponse message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.QueryDenomsMetadataResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.QueryDenomsMetadataResponse + * @static + * @param {cosmos.bank.v1beta1.IQueryDenomsMetadataResponse} message QueryDenomsMetadataResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDenomsMetadataResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDenomsMetadataResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.QueryDenomsMetadataResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.QueryDenomsMetadataResponse} QueryDenomsMetadataResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDenomsMetadataResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.QueryDenomsMetadataResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.metadatas && message.metadatas.length)) + message.metadatas = []; + message.metadatas.push($root.cosmos.bank.v1beta1.Metadata.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDenomsMetadataResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.QueryDenomsMetadataResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.QueryDenomsMetadataResponse} QueryDenomsMetadataResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDenomsMetadataResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDenomsMetadataResponse message. + * @function verify + * @memberof cosmos.bank.v1beta1.QueryDenomsMetadataResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDenomsMetadataResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metadatas != null && message.hasOwnProperty("metadatas")) { + if (!Array.isArray(message.metadatas)) + return "metadatas: array expected"; + for (let i = 0; i < message.metadatas.length; ++i) { + let error = $root.cosmos.bank.v1beta1.Metadata.verify(message.metadatas[i]); + if (error) + return "metadatas." + error; + } + } + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryDenomsMetadataResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.QueryDenomsMetadataResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.QueryDenomsMetadataResponse} QueryDenomsMetadataResponse + */ + QueryDenomsMetadataResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.QueryDenomsMetadataResponse) + return object; + let message = new $root.cosmos.bank.v1beta1.QueryDenomsMetadataResponse(); + if (object.metadatas) { + if (!Array.isArray(object.metadatas)) + throw TypeError(".cosmos.bank.v1beta1.QueryDenomsMetadataResponse.metadatas: array expected"); + message.metadatas = []; + for (let i = 0; i < object.metadatas.length; ++i) { + if (typeof object.metadatas[i] !== "object") + throw TypeError(".cosmos.bank.v1beta1.QueryDenomsMetadataResponse.metadatas: object expected"); + message.metadatas[i] = $root.cosmos.bank.v1beta1.Metadata.fromObject(object.metadatas[i]); + } + } + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.bank.v1beta1.QueryDenomsMetadataResponse.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryDenomsMetadataResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.QueryDenomsMetadataResponse + * @static + * @param {cosmos.bank.v1beta1.QueryDenomsMetadataResponse} message QueryDenomsMetadataResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDenomsMetadataResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.metadatas = []; + if (options.defaults) + object.pagination = null; + if (message.metadatas && message.metadatas.length) { + object.metadatas = []; + for (let j = 0; j < message.metadatas.length; ++j) + object.metadatas[j] = $root.cosmos.bank.v1beta1.Metadata.toObject(message.metadatas[j], options); + } + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryDenomsMetadataResponse to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.QueryDenomsMetadataResponse + * @instance + * @returns {Object.} JSON object + */ + QueryDenomsMetadataResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryDenomsMetadataResponse; + })(v1beta1.QueryDenomsMetadataResponse || {}); + + v1beta1.QueryDenomMetadataRequest = (function(QueryDenomMetadataRequest) { + + /** + * Properties of a QueryDenomMetadataRequest. + * @memberof cosmos.bank.v1beta1 + * @interface IQueryDenomMetadataRequest + * @property {string|null} [denom] QueryDenomMetadataRequest denom + */ + + /** + * Constructs a new QueryDenomMetadataRequest. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a QueryDenomMetadataRequest. + * @implements IQueryDenomMetadataRequest + * @constructor + * @param {cosmos.bank.v1beta1.IQueryDenomMetadataRequest=} [properties] Properties to set + */ + function QueryDenomMetadataRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryDenomMetadataRequest denom. + * @member {string} denom + * @memberof cosmos.bank.v1beta1.QueryDenomMetadataRequest + * @instance + */ + QueryDenomMetadataRequest.prototype.denom = ""; + + /** + * Creates a new QueryDenomMetadataRequest instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.QueryDenomMetadataRequest + * @static + * @param {cosmos.bank.v1beta1.IQueryDenomMetadataRequest=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.QueryDenomMetadataRequest} QueryDenomMetadataRequest instance + */ + QueryDenomMetadataRequest.create = function create(properties) { + return new QueryDenomMetadataRequest(properties); + }; + + /** + * Encodes the specified QueryDenomMetadataRequest message. Does not implicitly {@link cosmos.bank.v1beta1.QueryDenomMetadataRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.QueryDenomMetadataRequest + * @static + * @param {cosmos.bank.v1beta1.IQueryDenomMetadataRequest} message QueryDenomMetadataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDenomMetadataRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); + return writer; + }; + + /** + * Encodes the specified QueryDenomMetadataRequest message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.QueryDenomMetadataRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.QueryDenomMetadataRequest + * @static + * @param {cosmos.bank.v1beta1.IQueryDenomMetadataRequest} message QueryDenomMetadataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDenomMetadataRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDenomMetadataRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.QueryDenomMetadataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.QueryDenomMetadataRequest} QueryDenomMetadataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDenomMetadataRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.QueryDenomMetadataRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDenomMetadataRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.QueryDenomMetadataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.QueryDenomMetadataRequest} QueryDenomMetadataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDenomMetadataRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDenomMetadataRequest message. + * @function verify + * @memberof cosmos.bank.v1beta1.QueryDenomMetadataRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDenomMetadataRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.denom != null && message.hasOwnProperty("denom")) + if (!$util.isString(message.denom)) + return "denom: string expected"; + return null; + }; + + /** + * Creates a QueryDenomMetadataRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.QueryDenomMetadataRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.QueryDenomMetadataRequest} QueryDenomMetadataRequest + */ + QueryDenomMetadataRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.QueryDenomMetadataRequest) + return object; + let message = new $root.cosmos.bank.v1beta1.QueryDenomMetadataRequest(); + if (object.denom != null) + message.denom = String(object.denom); + return message; + }; + + /** + * Creates a plain object from a QueryDenomMetadataRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.QueryDenomMetadataRequest + * @static + * @param {cosmos.bank.v1beta1.QueryDenomMetadataRequest} message QueryDenomMetadataRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDenomMetadataRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.denom = ""; + if (message.denom != null && message.hasOwnProperty("denom")) + object.denom = message.denom; + return object; + }; + + /** + * Converts this QueryDenomMetadataRequest to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.QueryDenomMetadataRequest + * @instance + * @returns {Object.} JSON object + */ + QueryDenomMetadataRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryDenomMetadataRequest; + })(v1beta1.QueryDenomMetadataRequest || {}); + + v1beta1.QueryDenomMetadataResponse = (function(QueryDenomMetadataResponse) { + + /** + * Properties of a QueryDenomMetadataResponse. + * @memberof cosmos.bank.v1beta1 + * @interface IQueryDenomMetadataResponse + * @property {cosmos.bank.v1beta1.IMetadata|null} [metadata] QueryDenomMetadataResponse metadata + */ + + /** + * Constructs a new QueryDenomMetadataResponse. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a QueryDenomMetadataResponse. + * @implements IQueryDenomMetadataResponse + * @constructor + * @param {cosmos.bank.v1beta1.IQueryDenomMetadataResponse=} [properties] Properties to set + */ + function QueryDenomMetadataResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryDenomMetadataResponse metadata. + * @member {cosmos.bank.v1beta1.IMetadata|null|undefined} metadata + * @memberof cosmos.bank.v1beta1.QueryDenomMetadataResponse + * @instance + */ + QueryDenomMetadataResponse.prototype.metadata = null; + + /** + * Creates a new QueryDenomMetadataResponse instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.QueryDenomMetadataResponse + * @static + * @param {cosmos.bank.v1beta1.IQueryDenomMetadataResponse=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.QueryDenomMetadataResponse} QueryDenomMetadataResponse instance + */ + QueryDenomMetadataResponse.create = function create(properties) { + return new QueryDenomMetadataResponse(properties); + }; + + /** + * Encodes the specified QueryDenomMetadataResponse message. Does not implicitly {@link cosmos.bank.v1beta1.QueryDenomMetadataResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.QueryDenomMetadataResponse + * @static + * @param {cosmos.bank.v1beta1.IQueryDenomMetadataResponse} message QueryDenomMetadataResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDenomMetadataResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.cosmos.bank.v1beta1.Metadata.encode(message.metadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryDenomMetadataResponse message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.QueryDenomMetadataResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.QueryDenomMetadataResponse + * @static + * @param {cosmos.bank.v1beta1.IQueryDenomMetadataResponse} message QueryDenomMetadataResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDenomMetadataResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDenomMetadataResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.QueryDenomMetadataResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.QueryDenomMetadataResponse} QueryDenomMetadataResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDenomMetadataResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.QueryDenomMetadataResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.metadata = $root.cosmos.bank.v1beta1.Metadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDenomMetadataResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.QueryDenomMetadataResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.QueryDenomMetadataResponse} QueryDenomMetadataResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDenomMetadataResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDenomMetadataResponse message. + * @function verify + * @memberof cosmos.bank.v1beta1.QueryDenomMetadataResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDenomMetadataResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + let error = $root.cosmos.bank.v1beta1.Metadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a QueryDenomMetadataResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.QueryDenomMetadataResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.QueryDenomMetadataResponse} QueryDenomMetadataResponse + */ + QueryDenomMetadataResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.QueryDenomMetadataResponse) + return object; + let message = new $root.cosmos.bank.v1beta1.QueryDenomMetadataResponse(); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".cosmos.bank.v1beta1.QueryDenomMetadataResponse.metadata: object expected"); + message.metadata = $root.cosmos.bank.v1beta1.Metadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a QueryDenomMetadataResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.QueryDenomMetadataResponse + * @static + * @param {cosmos.bank.v1beta1.QueryDenomMetadataResponse} message QueryDenomMetadataResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDenomMetadataResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.metadata = null; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.cosmos.bank.v1beta1.Metadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this QueryDenomMetadataResponse to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.QueryDenomMetadataResponse + * @instance + * @returns {Object.} JSON object + */ + QueryDenomMetadataResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryDenomMetadataResponse; + })(v1beta1.QueryDenomMetadataResponse || {}); + + v1beta1.Msg = (function(Msg) { + + /** + * Constructs a new Msg service. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a Msg + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Msg(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; + + /** + * Creates new Msg service using the specified rpc implementation. + * @function create + * @memberof cosmos.bank.v1beta1.Msg + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Msg} RPC service. Useful where requests and/or responses are streamed. + */ + Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.bank.v1beta1.Msg#send}. + * @memberof cosmos.bank.v1beta1.Msg + * @typedef SendCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.bank.v1beta1.IMsgSendResponse} [response] MsgSendResponse + */ + + /** + * Calls Send. + * @function send + * @memberof cosmos.bank.v1beta1.Msg + * @instance + * @param {cosmos.bank.v1beta1.IMsgSend} request MsgSend message or plain object + * @param {cosmos.bank.v1beta1.Msg.SendCallback} callback Node-style callback called with the error, if any, and MsgSendResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.send = function send(request, callback) { + return this.rpcCall(send, $root.cosmos.bank.v1beta1.MsgSend, $root.cosmos.bank.v1beta1.MsgSendResponse, request, callback); + }, "name", { value: "Send" }); + + /** + * Calls Send. + * @function send + * @memberof cosmos.bank.v1beta1.Msg + * @instance + * @param {cosmos.bank.v1beta1.IMsgSend} request MsgSend message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.bank.v1beta1.Msg#multiSend}. + * @memberof cosmos.bank.v1beta1.Msg + * @typedef MultiSendCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.bank.v1beta1.IMsgMultiSendResponse} [response] MsgMultiSendResponse + */ + + /** + * Calls MultiSend. + * @function multiSend + * @memberof cosmos.bank.v1beta1.Msg + * @instance + * @param {cosmos.bank.v1beta1.IMsgMultiSend} request MsgMultiSend message or plain object + * @param {cosmos.bank.v1beta1.Msg.MultiSendCallback} callback Node-style callback called with the error, if any, and MsgMultiSendResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.multiSend = function multiSend(request, callback) { + return this.rpcCall(multiSend, $root.cosmos.bank.v1beta1.MsgMultiSend, $root.cosmos.bank.v1beta1.MsgMultiSendResponse, request, callback); + }, "name", { value: "MultiSend" }); + + /** + * Calls MultiSend. + * @function multiSend + * @memberof cosmos.bank.v1beta1.Msg + * @instance + * @param {cosmos.bank.v1beta1.IMsgMultiSend} request MsgMultiSend message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Msg; + })(v1beta1.Msg || {}); + + v1beta1.MsgSend = (function(MsgSend) { + + /** + * Properties of a MsgSend. + * @memberof cosmos.bank.v1beta1 + * @interface IMsgSend + * @property {string|null} [fromAddress] MsgSend fromAddress + * @property {string|null} [toAddress] MsgSend toAddress + * @property {Array.|null} [amount] MsgSend amount + */ + + /** + * Constructs a new MsgSend. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a MsgSend. + * @implements IMsgSend + * @constructor + * @param {cosmos.bank.v1beta1.IMsgSend=} [properties] Properties to set + */ + function MsgSend(properties) { + this.amount = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgSend fromAddress. + * @member {string} fromAddress + * @memberof cosmos.bank.v1beta1.MsgSend + * @instance + */ + MsgSend.prototype.fromAddress = ""; + + /** + * MsgSend toAddress. + * @member {string} toAddress + * @memberof cosmos.bank.v1beta1.MsgSend + * @instance + */ + MsgSend.prototype.toAddress = ""; + + /** + * MsgSend amount. + * @member {Array.} amount + * @memberof cosmos.bank.v1beta1.MsgSend + * @instance + */ + MsgSend.prototype.amount = $util.emptyArray; + + /** + * Creates a new MsgSend instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.MsgSend + * @static + * @param {cosmos.bank.v1beta1.IMsgSend=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.MsgSend} MsgSend instance + */ + MsgSend.create = function create(properties) { + return new MsgSend(properties); + }; + + /** + * Encodes the specified MsgSend message. Does not implicitly {@link cosmos.bank.v1beta1.MsgSend.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.MsgSend + * @static + * @param {cosmos.bank.v1beta1.IMsgSend} message MsgSend message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSend.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fromAddress != null && Object.hasOwnProperty.call(message, "fromAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fromAddress); + if (message.toAddress != null && Object.hasOwnProperty.call(message, "toAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.toAddress); + if (message.amount != null && message.amount.length) + for (let i = 0; i < message.amount.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.amount[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MsgSend message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.MsgSend.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.MsgSend + * @static + * @param {cosmos.bank.v1beta1.IMsgSend} message MsgSend message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSend.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgSend message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.MsgSend + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.MsgSend} MsgSend + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSend.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.MsgSend(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fromAddress = reader.string(); + break; + case 2: + message.toAddress = reader.string(); + break; + case 3: + if (!(message.amount && message.amount.length)) + message.amount = []; + message.amount.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgSend message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.MsgSend + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.MsgSend} MsgSend + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSend.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgSend message. + * @function verify + * @memberof cosmos.bank.v1beta1.MsgSend + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgSend.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fromAddress != null && message.hasOwnProperty("fromAddress")) + if (!$util.isString(message.fromAddress)) + return "fromAddress: string expected"; + if (message.toAddress != null && message.hasOwnProperty("toAddress")) + if (!$util.isString(message.toAddress)) + return "toAddress: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + if (!Array.isArray(message.amount)) + return "amount: array expected"; + for (let i = 0; i < message.amount.length; ++i) { + let error = $root.cosmos.base.v1beta1.Coin.verify(message.amount[i]); + if (error) + return "amount." + error; + } + } + return null; + }; + + /** + * Creates a MsgSend message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.MsgSend + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.MsgSend} MsgSend + */ + MsgSend.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.MsgSend) + return object; + let message = new $root.cosmos.bank.v1beta1.MsgSend(); + if (object.fromAddress != null) + message.fromAddress = String(object.fromAddress); + if (object.toAddress != null) + message.toAddress = String(object.toAddress); + if (object.amount) { + if (!Array.isArray(object.amount)) + throw TypeError(".cosmos.bank.v1beta1.MsgSend.amount: array expected"); + message.amount = []; + for (let i = 0; i < object.amount.length; ++i) { + if (typeof object.amount[i] !== "object") + throw TypeError(".cosmos.bank.v1beta1.MsgSend.amount: object expected"); + message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MsgSend message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.MsgSend + * @static + * @param {cosmos.bank.v1beta1.MsgSend} message MsgSend + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSend.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.amount = []; + if (options.defaults) { + object.fromAddress = ""; + object.toAddress = ""; + } + if (message.fromAddress != null && message.hasOwnProperty("fromAddress")) + object.fromAddress = message.fromAddress; + if (message.toAddress != null && message.hasOwnProperty("toAddress")) + object.toAddress = message.toAddress; + if (message.amount && message.amount.length) { + object.amount = []; + for (let j = 0; j < message.amount.length; ++j) + object.amount[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.amount[j], options); + } + return object; + }; + + /** + * Converts this MsgSend to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.MsgSend + * @instance + * @returns {Object.} JSON object + */ + MsgSend.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgSend; + })(v1beta1.MsgSend || {}); + + v1beta1.MsgSendResponse = (function(MsgSendResponse) { + + /** + * Properties of a MsgSendResponse. + * @memberof cosmos.bank.v1beta1 + * @interface IMsgSendResponse + */ + + /** + * Constructs a new MsgSendResponse. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a MsgSendResponse. + * @implements IMsgSendResponse + * @constructor + * @param {cosmos.bank.v1beta1.IMsgSendResponse=} [properties] Properties to set + */ + function MsgSendResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgSendResponse instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.MsgSendResponse + * @static + * @param {cosmos.bank.v1beta1.IMsgSendResponse=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.MsgSendResponse} MsgSendResponse instance + */ + MsgSendResponse.create = function create(properties) { + return new MsgSendResponse(properties); + }; + + /** + * Encodes the specified MsgSendResponse message. Does not implicitly {@link cosmos.bank.v1beta1.MsgSendResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.MsgSendResponse + * @static + * @param {cosmos.bank.v1beta1.IMsgSendResponse} message MsgSendResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSendResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgSendResponse message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.MsgSendResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.MsgSendResponse + * @static + * @param {cosmos.bank.v1beta1.IMsgSendResponse} message MsgSendResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSendResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgSendResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.MsgSendResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.MsgSendResponse} MsgSendResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSendResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.MsgSendResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgSendResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.MsgSendResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.MsgSendResponse} MsgSendResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSendResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgSendResponse message. + * @function verify + * @memberof cosmos.bank.v1beta1.MsgSendResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgSendResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgSendResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.MsgSendResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.MsgSendResponse} MsgSendResponse + */ + MsgSendResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.MsgSendResponse) + return object; + return new $root.cosmos.bank.v1beta1.MsgSendResponse(); + }; + + /** + * Creates a plain object from a MsgSendResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.MsgSendResponse + * @static + * @param {cosmos.bank.v1beta1.MsgSendResponse} message MsgSendResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSendResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgSendResponse to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.MsgSendResponse + * @instance + * @returns {Object.} JSON object + */ + MsgSendResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgSendResponse; + })(v1beta1.MsgSendResponse || {}); + + v1beta1.MsgMultiSend = (function(MsgMultiSend) { + + /** + * Properties of a MsgMultiSend. + * @memberof cosmos.bank.v1beta1 + * @interface IMsgMultiSend + * @property {Array.|null} [inputs] MsgMultiSend inputs + * @property {Array.|null} [outputs] MsgMultiSend outputs + */ + + /** + * Constructs a new MsgMultiSend. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a MsgMultiSend. + * @implements IMsgMultiSend + * @constructor + * @param {cosmos.bank.v1beta1.IMsgMultiSend=} [properties] Properties to set + */ + function MsgMultiSend(properties) { + this.inputs = []; + this.outputs = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgMultiSend inputs. + * @member {Array.} inputs + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @instance + */ + MsgMultiSend.prototype.inputs = $util.emptyArray; + + /** + * MsgMultiSend outputs. + * @member {Array.} outputs + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @instance + */ + MsgMultiSend.prototype.outputs = $util.emptyArray; + + /** + * Creates a new MsgMultiSend instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @static + * @param {cosmos.bank.v1beta1.IMsgMultiSend=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.MsgMultiSend} MsgMultiSend instance + */ + MsgMultiSend.create = function create(properties) { + return new MsgMultiSend(properties); + }; + + /** + * Encodes the specified MsgMultiSend message. Does not implicitly {@link cosmos.bank.v1beta1.MsgMultiSend.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @static + * @param {cosmos.bank.v1beta1.IMsgMultiSend} message MsgMultiSend message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgMultiSend.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputs != null && message.inputs.length) + for (let i = 0; i < message.inputs.length; ++i) + $root.cosmos.bank.v1beta1.Input.encode(message.inputs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.outputs != null && message.outputs.length) + for (let i = 0; i < message.outputs.length; ++i) + $root.cosmos.bank.v1beta1.Output.encode(message.outputs[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MsgMultiSend message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.MsgMultiSend.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @static + * @param {cosmos.bank.v1beta1.IMsgMultiSend} message MsgMultiSend message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgMultiSend.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgMultiSend message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.MsgMultiSend} MsgMultiSend + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgMultiSend.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.MsgMultiSend(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.inputs && message.inputs.length)) + message.inputs = []; + message.inputs.push($root.cosmos.bank.v1beta1.Input.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.outputs && message.outputs.length)) + message.outputs = []; + message.outputs.push($root.cosmos.bank.v1beta1.Output.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgMultiSend message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.MsgMultiSend} MsgMultiSend + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgMultiSend.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgMultiSend message. + * @function verify + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgMultiSend.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputs != null && message.hasOwnProperty("inputs")) { + if (!Array.isArray(message.inputs)) + return "inputs: array expected"; + for (let i = 0; i < message.inputs.length; ++i) { + let error = $root.cosmos.bank.v1beta1.Input.verify(message.inputs[i]); + if (error) + return "inputs." + error; + } + } + if (message.outputs != null && message.hasOwnProperty("outputs")) { + if (!Array.isArray(message.outputs)) + return "outputs: array expected"; + for (let i = 0; i < message.outputs.length; ++i) { + let error = $root.cosmos.bank.v1beta1.Output.verify(message.outputs[i]); + if (error) + return "outputs." + error; + } + } + return null; + }; + + /** + * Creates a MsgMultiSend message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.MsgMultiSend} MsgMultiSend + */ + MsgMultiSend.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.MsgMultiSend) + return object; + let message = new $root.cosmos.bank.v1beta1.MsgMultiSend(); + if (object.inputs) { + if (!Array.isArray(object.inputs)) + throw TypeError(".cosmos.bank.v1beta1.MsgMultiSend.inputs: array expected"); + message.inputs = []; + for (let i = 0; i < object.inputs.length; ++i) { + if (typeof object.inputs[i] !== "object") + throw TypeError(".cosmos.bank.v1beta1.MsgMultiSend.inputs: object expected"); + message.inputs[i] = $root.cosmos.bank.v1beta1.Input.fromObject(object.inputs[i]); + } + } + if (object.outputs) { + if (!Array.isArray(object.outputs)) + throw TypeError(".cosmos.bank.v1beta1.MsgMultiSend.outputs: array expected"); + message.outputs = []; + for (let i = 0; i < object.outputs.length; ++i) { + if (typeof object.outputs[i] !== "object") + throw TypeError(".cosmos.bank.v1beta1.MsgMultiSend.outputs: object expected"); + message.outputs[i] = $root.cosmos.bank.v1beta1.Output.fromObject(object.outputs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MsgMultiSend message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @static + * @param {cosmos.bank.v1beta1.MsgMultiSend} message MsgMultiSend + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgMultiSend.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) { + object.inputs = []; + object.outputs = []; + } + if (message.inputs && message.inputs.length) { + object.inputs = []; + for (let j = 0; j < message.inputs.length; ++j) + object.inputs[j] = $root.cosmos.bank.v1beta1.Input.toObject(message.inputs[j], options); + } + if (message.outputs && message.outputs.length) { + object.outputs = []; + for (let j = 0; j < message.outputs.length; ++j) + object.outputs[j] = $root.cosmos.bank.v1beta1.Output.toObject(message.outputs[j], options); + } + return object; + }; + + /** + * Converts this MsgMultiSend to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.MsgMultiSend + * @instance + * @returns {Object.} JSON object + */ + MsgMultiSend.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgMultiSend; + })(v1beta1.MsgMultiSend || {}); + + v1beta1.MsgMultiSendResponse = (function(MsgMultiSendResponse) { + + /** + * Properties of a MsgMultiSendResponse. + * @memberof cosmos.bank.v1beta1 + * @interface IMsgMultiSendResponse + */ + + /** + * Constructs a new MsgMultiSendResponse. + * @memberof cosmos.bank.v1beta1 + * @classdesc Represents a MsgMultiSendResponse. + * @implements IMsgMultiSendResponse + * @constructor + * @param {cosmos.bank.v1beta1.IMsgMultiSendResponse=} [properties] Properties to set + */ + function MsgMultiSendResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgMultiSendResponse instance using the specified properties. + * @function create + * @memberof cosmos.bank.v1beta1.MsgMultiSendResponse + * @static + * @param {cosmos.bank.v1beta1.IMsgMultiSendResponse=} [properties] Properties to set + * @returns {cosmos.bank.v1beta1.MsgMultiSendResponse} MsgMultiSendResponse instance + */ + MsgMultiSendResponse.create = function create(properties) { + return new MsgMultiSendResponse(properties); + }; + + /** + * Encodes the specified MsgMultiSendResponse message. Does not implicitly {@link cosmos.bank.v1beta1.MsgMultiSendResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.bank.v1beta1.MsgMultiSendResponse + * @static + * @param {cosmos.bank.v1beta1.IMsgMultiSendResponse} message MsgMultiSendResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgMultiSendResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgMultiSendResponse message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.MsgMultiSendResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.bank.v1beta1.MsgMultiSendResponse + * @static + * @param {cosmos.bank.v1beta1.IMsgMultiSendResponse} message MsgMultiSendResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgMultiSendResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgMultiSendResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.bank.v1beta1.MsgMultiSendResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.bank.v1beta1.MsgMultiSendResponse} MsgMultiSendResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgMultiSendResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.bank.v1beta1.MsgMultiSendResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgMultiSendResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.bank.v1beta1.MsgMultiSendResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.bank.v1beta1.MsgMultiSendResponse} MsgMultiSendResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgMultiSendResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgMultiSendResponse message. + * @function verify + * @memberof cosmos.bank.v1beta1.MsgMultiSendResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgMultiSendResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgMultiSendResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.bank.v1beta1.MsgMultiSendResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.bank.v1beta1.MsgMultiSendResponse} MsgMultiSendResponse + */ + MsgMultiSendResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.bank.v1beta1.MsgMultiSendResponse) + return object; + return new $root.cosmos.bank.v1beta1.MsgMultiSendResponse(); + }; + + /** + * Creates a plain object from a MsgMultiSendResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.bank.v1beta1.MsgMultiSendResponse + * @static + * @param {cosmos.bank.v1beta1.MsgMultiSendResponse} message MsgMultiSendResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgMultiSendResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgMultiSendResponse to JSON. + * @function toJSON + * @memberof cosmos.bank.v1beta1.MsgMultiSendResponse + * @instance + * @returns {Object.} JSON object + */ + MsgMultiSendResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgMultiSendResponse; + })(v1beta1.MsgMultiSendResponse || {}); + + return v1beta1; + })(bank.v1beta1 || {}); + + return bank; + })(cosmos.bank || {}); + + /** + * Namespace base. + * @memberof cosmos + * @namespace + */ + + cosmos.base = (function(base) { + + /** + * Namespace abci. + * @memberof cosmos.base + * @namespace + */ + + base.abci = (function(abci) { + + /** + * Namespace v1beta1. + * @memberof cosmos.base.abci + * @namespace + */ + + abci.v1beta1 = (function(v1beta1) { + + v1beta1.TxResponse = (function(TxResponse) { + + /** + * Properties of a TxResponse. + * @memberof cosmos.base.abci.v1beta1 + * @interface ITxResponse + * @property {number|Long|null} [height] TxResponse height + * @property {string|null} [txhash] TxResponse txhash + * @property {string|null} [codespace] TxResponse codespace + * @property {number|null} [code] TxResponse code + * @property {string|null} [data] TxResponse data + * @property {string|null} [rawLog] TxResponse rawLog + * @property {Array.|null} [logs] TxResponse logs + * @property {string|null} [info] TxResponse info + * @property {number|Long|null} [gasWanted] TxResponse gasWanted + * @property {number|Long|null} [gasUsed] TxResponse gasUsed + * @property {google.protobuf.IAny|null} [tx] TxResponse tx + * @property {string|null} [timestamp] TxResponse timestamp + */ + + /** + * Constructs a new TxResponse. + * @memberof cosmos.base.abci.v1beta1 + * @classdesc Represents a TxResponse. + * @implements ITxResponse + * @constructor + * @param {cosmos.base.abci.v1beta1.ITxResponse=} [properties] Properties to set + */ + function TxResponse(properties) { + this.logs = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TxResponse height. + * @member {number|Long} height + * @memberof cosmos.base.abci.v1beta1.TxResponse + * @instance + */ + TxResponse.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TxResponse txhash. + * @member {string} txhash + * @memberof cosmos.base.abci.v1beta1.TxResponse + * @instance + */ + TxResponse.prototype.txhash = ""; + + /** + * TxResponse codespace. + * @member {string} codespace + * @memberof cosmos.base.abci.v1beta1.TxResponse + * @instance + */ + TxResponse.prototype.codespace = ""; + + /** + * TxResponse code. + * @member {number} code + * @memberof cosmos.base.abci.v1beta1.TxResponse + * @instance + */ + TxResponse.prototype.code = 0; + + /** + * TxResponse data. + * @member {string} data + * @memberof cosmos.base.abci.v1beta1.TxResponse + * @instance + */ + TxResponse.prototype.data = ""; + + /** + * TxResponse rawLog. + * @member {string} rawLog + * @memberof cosmos.base.abci.v1beta1.TxResponse + * @instance + */ + TxResponse.prototype.rawLog = ""; + + /** + * TxResponse logs. + * @member {Array.} logs + * @memberof cosmos.base.abci.v1beta1.TxResponse + * @instance + */ + TxResponse.prototype.logs = $util.emptyArray; + + /** + * TxResponse info. + * @member {string} info + * @memberof cosmos.base.abci.v1beta1.TxResponse + * @instance + */ + TxResponse.prototype.info = ""; + + /** + * TxResponse gasWanted. + * @member {number|Long} gasWanted + * @memberof cosmos.base.abci.v1beta1.TxResponse + * @instance + */ + TxResponse.prototype.gasWanted = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TxResponse gasUsed. + * @member {number|Long} gasUsed + * @memberof cosmos.base.abci.v1beta1.TxResponse + * @instance + */ + TxResponse.prototype.gasUsed = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TxResponse tx. + * @member {google.protobuf.IAny|null|undefined} tx + * @memberof cosmos.base.abci.v1beta1.TxResponse + * @instance + */ + TxResponse.prototype.tx = null; + + /** + * TxResponse timestamp. + * @member {string} timestamp + * @memberof cosmos.base.abci.v1beta1.TxResponse + * @instance + */ + TxResponse.prototype.timestamp = ""; + + /** + * Creates a new TxResponse instance using the specified properties. + * @function create + * @memberof cosmos.base.abci.v1beta1.TxResponse + * @static + * @param {cosmos.base.abci.v1beta1.ITxResponse=} [properties] Properties to set + * @returns {cosmos.base.abci.v1beta1.TxResponse} TxResponse instance + */ + TxResponse.create = function create(properties) { + return new TxResponse(properties); + }; + + /** + * Encodes the specified TxResponse message. Does not implicitly {@link cosmos.base.abci.v1beta1.TxResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.base.abci.v1beta1.TxResponse + * @static + * @param {cosmos.base.abci.v1beta1.ITxResponse} message TxResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TxResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.height); + if (message.txhash != null && Object.hasOwnProperty.call(message, "txhash")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.txhash); + if (message.codespace != null && Object.hasOwnProperty.call(message, "codespace")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.codespace); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.code); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.data); + if (message.rawLog != null && Object.hasOwnProperty.call(message, "rawLog")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.rawLog); + if (message.logs != null && message.logs.length) + for (let i = 0; i < message.logs.length; ++i) + $root.cosmos.base.abci.v1beta1.ABCIMessageLog.encode(message.logs[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.info != null && Object.hasOwnProperty.call(message, "info")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.info); + if (message.gasWanted != null && Object.hasOwnProperty.call(message, "gasWanted")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.gasWanted); + if (message.gasUsed != null && Object.hasOwnProperty.call(message, "gasUsed")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.gasUsed); + if (message.tx != null && Object.hasOwnProperty.call(message, "tx")) + $root.google.protobuf.Any.encode(message.tx, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.timestamp); + return writer; + }; + + /** + * Encodes the specified TxResponse message, length delimited. Does not implicitly {@link cosmos.base.abci.v1beta1.TxResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.abci.v1beta1.TxResponse + * @static + * @param {cosmos.base.abci.v1beta1.ITxResponse} message TxResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TxResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TxResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.abci.v1beta1.TxResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.abci.v1beta1.TxResponse} TxResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TxResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.abci.v1beta1.TxResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + case 2: + message.txhash = reader.string(); + break; + case 3: + message.codespace = reader.string(); + break; + case 4: + message.code = reader.uint32(); + break; + case 5: + message.data = reader.string(); + break; + case 6: + message.rawLog = reader.string(); + break; + case 7: + if (!(message.logs && message.logs.length)) + message.logs = []; + message.logs.push($root.cosmos.base.abci.v1beta1.ABCIMessageLog.decode(reader, reader.uint32())); + break; + case 8: + message.info = reader.string(); + break; + case 9: + message.gasWanted = reader.int64(); + break; + case 10: + message.gasUsed = reader.int64(); + break; + case 11: + message.tx = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 12: + message.timestamp = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TxResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.abci.v1beta1.TxResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.abci.v1beta1.TxResponse} TxResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TxResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TxResponse message. + * @function verify + * @memberof cosmos.base.abci.v1beta1.TxResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TxResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.txhash != null && message.hasOwnProperty("txhash")) + if (!$util.isString(message.txhash)) + return "txhash: string expected"; + if (message.codespace != null && message.hasOwnProperty("codespace")) + if (!$util.isString(message.codespace)) + return "codespace: string expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!$util.isString(message.data)) + return "data: string expected"; + if (message.rawLog != null && message.hasOwnProperty("rawLog")) + if (!$util.isString(message.rawLog)) + return "rawLog: string expected"; + if (message.logs != null && message.hasOwnProperty("logs")) { + if (!Array.isArray(message.logs)) + return "logs: array expected"; + for (let i = 0; i < message.logs.length; ++i) { + let error = $root.cosmos.base.abci.v1beta1.ABCIMessageLog.verify(message.logs[i]); + if (error) + return "logs." + error; + } + } + if (message.info != null && message.hasOwnProperty("info")) + if (!$util.isString(message.info)) + return "info: string expected"; + if (message.gasWanted != null && message.hasOwnProperty("gasWanted")) + if (!$util.isInteger(message.gasWanted) && !(message.gasWanted && $util.isInteger(message.gasWanted.low) && $util.isInteger(message.gasWanted.high))) + return "gasWanted: integer|Long expected"; + if (message.gasUsed != null && message.hasOwnProperty("gasUsed")) + if (!$util.isInteger(message.gasUsed) && !(message.gasUsed && $util.isInteger(message.gasUsed.low) && $util.isInteger(message.gasUsed.high))) + return "gasUsed: integer|Long expected"; + if (message.tx != null && message.hasOwnProperty("tx")) { + let error = $root.google.protobuf.Any.verify(message.tx); + if (error) + return "tx." + error; + } + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (!$util.isString(message.timestamp)) + return "timestamp: string expected"; + return null; + }; + + /** + * Creates a TxResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.abci.v1beta1.TxResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.abci.v1beta1.TxResponse} TxResponse + */ + TxResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.abci.v1beta1.TxResponse) + return object; + let message = new $root.cosmos.base.abci.v1beta1.TxResponse(); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + if (object.txhash != null) + message.txhash = String(object.txhash); + if (object.codespace != null) + message.codespace = String(object.codespace); + if (object.code != null) + message.code = object.code >>> 0; + if (object.data != null) + message.data = String(object.data); + if (object.rawLog != null) + message.rawLog = String(object.rawLog); + if (object.logs) { + if (!Array.isArray(object.logs)) + throw TypeError(".cosmos.base.abci.v1beta1.TxResponse.logs: array expected"); + message.logs = []; + for (let i = 0; i < object.logs.length; ++i) { + if (typeof object.logs[i] !== "object") + throw TypeError(".cosmos.base.abci.v1beta1.TxResponse.logs: object expected"); + message.logs[i] = $root.cosmos.base.abci.v1beta1.ABCIMessageLog.fromObject(object.logs[i]); + } + } + if (object.info != null) + message.info = String(object.info); + if (object.gasWanted != null) + if ($util.Long) + (message.gasWanted = $util.Long.fromValue(object.gasWanted)).unsigned = false; + else if (typeof object.gasWanted === "string") + message.gasWanted = parseInt(object.gasWanted, 10); + else if (typeof object.gasWanted === "number") + message.gasWanted = object.gasWanted; + else if (typeof object.gasWanted === "object") + message.gasWanted = new $util.LongBits(object.gasWanted.low >>> 0, object.gasWanted.high >>> 0).toNumber(); + if (object.gasUsed != null) + if ($util.Long) + (message.gasUsed = $util.Long.fromValue(object.gasUsed)).unsigned = false; + else if (typeof object.gasUsed === "string") + message.gasUsed = parseInt(object.gasUsed, 10); + else if (typeof object.gasUsed === "number") + message.gasUsed = object.gasUsed; + else if (typeof object.gasUsed === "object") + message.gasUsed = new $util.LongBits(object.gasUsed.low >>> 0, object.gasUsed.high >>> 0).toNumber(); + if (object.tx != null) { + if (typeof object.tx !== "object") + throw TypeError(".cosmos.base.abci.v1beta1.TxResponse.tx: object expected"); + message.tx = $root.google.protobuf.Any.fromObject(object.tx); + } + if (object.timestamp != null) + message.timestamp = String(object.timestamp); + return message; + }; + + /** + * Creates a plain object from a TxResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.abci.v1beta1.TxResponse + * @static + * @param {cosmos.base.abci.v1beta1.TxResponse} message TxResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TxResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.logs = []; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.txhash = ""; + object.codespace = ""; + object.code = 0; + object.data = ""; + object.rawLog = ""; + object.info = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.gasWanted = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.gasWanted = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.gasUsed = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.gasUsed = options.longs === String ? "0" : 0; + object.tx = null; + object.timestamp = ""; + } + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + if (message.txhash != null && message.hasOwnProperty("txhash")) + object.txhash = message.txhash; + if (message.codespace != null && message.hasOwnProperty("codespace")) + object.codespace = message.codespace; + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.data != null && message.hasOwnProperty("data")) + object.data = message.data; + if (message.rawLog != null && message.hasOwnProperty("rawLog")) + object.rawLog = message.rawLog; + if (message.logs && message.logs.length) { + object.logs = []; + for (let j = 0; j < message.logs.length; ++j) + object.logs[j] = $root.cosmos.base.abci.v1beta1.ABCIMessageLog.toObject(message.logs[j], options); + } + if (message.info != null && message.hasOwnProperty("info")) + object.info = message.info; + if (message.gasWanted != null && message.hasOwnProperty("gasWanted")) + if (typeof message.gasWanted === "number") + object.gasWanted = options.longs === String ? String(message.gasWanted) : message.gasWanted; + else + object.gasWanted = options.longs === String ? $util.Long.prototype.toString.call(message.gasWanted) : options.longs === Number ? new $util.LongBits(message.gasWanted.low >>> 0, message.gasWanted.high >>> 0).toNumber() : message.gasWanted; + if (message.gasUsed != null && message.hasOwnProperty("gasUsed")) + if (typeof message.gasUsed === "number") + object.gasUsed = options.longs === String ? String(message.gasUsed) : message.gasUsed; + else + object.gasUsed = options.longs === String ? $util.Long.prototype.toString.call(message.gasUsed) : options.longs === Number ? new $util.LongBits(message.gasUsed.low >>> 0, message.gasUsed.high >>> 0).toNumber() : message.gasUsed; + if (message.tx != null && message.hasOwnProperty("tx")) + object.tx = $root.google.protobuf.Any.toObject(message.tx, options); + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + object.timestamp = message.timestamp; + return object; + }; + + /** + * Converts this TxResponse to JSON. + * @function toJSON + * @memberof cosmos.base.abci.v1beta1.TxResponse + * @instance + * @returns {Object.} JSON object + */ + TxResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TxResponse; + })(v1beta1.TxResponse || {}); + + v1beta1.ABCIMessageLog = (function(ABCIMessageLog) { + + /** + * Properties of a ABCIMessageLog. + * @memberof cosmos.base.abci.v1beta1 + * @interface IABCIMessageLog + * @property {number|null} [msgIndex] ABCIMessageLog msgIndex + * @property {string|null} [log] ABCIMessageLog log + * @property {Array.|null} [events] ABCIMessageLog events + */ + + /** + * Constructs a new ABCIMessageLog. + * @memberof cosmos.base.abci.v1beta1 + * @classdesc Represents a ABCIMessageLog. + * @implements IABCIMessageLog + * @constructor + * @param {cosmos.base.abci.v1beta1.IABCIMessageLog=} [properties] Properties to set + */ + function ABCIMessageLog(properties) { + this.events = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ABCIMessageLog msgIndex. + * @member {number} msgIndex + * @memberof cosmos.base.abci.v1beta1.ABCIMessageLog + * @instance + */ + ABCIMessageLog.prototype.msgIndex = 0; + + /** + * ABCIMessageLog log. + * @member {string} log + * @memberof cosmos.base.abci.v1beta1.ABCIMessageLog + * @instance + */ + ABCIMessageLog.prototype.log = ""; + + /** + * ABCIMessageLog events. + * @member {Array.} events + * @memberof cosmos.base.abci.v1beta1.ABCIMessageLog + * @instance + */ + ABCIMessageLog.prototype.events = $util.emptyArray; + + /** + * Creates a new ABCIMessageLog instance using the specified properties. + * @function create + * @memberof cosmos.base.abci.v1beta1.ABCIMessageLog + * @static + * @param {cosmos.base.abci.v1beta1.IABCIMessageLog=} [properties] Properties to set + * @returns {cosmos.base.abci.v1beta1.ABCIMessageLog} ABCIMessageLog instance + */ + ABCIMessageLog.create = function create(properties) { + return new ABCIMessageLog(properties); + }; + + /** + * Encodes the specified ABCIMessageLog message. Does not implicitly {@link cosmos.base.abci.v1beta1.ABCIMessageLog.verify|verify} messages. + * @function encode + * @memberof cosmos.base.abci.v1beta1.ABCIMessageLog + * @static + * @param {cosmos.base.abci.v1beta1.IABCIMessageLog} message ABCIMessageLog message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ABCIMessageLog.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.msgIndex != null && Object.hasOwnProperty.call(message, "msgIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.msgIndex); + if (message.log != null && Object.hasOwnProperty.call(message, "log")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.log); + if (message.events != null && message.events.length) + for (let i = 0; i < message.events.length; ++i) + $root.cosmos.base.abci.v1beta1.StringEvent.encode(message.events[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ABCIMessageLog message, length delimited. Does not implicitly {@link cosmos.base.abci.v1beta1.ABCIMessageLog.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.abci.v1beta1.ABCIMessageLog + * @static + * @param {cosmos.base.abci.v1beta1.IABCIMessageLog} message ABCIMessageLog message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ABCIMessageLog.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ABCIMessageLog message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.abci.v1beta1.ABCIMessageLog + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.abci.v1beta1.ABCIMessageLog} ABCIMessageLog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ABCIMessageLog.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.abci.v1beta1.ABCIMessageLog(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.msgIndex = reader.uint32(); + break; + case 2: + message.log = reader.string(); + break; + case 3: + if (!(message.events && message.events.length)) + message.events = []; + message.events.push($root.cosmos.base.abci.v1beta1.StringEvent.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ABCIMessageLog message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.abci.v1beta1.ABCIMessageLog + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.abci.v1beta1.ABCIMessageLog} ABCIMessageLog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ABCIMessageLog.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ABCIMessageLog message. + * @function verify + * @memberof cosmos.base.abci.v1beta1.ABCIMessageLog + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ABCIMessageLog.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.msgIndex != null && message.hasOwnProperty("msgIndex")) + if (!$util.isInteger(message.msgIndex)) + return "msgIndex: integer expected"; + if (message.log != null && message.hasOwnProperty("log")) + if (!$util.isString(message.log)) + return "log: string expected"; + if (message.events != null && message.hasOwnProperty("events")) { + if (!Array.isArray(message.events)) + return "events: array expected"; + for (let i = 0; i < message.events.length; ++i) { + let error = $root.cosmos.base.abci.v1beta1.StringEvent.verify(message.events[i]); + if (error) + return "events." + error; + } + } + return null; + }; + + /** + * Creates a ABCIMessageLog message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.abci.v1beta1.ABCIMessageLog + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.abci.v1beta1.ABCIMessageLog} ABCIMessageLog + */ + ABCIMessageLog.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.abci.v1beta1.ABCIMessageLog) + return object; + let message = new $root.cosmos.base.abci.v1beta1.ABCIMessageLog(); + if (object.msgIndex != null) + message.msgIndex = object.msgIndex >>> 0; + if (object.log != null) + message.log = String(object.log); + if (object.events) { + if (!Array.isArray(object.events)) + throw TypeError(".cosmos.base.abci.v1beta1.ABCIMessageLog.events: array expected"); + message.events = []; + for (let i = 0; i < object.events.length; ++i) { + if (typeof object.events[i] !== "object") + throw TypeError(".cosmos.base.abci.v1beta1.ABCIMessageLog.events: object expected"); + message.events[i] = $root.cosmos.base.abci.v1beta1.StringEvent.fromObject(object.events[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ABCIMessageLog message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.abci.v1beta1.ABCIMessageLog + * @static + * @param {cosmos.base.abci.v1beta1.ABCIMessageLog} message ABCIMessageLog + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ABCIMessageLog.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.events = []; + if (options.defaults) { + object.msgIndex = 0; + object.log = ""; + } + if (message.msgIndex != null && message.hasOwnProperty("msgIndex")) + object.msgIndex = message.msgIndex; + if (message.log != null && message.hasOwnProperty("log")) + object.log = message.log; + if (message.events && message.events.length) { + object.events = []; + for (let j = 0; j < message.events.length; ++j) + object.events[j] = $root.cosmos.base.abci.v1beta1.StringEvent.toObject(message.events[j], options); + } + return object; + }; + + /** + * Converts this ABCIMessageLog to JSON. + * @function toJSON + * @memberof cosmos.base.abci.v1beta1.ABCIMessageLog + * @instance + * @returns {Object.} JSON object + */ + ABCIMessageLog.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ABCIMessageLog; + })(v1beta1.ABCIMessageLog || {}); + + v1beta1.StringEvent = (function(StringEvent) { + + /** + * Properties of a StringEvent. + * @memberof cosmos.base.abci.v1beta1 + * @interface IStringEvent + * @property {string|null} [type] StringEvent type + * @property {Array.|null} [attributes] StringEvent attributes + */ + + /** + * Constructs a new StringEvent. + * @memberof cosmos.base.abci.v1beta1 + * @classdesc Represents a StringEvent. + * @implements IStringEvent + * @constructor + * @param {cosmos.base.abci.v1beta1.IStringEvent=} [properties] Properties to set + */ + function StringEvent(properties) { + this.attributes = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StringEvent type. + * @member {string} type + * @memberof cosmos.base.abci.v1beta1.StringEvent + * @instance + */ + StringEvent.prototype.type = ""; + + /** + * StringEvent attributes. + * @member {Array.} attributes + * @memberof cosmos.base.abci.v1beta1.StringEvent + * @instance + */ + StringEvent.prototype.attributes = $util.emptyArray; + + /** + * Creates a new StringEvent instance using the specified properties. + * @function create + * @memberof cosmos.base.abci.v1beta1.StringEvent + * @static + * @param {cosmos.base.abci.v1beta1.IStringEvent=} [properties] Properties to set + * @returns {cosmos.base.abci.v1beta1.StringEvent} StringEvent instance + */ + StringEvent.create = function create(properties) { + return new StringEvent(properties); + }; + + /** + * Encodes the specified StringEvent message. Does not implicitly {@link cosmos.base.abci.v1beta1.StringEvent.verify|verify} messages. + * @function encode + * @memberof cosmos.base.abci.v1beta1.StringEvent + * @static + * @param {cosmos.base.abci.v1beta1.IStringEvent} message StringEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.attributes != null && message.attributes.length) + for (let i = 0; i < message.attributes.length; ++i) + $root.cosmos.base.abci.v1beta1.Attribute.encode(message.attributes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StringEvent message, length delimited. Does not implicitly {@link cosmos.base.abci.v1beta1.StringEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.abci.v1beta1.StringEvent + * @static + * @param {cosmos.base.abci.v1beta1.IStringEvent} message StringEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringEvent message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.abci.v1beta1.StringEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.abci.v1beta1.StringEvent} StringEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.abci.v1beta1.StringEvent(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + if (!(message.attributes && message.attributes.length)) + message.attributes = []; + message.attributes.push($root.cosmos.base.abci.v1beta1.Attribute.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.abci.v1beta1.StringEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.abci.v1beta1.StringEvent} StringEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringEvent message. + * @function verify + * @memberof cosmos.base.abci.v1beta1.StringEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!Array.isArray(message.attributes)) + return "attributes: array expected"; + for (let i = 0; i < message.attributes.length; ++i) { + let error = $root.cosmos.base.abci.v1beta1.Attribute.verify(message.attributes[i]); + if (error) + return "attributes." + error; + } + } + return null; + }; + + /** + * Creates a StringEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.abci.v1beta1.StringEvent + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.abci.v1beta1.StringEvent} StringEvent + */ + StringEvent.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.abci.v1beta1.StringEvent) + return object; + let message = new $root.cosmos.base.abci.v1beta1.StringEvent(); + if (object.type != null) + message.type = String(object.type); + if (object.attributes) { + if (!Array.isArray(object.attributes)) + throw TypeError(".cosmos.base.abci.v1beta1.StringEvent.attributes: array expected"); + message.attributes = []; + for (let i = 0; i < object.attributes.length; ++i) { + if (typeof object.attributes[i] !== "object") + throw TypeError(".cosmos.base.abci.v1beta1.StringEvent.attributes: object expected"); + message.attributes[i] = $root.cosmos.base.abci.v1beta1.Attribute.fromObject(object.attributes[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a StringEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.abci.v1beta1.StringEvent + * @static + * @param {cosmos.base.abci.v1beta1.StringEvent} message StringEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.attributes = []; + if (options.defaults) + object.type = ""; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.attributes && message.attributes.length) { + object.attributes = []; + for (let j = 0; j < message.attributes.length; ++j) + object.attributes[j] = $root.cosmos.base.abci.v1beta1.Attribute.toObject(message.attributes[j], options); + } + return object; + }; + + /** + * Converts this StringEvent to JSON. + * @function toJSON + * @memberof cosmos.base.abci.v1beta1.StringEvent + * @instance + * @returns {Object.} JSON object + */ + StringEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StringEvent; + })(v1beta1.StringEvent || {}); + + v1beta1.Attribute = (function(Attribute) { + + /** + * Properties of an Attribute. + * @memberof cosmos.base.abci.v1beta1 + * @interface IAttribute + * @property {string|null} [key] Attribute key + * @property {string|null} [value] Attribute value + */ + + /** + * Constructs a new Attribute. + * @memberof cosmos.base.abci.v1beta1 + * @classdesc Represents an Attribute. + * @implements IAttribute + * @constructor + * @param {cosmos.base.abci.v1beta1.IAttribute=} [properties] Properties to set + */ + function Attribute(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Attribute key. + * @member {string} key + * @memberof cosmos.base.abci.v1beta1.Attribute + * @instance + */ + Attribute.prototype.key = ""; + + /** + * Attribute value. + * @member {string} value + * @memberof cosmos.base.abci.v1beta1.Attribute + * @instance + */ + Attribute.prototype.value = ""; + + /** + * Creates a new Attribute instance using the specified properties. + * @function create + * @memberof cosmos.base.abci.v1beta1.Attribute + * @static + * @param {cosmos.base.abci.v1beta1.IAttribute=} [properties] Properties to set + * @returns {cosmos.base.abci.v1beta1.Attribute} Attribute instance + */ + Attribute.create = function create(properties) { + return new Attribute(properties); + }; + + /** + * Encodes the specified Attribute message. Does not implicitly {@link cosmos.base.abci.v1beta1.Attribute.verify|verify} messages. + * @function encode + * @memberof cosmos.base.abci.v1beta1.Attribute + * @static + * @param {cosmos.base.abci.v1beta1.IAttribute} message Attribute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Attribute.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + return writer; + }; + + /** + * Encodes the specified Attribute message, length delimited. Does not implicitly {@link cosmos.base.abci.v1beta1.Attribute.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.abci.v1beta1.Attribute + * @static + * @param {cosmos.base.abci.v1beta1.IAttribute} message Attribute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Attribute.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Attribute message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.abci.v1beta1.Attribute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.abci.v1beta1.Attribute} Attribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Attribute.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.abci.v1beta1.Attribute(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Attribute message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.abci.v1beta1.Attribute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.abci.v1beta1.Attribute} Attribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Attribute.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Attribute message. + * @function verify + * @memberof cosmos.base.abci.v1beta1.Attribute + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Attribute.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an Attribute message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.abci.v1beta1.Attribute + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.abci.v1beta1.Attribute} Attribute + */ + Attribute.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.abci.v1beta1.Attribute) + return object; + let message = new $root.cosmos.base.abci.v1beta1.Attribute(); + if (object.key != null) + message.key = String(object.key); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an Attribute message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.abci.v1beta1.Attribute + * @static + * @param {cosmos.base.abci.v1beta1.Attribute} message Attribute + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Attribute.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.key = ""; + object.value = ""; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this Attribute to JSON. + * @function toJSON + * @memberof cosmos.base.abci.v1beta1.Attribute + * @instance + * @returns {Object.} JSON object + */ + Attribute.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Attribute; + })(v1beta1.Attribute || {}); + + v1beta1.GasInfo = (function(GasInfo) { + + /** + * Properties of a GasInfo. + * @memberof cosmos.base.abci.v1beta1 + * @interface IGasInfo + * @property {number|Long|null} [gasWanted] GasInfo gasWanted + * @property {number|Long|null} [gasUsed] GasInfo gasUsed + */ + + /** + * Constructs a new GasInfo. + * @memberof cosmos.base.abci.v1beta1 + * @classdesc Represents a GasInfo. + * @implements IGasInfo + * @constructor + * @param {cosmos.base.abci.v1beta1.IGasInfo=} [properties] Properties to set + */ + function GasInfo(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GasInfo gasWanted. + * @member {number|Long} gasWanted + * @memberof cosmos.base.abci.v1beta1.GasInfo + * @instance + */ + GasInfo.prototype.gasWanted = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GasInfo gasUsed. + * @member {number|Long} gasUsed + * @memberof cosmos.base.abci.v1beta1.GasInfo + * @instance + */ + GasInfo.prototype.gasUsed = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new GasInfo instance using the specified properties. + * @function create + * @memberof cosmos.base.abci.v1beta1.GasInfo + * @static + * @param {cosmos.base.abci.v1beta1.IGasInfo=} [properties] Properties to set + * @returns {cosmos.base.abci.v1beta1.GasInfo} GasInfo instance + */ + GasInfo.create = function create(properties) { + return new GasInfo(properties); + }; + + /** + * Encodes the specified GasInfo message. Does not implicitly {@link cosmos.base.abci.v1beta1.GasInfo.verify|verify} messages. + * @function encode + * @memberof cosmos.base.abci.v1beta1.GasInfo + * @static + * @param {cosmos.base.abci.v1beta1.IGasInfo} message GasInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GasInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gasWanted != null && Object.hasOwnProperty.call(message, "gasWanted")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.gasWanted); + if (message.gasUsed != null && Object.hasOwnProperty.call(message, "gasUsed")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.gasUsed); + return writer; + }; + + /** + * Encodes the specified GasInfo message, length delimited. Does not implicitly {@link cosmos.base.abci.v1beta1.GasInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.abci.v1beta1.GasInfo + * @static + * @param {cosmos.base.abci.v1beta1.IGasInfo} message GasInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GasInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GasInfo message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.abci.v1beta1.GasInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.abci.v1beta1.GasInfo} GasInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GasInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.abci.v1beta1.GasInfo(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gasWanted = reader.uint64(); + break; + case 2: + message.gasUsed = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GasInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.abci.v1beta1.GasInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.abci.v1beta1.GasInfo} GasInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GasInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GasInfo message. + * @function verify + * @memberof cosmos.base.abci.v1beta1.GasInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GasInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gasWanted != null && message.hasOwnProperty("gasWanted")) + if (!$util.isInteger(message.gasWanted) && !(message.gasWanted && $util.isInteger(message.gasWanted.low) && $util.isInteger(message.gasWanted.high))) + return "gasWanted: integer|Long expected"; + if (message.gasUsed != null && message.hasOwnProperty("gasUsed")) + if (!$util.isInteger(message.gasUsed) && !(message.gasUsed && $util.isInteger(message.gasUsed.low) && $util.isInteger(message.gasUsed.high))) + return "gasUsed: integer|Long expected"; + return null; + }; + + /** + * Creates a GasInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.abci.v1beta1.GasInfo + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.abci.v1beta1.GasInfo} GasInfo + */ + GasInfo.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.abci.v1beta1.GasInfo) + return object; + let message = new $root.cosmos.base.abci.v1beta1.GasInfo(); + if (object.gasWanted != null) + if ($util.Long) + (message.gasWanted = $util.Long.fromValue(object.gasWanted)).unsigned = true; + else if (typeof object.gasWanted === "string") + message.gasWanted = parseInt(object.gasWanted, 10); + else if (typeof object.gasWanted === "number") + message.gasWanted = object.gasWanted; + else if (typeof object.gasWanted === "object") + message.gasWanted = new $util.LongBits(object.gasWanted.low >>> 0, object.gasWanted.high >>> 0).toNumber(true); + if (object.gasUsed != null) + if ($util.Long) + (message.gasUsed = $util.Long.fromValue(object.gasUsed)).unsigned = true; + else if (typeof object.gasUsed === "string") + message.gasUsed = parseInt(object.gasUsed, 10); + else if (typeof object.gasUsed === "number") + message.gasUsed = object.gasUsed; + else if (typeof object.gasUsed === "object") + message.gasUsed = new $util.LongBits(object.gasUsed.low >>> 0, object.gasUsed.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a GasInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.abci.v1beta1.GasInfo + * @static + * @param {cosmos.base.abci.v1beta1.GasInfo} message GasInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GasInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.gasWanted = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.gasWanted = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.gasUsed = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.gasUsed = options.longs === String ? "0" : 0; + } + if (message.gasWanted != null && message.hasOwnProperty("gasWanted")) + if (typeof message.gasWanted === "number") + object.gasWanted = options.longs === String ? String(message.gasWanted) : message.gasWanted; + else + object.gasWanted = options.longs === String ? $util.Long.prototype.toString.call(message.gasWanted) : options.longs === Number ? new $util.LongBits(message.gasWanted.low >>> 0, message.gasWanted.high >>> 0).toNumber(true) : message.gasWanted; + if (message.gasUsed != null && message.hasOwnProperty("gasUsed")) + if (typeof message.gasUsed === "number") + object.gasUsed = options.longs === String ? String(message.gasUsed) : message.gasUsed; + else + object.gasUsed = options.longs === String ? $util.Long.prototype.toString.call(message.gasUsed) : options.longs === Number ? new $util.LongBits(message.gasUsed.low >>> 0, message.gasUsed.high >>> 0).toNumber(true) : message.gasUsed; + return object; + }; + + /** + * Converts this GasInfo to JSON. + * @function toJSON + * @memberof cosmos.base.abci.v1beta1.GasInfo + * @instance + * @returns {Object.} JSON object + */ + GasInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GasInfo; + })(v1beta1.GasInfo || {}); + + v1beta1.Result = (function(Result) { + + /** + * Properties of a Result. + * @memberof cosmos.base.abci.v1beta1 + * @interface IResult + * @property {Uint8Array|null} [data] Result data + * @property {string|null} [log] Result log + * @property {Array.|null} [events] Result events + */ + + /** + * Constructs a new Result. + * @memberof cosmos.base.abci.v1beta1 + * @classdesc Represents a Result. + * @implements IResult + * @constructor + * @param {cosmos.base.abci.v1beta1.IResult=} [properties] Properties to set + */ + function Result(properties) { + this.events = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Result data. + * @member {Uint8Array} data + * @memberof cosmos.base.abci.v1beta1.Result + * @instance + */ + Result.prototype.data = $util.newBuffer([]); + + /** + * Result log. + * @member {string} log + * @memberof cosmos.base.abci.v1beta1.Result + * @instance + */ + Result.prototype.log = ""; + + /** + * Result events. + * @member {Array.} events + * @memberof cosmos.base.abci.v1beta1.Result + * @instance + */ + Result.prototype.events = $util.emptyArray; + + /** + * Creates a new Result instance using the specified properties. + * @function create + * @memberof cosmos.base.abci.v1beta1.Result + * @static + * @param {cosmos.base.abci.v1beta1.IResult=} [properties] Properties to set + * @returns {cosmos.base.abci.v1beta1.Result} Result instance + */ + Result.create = function create(properties) { + return new Result(properties); + }; + + /** + * Encodes the specified Result message. Does not implicitly {@link cosmos.base.abci.v1beta1.Result.verify|verify} messages. + * @function encode + * @memberof cosmos.base.abci.v1beta1.Result + * @static + * @param {cosmos.base.abci.v1beta1.IResult} message Result message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Result.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.data); + if (message.log != null && Object.hasOwnProperty.call(message, "log")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.log); + if (message.events != null && message.events.length) + for (let i = 0; i < message.events.length; ++i) + $root.tendermint.abci.Event.encode(message.events[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Result message, length delimited. Does not implicitly {@link cosmos.base.abci.v1beta1.Result.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.abci.v1beta1.Result + * @static + * @param {cosmos.base.abci.v1beta1.IResult} message Result message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Result.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Result message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.abci.v1beta1.Result + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.abci.v1beta1.Result} Result + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Result.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.abci.v1beta1.Result(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + case 2: + message.log = reader.string(); + break; + case 3: + if (!(message.events && message.events.length)) + message.events = []; + message.events.push($root.tendermint.abci.Event.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Result message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.abci.v1beta1.Result + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.abci.v1beta1.Result} Result + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Result.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Result message. + * @function verify + * @memberof cosmos.base.abci.v1beta1.Result + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Result.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + if (message.log != null && message.hasOwnProperty("log")) + if (!$util.isString(message.log)) + return "log: string expected"; + if (message.events != null && message.hasOwnProperty("events")) { + if (!Array.isArray(message.events)) + return "events: array expected"; + for (let i = 0; i < message.events.length; ++i) { + let error = $root.tendermint.abci.Event.verify(message.events[i]); + if (error) + return "events." + error; + } + } + return null; + }; + + /** + * Creates a Result message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.abci.v1beta1.Result + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.abci.v1beta1.Result} Result + */ + Result.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.abci.v1beta1.Result) + return object; + let message = new $root.cosmos.base.abci.v1beta1.Result(); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length) + message.data = object.data; + if (object.log != null) + message.log = String(object.log); + if (object.events) { + if (!Array.isArray(object.events)) + throw TypeError(".cosmos.base.abci.v1beta1.Result.events: array expected"); + message.events = []; + for (let i = 0; i < object.events.length; ++i) { + if (typeof object.events[i] !== "object") + throw TypeError(".cosmos.base.abci.v1beta1.Result.events: object expected"); + message.events[i] = $root.tendermint.abci.Event.fromObject(object.events[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Result message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.abci.v1beta1.Result + * @static + * @param {cosmos.base.abci.v1beta1.Result} message Result + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Result.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.events = []; + if (options.defaults) { + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + object.log = ""; + } + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + if (message.log != null && message.hasOwnProperty("log")) + object.log = message.log; + if (message.events && message.events.length) { + object.events = []; + for (let j = 0; j < message.events.length; ++j) + object.events[j] = $root.tendermint.abci.Event.toObject(message.events[j], options); + } + return object; + }; + + /** + * Converts this Result to JSON. + * @function toJSON + * @memberof cosmos.base.abci.v1beta1.Result + * @instance + * @returns {Object.} JSON object + */ + Result.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Result; + })(v1beta1.Result || {}); + + v1beta1.SimulationResponse = (function(SimulationResponse) { + + /** + * Properties of a SimulationResponse. + * @memberof cosmos.base.abci.v1beta1 + * @interface ISimulationResponse + * @property {cosmos.base.abci.v1beta1.IGasInfo|null} [gasInfo] SimulationResponse gasInfo + * @property {cosmos.base.abci.v1beta1.IResult|null} [result] SimulationResponse result + */ + + /** + * Constructs a new SimulationResponse. + * @memberof cosmos.base.abci.v1beta1 + * @classdesc Represents a SimulationResponse. + * @implements ISimulationResponse + * @constructor + * @param {cosmos.base.abci.v1beta1.ISimulationResponse=} [properties] Properties to set + */ + function SimulationResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SimulationResponse gasInfo. + * @member {cosmos.base.abci.v1beta1.IGasInfo|null|undefined} gasInfo + * @memberof cosmos.base.abci.v1beta1.SimulationResponse + * @instance + */ + SimulationResponse.prototype.gasInfo = null; + + /** + * SimulationResponse result. + * @member {cosmos.base.abci.v1beta1.IResult|null|undefined} result + * @memberof cosmos.base.abci.v1beta1.SimulationResponse + * @instance + */ + SimulationResponse.prototype.result = null; + + /** + * Creates a new SimulationResponse instance using the specified properties. + * @function create + * @memberof cosmos.base.abci.v1beta1.SimulationResponse + * @static + * @param {cosmos.base.abci.v1beta1.ISimulationResponse=} [properties] Properties to set + * @returns {cosmos.base.abci.v1beta1.SimulationResponse} SimulationResponse instance + */ + SimulationResponse.create = function create(properties) { + return new SimulationResponse(properties); + }; + + /** + * Encodes the specified SimulationResponse message. Does not implicitly {@link cosmos.base.abci.v1beta1.SimulationResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.base.abci.v1beta1.SimulationResponse + * @static + * @param {cosmos.base.abci.v1beta1.ISimulationResponse} message SimulationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SimulationResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gasInfo != null && Object.hasOwnProperty.call(message, "gasInfo")) + $root.cosmos.base.abci.v1beta1.GasInfo.encode(message.gasInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.result != null && Object.hasOwnProperty.call(message, "result")) + $root.cosmos.base.abci.v1beta1.Result.encode(message.result, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SimulationResponse message, length delimited. Does not implicitly {@link cosmos.base.abci.v1beta1.SimulationResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.abci.v1beta1.SimulationResponse + * @static + * @param {cosmos.base.abci.v1beta1.ISimulationResponse} message SimulationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SimulationResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SimulationResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.abci.v1beta1.SimulationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.abci.v1beta1.SimulationResponse} SimulationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SimulationResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.abci.v1beta1.SimulationResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gasInfo = $root.cosmos.base.abci.v1beta1.GasInfo.decode(reader, reader.uint32()); + break; + case 2: + message.result = $root.cosmos.base.abci.v1beta1.Result.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SimulationResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.abci.v1beta1.SimulationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.abci.v1beta1.SimulationResponse} SimulationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SimulationResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SimulationResponse message. + * @function verify + * @memberof cosmos.base.abci.v1beta1.SimulationResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SimulationResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gasInfo != null && message.hasOwnProperty("gasInfo")) { + let error = $root.cosmos.base.abci.v1beta1.GasInfo.verify(message.gasInfo); + if (error) + return "gasInfo." + error; + } + if (message.result != null && message.hasOwnProperty("result")) { + let error = $root.cosmos.base.abci.v1beta1.Result.verify(message.result); + if (error) + return "result." + error; + } + return null; + }; + + /** + * Creates a SimulationResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.abci.v1beta1.SimulationResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.abci.v1beta1.SimulationResponse} SimulationResponse + */ + SimulationResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.abci.v1beta1.SimulationResponse) + return object; + let message = new $root.cosmos.base.abci.v1beta1.SimulationResponse(); + if (object.gasInfo != null) { + if (typeof object.gasInfo !== "object") + throw TypeError(".cosmos.base.abci.v1beta1.SimulationResponse.gasInfo: object expected"); + message.gasInfo = $root.cosmos.base.abci.v1beta1.GasInfo.fromObject(object.gasInfo); + } + if (object.result != null) { + if (typeof object.result !== "object") + throw TypeError(".cosmos.base.abci.v1beta1.SimulationResponse.result: object expected"); + message.result = $root.cosmos.base.abci.v1beta1.Result.fromObject(object.result); + } + return message; + }; + + /** + * Creates a plain object from a SimulationResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.abci.v1beta1.SimulationResponse + * @static + * @param {cosmos.base.abci.v1beta1.SimulationResponse} message SimulationResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SimulationResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.gasInfo = null; + object.result = null; + } + if (message.gasInfo != null && message.hasOwnProperty("gasInfo")) + object.gasInfo = $root.cosmos.base.abci.v1beta1.GasInfo.toObject(message.gasInfo, options); + if (message.result != null && message.hasOwnProperty("result")) + object.result = $root.cosmos.base.abci.v1beta1.Result.toObject(message.result, options); + return object; + }; + + /** + * Converts this SimulationResponse to JSON. + * @function toJSON + * @memberof cosmos.base.abci.v1beta1.SimulationResponse + * @instance + * @returns {Object.} JSON object + */ + SimulationResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SimulationResponse; + })(v1beta1.SimulationResponse || {}); + + v1beta1.MsgData = (function(MsgData) { + + /** + * Properties of a MsgData. + * @memberof cosmos.base.abci.v1beta1 + * @interface IMsgData + * @property {string|null} [msgType] MsgData msgType + * @property {Uint8Array|null} [data] MsgData data + */ + + /** + * Constructs a new MsgData. + * @memberof cosmos.base.abci.v1beta1 + * @classdesc Represents a MsgData. + * @implements IMsgData + * @constructor + * @param {cosmos.base.abci.v1beta1.IMsgData=} [properties] Properties to set + */ + function MsgData(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgData msgType. + * @member {string} msgType + * @memberof cosmos.base.abci.v1beta1.MsgData + * @instance + */ + MsgData.prototype.msgType = ""; + + /** + * MsgData data. + * @member {Uint8Array} data + * @memberof cosmos.base.abci.v1beta1.MsgData + * @instance + */ + MsgData.prototype.data = $util.newBuffer([]); + + /** + * Creates a new MsgData instance using the specified properties. + * @function create + * @memberof cosmos.base.abci.v1beta1.MsgData + * @static + * @param {cosmos.base.abci.v1beta1.IMsgData=} [properties] Properties to set + * @returns {cosmos.base.abci.v1beta1.MsgData} MsgData instance + */ + MsgData.create = function create(properties) { + return new MsgData(properties); + }; + + /** + * Encodes the specified MsgData message. Does not implicitly {@link cosmos.base.abci.v1beta1.MsgData.verify|verify} messages. + * @function encode + * @memberof cosmos.base.abci.v1beta1.MsgData + * @static + * @param {cosmos.base.abci.v1beta1.IMsgData} message MsgData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.msgType != null && Object.hasOwnProperty.call(message, "msgType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.msgType); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); + return writer; + }; + + /** + * Encodes the specified MsgData message, length delimited. Does not implicitly {@link cosmos.base.abci.v1beta1.MsgData.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.abci.v1beta1.MsgData + * @static + * @param {cosmos.base.abci.v1beta1.IMsgData} message MsgData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgData message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.abci.v1beta1.MsgData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.abci.v1beta1.MsgData} MsgData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.abci.v1beta1.MsgData(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.msgType = reader.string(); + break; + case 2: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.abci.v1beta1.MsgData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.abci.v1beta1.MsgData} MsgData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgData message. + * @function verify + * @memberof cosmos.base.abci.v1beta1.MsgData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.msgType != null && message.hasOwnProperty("msgType")) + if (!$util.isString(message.msgType)) + return "msgType: string expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + return null; + }; + + /** + * Creates a MsgData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.abci.v1beta1.MsgData + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.abci.v1beta1.MsgData} MsgData + */ + MsgData.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.abci.v1beta1.MsgData) + return object; + let message = new $root.cosmos.base.abci.v1beta1.MsgData(); + if (object.msgType != null) + message.msgType = String(object.msgType); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length) + message.data = object.data; + return message; + }; + + /** + * Creates a plain object from a MsgData message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.abci.v1beta1.MsgData + * @static + * @param {cosmos.base.abci.v1beta1.MsgData} message MsgData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgData.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.msgType = ""; + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + } + if (message.msgType != null && message.hasOwnProperty("msgType")) + object.msgType = message.msgType; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + return object; + }; + + /** + * Converts this MsgData to JSON. + * @function toJSON + * @memberof cosmos.base.abci.v1beta1.MsgData + * @instance + * @returns {Object.} JSON object + */ + MsgData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgData; + })(v1beta1.MsgData || {}); + + v1beta1.TxMsgData = (function(TxMsgData) { + + /** + * Properties of a TxMsgData. + * @memberof cosmos.base.abci.v1beta1 + * @interface ITxMsgData + * @property {Array.|null} [data] TxMsgData data + */ + + /** + * Constructs a new TxMsgData. + * @memberof cosmos.base.abci.v1beta1 + * @classdesc Represents a TxMsgData. + * @implements ITxMsgData + * @constructor + * @param {cosmos.base.abci.v1beta1.ITxMsgData=} [properties] Properties to set + */ + function TxMsgData(properties) { + this.data = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TxMsgData data. + * @member {Array.} data + * @memberof cosmos.base.abci.v1beta1.TxMsgData + * @instance + */ + TxMsgData.prototype.data = $util.emptyArray; + + /** + * Creates a new TxMsgData instance using the specified properties. + * @function create + * @memberof cosmos.base.abci.v1beta1.TxMsgData + * @static + * @param {cosmos.base.abci.v1beta1.ITxMsgData=} [properties] Properties to set + * @returns {cosmos.base.abci.v1beta1.TxMsgData} TxMsgData instance + */ + TxMsgData.create = function create(properties) { + return new TxMsgData(properties); + }; + + /** + * Encodes the specified TxMsgData message. Does not implicitly {@link cosmos.base.abci.v1beta1.TxMsgData.verify|verify} messages. + * @function encode + * @memberof cosmos.base.abci.v1beta1.TxMsgData + * @static + * @param {cosmos.base.abci.v1beta1.ITxMsgData} message TxMsgData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TxMsgData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.data != null && message.data.length) + for (let i = 0; i < message.data.length; ++i) + $root.cosmos.base.abci.v1beta1.MsgData.encode(message.data[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TxMsgData message, length delimited. Does not implicitly {@link cosmos.base.abci.v1beta1.TxMsgData.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.abci.v1beta1.TxMsgData + * @static + * @param {cosmos.base.abci.v1beta1.ITxMsgData} message TxMsgData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TxMsgData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TxMsgData message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.abci.v1beta1.TxMsgData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.abci.v1beta1.TxMsgData} TxMsgData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TxMsgData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.abci.v1beta1.TxMsgData(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.data && message.data.length)) + message.data = []; + message.data.push($root.cosmos.base.abci.v1beta1.MsgData.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TxMsgData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.abci.v1beta1.TxMsgData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.abci.v1beta1.TxMsgData} TxMsgData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TxMsgData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TxMsgData message. + * @function verify + * @memberof cosmos.base.abci.v1beta1.TxMsgData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TxMsgData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.data != null && message.hasOwnProperty("data")) { + if (!Array.isArray(message.data)) + return "data: array expected"; + for (let i = 0; i < message.data.length; ++i) { + let error = $root.cosmos.base.abci.v1beta1.MsgData.verify(message.data[i]); + if (error) + return "data." + error; + } + } + return null; + }; + + /** + * Creates a TxMsgData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.abci.v1beta1.TxMsgData + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.abci.v1beta1.TxMsgData} TxMsgData + */ + TxMsgData.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.abci.v1beta1.TxMsgData) + return object; + let message = new $root.cosmos.base.abci.v1beta1.TxMsgData(); + if (object.data) { + if (!Array.isArray(object.data)) + throw TypeError(".cosmos.base.abci.v1beta1.TxMsgData.data: array expected"); + message.data = []; + for (let i = 0; i < object.data.length; ++i) { + if (typeof object.data[i] !== "object") + throw TypeError(".cosmos.base.abci.v1beta1.TxMsgData.data: object expected"); + message.data[i] = $root.cosmos.base.abci.v1beta1.MsgData.fromObject(object.data[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TxMsgData message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.abci.v1beta1.TxMsgData + * @static + * @param {cosmos.base.abci.v1beta1.TxMsgData} message TxMsgData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TxMsgData.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.data = []; + if (message.data && message.data.length) { + object.data = []; + for (let j = 0; j < message.data.length; ++j) + object.data[j] = $root.cosmos.base.abci.v1beta1.MsgData.toObject(message.data[j], options); + } + return object; + }; + + /** + * Converts this TxMsgData to JSON. + * @function toJSON + * @memberof cosmos.base.abci.v1beta1.TxMsgData + * @instance + * @returns {Object.} JSON object + */ + TxMsgData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TxMsgData; + })(v1beta1.TxMsgData || {}); + + v1beta1.SearchTxsResult = (function(SearchTxsResult) { + + /** + * Properties of a SearchTxsResult. + * @memberof cosmos.base.abci.v1beta1 + * @interface ISearchTxsResult + * @property {number|Long|null} [totalCount] SearchTxsResult totalCount + * @property {number|Long|null} [count] SearchTxsResult count + * @property {number|Long|null} [pageNumber] SearchTxsResult pageNumber + * @property {number|Long|null} [pageTotal] SearchTxsResult pageTotal + * @property {number|Long|null} [limit] SearchTxsResult limit + * @property {Array.|null} [txs] SearchTxsResult txs + */ + + /** + * Constructs a new SearchTxsResult. + * @memberof cosmos.base.abci.v1beta1 + * @classdesc Represents a SearchTxsResult. + * @implements ISearchTxsResult + * @constructor + * @param {cosmos.base.abci.v1beta1.ISearchTxsResult=} [properties] Properties to set + */ + function SearchTxsResult(properties) { + this.txs = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchTxsResult totalCount. + * @member {number|Long} totalCount + * @memberof cosmos.base.abci.v1beta1.SearchTxsResult + * @instance + */ + SearchTxsResult.prototype.totalCount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * SearchTxsResult count. + * @member {number|Long} count + * @memberof cosmos.base.abci.v1beta1.SearchTxsResult + * @instance + */ + SearchTxsResult.prototype.count = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * SearchTxsResult pageNumber. + * @member {number|Long} pageNumber + * @memberof cosmos.base.abci.v1beta1.SearchTxsResult + * @instance + */ + SearchTxsResult.prototype.pageNumber = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * SearchTxsResult pageTotal. + * @member {number|Long} pageTotal + * @memberof cosmos.base.abci.v1beta1.SearchTxsResult + * @instance + */ + SearchTxsResult.prototype.pageTotal = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * SearchTxsResult limit. + * @member {number|Long} limit + * @memberof cosmos.base.abci.v1beta1.SearchTxsResult + * @instance + */ + SearchTxsResult.prototype.limit = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * SearchTxsResult txs. + * @member {Array.} txs + * @memberof cosmos.base.abci.v1beta1.SearchTxsResult + * @instance + */ + SearchTxsResult.prototype.txs = $util.emptyArray; + + /** + * Creates a new SearchTxsResult instance using the specified properties. + * @function create + * @memberof cosmos.base.abci.v1beta1.SearchTxsResult + * @static + * @param {cosmos.base.abci.v1beta1.ISearchTxsResult=} [properties] Properties to set + * @returns {cosmos.base.abci.v1beta1.SearchTxsResult} SearchTxsResult instance + */ + SearchTxsResult.create = function create(properties) { + return new SearchTxsResult(properties); + }; + + /** + * Encodes the specified SearchTxsResult message. Does not implicitly {@link cosmos.base.abci.v1beta1.SearchTxsResult.verify|verify} messages. + * @function encode + * @memberof cosmos.base.abci.v1beta1.SearchTxsResult + * @static + * @param {cosmos.base.abci.v1beta1.ISearchTxsResult} message SearchTxsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchTxsResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.totalCount != null && Object.hasOwnProperty.call(message, "totalCount")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.totalCount); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.count); + if (message.pageNumber != null && Object.hasOwnProperty.call(message, "pageNumber")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.pageNumber); + if (message.pageTotal != null && Object.hasOwnProperty.call(message, "pageTotal")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.pageTotal); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.limit); + if (message.txs != null && message.txs.length) + for (let i = 0; i < message.txs.length; ++i) + $root.cosmos.base.abci.v1beta1.TxResponse.encode(message.txs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SearchTxsResult message, length delimited. Does not implicitly {@link cosmos.base.abci.v1beta1.SearchTxsResult.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.abci.v1beta1.SearchTxsResult + * @static + * @param {cosmos.base.abci.v1beta1.ISearchTxsResult} message SearchTxsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchTxsResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchTxsResult message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.abci.v1beta1.SearchTxsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.abci.v1beta1.SearchTxsResult} SearchTxsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchTxsResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.abci.v1beta1.SearchTxsResult(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.totalCount = reader.uint64(); + break; + case 2: + message.count = reader.uint64(); + break; + case 3: + message.pageNumber = reader.uint64(); + break; + case 4: + message.pageTotal = reader.uint64(); + break; + case 5: + message.limit = reader.uint64(); + break; + case 6: + if (!(message.txs && message.txs.length)) + message.txs = []; + message.txs.push($root.cosmos.base.abci.v1beta1.TxResponse.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchTxsResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.abci.v1beta1.SearchTxsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.abci.v1beta1.SearchTxsResult} SearchTxsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchTxsResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchTxsResult message. + * @function verify + * @memberof cosmos.base.abci.v1beta1.SearchTxsResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchTxsResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.totalCount != null && message.hasOwnProperty("totalCount")) + if (!$util.isInteger(message.totalCount) && !(message.totalCount && $util.isInteger(message.totalCount.low) && $util.isInteger(message.totalCount.high))) + return "totalCount: integer|Long expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + if (message.pageNumber != null && message.hasOwnProperty("pageNumber")) + if (!$util.isInteger(message.pageNumber) && !(message.pageNumber && $util.isInteger(message.pageNumber.low) && $util.isInteger(message.pageNumber.high))) + return "pageNumber: integer|Long expected"; + if (message.pageTotal != null && message.hasOwnProperty("pageTotal")) + if (!$util.isInteger(message.pageTotal) && !(message.pageTotal && $util.isInteger(message.pageTotal.low) && $util.isInteger(message.pageTotal.high))) + return "pageTotal: integer|Long expected"; + if (message.limit != null && message.hasOwnProperty("limit")) + if (!$util.isInteger(message.limit) && !(message.limit && $util.isInteger(message.limit.low) && $util.isInteger(message.limit.high))) + return "limit: integer|Long expected"; + if (message.txs != null && message.hasOwnProperty("txs")) { + if (!Array.isArray(message.txs)) + return "txs: array expected"; + for (let i = 0; i < message.txs.length; ++i) { + let error = $root.cosmos.base.abci.v1beta1.TxResponse.verify(message.txs[i]); + if (error) + return "txs." + error; + } + } + return null; + }; + + /** + * Creates a SearchTxsResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.abci.v1beta1.SearchTxsResult + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.abci.v1beta1.SearchTxsResult} SearchTxsResult + */ + SearchTxsResult.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.abci.v1beta1.SearchTxsResult) + return object; + let message = new $root.cosmos.base.abci.v1beta1.SearchTxsResult(); + if (object.totalCount != null) + if ($util.Long) + (message.totalCount = $util.Long.fromValue(object.totalCount)).unsigned = true; + else if (typeof object.totalCount === "string") + message.totalCount = parseInt(object.totalCount, 10); + else if (typeof object.totalCount === "number") + message.totalCount = object.totalCount; + else if (typeof object.totalCount === "object") + message.totalCount = new $util.LongBits(object.totalCount.low >>> 0, object.totalCount.high >>> 0).toNumber(true); + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = true; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(true); + if (object.pageNumber != null) + if ($util.Long) + (message.pageNumber = $util.Long.fromValue(object.pageNumber)).unsigned = true; + else if (typeof object.pageNumber === "string") + message.pageNumber = parseInt(object.pageNumber, 10); + else if (typeof object.pageNumber === "number") + message.pageNumber = object.pageNumber; + else if (typeof object.pageNumber === "object") + message.pageNumber = new $util.LongBits(object.pageNumber.low >>> 0, object.pageNumber.high >>> 0).toNumber(true); + if (object.pageTotal != null) + if ($util.Long) + (message.pageTotal = $util.Long.fromValue(object.pageTotal)).unsigned = true; + else if (typeof object.pageTotal === "string") + message.pageTotal = parseInt(object.pageTotal, 10); + else if (typeof object.pageTotal === "number") + message.pageTotal = object.pageTotal; + else if (typeof object.pageTotal === "object") + message.pageTotal = new $util.LongBits(object.pageTotal.low >>> 0, object.pageTotal.high >>> 0).toNumber(true); + if (object.limit != null) + if ($util.Long) + (message.limit = $util.Long.fromValue(object.limit)).unsigned = true; + else if (typeof object.limit === "string") + message.limit = parseInt(object.limit, 10); + else if (typeof object.limit === "number") + message.limit = object.limit; + else if (typeof object.limit === "object") + message.limit = new $util.LongBits(object.limit.low >>> 0, object.limit.high >>> 0).toNumber(true); + if (object.txs) { + if (!Array.isArray(object.txs)) + throw TypeError(".cosmos.base.abci.v1beta1.SearchTxsResult.txs: array expected"); + message.txs = []; + for (let i = 0; i < object.txs.length; ++i) { + if (typeof object.txs[i] !== "object") + throw TypeError(".cosmos.base.abci.v1beta1.SearchTxsResult.txs: object expected"); + message.txs[i] = $root.cosmos.base.abci.v1beta1.TxResponse.fromObject(object.txs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SearchTxsResult message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.abci.v1beta1.SearchTxsResult + * @static + * @param {cosmos.base.abci.v1beta1.SearchTxsResult} message SearchTxsResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchTxsResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.txs = []; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.totalCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalCount = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.pageNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.pageNumber = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.pageTotal = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.pageTotal = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.limit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.limit = options.longs === String ? "0" : 0; + } + if (message.totalCount != null && message.hasOwnProperty("totalCount")) + if (typeof message.totalCount === "number") + object.totalCount = options.longs === String ? String(message.totalCount) : message.totalCount; + else + object.totalCount = options.longs === String ? $util.Long.prototype.toString.call(message.totalCount) : options.longs === Number ? new $util.LongBits(message.totalCount.low >>> 0, message.totalCount.high >>> 0).toNumber(true) : message.totalCount; + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber(true) : message.count; + if (message.pageNumber != null && message.hasOwnProperty("pageNumber")) + if (typeof message.pageNumber === "number") + object.pageNumber = options.longs === String ? String(message.pageNumber) : message.pageNumber; + else + object.pageNumber = options.longs === String ? $util.Long.prototype.toString.call(message.pageNumber) : options.longs === Number ? new $util.LongBits(message.pageNumber.low >>> 0, message.pageNumber.high >>> 0).toNumber(true) : message.pageNumber; + if (message.pageTotal != null && message.hasOwnProperty("pageTotal")) + if (typeof message.pageTotal === "number") + object.pageTotal = options.longs === String ? String(message.pageTotal) : message.pageTotal; + else + object.pageTotal = options.longs === String ? $util.Long.prototype.toString.call(message.pageTotal) : options.longs === Number ? new $util.LongBits(message.pageTotal.low >>> 0, message.pageTotal.high >>> 0).toNumber(true) : message.pageTotal; + if (message.limit != null && message.hasOwnProperty("limit")) + if (typeof message.limit === "number") + object.limit = options.longs === String ? String(message.limit) : message.limit; + else + object.limit = options.longs === String ? $util.Long.prototype.toString.call(message.limit) : options.longs === Number ? new $util.LongBits(message.limit.low >>> 0, message.limit.high >>> 0).toNumber(true) : message.limit; + if (message.txs && message.txs.length) { + object.txs = []; + for (let j = 0; j < message.txs.length; ++j) + object.txs[j] = $root.cosmos.base.abci.v1beta1.TxResponse.toObject(message.txs[j], options); + } + return object; + }; + + /** + * Converts this SearchTxsResult to JSON. + * @function toJSON + * @memberof cosmos.base.abci.v1beta1.SearchTxsResult + * @instance + * @returns {Object.} JSON object + */ + SearchTxsResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SearchTxsResult; + })(v1beta1.SearchTxsResult || {}); + + return v1beta1; + })(abci.v1beta1 || {}); + + return abci; + })(base.abci || {}); + + /** + * Namespace kv. + * @memberof cosmos.base + * @namespace + */ + + base.kv = (function(kv) { + + /** + * Namespace v1beta1. + * @memberof cosmos.base.kv + * @namespace + */ + + kv.v1beta1 = (function(v1beta1) { + + v1beta1.Pairs = (function(Pairs) { + + /** + * Properties of a Pairs. + * @memberof cosmos.base.kv.v1beta1 + * @interface IPairs + * @property {Array.|null} [pairs] Pairs pairs + */ + + /** + * Constructs a new Pairs. + * @memberof cosmos.base.kv.v1beta1 + * @classdesc Represents a Pairs. + * @implements IPairs + * @constructor + * @param {cosmos.base.kv.v1beta1.IPairs=} [properties] Properties to set + */ + function Pairs(properties) { + this.pairs = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Pairs pairs. + * @member {Array.} pairs + * @memberof cosmos.base.kv.v1beta1.Pairs + * @instance + */ + Pairs.prototype.pairs = $util.emptyArray; + + /** + * Creates a new Pairs instance using the specified properties. + * @function create + * @memberof cosmos.base.kv.v1beta1.Pairs + * @static + * @param {cosmos.base.kv.v1beta1.IPairs=} [properties] Properties to set + * @returns {cosmos.base.kv.v1beta1.Pairs} Pairs instance + */ + Pairs.create = function create(properties) { + return new Pairs(properties); + }; + + /** + * Encodes the specified Pairs message. Does not implicitly {@link cosmos.base.kv.v1beta1.Pairs.verify|verify} messages. + * @function encode + * @memberof cosmos.base.kv.v1beta1.Pairs + * @static + * @param {cosmos.base.kv.v1beta1.IPairs} message Pairs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Pairs.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pairs != null && message.pairs.length) + for (let i = 0; i < message.pairs.length; ++i) + $root.cosmos.base.kv.v1beta1.Pair.encode(message.pairs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Pairs message, length delimited. Does not implicitly {@link cosmos.base.kv.v1beta1.Pairs.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.kv.v1beta1.Pairs + * @static + * @param {cosmos.base.kv.v1beta1.IPairs} message Pairs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Pairs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Pairs message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.kv.v1beta1.Pairs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.kv.v1beta1.Pairs} Pairs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Pairs.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.kv.v1beta1.Pairs(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.pairs && message.pairs.length)) + message.pairs = []; + message.pairs.push($root.cosmos.base.kv.v1beta1.Pair.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Pairs message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.kv.v1beta1.Pairs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.kv.v1beta1.Pairs} Pairs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Pairs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Pairs message. + * @function verify + * @memberof cosmos.base.kv.v1beta1.Pairs + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Pairs.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pairs != null && message.hasOwnProperty("pairs")) { + if (!Array.isArray(message.pairs)) + return "pairs: array expected"; + for (let i = 0; i < message.pairs.length; ++i) { + let error = $root.cosmos.base.kv.v1beta1.Pair.verify(message.pairs[i]); + if (error) + return "pairs." + error; + } + } + return null; + }; + + /** + * Creates a Pairs message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.kv.v1beta1.Pairs + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.kv.v1beta1.Pairs} Pairs + */ + Pairs.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.kv.v1beta1.Pairs) + return object; + let message = new $root.cosmos.base.kv.v1beta1.Pairs(); + if (object.pairs) { + if (!Array.isArray(object.pairs)) + throw TypeError(".cosmos.base.kv.v1beta1.Pairs.pairs: array expected"); + message.pairs = []; + for (let i = 0; i < object.pairs.length; ++i) { + if (typeof object.pairs[i] !== "object") + throw TypeError(".cosmos.base.kv.v1beta1.Pairs.pairs: object expected"); + message.pairs[i] = $root.cosmos.base.kv.v1beta1.Pair.fromObject(object.pairs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Pairs message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.kv.v1beta1.Pairs + * @static + * @param {cosmos.base.kv.v1beta1.Pairs} message Pairs + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Pairs.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.pairs = []; + if (message.pairs && message.pairs.length) { + object.pairs = []; + for (let j = 0; j < message.pairs.length; ++j) + object.pairs[j] = $root.cosmos.base.kv.v1beta1.Pair.toObject(message.pairs[j], options); + } + return object; + }; + + /** + * Converts this Pairs to JSON. + * @function toJSON + * @memberof cosmos.base.kv.v1beta1.Pairs + * @instance + * @returns {Object.} JSON object + */ + Pairs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Pairs; + })(v1beta1.Pairs || {}); + + v1beta1.Pair = (function(Pair) { + + /** + * Properties of a Pair. + * @memberof cosmos.base.kv.v1beta1 + * @interface IPair + * @property {Uint8Array|null} [key] Pair key + * @property {Uint8Array|null} [value] Pair value + */ + + /** + * Constructs a new Pair. + * @memberof cosmos.base.kv.v1beta1 + * @classdesc Represents a Pair. + * @implements IPair + * @constructor + * @param {cosmos.base.kv.v1beta1.IPair=} [properties] Properties to set + */ + function Pair(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Pair key. + * @member {Uint8Array} key + * @memberof cosmos.base.kv.v1beta1.Pair + * @instance + */ + Pair.prototype.key = $util.newBuffer([]); + + /** + * Pair value. + * @member {Uint8Array} value + * @memberof cosmos.base.kv.v1beta1.Pair + * @instance + */ + Pair.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Pair instance using the specified properties. + * @function create + * @memberof cosmos.base.kv.v1beta1.Pair + * @static + * @param {cosmos.base.kv.v1beta1.IPair=} [properties] Properties to set + * @returns {cosmos.base.kv.v1beta1.Pair} Pair instance + */ + Pair.create = function create(properties) { + return new Pair(properties); + }; + + /** + * Encodes the specified Pair message. Does not implicitly {@link cosmos.base.kv.v1beta1.Pair.verify|verify} messages. + * @function encode + * @memberof cosmos.base.kv.v1beta1.Pair + * @static + * @param {cosmos.base.kv.v1beta1.IPair} message Pair message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Pair.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Pair message, length delimited. Does not implicitly {@link cosmos.base.kv.v1beta1.Pair.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.kv.v1beta1.Pair + * @static + * @param {cosmos.base.kv.v1beta1.IPair} message Pair message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Pair.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Pair message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.kv.v1beta1.Pair + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.kv.v1beta1.Pair} Pair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Pair.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.kv.v1beta1.Pair(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Pair message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.kv.v1beta1.Pair + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.kv.v1beta1.Pair} Pair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Pair.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Pair message. + * @function verify + * @memberof cosmos.base.kv.v1beta1.Pair + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Pair.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a Pair message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.kv.v1beta1.Pair + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.kv.v1beta1.Pair} Pair + */ + Pair.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.kv.v1beta1.Pair) + return object; + let message = new $root.cosmos.base.kv.v1beta1.Pair(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length) + message.key = object.key; + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a Pair message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.kv.v1beta1.Pair + * @static + * @param {cosmos.base.kv.v1beta1.Pair} message Pair + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Pair.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Pair to JSON. + * @function toJSON + * @memberof cosmos.base.kv.v1beta1.Pair + * @instance + * @returns {Object.} JSON object + */ + Pair.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Pair; + })(v1beta1.Pair || {}); + + return v1beta1; + })(kv.v1beta1 || {}); + + return kv; + })(base.kv || {}); + + /** + * Namespace query. + * @memberof cosmos.base + * @namespace + */ + + base.query = (function(query) { + + /** + * Namespace v1beta1. + * @memberof cosmos.base.query + * @namespace + */ + + query.v1beta1 = (function(v1beta1) { + + v1beta1.PageRequest = (function(PageRequest) { + + /** + * Properties of a PageRequest. + * @memberof cosmos.base.query.v1beta1 + * @interface IPageRequest + * @property {Uint8Array|null} [key] PageRequest key + * @property {number|Long|null} [offset] PageRequest offset + * @property {number|Long|null} [limit] PageRequest limit + * @property {boolean|null} [countTotal] PageRequest countTotal + */ + + /** + * Constructs a new PageRequest. + * @memberof cosmos.base.query.v1beta1 + * @classdesc Represents a PageRequest. + * @implements IPageRequest + * @constructor + * @param {cosmos.base.query.v1beta1.IPageRequest=} [properties] Properties to set + */ + function PageRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PageRequest key. + * @member {Uint8Array} key + * @memberof cosmos.base.query.v1beta1.PageRequest + * @instance + */ + PageRequest.prototype.key = $util.newBuffer([]); + + /** + * PageRequest offset. + * @member {number|Long} offset + * @memberof cosmos.base.query.v1beta1.PageRequest + * @instance + */ + PageRequest.prototype.offset = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * PageRequest limit. + * @member {number|Long} limit + * @memberof cosmos.base.query.v1beta1.PageRequest + * @instance + */ + PageRequest.prototype.limit = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * PageRequest countTotal. + * @member {boolean} countTotal + * @memberof cosmos.base.query.v1beta1.PageRequest + * @instance + */ + PageRequest.prototype.countTotal = false; + + /** + * Creates a new PageRequest instance using the specified properties. + * @function create + * @memberof cosmos.base.query.v1beta1.PageRequest + * @static + * @param {cosmos.base.query.v1beta1.IPageRequest=} [properties] Properties to set + * @returns {cosmos.base.query.v1beta1.PageRequest} PageRequest instance + */ + PageRequest.create = function create(properties) { + return new PageRequest(properties); + }; + + /** + * Encodes the specified PageRequest message. Does not implicitly {@link cosmos.base.query.v1beta1.PageRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.base.query.v1beta1.PageRequest + * @static + * @param {cosmos.base.query.v1beta1.IPageRequest} message PageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.offset); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.limit); + if (message.countTotal != null && Object.hasOwnProperty.call(message, "countTotal")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.countTotal); + return writer; + }; + + /** + * Encodes the specified PageRequest message, length delimited. Does not implicitly {@link cosmos.base.query.v1beta1.PageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.query.v1beta1.PageRequest + * @static + * @param {cosmos.base.query.v1beta1.IPageRequest} message PageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PageRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.query.v1beta1.PageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.query.v1beta1.PageRequest} PageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PageRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.query.v1beta1.PageRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.offset = reader.uint64(); + break; + case 3: + message.limit = reader.uint64(); + break; + case 4: + message.countTotal = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.query.v1beta1.PageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.query.v1beta1.PageRequest} PageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PageRequest message. + * @function verify + * @memberof cosmos.base.query.v1beta1.PageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + if (message.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset) && !(message.offset && $util.isInteger(message.offset.low) && $util.isInteger(message.offset.high))) + return "offset: integer|Long expected"; + if (message.limit != null && message.hasOwnProperty("limit")) + if (!$util.isInteger(message.limit) && !(message.limit && $util.isInteger(message.limit.low) && $util.isInteger(message.limit.high))) + return "limit: integer|Long expected"; + if (message.countTotal != null && message.hasOwnProperty("countTotal")) + if (typeof message.countTotal !== "boolean") + return "countTotal: boolean expected"; + return null; + }; + + /** + * Creates a PageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.query.v1beta1.PageRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.query.v1beta1.PageRequest} PageRequest + */ + PageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.query.v1beta1.PageRequest) + return object; + let message = new $root.cosmos.base.query.v1beta1.PageRequest(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length) + message.key = object.key; + if (object.offset != null) + if ($util.Long) + (message.offset = $util.Long.fromValue(object.offset)).unsigned = true; + else if (typeof object.offset === "string") + message.offset = parseInt(object.offset, 10); + else if (typeof object.offset === "number") + message.offset = object.offset; + else if (typeof object.offset === "object") + message.offset = new $util.LongBits(object.offset.low >>> 0, object.offset.high >>> 0).toNumber(true); + if (object.limit != null) + if ($util.Long) + (message.limit = $util.Long.fromValue(object.limit)).unsigned = true; + else if (typeof object.limit === "string") + message.limit = parseInt(object.limit, 10); + else if (typeof object.limit === "number") + message.limit = object.limit; + else if (typeof object.limit === "object") + message.limit = new $util.LongBits(object.limit.low >>> 0, object.limit.high >>> 0).toNumber(true); + if (object.countTotal != null) + message.countTotal = Boolean(object.countTotal); + return message; + }; + + /** + * Creates a plain object from a PageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.query.v1beta1.PageRequest + * @static + * @param {cosmos.base.query.v1beta1.PageRequest} message PageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.offset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.offset = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.limit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.limit = options.longs === String ? "0" : 0; + object.countTotal = false; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.offset != null && message.hasOwnProperty("offset")) + if (typeof message.offset === "number") + object.offset = options.longs === String ? String(message.offset) : message.offset; + else + object.offset = options.longs === String ? $util.Long.prototype.toString.call(message.offset) : options.longs === Number ? new $util.LongBits(message.offset.low >>> 0, message.offset.high >>> 0).toNumber(true) : message.offset; + if (message.limit != null && message.hasOwnProperty("limit")) + if (typeof message.limit === "number") + object.limit = options.longs === String ? String(message.limit) : message.limit; + else + object.limit = options.longs === String ? $util.Long.prototype.toString.call(message.limit) : options.longs === Number ? new $util.LongBits(message.limit.low >>> 0, message.limit.high >>> 0).toNumber(true) : message.limit; + if (message.countTotal != null && message.hasOwnProperty("countTotal")) + object.countTotal = message.countTotal; + return object; + }; + + /** + * Converts this PageRequest to JSON. + * @function toJSON + * @memberof cosmos.base.query.v1beta1.PageRequest + * @instance + * @returns {Object.} JSON object + */ + PageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PageRequest; + })(v1beta1.PageRequest || {}); + + v1beta1.PageResponse = (function(PageResponse) { + + /** + * Properties of a PageResponse. + * @memberof cosmos.base.query.v1beta1 + * @interface IPageResponse + * @property {Uint8Array|null} [nextKey] PageResponse nextKey + * @property {number|Long|null} [total] PageResponse total + */ + + /** + * Constructs a new PageResponse. + * @memberof cosmos.base.query.v1beta1 + * @classdesc Represents a PageResponse. + * @implements IPageResponse + * @constructor + * @param {cosmos.base.query.v1beta1.IPageResponse=} [properties] Properties to set + */ + function PageResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PageResponse nextKey. + * @member {Uint8Array} nextKey + * @memberof cosmos.base.query.v1beta1.PageResponse + * @instance + */ + PageResponse.prototype.nextKey = $util.newBuffer([]); + + /** + * PageResponse total. + * @member {number|Long} total + * @memberof cosmos.base.query.v1beta1.PageResponse + * @instance + */ + PageResponse.prototype.total = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PageResponse instance using the specified properties. + * @function create + * @memberof cosmos.base.query.v1beta1.PageResponse + * @static + * @param {cosmos.base.query.v1beta1.IPageResponse=} [properties] Properties to set + * @returns {cosmos.base.query.v1beta1.PageResponse} PageResponse instance + */ + PageResponse.create = function create(properties) { + return new PageResponse(properties); + }; + + /** + * Encodes the specified PageResponse message. Does not implicitly {@link cosmos.base.query.v1beta1.PageResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.base.query.v1beta1.PageResponse + * @static + * @param {cosmos.base.query.v1beta1.IPageResponse} message PageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PageResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nextKey != null && Object.hasOwnProperty.call(message, "nextKey")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.nextKey); + if (message.total != null && Object.hasOwnProperty.call(message, "total")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.total); + return writer; + }; + + /** + * Encodes the specified PageResponse message, length delimited. Does not implicitly {@link cosmos.base.query.v1beta1.PageResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.query.v1beta1.PageResponse + * @static + * @param {cosmos.base.query.v1beta1.IPageResponse} message PageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PageResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PageResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.query.v1beta1.PageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.query.v1beta1.PageResponse} PageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PageResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.query.v1beta1.PageResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nextKey = reader.bytes(); + break; + case 2: + message.total = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PageResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.query.v1beta1.PageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.query.v1beta1.PageResponse} PageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PageResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PageResponse message. + * @function verify + * @memberof cosmos.base.query.v1beta1.PageResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PageResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nextKey != null && message.hasOwnProperty("nextKey")) + if (!(message.nextKey && typeof message.nextKey.length === "number" || $util.isString(message.nextKey))) + return "nextKey: buffer expected"; + if (message.total != null && message.hasOwnProperty("total")) + if (!$util.isInteger(message.total) && !(message.total && $util.isInteger(message.total.low) && $util.isInteger(message.total.high))) + return "total: integer|Long expected"; + return null; + }; + + /** + * Creates a PageResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.query.v1beta1.PageResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.query.v1beta1.PageResponse} PageResponse + */ + PageResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.query.v1beta1.PageResponse) + return object; + let message = new $root.cosmos.base.query.v1beta1.PageResponse(); + if (object.nextKey != null) + if (typeof object.nextKey === "string") + $util.base64.decode(object.nextKey, message.nextKey = $util.newBuffer($util.base64.length(object.nextKey)), 0); + else if (object.nextKey.length) + message.nextKey = object.nextKey; + if (object.total != null) + if ($util.Long) + (message.total = $util.Long.fromValue(object.total)).unsigned = true; + else if (typeof object.total === "string") + message.total = parseInt(object.total, 10); + else if (typeof object.total === "number") + message.total = object.total; + else if (typeof object.total === "object") + message.total = new $util.LongBits(object.total.low >>> 0, object.total.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a PageResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.query.v1beta1.PageResponse + * @static + * @param {cosmos.base.query.v1beta1.PageResponse} message PageResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PageResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if (options.bytes === String) + object.nextKey = ""; + else { + object.nextKey = []; + if (options.bytes !== Array) + object.nextKey = $util.newBuffer(object.nextKey); + } + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.total = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.total = options.longs === String ? "0" : 0; + } + if (message.nextKey != null && message.hasOwnProperty("nextKey")) + object.nextKey = options.bytes === String ? $util.base64.encode(message.nextKey, 0, message.nextKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.nextKey) : message.nextKey; + if (message.total != null && message.hasOwnProperty("total")) + if (typeof message.total === "number") + object.total = options.longs === String ? String(message.total) : message.total; + else + object.total = options.longs === String ? $util.Long.prototype.toString.call(message.total) : options.longs === Number ? new $util.LongBits(message.total.low >>> 0, message.total.high >>> 0).toNumber(true) : message.total; + return object; + }; + + /** + * Converts this PageResponse to JSON. + * @function toJSON + * @memberof cosmos.base.query.v1beta1.PageResponse + * @instance + * @returns {Object.} JSON object + */ + PageResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PageResponse; + })(v1beta1.PageResponse || {}); + + return v1beta1; + })(query.v1beta1 || {}); + + return query; + })(base.query || {}); + + /** + * Namespace reflection. + * @memberof cosmos.base + * @namespace + */ + + base.reflection = (function(reflection) { + + /** + * Namespace v1beta1. + * @memberof cosmos.base.reflection + * @namespace + */ + + reflection.v1beta1 = (function(v1beta1) { + + v1beta1.ReflectionService = (function(ReflectionService) { + + /** + * Constructs a new ReflectionService service. + * @memberof cosmos.base.reflection.v1beta1 + * @classdesc Represents a ReflectionService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function ReflectionService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ReflectionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ReflectionService; + + /** + * Creates new ReflectionService service using the specified rpc implementation. + * @function create + * @memberof cosmos.base.reflection.v1beta1.ReflectionService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {ReflectionService} RPC service. Useful where requests and/or responses are streamed. + */ + ReflectionService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.base.reflection.v1beta1.ReflectionService#listAllInterfaces}. + * @memberof cosmos.base.reflection.v1beta1.ReflectionService + * @typedef ListAllInterfacesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.base.reflection.v1beta1.IListAllInterfacesResponse} [response] ListAllInterfacesResponse + */ + + /** + * Calls ListAllInterfaces. + * @function listAllInterfaces + * @memberof cosmos.base.reflection.v1beta1.ReflectionService + * @instance + * @param {cosmos.base.reflection.v1beta1.IListAllInterfacesRequest} request ListAllInterfacesRequest message or plain object + * @param {cosmos.base.reflection.v1beta1.ReflectionService.ListAllInterfacesCallback} callback Node-style callback called with the error, if any, and ListAllInterfacesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReflectionService.prototype.listAllInterfaces = function listAllInterfaces(request, callback) { + return this.rpcCall(listAllInterfaces, $root.cosmos.base.reflection.v1beta1.ListAllInterfacesRequest, $root.cosmos.base.reflection.v1beta1.ListAllInterfacesResponse, request, callback); + }, "name", { value: "ListAllInterfaces" }); + + /** + * Calls ListAllInterfaces. + * @function listAllInterfaces + * @memberof cosmos.base.reflection.v1beta1.ReflectionService + * @instance + * @param {cosmos.base.reflection.v1beta1.IListAllInterfacesRequest} request ListAllInterfacesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.base.reflection.v1beta1.ReflectionService#listImplementations}. + * @memberof cosmos.base.reflection.v1beta1.ReflectionService + * @typedef ListImplementationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.base.reflection.v1beta1.IListImplementationsResponse} [response] ListImplementationsResponse + */ + + /** + * Calls ListImplementations. + * @function listImplementations + * @memberof cosmos.base.reflection.v1beta1.ReflectionService + * @instance + * @param {cosmos.base.reflection.v1beta1.IListImplementationsRequest} request ListImplementationsRequest message or plain object + * @param {cosmos.base.reflection.v1beta1.ReflectionService.ListImplementationsCallback} callback Node-style callback called with the error, if any, and ListImplementationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReflectionService.prototype.listImplementations = function listImplementations(request, callback) { + return this.rpcCall(listImplementations, $root.cosmos.base.reflection.v1beta1.ListImplementationsRequest, $root.cosmos.base.reflection.v1beta1.ListImplementationsResponse, request, callback); + }, "name", { value: "ListImplementations" }); + + /** + * Calls ListImplementations. + * @function listImplementations + * @memberof cosmos.base.reflection.v1beta1.ReflectionService + * @instance + * @param {cosmos.base.reflection.v1beta1.IListImplementationsRequest} request ListImplementationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ReflectionService; + })(v1beta1.ReflectionService || {}); + + v1beta1.ListAllInterfacesRequest = (function(ListAllInterfacesRequest) { + + /** + * Properties of a ListAllInterfacesRequest. + * @memberof cosmos.base.reflection.v1beta1 + * @interface IListAllInterfacesRequest + */ + + /** + * Constructs a new ListAllInterfacesRequest. + * @memberof cosmos.base.reflection.v1beta1 + * @classdesc Represents a ListAllInterfacesRequest. + * @implements IListAllInterfacesRequest + * @constructor + * @param {cosmos.base.reflection.v1beta1.IListAllInterfacesRequest=} [properties] Properties to set + */ + function ListAllInterfacesRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new ListAllInterfacesRequest instance using the specified properties. + * @function create + * @memberof cosmos.base.reflection.v1beta1.ListAllInterfacesRequest + * @static + * @param {cosmos.base.reflection.v1beta1.IListAllInterfacesRequest=} [properties] Properties to set + * @returns {cosmos.base.reflection.v1beta1.ListAllInterfacesRequest} ListAllInterfacesRequest instance + */ + ListAllInterfacesRequest.create = function create(properties) { + return new ListAllInterfacesRequest(properties); + }; + + /** + * Encodes the specified ListAllInterfacesRequest message. Does not implicitly {@link cosmos.base.reflection.v1beta1.ListAllInterfacesRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.base.reflection.v1beta1.ListAllInterfacesRequest + * @static + * @param {cosmos.base.reflection.v1beta1.IListAllInterfacesRequest} message ListAllInterfacesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAllInterfacesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ListAllInterfacesRequest message, length delimited. Does not implicitly {@link cosmos.base.reflection.v1beta1.ListAllInterfacesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.reflection.v1beta1.ListAllInterfacesRequest + * @static + * @param {cosmos.base.reflection.v1beta1.IListAllInterfacesRequest} message ListAllInterfacesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAllInterfacesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAllInterfacesRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.reflection.v1beta1.ListAllInterfacesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.reflection.v1beta1.ListAllInterfacesRequest} ListAllInterfacesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAllInterfacesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.reflection.v1beta1.ListAllInterfacesRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAllInterfacesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.reflection.v1beta1.ListAllInterfacesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.reflection.v1beta1.ListAllInterfacesRequest} ListAllInterfacesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAllInterfacesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAllInterfacesRequest message. + * @function verify + * @memberof cosmos.base.reflection.v1beta1.ListAllInterfacesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAllInterfacesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a ListAllInterfacesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.reflection.v1beta1.ListAllInterfacesRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.reflection.v1beta1.ListAllInterfacesRequest} ListAllInterfacesRequest + */ + ListAllInterfacesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.reflection.v1beta1.ListAllInterfacesRequest) + return object; + return new $root.cosmos.base.reflection.v1beta1.ListAllInterfacesRequest(); + }; + + /** + * Creates a plain object from a ListAllInterfacesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.reflection.v1beta1.ListAllInterfacesRequest + * @static + * @param {cosmos.base.reflection.v1beta1.ListAllInterfacesRequest} message ListAllInterfacesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAllInterfacesRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ListAllInterfacesRequest to JSON. + * @function toJSON + * @memberof cosmos.base.reflection.v1beta1.ListAllInterfacesRequest + * @instance + * @returns {Object.} JSON object + */ + ListAllInterfacesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListAllInterfacesRequest; + })(v1beta1.ListAllInterfacesRequest || {}); + + v1beta1.ListAllInterfacesResponse = (function(ListAllInterfacesResponse) { + + /** + * Properties of a ListAllInterfacesResponse. + * @memberof cosmos.base.reflection.v1beta1 + * @interface IListAllInterfacesResponse + * @property {Array.|null} [interfaceNames] ListAllInterfacesResponse interfaceNames + */ + + /** + * Constructs a new ListAllInterfacesResponse. + * @memberof cosmos.base.reflection.v1beta1 + * @classdesc Represents a ListAllInterfacesResponse. + * @implements IListAllInterfacesResponse + * @constructor + * @param {cosmos.base.reflection.v1beta1.IListAllInterfacesResponse=} [properties] Properties to set + */ + function ListAllInterfacesResponse(properties) { + this.interfaceNames = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAllInterfacesResponse interfaceNames. + * @member {Array.} interfaceNames + * @memberof cosmos.base.reflection.v1beta1.ListAllInterfacesResponse + * @instance + */ + ListAllInterfacesResponse.prototype.interfaceNames = $util.emptyArray; + + /** + * Creates a new ListAllInterfacesResponse instance using the specified properties. + * @function create + * @memberof cosmos.base.reflection.v1beta1.ListAllInterfacesResponse + * @static + * @param {cosmos.base.reflection.v1beta1.IListAllInterfacesResponse=} [properties] Properties to set + * @returns {cosmos.base.reflection.v1beta1.ListAllInterfacesResponse} ListAllInterfacesResponse instance + */ + ListAllInterfacesResponse.create = function create(properties) { + return new ListAllInterfacesResponse(properties); + }; + + /** + * Encodes the specified ListAllInterfacesResponse message. Does not implicitly {@link cosmos.base.reflection.v1beta1.ListAllInterfacesResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.base.reflection.v1beta1.ListAllInterfacesResponse + * @static + * @param {cosmos.base.reflection.v1beta1.IListAllInterfacesResponse} message ListAllInterfacesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAllInterfacesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.interfaceNames != null && message.interfaceNames.length) + for (let i = 0; i < message.interfaceNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.interfaceNames[i]); + return writer; + }; + + /** + * Encodes the specified ListAllInterfacesResponse message, length delimited. Does not implicitly {@link cosmos.base.reflection.v1beta1.ListAllInterfacesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.reflection.v1beta1.ListAllInterfacesResponse + * @static + * @param {cosmos.base.reflection.v1beta1.IListAllInterfacesResponse} message ListAllInterfacesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAllInterfacesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAllInterfacesResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.reflection.v1beta1.ListAllInterfacesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.reflection.v1beta1.ListAllInterfacesResponse} ListAllInterfacesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAllInterfacesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.reflection.v1beta1.ListAllInterfacesResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.interfaceNames && message.interfaceNames.length)) + message.interfaceNames = []; + message.interfaceNames.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAllInterfacesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.reflection.v1beta1.ListAllInterfacesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.reflection.v1beta1.ListAllInterfacesResponse} ListAllInterfacesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAllInterfacesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAllInterfacesResponse message. + * @function verify + * @memberof cosmos.base.reflection.v1beta1.ListAllInterfacesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAllInterfacesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.interfaceNames != null && message.hasOwnProperty("interfaceNames")) { + if (!Array.isArray(message.interfaceNames)) + return "interfaceNames: array expected"; + for (let i = 0; i < message.interfaceNames.length; ++i) + if (!$util.isString(message.interfaceNames[i])) + return "interfaceNames: string[] expected"; + } + return null; + }; + + /** + * Creates a ListAllInterfacesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.reflection.v1beta1.ListAllInterfacesResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.reflection.v1beta1.ListAllInterfacesResponse} ListAllInterfacesResponse + */ + ListAllInterfacesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.reflection.v1beta1.ListAllInterfacesResponse) + return object; + let message = new $root.cosmos.base.reflection.v1beta1.ListAllInterfacesResponse(); + if (object.interfaceNames) { + if (!Array.isArray(object.interfaceNames)) + throw TypeError(".cosmos.base.reflection.v1beta1.ListAllInterfacesResponse.interfaceNames: array expected"); + message.interfaceNames = []; + for (let i = 0; i < object.interfaceNames.length; ++i) + message.interfaceNames[i] = String(object.interfaceNames[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListAllInterfacesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.reflection.v1beta1.ListAllInterfacesResponse + * @static + * @param {cosmos.base.reflection.v1beta1.ListAllInterfacesResponse} message ListAllInterfacesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAllInterfacesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.interfaceNames = []; + if (message.interfaceNames && message.interfaceNames.length) { + object.interfaceNames = []; + for (let j = 0; j < message.interfaceNames.length; ++j) + object.interfaceNames[j] = message.interfaceNames[j]; + } + return object; + }; + + /** + * Converts this ListAllInterfacesResponse to JSON. + * @function toJSON + * @memberof cosmos.base.reflection.v1beta1.ListAllInterfacesResponse + * @instance + * @returns {Object.} JSON object + */ + ListAllInterfacesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListAllInterfacesResponse; + })(v1beta1.ListAllInterfacesResponse || {}); + + v1beta1.ListImplementationsRequest = (function(ListImplementationsRequest) { + + /** + * Properties of a ListImplementationsRequest. + * @memberof cosmos.base.reflection.v1beta1 + * @interface IListImplementationsRequest + * @property {string|null} [interfaceName] ListImplementationsRequest interfaceName + */ + + /** + * Constructs a new ListImplementationsRequest. + * @memberof cosmos.base.reflection.v1beta1 + * @classdesc Represents a ListImplementationsRequest. + * @implements IListImplementationsRequest + * @constructor + * @param {cosmos.base.reflection.v1beta1.IListImplementationsRequest=} [properties] Properties to set + */ + function ListImplementationsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListImplementationsRequest interfaceName. + * @member {string} interfaceName + * @memberof cosmos.base.reflection.v1beta1.ListImplementationsRequest + * @instance + */ + ListImplementationsRequest.prototype.interfaceName = ""; + + /** + * Creates a new ListImplementationsRequest instance using the specified properties. + * @function create + * @memberof cosmos.base.reflection.v1beta1.ListImplementationsRequest + * @static + * @param {cosmos.base.reflection.v1beta1.IListImplementationsRequest=} [properties] Properties to set + * @returns {cosmos.base.reflection.v1beta1.ListImplementationsRequest} ListImplementationsRequest instance + */ + ListImplementationsRequest.create = function create(properties) { + return new ListImplementationsRequest(properties); + }; + + /** + * Encodes the specified ListImplementationsRequest message. Does not implicitly {@link cosmos.base.reflection.v1beta1.ListImplementationsRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.base.reflection.v1beta1.ListImplementationsRequest + * @static + * @param {cosmos.base.reflection.v1beta1.IListImplementationsRequest} message ListImplementationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListImplementationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.interfaceName != null && Object.hasOwnProperty.call(message, "interfaceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.interfaceName); + return writer; + }; + + /** + * Encodes the specified ListImplementationsRequest message, length delimited. Does not implicitly {@link cosmos.base.reflection.v1beta1.ListImplementationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.reflection.v1beta1.ListImplementationsRequest + * @static + * @param {cosmos.base.reflection.v1beta1.IListImplementationsRequest} message ListImplementationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListImplementationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListImplementationsRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.reflection.v1beta1.ListImplementationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.reflection.v1beta1.ListImplementationsRequest} ListImplementationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListImplementationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.reflection.v1beta1.ListImplementationsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.interfaceName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListImplementationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.reflection.v1beta1.ListImplementationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.reflection.v1beta1.ListImplementationsRequest} ListImplementationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListImplementationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListImplementationsRequest message. + * @function verify + * @memberof cosmos.base.reflection.v1beta1.ListImplementationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListImplementationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.interfaceName != null && message.hasOwnProperty("interfaceName")) + if (!$util.isString(message.interfaceName)) + return "interfaceName: string expected"; + return null; + }; + + /** + * Creates a ListImplementationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.reflection.v1beta1.ListImplementationsRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.reflection.v1beta1.ListImplementationsRequest} ListImplementationsRequest + */ + ListImplementationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.reflection.v1beta1.ListImplementationsRequest) + return object; + let message = new $root.cosmos.base.reflection.v1beta1.ListImplementationsRequest(); + if (object.interfaceName != null) + message.interfaceName = String(object.interfaceName); + return message; + }; + + /** + * Creates a plain object from a ListImplementationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.reflection.v1beta1.ListImplementationsRequest + * @static + * @param {cosmos.base.reflection.v1beta1.ListImplementationsRequest} message ListImplementationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListImplementationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.interfaceName = ""; + if (message.interfaceName != null && message.hasOwnProperty("interfaceName")) + object.interfaceName = message.interfaceName; + return object; + }; + + /** + * Converts this ListImplementationsRequest to JSON. + * @function toJSON + * @memberof cosmos.base.reflection.v1beta1.ListImplementationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListImplementationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListImplementationsRequest; + })(v1beta1.ListImplementationsRequest || {}); + + v1beta1.ListImplementationsResponse = (function(ListImplementationsResponse) { + + /** + * Properties of a ListImplementationsResponse. + * @memberof cosmos.base.reflection.v1beta1 + * @interface IListImplementationsResponse + * @property {Array.|null} [implementationMessageNames] ListImplementationsResponse implementationMessageNames + */ + + /** + * Constructs a new ListImplementationsResponse. + * @memberof cosmos.base.reflection.v1beta1 + * @classdesc Represents a ListImplementationsResponse. + * @implements IListImplementationsResponse + * @constructor + * @param {cosmos.base.reflection.v1beta1.IListImplementationsResponse=} [properties] Properties to set + */ + function ListImplementationsResponse(properties) { + this.implementationMessageNames = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListImplementationsResponse implementationMessageNames. + * @member {Array.} implementationMessageNames + * @memberof cosmos.base.reflection.v1beta1.ListImplementationsResponse + * @instance + */ + ListImplementationsResponse.prototype.implementationMessageNames = $util.emptyArray; + + /** + * Creates a new ListImplementationsResponse instance using the specified properties. + * @function create + * @memberof cosmos.base.reflection.v1beta1.ListImplementationsResponse + * @static + * @param {cosmos.base.reflection.v1beta1.IListImplementationsResponse=} [properties] Properties to set + * @returns {cosmos.base.reflection.v1beta1.ListImplementationsResponse} ListImplementationsResponse instance + */ + ListImplementationsResponse.create = function create(properties) { + return new ListImplementationsResponse(properties); + }; + + /** + * Encodes the specified ListImplementationsResponse message. Does not implicitly {@link cosmos.base.reflection.v1beta1.ListImplementationsResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.base.reflection.v1beta1.ListImplementationsResponse + * @static + * @param {cosmos.base.reflection.v1beta1.IListImplementationsResponse} message ListImplementationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListImplementationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.implementationMessageNames != null && message.implementationMessageNames.length) + for (let i = 0; i < message.implementationMessageNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.implementationMessageNames[i]); + return writer; + }; + + /** + * Encodes the specified ListImplementationsResponse message, length delimited. Does not implicitly {@link cosmos.base.reflection.v1beta1.ListImplementationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.reflection.v1beta1.ListImplementationsResponse + * @static + * @param {cosmos.base.reflection.v1beta1.IListImplementationsResponse} message ListImplementationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListImplementationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListImplementationsResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.reflection.v1beta1.ListImplementationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.reflection.v1beta1.ListImplementationsResponse} ListImplementationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListImplementationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.reflection.v1beta1.ListImplementationsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.implementationMessageNames && message.implementationMessageNames.length)) + message.implementationMessageNames = []; + message.implementationMessageNames.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListImplementationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.reflection.v1beta1.ListImplementationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.reflection.v1beta1.ListImplementationsResponse} ListImplementationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListImplementationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListImplementationsResponse message. + * @function verify + * @memberof cosmos.base.reflection.v1beta1.ListImplementationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListImplementationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.implementationMessageNames != null && message.hasOwnProperty("implementationMessageNames")) { + if (!Array.isArray(message.implementationMessageNames)) + return "implementationMessageNames: array expected"; + for (let i = 0; i < message.implementationMessageNames.length; ++i) + if (!$util.isString(message.implementationMessageNames[i])) + return "implementationMessageNames: string[] expected"; + } + return null; + }; + + /** + * Creates a ListImplementationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.reflection.v1beta1.ListImplementationsResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.reflection.v1beta1.ListImplementationsResponse} ListImplementationsResponse + */ + ListImplementationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.reflection.v1beta1.ListImplementationsResponse) + return object; + let message = new $root.cosmos.base.reflection.v1beta1.ListImplementationsResponse(); + if (object.implementationMessageNames) { + if (!Array.isArray(object.implementationMessageNames)) + throw TypeError(".cosmos.base.reflection.v1beta1.ListImplementationsResponse.implementationMessageNames: array expected"); + message.implementationMessageNames = []; + for (let i = 0; i < object.implementationMessageNames.length; ++i) + message.implementationMessageNames[i] = String(object.implementationMessageNames[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListImplementationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.reflection.v1beta1.ListImplementationsResponse + * @static + * @param {cosmos.base.reflection.v1beta1.ListImplementationsResponse} message ListImplementationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListImplementationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.implementationMessageNames = []; + if (message.implementationMessageNames && message.implementationMessageNames.length) { + object.implementationMessageNames = []; + for (let j = 0; j < message.implementationMessageNames.length; ++j) + object.implementationMessageNames[j] = message.implementationMessageNames[j]; + } + return object; + }; + + /** + * Converts this ListImplementationsResponse to JSON. + * @function toJSON + * @memberof cosmos.base.reflection.v1beta1.ListImplementationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListImplementationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListImplementationsResponse; + })(v1beta1.ListImplementationsResponse || {}); + + return v1beta1; + })(reflection.v1beta1 || {}); + + return reflection; + })(base.reflection || {}); + + /** + * Namespace snapshots. + * @memberof cosmos.base + * @namespace + */ + + base.snapshots = (function(snapshots) { + + /** + * Namespace v1beta1. + * @memberof cosmos.base.snapshots + * @namespace + */ + + snapshots.v1beta1 = (function(v1beta1) { + + v1beta1.Snapshot = (function(Snapshot) { + + /** + * Properties of a Snapshot. + * @memberof cosmos.base.snapshots.v1beta1 + * @interface ISnapshot + * @property {number|Long|null} [height] Snapshot height + * @property {number|null} [format] Snapshot format + * @property {number|null} [chunks] Snapshot chunks + * @property {Uint8Array|null} [hash] Snapshot hash + * @property {cosmos.base.snapshots.v1beta1.IMetadata|null} [metadata] Snapshot metadata + */ + + /** + * Constructs a new Snapshot. + * @memberof cosmos.base.snapshots.v1beta1 + * @classdesc Represents a Snapshot. + * @implements ISnapshot + * @constructor + * @param {cosmos.base.snapshots.v1beta1.ISnapshot=} [properties] Properties to set + */ + function Snapshot(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Snapshot height. + * @member {number|Long} height + * @memberof cosmos.base.snapshots.v1beta1.Snapshot + * @instance + */ + Snapshot.prototype.height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Snapshot format. + * @member {number} format + * @memberof cosmos.base.snapshots.v1beta1.Snapshot + * @instance + */ + Snapshot.prototype.format = 0; + + /** + * Snapshot chunks. + * @member {number} chunks + * @memberof cosmos.base.snapshots.v1beta1.Snapshot + * @instance + */ + Snapshot.prototype.chunks = 0; + + /** + * Snapshot hash. + * @member {Uint8Array} hash + * @memberof cosmos.base.snapshots.v1beta1.Snapshot + * @instance + */ + Snapshot.prototype.hash = $util.newBuffer([]); + + /** + * Snapshot metadata. + * @member {cosmos.base.snapshots.v1beta1.IMetadata|null|undefined} metadata + * @memberof cosmos.base.snapshots.v1beta1.Snapshot + * @instance + */ + Snapshot.prototype.metadata = null; + + /** + * Creates a new Snapshot instance using the specified properties. + * @function create + * @memberof cosmos.base.snapshots.v1beta1.Snapshot + * @static + * @param {cosmos.base.snapshots.v1beta1.ISnapshot=} [properties] Properties to set + * @returns {cosmos.base.snapshots.v1beta1.Snapshot} Snapshot instance + */ + Snapshot.create = function create(properties) { + return new Snapshot(properties); + }; + + /** + * Encodes the specified Snapshot message. Does not implicitly {@link cosmos.base.snapshots.v1beta1.Snapshot.verify|verify} messages. + * @function encode + * @memberof cosmos.base.snapshots.v1beta1.Snapshot + * @static + * @param {cosmos.base.snapshots.v1beta1.ISnapshot} message Snapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Snapshot.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.height); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.format); + if (message.chunks != null && Object.hasOwnProperty.call(message, "chunks")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.chunks); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.hash); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.cosmos.base.snapshots.v1beta1.Metadata.encode(message.metadata, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Snapshot message, length delimited. Does not implicitly {@link cosmos.base.snapshots.v1beta1.Snapshot.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.snapshots.v1beta1.Snapshot + * @static + * @param {cosmos.base.snapshots.v1beta1.ISnapshot} message Snapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Snapshot.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Snapshot message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.snapshots.v1beta1.Snapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.snapshots.v1beta1.Snapshot} Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Snapshot.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.snapshots.v1beta1.Snapshot(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.uint64(); + break; + case 2: + message.format = reader.uint32(); + break; + case 3: + message.chunks = reader.uint32(); + break; + case 4: + message.hash = reader.bytes(); + break; + case 5: + message.metadata = $root.cosmos.base.snapshots.v1beta1.Metadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Snapshot message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.snapshots.v1beta1.Snapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.snapshots.v1beta1.Snapshot} Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Snapshot.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Snapshot message. + * @function verify + * @memberof cosmos.base.snapshots.v1beta1.Snapshot + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Snapshot.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.format != null && message.hasOwnProperty("format")) + if (!$util.isInteger(message.format)) + return "format: integer expected"; + if (message.chunks != null && message.hasOwnProperty("chunks")) + if (!$util.isInteger(message.chunks)) + return "chunks: integer expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash))) + return "hash: buffer expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + let error = $root.cosmos.base.snapshots.v1beta1.Metadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a Snapshot message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.snapshots.v1beta1.Snapshot + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.snapshots.v1beta1.Snapshot} Snapshot + */ + Snapshot.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.snapshots.v1beta1.Snapshot) + return object; + let message = new $root.cosmos.base.snapshots.v1beta1.Snapshot(); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = true; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(true); + if (object.format != null) + message.format = object.format >>> 0; + if (object.chunks != null) + message.chunks = object.chunks >>> 0; + if (object.hash != null) + if (typeof object.hash === "string") + $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0); + else if (object.hash.length) + message.hash = object.hash; + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".cosmos.base.snapshots.v1beta1.Snapshot.metadata: object expected"); + message.metadata = $root.cosmos.base.snapshots.v1beta1.Metadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a Snapshot message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.snapshots.v1beta1.Snapshot + * @static + * @param {cosmos.base.snapshots.v1beta1.Snapshot} message Snapshot + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Snapshot.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.format = 0; + object.chunks = 0; + if (options.bytes === String) + object.hash = ""; + else { + object.hash = []; + if (options.bytes !== Array) + object.hash = $util.newBuffer(object.hash); + } + object.metadata = null; + } + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber(true) : message.height; + if (message.format != null && message.hasOwnProperty("format")) + object.format = message.format; + if (message.chunks != null && message.hasOwnProperty("chunks")) + object.chunks = message.chunks; + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.cosmos.base.snapshots.v1beta1.Metadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this Snapshot to JSON. + * @function toJSON + * @memberof cosmos.base.snapshots.v1beta1.Snapshot + * @instance + * @returns {Object.} JSON object + */ + Snapshot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Snapshot; + })(v1beta1.Snapshot || {}); + + v1beta1.Metadata = (function(Metadata) { + + /** + * Properties of a Metadata. + * @memberof cosmos.base.snapshots.v1beta1 + * @interface IMetadata + * @property {Array.|null} [chunkHashes] Metadata chunkHashes + */ + + /** + * Constructs a new Metadata. + * @memberof cosmos.base.snapshots.v1beta1 + * @classdesc Represents a Metadata. + * @implements IMetadata + * @constructor + * @param {cosmos.base.snapshots.v1beta1.IMetadata=} [properties] Properties to set + */ + function Metadata(properties) { + this.chunkHashes = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Metadata chunkHashes. + * @member {Array.} chunkHashes + * @memberof cosmos.base.snapshots.v1beta1.Metadata + * @instance + */ + Metadata.prototype.chunkHashes = $util.emptyArray; + + /** + * Creates a new Metadata instance using the specified properties. + * @function create + * @memberof cosmos.base.snapshots.v1beta1.Metadata + * @static + * @param {cosmos.base.snapshots.v1beta1.IMetadata=} [properties] Properties to set + * @returns {cosmos.base.snapshots.v1beta1.Metadata} Metadata instance + */ + Metadata.create = function create(properties) { + return new Metadata(properties); + }; + + /** + * Encodes the specified Metadata message. Does not implicitly {@link cosmos.base.snapshots.v1beta1.Metadata.verify|verify} messages. + * @function encode + * @memberof cosmos.base.snapshots.v1beta1.Metadata + * @static + * @param {cosmos.base.snapshots.v1beta1.IMetadata} message Metadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.chunkHashes != null && message.chunkHashes.length) + for (let i = 0; i < message.chunkHashes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.chunkHashes[i]); + return writer; + }; + + /** + * Encodes the specified Metadata message, length delimited. Does not implicitly {@link cosmos.base.snapshots.v1beta1.Metadata.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.snapshots.v1beta1.Metadata + * @static + * @param {cosmos.base.snapshots.v1beta1.IMetadata} message Metadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Metadata message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.snapshots.v1beta1.Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.snapshots.v1beta1.Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.snapshots.v1beta1.Metadata(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.chunkHashes && message.chunkHashes.length)) + message.chunkHashes = []; + message.chunkHashes.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Metadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.snapshots.v1beta1.Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.snapshots.v1beta1.Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Metadata message. + * @function verify + * @memberof cosmos.base.snapshots.v1beta1.Metadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Metadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.chunkHashes != null && message.hasOwnProperty("chunkHashes")) { + if (!Array.isArray(message.chunkHashes)) + return "chunkHashes: array expected"; + for (let i = 0; i < message.chunkHashes.length; ++i) + if (!(message.chunkHashes[i] && typeof message.chunkHashes[i].length === "number" || $util.isString(message.chunkHashes[i]))) + return "chunkHashes: buffer[] expected"; + } + return null; + }; + + /** + * Creates a Metadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.snapshots.v1beta1.Metadata + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.snapshots.v1beta1.Metadata} Metadata + */ + Metadata.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.snapshots.v1beta1.Metadata) + return object; + let message = new $root.cosmos.base.snapshots.v1beta1.Metadata(); + if (object.chunkHashes) { + if (!Array.isArray(object.chunkHashes)) + throw TypeError(".cosmos.base.snapshots.v1beta1.Metadata.chunkHashes: array expected"); + message.chunkHashes = []; + for (let i = 0; i < object.chunkHashes.length; ++i) + if (typeof object.chunkHashes[i] === "string") + $util.base64.decode(object.chunkHashes[i], message.chunkHashes[i] = $util.newBuffer($util.base64.length(object.chunkHashes[i])), 0); + else if (object.chunkHashes[i].length) + message.chunkHashes[i] = object.chunkHashes[i]; + } + return message; + }; + + /** + * Creates a plain object from a Metadata message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.snapshots.v1beta1.Metadata + * @static + * @param {cosmos.base.snapshots.v1beta1.Metadata} message Metadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Metadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.chunkHashes = []; + if (message.chunkHashes && message.chunkHashes.length) { + object.chunkHashes = []; + for (let j = 0; j < message.chunkHashes.length; ++j) + object.chunkHashes[j] = options.bytes === String ? $util.base64.encode(message.chunkHashes[j], 0, message.chunkHashes[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.chunkHashes[j]) : message.chunkHashes[j]; + } + return object; + }; + + /** + * Converts this Metadata to JSON. + * @function toJSON + * @memberof cosmos.base.snapshots.v1beta1.Metadata + * @instance + * @returns {Object.} JSON object + */ + Metadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Metadata; + })(v1beta1.Metadata || {}); + + return v1beta1; + })(snapshots.v1beta1 || {}); + + return snapshots; + })(base.snapshots || {}); + + /** + * Namespace store. + * @memberof cosmos.base + * @namespace + */ + + base.store = (function(store) { + + /** + * Namespace v1beta1. + * @memberof cosmos.base.store + * @namespace + */ + + store.v1beta1 = (function(v1beta1) { + + v1beta1.CommitInfo = (function(CommitInfo) { + + /** + * Properties of a CommitInfo. + * @memberof cosmos.base.store.v1beta1 + * @interface ICommitInfo + * @property {number|Long|null} [version] CommitInfo version + * @property {Array.|null} [storeInfos] CommitInfo storeInfos + */ + + /** + * Constructs a new CommitInfo. + * @memberof cosmos.base.store.v1beta1 + * @classdesc Represents a CommitInfo. + * @implements ICommitInfo + * @constructor + * @param {cosmos.base.store.v1beta1.ICommitInfo=} [properties] Properties to set + */ + function CommitInfo(properties) { + this.storeInfos = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommitInfo version. + * @member {number|Long} version + * @memberof cosmos.base.store.v1beta1.CommitInfo + * @instance + */ + CommitInfo.prototype.version = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * CommitInfo storeInfos. + * @member {Array.} storeInfos + * @memberof cosmos.base.store.v1beta1.CommitInfo + * @instance + */ + CommitInfo.prototype.storeInfos = $util.emptyArray; + + /** + * Creates a new CommitInfo instance using the specified properties. + * @function create + * @memberof cosmos.base.store.v1beta1.CommitInfo + * @static + * @param {cosmos.base.store.v1beta1.ICommitInfo=} [properties] Properties to set + * @returns {cosmos.base.store.v1beta1.CommitInfo} CommitInfo instance + */ + CommitInfo.create = function create(properties) { + return new CommitInfo(properties); + }; + + /** + * Encodes the specified CommitInfo message. Does not implicitly {@link cosmos.base.store.v1beta1.CommitInfo.verify|verify} messages. + * @function encode + * @memberof cosmos.base.store.v1beta1.CommitInfo + * @static + * @param {cosmos.base.store.v1beta1.ICommitInfo} message CommitInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.version); + if (message.storeInfos != null && message.storeInfos.length) + for (let i = 0; i < message.storeInfos.length; ++i) + $root.cosmos.base.store.v1beta1.StoreInfo.encode(message.storeInfos[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CommitInfo message, length delimited. Does not implicitly {@link cosmos.base.store.v1beta1.CommitInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.store.v1beta1.CommitInfo + * @static + * @param {cosmos.base.store.v1beta1.ICommitInfo} message CommitInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommitInfo message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.store.v1beta1.CommitInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.store.v1beta1.CommitInfo} CommitInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.store.v1beta1.CommitInfo(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.int64(); + break; + case 2: + if (!(message.storeInfos && message.storeInfos.length)) + message.storeInfos = []; + message.storeInfos.push($root.cosmos.base.store.v1beta1.StoreInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommitInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.store.v1beta1.CommitInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.store.v1beta1.CommitInfo} CommitInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommitInfo message. + * @function verify + * @memberof cosmos.base.store.v1beta1.CommitInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommitInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version) && !(message.version && $util.isInteger(message.version.low) && $util.isInteger(message.version.high))) + return "version: integer|Long expected"; + if (message.storeInfos != null && message.hasOwnProperty("storeInfos")) { + if (!Array.isArray(message.storeInfos)) + return "storeInfos: array expected"; + for (let i = 0; i < message.storeInfos.length; ++i) { + let error = $root.cosmos.base.store.v1beta1.StoreInfo.verify(message.storeInfos[i]); + if (error) + return "storeInfos." + error; + } + } + return null; + }; + + /** + * Creates a CommitInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.store.v1beta1.CommitInfo + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.store.v1beta1.CommitInfo} CommitInfo + */ + CommitInfo.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.store.v1beta1.CommitInfo) + return object; + let message = new $root.cosmos.base.store.v1beta1.CommitInfo(); + if (object.version != null) + if ($util.Long) + (message.version = $util.Long.fromValue(object.version)).unsigned = false; + else if (typeof object.version === "string") + message.version = parseInt(object.version, 10); + else if (typeof object.version === "number") + message.version = object.version; + else if (typeof object.version === "object") + message.version = new $util.LongBits(object.version.low >>> 0, object.version.high >>> 0).toNumber(); + if (object.storeInfos) { + if (!Array.isArray(object.storeInfos)) + throw TypeError(".cosmos.base.store.v1beta1.CommitInfo.storeInfos: array expected"); + message.storeInfos = []; + for (let i = 0; i < object.storeInfos.length; ++i) { + if (typeof object.storeInfos[i] !== "object") + throw TypeError(".cosmos.base.store.v1beta1.CommitInfo.storeInfos: object expected"); + message.storeInfos[i] = $root.cosmos.base.store.v1beta1.StoreInfo.fromObject(object.storeInfos[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CommitInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.store.v1beta1.CommitInfo + * @static + * @param {cosmos.base.store.v1beta1.CommitInfo} message CommitInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommitInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.storeInfos = []; + if (options.defaults) + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.version = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.version = options.longs === String ? "0" : 0; + if (message.version != null && message.hasOwnProperty("version")) + if (typeof message.version === "number") + object.version = options.longs === String ? String(message.version) : message.version; + else + object.version = options.longs === String ? $util.Long.prototype.toString.call(message.version) : options.longs === Number ? new $util.LongBits(message.version.low >>> 0, message.version.high >>> 0).toNumber() : message.version; + if (message.storeInfos && message.storeInfos.length) { + object.storeInfos = []; + for (let j = 0; j < message.storeInfos.length; ++j) + object.storeInfos[j] = $root.cosmos.base.store.v1beta1.StoreInfo.toObject(message.storeInfos[j], options); + } + return object; + }; + + /** + * Converts this CommitInfo to JSON. + * @function toJSON + * @memberof cosmos.base.store.v1beta1.CommitInfo + * @instance + * @returns {Object.} JSON object + */ + CommitInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CommitInfo; + })(v1beta1.CommitInfo || {}); + + v1beta1.StoreInfo = (function(StoreInfo) { + + /** + * Properties of a StoreInfo. + * @memberof cosmos.base.store.v1beta1 + * @interface IStoreInfo + * @property {string|null} [name] StoreInfo name + * @property {cosmos.base.store.v1beta1.ICommitID|null} [commitId] StoreInfo commitId + */ + + /** + * Constructs a new StoreInfo. + * @memberof cosmos.base.store.v1beta1 + * @classdesc Represents a StoreInfo. + * @implements IStoreInfo + * @constructor + * @param {cosmos.base.store.v1beta1.IStoreInfo=} [properties] Properties to set + */ + function StoreInfo(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StoreInfo name. + * @member {string} name + * @memberof cosmos.base.store.v1beta1.StoreInfo + * @instance + */ + StoreInfo.prototype.name = ""; + + /** + * StoreInfo commitId. + * @member {cosmos.base.store.v1beta1.ICommitID|null|undefined} commitId + * @memberof cosmos.base.store.v1beta1.StoreInfo + * @instance + */ + StoreInfo.prototype.commitId = null; + + /** + * Creates a new StoreInfo instance using the specified properties. + * @function create + * @memberof cosmos.base.store.v1beta1.StoreInfo + * @static + * @param {cosmos.base.store.v1beta1.IStoreInfo=} [properties] Properties to set + * @returns {cosmos.base.store.v1beta1.StoreInfo} StoreInfo instance + */ + StoreInfo.create = function create(properties) { + return new StoreInfo(properties); + }; + + /** + * Encodes the specified StoreInfo message. Does not implicitly {@link cosmos.base.store.v1beta1.StoreInfo.verify|verify} messages. + * @function encode + * @memberof cosmos.base.store.v1beta1.StoreInfo + * @static + * @param {cosmos.base.store.v1beta1.IStoreInfo} message StoreInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StoreInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.commitId != null && Object.hasOwnProperty.call(message, "commitId")) + $root.cosmos.base.store.v1beta1.CommitID.encode(message.commitId, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StoreInfo message, length delimited. Does not implicitly {@link cosmos.base.store.v1beta1.StoreInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.store.v1beta1.StoreInfo + * @static + * @param {cosmos.base.store.v1beta1.IStoreInfo} message StoreInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StoreInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StoreInfo message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.store.v1beta1.StoreInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.store.v1beta1.StoreInfo} StoreInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StoreInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.store.v1beta1.StoreInfo(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.commitId = $root.cosmos.base.store.v1beta1.CommitID.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StoreInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.store.v1beta1.StoreInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.store.v1beta1.StoreInfo} StoreInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StoreInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StoreInfo message. + * @function verify + * @memberof cosmos.base.store.v1beta1.StoreInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StoreInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.commitId != null && message.hasOwnProperty("commitId")) { + let error = $root.cosmos.base.store.v1beta1.CommitID.verify(message.commitId); + if (error) + return "commitId." + error; + } + return null; + }; + + /** + * Creates a StoreInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.store.v1beta1.StoreInfo + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.store.v1beta1.StoreInfo} StoreInfo + */ + StoreInfo.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.store.v1beta1.StoreInfo) + return object; + let message = new $root.cosmos.base.store.v1beta1.StoreInfo(); + if (object.name != null) + message.name = String(object.name); + if (object.commitId != null) { + if (typeof object.commitId !== "object") + throw TypeError(".cosmos.base.store.v1beta1.StoreInfo.commitId: object expected"); + message.commitId = $root.cosmos.base.store.v1beta1.CommitID.fromObject(object.commitId); + } + return message; + }; + + /** + * Creates a plain object from a StoreInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.store.v1beta1.StoreInfo + * @static + * @param {cosmos.base.store.v1beta1.StoreInfo} message StoreInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StoreInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.name = ""; + object.commitId = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.commitId != null && message.hasOwnProperty("commitId")) + object.commitId = $root.cosmos.base.store.v1beta1.CommitID.toObject(message.commitId, options); + return object; + }; + + /** + * Converts this StoreInfo to JSON. + * @function toJSON + * @memberof cosmos.base.store.v1beta1.StoreInfo + * @instance + * @returns {Object.} JSON object + */ + StoreInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StoreInfo; + })(v1beta1.StoreInfo || {}); + + v1beta1.CommitID = (function(CommitID) { + + /** + * Properties of a CommitID. + * @memberof cosmos.base.store.v1beta1 + * @interface ICommitID + * @property {number|Long|null} [version] CommitID version + * @property {Uint8Array|null} [hash] CommitID hash + */ + + /** + * Constructs a new CommitID. + * @memberof cosmos.base.store.v1beta1 + * @classdesc Represents a CommitID. + * @implements ICommitID + * @constructor + * @param {cosmos.base.store.v1beta1.ICommitID=} [properties] Properties to set + */ + function CommitID(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommitID version. + * @member {number|Long} version + * @memberof cosmos.base.store.v1beta1.CommitID + * @instance + */ + CommitID.prototype.version = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * CommitID hash. + * @member {Uint8Array} hash + * @memberof cosmos.base.store.v1beta1.CommitID + * @instance + */ + CommitID.prototype.hash = $util.newBuffer([]); + + /** + * Creates a new CommitID instance using the specified properties. + * @function create + * @memberof cosmos.base.store.v1beta1.CommitID + * @static + * @param {cosmos.base.store.v1beta1.ICommitID=} [properties] Properties to set + * @returns {cosmos.base.store.v1beta1.CommitID} CommitID instance + */ + CommitID.create = function create(properties) { + return new CommitID(properties); + }; + + /** + * Encodes the specified CommitID message. Does not implicitly {@link cosmos.base.store.v1beta1.CommitID.verify|verify} messages. + * @function encode + * @memberof cosmos.base.store.v1beta1.CommitID + * @static + * @param {cosmos.base.store.v1beta1.ICommitID} message CommitID message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitID.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.version); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.hash); + return writer; + }; + + /** + * Encodes the specified CommitID message, length delimited. Does not implicitly {@link cosmos.base.store.v1beta1.CommitID.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.store.v1beta1.CommitID + * @static + * @param {cosmos.base.store.v1beta1.ICommitID} message CommitID message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitID.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommitID message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.store.v1beta1.CommitID + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.store.v1beta1.CommitID} CommitID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitID.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.store.v1beta1.CommitID(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.int64(); + break; + case 2: + message.hash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommitID message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.store.v1beta1.CommitID + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.store.v1beta1.CommitID} CommitID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitID.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommitID message. + * @function verify + * @memberof cosmos.base.store.v1beta1.CommitID + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommitID.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version) && !(message.version && $util.isInteger(message.version.low) && $util.isInteger(message.version.high))) + return "version: integer|Long expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash))) + return "hash: buffer expected"; + return null; + }; + + /** + * Creates a CommitID message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.store.v1beta1.CommitID + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.store.v1beta1.CommitID} CommitID + */ + CommitID.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.store.v1beta1.CommitID) + return object; + let message = new $root.cosmos.base.store.v1beta1.CommitID(); + if (object.version != null) + if ($util.Long) + (message.version = $util.Long.fromValue(object.version)).unsigned = false; + else if (typeof object.version === "string") + message.version = parseInt(object.version, 10); + else if (typeof object.version === "number") + message.version = object.version; + else if (typeof object.version === "object") + message.version = new $util.LongBits(object.version.low >>> 0, object.version.high >>> 0).toNumber(); + if (object.hash != null) + if (typeof object.hash === "string") + $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0); + else if (object.hash.length) + message.hash = object.hash; + return message; + }; + + /** + * Creates a plain object from a CommitID message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.store.v1beta1.CommitID + * @static + * @param {cosmos.base.store.v1beta1.CommitID} message CommitID + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommitID.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.version = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.version = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.hash = ""; + else { + object.hash = []; + if (options.bytes !== Array) + object.hash = $util.newBuffer(object.hash); + } + } + if (message.version != null && message.hasOwnProperty("version")) + if (typeof message.version === "number") + object.version = options.longs === String ? String(message.version) : message.version; + else + object.version = options.longs === String ? $util.Long.prototype.toString.call(message.version) : options.longs === Number ? new $util.LongBits(message.version.low >>> 0, message.version.high >>> 0).toNumber() : message.version; + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash; + return object; + }; + + /** + * Converts this CommitID to JSON. + * @function toJSON + * @memberof cosmos.base.store.v1beta1.CommitID + * @instance + * @returns {Object.} JSON object + */ + CommitID.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CommitID; + })(v1beta1.CommitID || {}); + + v1beta1.SnapshotItem = (function(SnapshotItem) { + + /** + * Properties of a SnapshotItem. + * @memberof cosmos.base.store.v1beta1 + * @interface ISnapshotItem + * @property {cosmos.base.store.v1beta1.ISnapshotStoreItem|null} [store] SnapshotItem store + * @property {cosmos.base.store.v1beta1.ISnapshotIAVLItem|null} [iavl] SnapshotItem iavl + */ + + /** + * Constructs a new SnapshotItem. + * @memberof cosmos.base.store.v1beta1 + * @classdesc Represents a SnapshotItem. + * @implements ISnapshotItem + * @constructor + * @param {cosmos.base.store.v1beta1.ISnapshotItem=} [properties] Properties to set + */ + function SnapshotItem(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SnapshotItem store. + * @member {cosmos.base.store.v1beta1.ISnapshotStoreItem|null|undefined} store + * @memberof cosmos.base.store.v1beta1.SnapshotItem + * @instance + */ + SnapshotItem.prototype.store = null; + + /** + * SnapshotItem iavl. + * @member {cosmos.base.store.v1beta1.ISnapshotIAVLItem|null|undefined} iavl + * @memberof cosmos.base.store.v1beta1.SnapshotItem + * @instance + */ + SnapshotItem.prototype.iavl = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SnapshotItem item. + * @member {"store"|"iavl"|undefined} item + * @memberof cosmos.base.store.v1beta1.SnapshotItem + * @instance + */ + Object.defineProperty(SnapshotItem.prototype, "item", { + get: $util.oneOfGetter($oneOfFields = ["store", "iavl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SnapshotItem instance using the specified properties. + * @function create + * @memberof cosmos.base.store.v1beta1.SnapshotItem + * @static + * @param {cosmos.base.store.v1beta1.ISnapshotItem=} [properties] Properties to set + * @returns {cosmos.base.store.v1beta1.SnapshotItem} SnapshotItem instance + */ + SnapshotItem.create = function create(properties) { + return new SnapshotItem(properties); + }; + + /** + * Encodes the specified SnapshotItem message. Does not implicitly {@link cosmos.base.store.v1beta1.SnapshotItem.verify|verify} messages. + * @function encode + * @memberof cosmos.base.store.v1beta1.SnapshotItem + * @static + * @param {cosmos.base.store.v1beta1.ISnapshotItem} message SnapshotItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SnapshotItem.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.store != null && Object.hasOwnProperty.call(message, "store")) + $root.cosmos.base.store.v1beta1.SnapshotStoreItem.encode(message.store, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.iavl != null && Object.hasOwnProperty.call(message, "iavl")) + $root.cosmos.base.store.v1beta1.SnapshotIAVLItem.encode(message.iavl, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SnapshotItem message, length delimited. Does not implicitly {@link cosmos.base.store.v1beta1.SnapshotItem.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.store.v1beta1.SnapshotItem + * @static + * @param {cosmos.base.store.v1beta1.ISnapshotItem} message SnapshotItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SnapshotItem.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SnapshotItem message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.store.v1beta1.SnapshotItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.store.v1beta1.SnapshotItem} SnapshotItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SnapshotItem.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.store.v1beta1.SnapshotItem(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.store = $root.cosmos.base.store.v1beta1.SnapshotStoreItem.decode(reader, reader.uint32()); + break; + case 2: + message.iavl = $root.cosmos.base.store.v1beta1.SnapshotIAVLItem.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SnapshotItem message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.store.v1beta1.SnapshotItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.store.v1beta1.SnapshotItem} SnapshotItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SnapshotItem.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SnapshotItem message. + * @function verify + * @memberof cosmos.base.store.v1beta1.SnapshotItem + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SnapshotItem.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + let properties = {}; + if (message.store != null && message.hasOwnProperty("store")) { + properties.item = 1; + { + let error = $root.cosmos.base.store.v1beta1.SnapshotStoreItem.verify(message.store); + if (error) + return "store." + error; + } + } + if (message.iavl != null && message.hasOwnProperty("iavl")) { + if (properties.item === 1) + return "item: multiple values"; + properties.item = 1; + { + let error = $root.cosmos.base.store.v1beta1.SnapshotIAVLItem.verify(message.iavl); + if (error) + return "iavl." + error; + } + } + return null; + }; + + /** + * Creates a SnapshotItem message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.store.v1beta1.SnapshotItem + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.store.v1beta1.SnapshotItem} SnapshotItem + */ + SnapshotItem.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.store.v1beta1.SnapshotItem) + return object; + let message = new $root.cosmos.base.store.v1beta1.SnapshotItem(); + if (object.store != null) { + if (typeof object.store !== "object") + throw TypeError(".cosmos.base.store.v1beta1.SnapshotItem.store: object expected"); + message.store = $root.cosmos.base.store.v1beta1.SnapshotStoreItem.fromObject(object.store); + } + if (object.iavl != null) { + if (typeof object.iavl !== "object") + throw TypeError(".cosmos.base.store.v1beta1.SnapshotItem.iavl: object expected"); + message.iavl = $root.cosmos.base.store.v1beta1.SnapshotIAVLItem.fromObject(object.iavl); + } + return message; + }; + + /** + * Creates a plain object from a SnapshotItem message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.store.v1beta1.SnapshotItem + * @static + * @param {cosmos.base.store.v1beta1.SnapshotItem} message SnapshotItem + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SnapshotItem.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.store != null && message.hasOwnProperty("store")) { + object.store = $root.cosmos.base.store.v1beta1.SnapshotStoreItem.toObject(message.store, options); + if (options.oneofs) + object.item = "store"; + } + if (message.iavl != null && message.hasOwnProperty("iavl")) { + object.iavl = $root.cosmos.base.store.v1beta1.SnapshotIAVLItem.toObject(message.iavl, options); + if (options.oneofs) + object.item = "iavl"; + } + return object; + }; + + /** + * Converts this SnapshotItem to JSON. + * @function toJSON + * @memberof cosmos.base.store.v1beta1.SnapshotItem + * @instance + * @returns {Object.} JSON object + */ + SnapshotItem.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SnapshotItem; + })(v1beta1.SnapshotItem || {}); + + v1beta1.SnapshotStoreItem = (function(SnapshotStoreItem) { + + /** + * Properties of a SnapshotStoreItem. + * @memberof cosmos.base.store.v1beta1 + * @interface ISnapshotStoreItem + * @property {string|null} [name] SnapshotStoreItem name + */ + + /** + * Constructs a new SnapshotStoreItem. + * @memberof cosmos.base.store.v1beta1 + * @classdesc Represents a SnapshotStoreItem. + * @implements ISnapshotStoreItem + * @constructor + * @param {cosmos.base.store.v1beta1.ISnapshotStoreItem=} [properties] Properties to set + */ + function SnapshotStoreItem(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SnapshotStoreItem name. + * @member {string} name + * @memberof cosmos.base.store.v1beta1.SnapshotStoreItem + * @instance + */ + SnapshotStoreItem.prototype.name = ""; + + /** + * Creates a new SnapshotStoreItem instance using the specified properties. + * @function create + * @memberof cosmos.base.store.v1beta1.SnapshotStoreItem + * @static + * @param {cosmos.base.store.v1beta1.ISnapshotStoreItem=} [properties] Properties to set + * @returns {cosmos.base.store.v1beta1.SnapshotStoreItem} SnapshotStoreItem instance + */ + SnapshotStoreItem.create = function create(properties) { + return new SnapshotStoreItem(properties); + }; + + /** + * Encodes the specified SnapshotStoreItem message. Does not implicitly {@link cosmos.base.store.v1beta1.SnapshotStoreItem.verify|verify} messages. + * @function encode + * @memberof cosmos.base.store.v1beta1.SnapshotStoreItem + * @static + * @param {cosmos.base.store.v1beta1.ISnapshotStoreItem} message SnapshotStoreItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SnapshotStoreItem.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified SnapshotStoreItem message, length delimited. Does not implicitly {@link cosmos.base.store.v1beta1.SnapshotStoreItem.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.store.v1beta1.SnapshotStoreItem + * @static + * @param {cosmos.base.store.v1beta1.ISnapshotStoreItem} message SnapshotStoreItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SnapshotStoreItem.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SnapshotStoreItem message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.store.v1beta1.SnapshotStoreItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.store.v1beta1.SnapshotStoreItem} SnapshotStoreItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SnapshotStoreItem.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.store.v1beta1.SnapshotStoreItem(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SnapshotStoreItem message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.store.v1beta1.SnapshotStoreItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.store.v1beta1.SnapshotStoreItem} SnapshotStoreItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SnapshotStoreItem.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SnapshotStoreItem message. + * @function verify + * @memberof cosmos.base.store.v1beta1.SnapshotStoreItem + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SnapshotStoreItem.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a SnapshotStoreItem message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.store.v1beta1.SnapshotStoreItem + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.store.v1beta1.SnapshotStoreItem} SnapshotStoreItem + */ + SnapshotStoreItem.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.store.v1beta1.SnapshotStoreItem) + return object; + let message = new $root.cosmos.base.store.v1beta1.SnapshotStoreItem(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a SnapshotStoreItem message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.store.v1beta1.SnapshotStoreItem + * @static + * @param {cosmos.base.store.v1beta1.SnapshotStoreItem} message SnapshotStoreItem + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SnapshotStoreItem.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this SnapshotStoreItem to JSON. + * @function toJSON + * @memberof cosmos.base.store.v1beta1.SnapshotStoreItem + * @instance + * @returns {Object.} JSON object + */ + SnapshotStoreItem.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SnapshotStoreItem; + })(v1beta1.SnapshotStoreItem || {}); + + v1beta1.SnapshotIAVLItem = (function(SnapshotIAVLItem) { + + /** + * Properties of a SnapshotIAVLItem. + * @memberof cosmos.base.store.v1beta1 + * @interface ISnapshotIAVLItem + * @property {Uint8Array|null} [key] SnapshotIAVLItem key + * @property {Uint8Array|null} [value] SnapshotIAVLItem value + * @property {number|Long|null} [version] SnapshotIAVLItem version + * @property {number|null} [height] SnapshotIAVLItem height + */ + + /** + * Constructs a new SnapshotIAVLItem. + * @memberof cosmos.base.store.v1beta1 + * @classdesc Represents a SnapshotIAVLItem. + * @implements ISnapshotIAVLItem + * @constructor + * @param {cosmos.base.store.v1beta1.ISnapshotIAVLItem=} [properties] Properties to set + */ + function SnapshotIAVLItem(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SnapshotIAVLItem key. + * @member {Uint8Array} key + * @memberof cosmos.base.store.v1beta1.SnapshotIAVLItem + * @instance + */ + SnapshotIAVLItem.prototype.key = $util.newBuffer([]); + + /** + * SnapshotIAVLItem value. + * @member {Uint8Array} value + * @memberof cosmos.base.store.v1beta1.SnapshotIAVLItem + * @instance + */ + SnapshotIAVLItem.prototype.value = $util.newBuffer([]); + + /** + * SnapshotIAVLItem version. + * @member {number|Long} version + * @memberof cosmos.base.store.v1beta1.SnapshotIAVLItem + * @instance + */ + SnapshotIAVLItem.prototype.version = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * SnapshotIAVLItem height. + * @member {number} height + * @memberof cosmos.base.store.v1beta1.SnapshotIAVLItem + * @instance + */ + SnapshotIAVLItem.prototype.height = 0; + + /** + * Creates a new SnapshotIAVLItem instance using the specified properties. + * @function create + * @memberof cosmos.base.store.v1beta1.SnapshotIAVLItem + * @static + * @param {cosmos.base.store.v1beta1.ISnapshotIAVLItem=} [properties] Properties to set + * @returns {cosmos.base.store.v1beta1.SnapshotIAVLItem} SnapshotIAVLItem instance + */ + SnapshotIAVLItem.create = function create(properties) { + return new SnapshotIAVLItem(properties); + }; + + /** + * Encodes the specified SnapshotIAVLItem message. Does not implicitly {@link cosmos.base.store.v1beta1.SnapshotIAVLItem.verify|verify} messages. + * @function encode + * @memberof cosmos.base.store.v1beta1.SnapshotIAVLItem + * @static + * @param {cosmos.base.store.v1beta1.ISnapshotIAVLItem} message SnapshotIAVLItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SnapshotIAVLItem.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.version); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.height); + return writer; + }; + + /** + * Encodes the specified SnapshotIAVLItem message, length delimited. Does not implicitly {@link cosmos.base.store.v1beta1.SnapshotIAVLItem.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.store.v1beta1.SnapshotIAVLItem + * @static + * @param {cosmos.base.store.v1beta1.ISnapshotIAVLItem} message SnapshotIAVLItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SnapshotIAVLItem.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SnapshotIAVLItem message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.store.v1beta1.SnapshotIAVLItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.store.v1beta1.SnapshotIAVLItem} SnapshotIAVLItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SnapshotIAVLItem.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.store.v1beta1.SnapshotIAVLItem(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + case 3: + message.version = reader.int64(); + break; + case 4: + message.height = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SnapshotIAVLItem message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.store.v1beta1.SnapshotIAVLItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.store.v1beta1.SnapshotIAVLItem} SnapshotIAVLItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SnapshotIAVLItem.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SnapshotIAVLItem message. + * @function verify + * @memberof cosmos.base.store.v1beta1.SnapshotIAVLItem + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SnapshotIAVLItem.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version) && !(message.version && $util.isInteger(message.version.low) && $util.isInteger(message.version.high))) + return "version: integer|Long expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height)) + return "height: integer expected"; + return null; + }; + + /** + * Creates a SnapshotIAVLItem message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.store.v1beta1.SnapshotIAVLItem + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.store.v1beta1.SnapshotIAVLItem} SnapshotIAVLItem + */ + SnapshotIAVLItem.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.store.v1beta1.SnapshotIAVLItem) + return object; + let message = new $root.cosmos.base.store.v1beta1.SnapshotIAVLItem(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length) + message.key = object.key; + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length) + message.value = object.value; + if (object.version != null) + if ($util.Long) + (message.version = $util.Long.fromValue(object.version)).unsigned = false; + else if (typeof object.version === "string") + message.version = parseInt(object.version, 10); + else if (typeof object.version === "number") + message.version = object.version; + else if (typeof object.version === "object") + message.version = new $util.LongBits(object.version.low >>> 0, object.version.high >>> 0).toNumber(); + if (object.height != null) + message.height = object.height | 0; + return message; + }; + + /** + * Creates a plain object from a SnapshotIAVLItem message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.store.v1beta1.SnapshotIAVLItem + * @static + * @param {cosmos.base.store.v1beta1.SnapshotIAVLItem} message SnapshotIAVLItem + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SnapshotIAVLItem.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.version = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.version = options.longs === String ? "0" : 0; + object.height = 0; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + if (message.version != null && message.hasOwnProperty("version")) + if (typeof message.version === "number") + object.version = options.longs === String ? String(message.version) : message.version; + else + object.version = options.longs === String ? $util.Long.prototype.toString.call(message.version) : options.longs === Number ? new $util.LongBits(message.version.low >>> 0, message.version.high >>> 0).toNumber() : message.version; + if (message.height != null && message.hasOwnProperty("height")) + object.height = message.height; + return object; + }; + + /** + * Converts this SnapshotIAVLItem to JSON. + * @function toJSON + * @memberof cosmos.base.store.v1beta1.SnapshotIAVLItem + * @instance + * @returns {Object.} JSON object + */ + SnapshotIAVLItem.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SnapshotIAVLItem; + })(v1beta1.SnapshotIAVLItem || {}); + + return v1beta1; + })(store.v1beta1 || {}); + + return store; + })(base.store || {}); + + /** + * Namespace tendermint. + * @memberof cosmos.base + * @namespace + */ + + base.tendermint = (function(tendermint) { + + /** + * Namespace v1beta1. + * @memberof cosmos.base.tendermint + * @namespace + */ + + tendermint.v1beta1 = (function(v1beta1) { + + v1beta1.Service = (function(Service) { + + /** + * Constructs a new Service service. + * @memberof cosmos.base.tendermint.v1beta1 + * @classdesc Represents a Service + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Service(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Service.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Service; + + /** + * Creates new Service service using the specified rpc implementation. + * @function create + * @memberof cosmos.base.tendermint.v1beta1.Service + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Service} RPC service. Useful where requests and/or responses are streamed. + */ + Service.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.base.tendermint.v1beta1.Service#getNodeInfo}. + * @memberof cosmos.base.tendermint.v1beta1.Service + * @typedef GetNodeInfoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.base.tendermint.v1beta1.IGetNodeInfoResponse} [response] GetNodeInfoResponse + */ + + /** + * Calls GetNodeInfo. + * @function getNodeInfo + * @memberof cosmos.base.tendermint.v1beta1.Service + * @instance + * @param {cosmos.base.tendermint.v1beta1.IGetNodeInfoRequest} request GetNodeInfoRequest message or plain object + * @param {cosmos.base.tendermint.v1beta1.Service.GetNodeInfoCallback} callback Node-style callback called with the error, if any, and GetNodeInfoResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Service.prototype.getNodeInfo = function getNodeInfo(request, callback) { + return this.rpcCall(getNodeInfo, $root.cosmos.base.tendermint.v1beta1.GetNodeInfoRequest, $root.cosmos.base.tendermint.v1beta1.GetNodeInfoResponse, request, callback); + }, "name", { value: "GetNodeInfo" }); + + /** + * Calls GetNodeInfo. + * @function getNodeInfo + * @memberof cosmos.base.tendermint.v1beta1.Service + * @instance + * @param {cosmos.base.tendermint.v1beta1.IGetNodeInfoRequest} request GetNodeInfoRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.base.tendermint.v1beta1.Service#getSyncing}. + * @memberof cosmos.base.tendermint.v1beta1.Service + * @typedef GetSyncingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.base.tendermint.v1beta1.IGetSyncingResponse} [response] GetSyncingResponse + */ + + /** + * Calls GetSyncing. + * @function getSyncing + * @memberof cosmos.base.tendermint.v1beta1.Service + * @instance + * @param {cosmos.base.tendermint.v1beta1.IGetSyncingRequest} request GetSyncingRequest message or plain object + * @param {cosmos.base.tendermint.v1beta1.Service.GetSyncingCallback} callback Node-style callback called with the error, if any, and GetSyncingResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Service.prototype.getSyncing = function getSyncing(request, callback) { + return this.rpcCall(getSyncing, $root.cosmos.base.tendermint.v1beta1.GetSyncingRequest, $root.cosmos.base.tendermint.v1beta1.GetSyncingResponse, request, callback); + }, "name", { value: "GetSyncing" }); + + /** + * Calls GetSyncing. + * @function getSyncing + * @memberof cosmos.base.tendermint.v1beta1.Service + * @instance + * @param {cosmos.base.tendermint.v1beta1.IGetSyncingRequest} request GetSyncingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.base.tendermint.v1beta1.Service#getLatestBlock}. + * @memberof cosmos.base.tendermint.v1beta1.Service + * @typedef GetLatestBlockCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.base.tendermint.v1beta1.IGetLatestBlockResponse} [response] GetLatestBlockResponse + */ + + /** + * Calls GetLatestBlock. + * @function getLatestBlock + * @memberof cosmos.base.tendermint.v1beta1.Service + * @instance + * @param {cosmos.base.tendermint.v1beta1.IGetLatestBlockRequest} request GetLatestBlockRequest message or plain object + * @param {cosmos.base.tendermint.v1beta1.Service.GetLatestBlockCallback} callback Node-style callback called with the error, if any, and GetLatestBlockResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Service.prototype.getLatestBlock = function getLatestBlock(request, callback) { + return this.rpcCall(getLatestBlock, $root.cosmos.base.tendermint.v1beta1.GetLatestBlockRequest, $root.cosmos.base.tendermint.v1beta1.GetLatestBlockResponse, request, callback); + }, "name", { value: "GetLatestBlock" }); + + /** + * Calls GetLatestBlock. + * @function getLatestBlock + * @memberof cosmos.base.tendermint.v1beta1.Service + * @instance + * @param {cosmos.base.tendermint.v1beta1.IGetLatestBlockRequest} request GetLatestBlockRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.base.tendermint.v1beta1.Service#getBlockByHeight}. + * @memberof cosmos.base.tendermint.v1beta1.Service + * @typedef GetBlockByHeightCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.base.tendermint.v1beta1.IGetBlockByHeightResponse} [response] GetBlockByHeightResponse + */ + + /** + * Calls GetBlockByHeight. + * @function getBlockByHeight + * @memberof cosmos.base.tendermint.v1beta1.Service + * @instance + * @param {cosmos.base.tendermint.v1beta1.IGetBlockByHeightRequest} request GetBlockByHeightRequest message or plain object + * @param {cosmos.base.tendermint.v1beta1.Service.GetBlockByHeightCallback} callback Node-style callback called with the error, if any, and GetBlockByHeightResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Service.prototype.getBlockByHeight = function getBlockByHeight(request, callback) { + return this.rpcCall(getBlockByHeight, $root.cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest, $root.cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse, request, callback); + }, "name", { value: "GetBlockByHeight" }); + + /** + * Calls GetBlockByHeight. + * @function getBlockByHeight + * @memberof cosmos.base.tendermint.v1beta1.Service + * @instance + * @param {cosmos.base.tendermint.v1beta1.IGetBlockByHeightRequest} request GetBlockByHeightRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.base.tendermint.v1beta1.Service#getLatestValidatorSet}. + * @memberof cosmos.base.tendermint.v1beta1.Service + * @typedef GetLatestValidatorSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.base.tendermint.v1beta1.IGetLatestValidatorSetResponse} [response] GetLatestValidatorSetResponse + */ + + /** + * Calls GetLatestValidatorSet. + * @function getLatestValidatorSet + * @memberof cosmos.base.tendermint.v1beta1.Service + * @instance + * @param {cosmos.base.tendermint.v1beta1.IGetLatestValidatorSetRequest} request GetLatestValidatorSetRequest message or plain object + * @param {cosmos.base.tendermint.v1beta1.Service.GetLatestValidatorSetCallback} callback Node-style callback called with the error, if any, and GetLatestValidatorSetResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Service.prototype.getLatestValidatorSet = function getLatestValidatorSet(request, callback) { + return this.rpcCall(getLatestValidatorSet, $root.cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest, $root.cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse, request, callback); + }, "name", { value: "GetLatestValidatorSet" }); + + /** + * Calls GetLatestValidatorSet. + * @function getLatestValidatorSet + * @memberof cosmos.base.tendermint.v1beta1.Service + * @instance + * @param {cosmos.base.tendermint.v1beta1.IGetLatestValidatorSetRequest} request GetLatestValidatorSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.base.tendermint.v1beta1.Service#getValidatorSetByHeight}. + * @memberof cosmos.base.tendermint.v1beta1.Service + * @typedef GetValidatorSetByHeightCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.base.tendermint.v1beta1.IGetValidatorSetByHeightResponse} [response] GetValidatorSetByHeightResponse + */ + + /** + * Calls GetValidatorSetByHeight. + * @function getValidatorSetByHeight + * @memberof cosmos.base.tendermint.v1beta1.Service + * @instance + * @param {cosmos.base.tendermint.v1beta1.IGetValidatorSetByHeightRequest} request GetValidatorSetByHeightRequest message or plain object + * @param {cosmos.base.tendermint.v1beta1.Service.GetValidatorSetByHeightCallback} callback Node-style callback called with the error, if any, and GetValidatorSetByHeightResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Service.prototype.getValidatorSetByHeight = function getValidatorSetByHeight(request, callback) { + return this.rpcCall(getValidatorSetByHeight, $root.cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest, $root.cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse, request, callback); + }, "name", { value: "GetValidatorSetByHeight" }); + + /** + * Calls GetValidatorSetByHeight. + * @function getValidatorSetByHeight + * @memberof cosmos.base.tendermint.v1beta1.Service + * @instance + * @param {cosmos.base.tendermint.v1beta1.IGetValidatorSetByHeightRequest} request GetValidatorSetByHeightRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Service; + })(v1beta1.Service || {}); + + v1beta1.GetValidatorSetByHeightRequest = (function(GetValidatorSetByHeightRequest) { + + /** + * Properties of a GetValidatorSetByHeightRequest. + * @memberof cosmos.base.tendermint.v1beta1 + * @interface IGetValidatorSetByHeightRequest + * @property {number|Long|null} [height] GetValidatorSetByHeightRequest height + * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] GetValidatorSetByHeightRequest pagination + */ + + /** + * Constructs a new GetValidatorSetByHeightRequest. + * @memberof cosmos.base.tendermint.v1beta1 + * @classdesc Represents a GetValidatorSetByHeightRequest. + * @implements IGetValidatorSetByHeightRequest + * @constructor + * @param {cosmos.base.tendermint.v1beta1.IGetValidatorSetByHeightRequest=} [properties] Properties to set + */ + function GetValidatorSetByHeightRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetValidatorSetByHeightRequest height. + * @member {number|Long} height + * @memberof cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest + * @instance + */ + GetValidatorSetByHeightRequest.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * GetValidatorSetByHeightRequest pagination. + * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination + * @memberof cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest + * @instance + */ + GetValidatorSetByHeightRequest.prototype.pagination = null; + + /** + * Creates a new GetValidatorSetByHeightRequest instance using the specified properties. + * @function create + * @memberof cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetValidatorSetByHeightRequest=} [properties] Properties to set + * @returns {cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest} GetValidatorSetByHeightRequest instance + */ + GetValidatorSetByHeightRequest.create = function create(properties) { + return new GetValidatorSetByHeightRequest(properties); + }; + + /** + * Encodes the specified GetValidatorSetByHeightRequest message. Does not implicitly {@link cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetValidatorSetByHeightRequest} message GetValidatorSetByHeightRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetValidatorSetByHeightRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.height); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetValidatorSetByHeightRequest message, length delimited. Does not implicitly {@link cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetValidatorSetByHeightRequest} message GetValidatorSetByHeightRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetValidatorSetByHeightRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetValidatorSetByHeightRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest} GetValidatorSetByHeightRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetValidatorSetByHeightRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetValidatorSetByHeightRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest} GetValidatorSetByHeightRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetValidatorSetByHeightRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetValidatorSetByHeightRequest message. + * @function verify + * @memberof cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetValidatorSetByHeightRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a GetValidatorSetByHeightRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest} GetValidatorSetByHeightRequest + */ + GetValidatorSetByHeightRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest) + return object; + let message = new $root.cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest(); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a GetValidatorSetByHeightRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest + * @static + * @param {cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest} message GetValidatorSetByHeightRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetValidatorSetByHeightRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.pagination = null; + } + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this GetValidatorSetByHeightRequest to JSON. + * @function toJSON + * @memberof cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest + * @instance + * @returns {Object.} JSON object + */ + GetValidatorSetByHeightRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetValidatorSetByHeightRequest; + })(v1beta1.GetValidatorSetByHeightRequest || {}); + + v1beta1.GetValidatorSetByHeightResponse = (function(GetValidatorSetByHeightResponse) { + + /** + * Properties of a GetValidatorSetByHeightResponse. + * @memberof cosmos.base.tendermint.v1beta1 + * @interface IGetValidatorSetByHeightResponse + * @property {number|Long|null} [blockHeight] GetValidatorSetByHeightResponse blockHeight + * @property {Array.|null} [validators] GetValidatorSetByHeightResponse validators + * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] GetValidatorSetByHeightResponse pagination + */ + + /** + * Constructs a new GetValidatorSetByHeightResponse. + * @memberof cosmos.base.tendermint.v1beta1 + * @classdesc Represents a GetValidatorSetByHeightResponse. + * @implements IGetValidatorSetByHeightResponse + * @constructor + * @param {cosmos.base.tendermint.v1beta1.IGetValidatorSetByHeightResponse=} [properties] Properties to set + */ + function GetValidatorSetByHeightResponse(properties) { + this.validators = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetValidatorSetByHeightResponse blockHeight. + * @member {number|Long} blockHeight + * @memberof cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse + * @instance + */ + GetValidatorSetByHeightResponse.prototype.blockHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * GetValidatorSetByHeightResponse validators. + * @member {Array.} validators + * @memberof cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse + * @instance + */ + GetValidatorSetByHeightResponse.prototype.validators = $util.emptyArray; + + /** + * GetValidatorSetByHeightResponse pagination. + * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination + * @memberof cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse + * @instance + */ + GetValidatorSetByHeightResponse.prototype.pagination = null; + + /** + * Creates a new GetValidatorSetByHeightResponse instance using the specified properties. + * @function create + * @memberof cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetValidatorSetByHeightResponse=} [properties] Properties to set + * @returns {cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse} GetValidatorSetByHeightResponse instance + */ + GetValidatorSetByHeightResponse.create = function create(properties) { + return new GetValidatorSetByHeightResponse(properties); + }; + + /** + * Encodes the specified GetValidatorSetByHeightResponse message. Does not implicitly {@link cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetValidatorSetByHeightResponse} message GetValidatorSetByHeightResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetValidatorSetByHeightResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.blockHeight != null && Object.hasOwnProperty.call(message, "blockHeight")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.blockHeight); + if (message.validators != null && message.validators.length) + for (let i = 0; i < message.validators.length; ++i) + $root.cosmos.base.tendermint.v1beta1.Validator.encode(message.validators[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetValidatorSetByHeightResponse message, length delimited. Does not implicitly {@link cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetValidatorSetByHeightResponse} message GetValidatorSetByHeightResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetValidatorSetByHeightResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetValidatorSetByHeightResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse} GetValidatorSetByHeightResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetValidatorSetByHeightResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockHeight = reader.int64(); + break; + case 2: + if (!(message.validators && message.validators.length)) + message.validators = []; + message.validators.push($root.cosmos.base.tendermint.v1beta1.Validator.decode(reader, reader.uint32())); + break; + case 3: + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetValidatorSetByHeightResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse} GetValidatorSetByHeightResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetValidatorSetByHeightResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetValidatorSetByHeightResponse message. + * @function verify + * @memberof cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetValidatorSetByHeightResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.blockHeight != null && message.hasOwnProperty("blockHeight")) + if (!$util.isInteger(message.blockHeight) && !(message.blockHeight && $util.isInteger(message.blockHeight.low) && $util.isInteger(message.blockHeight.high))) + return "blockHeight: integer|Long expected"; + if (message.validators != null && message.hasOwnProperty("validators")) { + if (!Array.isArray(message.validators)) + return "validators: array expected"; + for (let i = 0; i < message.validators.length; ++i) { + let error = $root.cosmos.base.tendermint.v1beta1.Validator.verify(message.validators[i]); + if (error) + return "validators." + error; + } + } + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a GetValidatorSetByHeightResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse} GetValidatorSetByHeightResponse + */ + GetValidatorSetByHeightResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse) + return object; + let message = new $root.cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse(); + if (object.blockHeight != null) + if ($util.Long) + (message.blockHeight = $util.Long.fromValue(object.blockHeight)).unsigned = false; + else if (typeof object.blockHeight === "string") + message.blockHeight = parseInt(object.blockHeight, 10); + else if (typeof object.blockHeight === "number") + message.blockHeight = object.blockHeight; + else if (typeof object.blockHeight === "object") + message.blockHeight = new $util.LongBits(object.blockHeight.low >>> 0, object.blockHeight.high >>> 0).toNumber(); + if (object.validators) { + if (!Array.isArray(object.validators)) + throw TypeError(".cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse.validators: array expected"); + message.validators = []; + for (let i = 0; i < object.validators.length; ++i) { + if (typeof object.validators[i] !== "object") + throw TypeError(".cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse.validators: object expected"); + message.validators[i] = $root.cosmos.base.tendermint.v1beta1.Validator.fromObject(object.validators[i]); + } + } + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a GetValidatorSetByHeightResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse + * @static + * @param {cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse} message GetValidatorSetByHeightResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetValidatorSetByHeightResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.validators = []; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.blockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.blockHeight = options.longs === String ? "0" : 0; + object.pagination = null; + } + if (message.blockHeight != null && message.hasOwnProperty("blockHeight")) + if (typeof message.blockHeight === "number") + object.blockHeight = options.longs === String ? String(message.blockHeight) : message.blockHeight; + else + object.blockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.blockHeight) : options.longs === Number ? new $util.LongBits(message.blockHeight.low >>> 0, message.blockHeight.high >>> 0).toNumber() : message.blockHeight; + if (message.validators && message.validators.length) { + object.validators = []; + for (let j = 0; j < message.validators.length; ++j) + object.validators[j] = $root.cosmos.base.tendermint.v1beta1.Validator.toObject(message.validators[j], options); + } + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this GetValidatorSetByHeightResponse to JSON. + * @function toJSON + * @memberof cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse + * @instance + * @returns {Object.} JSON object + */ + GetValidatorSetByHeightResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetValidatorSetByHeightResponse; + })(v1beta1.GetValidatorSetByHeightResponse || {}); + + v1beta1.GetLatestValidatorSetRequest = (function(GetLatestValidatorSetRequest) { + + /** + * Properties of a GetLatestValidatorSetRequest. + * @memberof cosmos.base.tendermint.v1beta1 + * @interface IGetLatestValidatorSetRequest + * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] GetLatestValidatorSetRequest pagination + */ + + /** + * Constructs a new GetLatestValidatorSetRequest. + * @memberof cosmos.base.tendermint.v1beta1 + * @classdesc Represents a GetLatestValidatorSetRequest. + * @implements IGetLatestValidatorSetRequest + * @constructor + * @param {cosmos.base.tendermint.v1beta1.IGetLatestValidatorSetRequest=} [properties] Properties to set + */ + function GetLatestValidatorSetRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetLatestValidatorSetRequest pagination. + * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination + * @memberof cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest + * @instance + */ + GetLatestValidatorSetRequest.prototype.pagination = null; + + /** + * Creates a new GetLatestValidatorSetRequest instance using the specified properties. + * @function create + * @memberof cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetLatestValidatorSetRequest=} [properties] Properties to set + * @returns {cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest} GetLatestValidatorSetRequest instance + */ + GetLatestValidatorSetRequest.create = function create(properties) { + return new GetLatestValidatorSetRequest(properties); + }; + + /** + * Encodes the specified GetLatestValidatorSetRequest message. Does not implicitly {@link cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetLatestValidatorSetRequest} message GetLatestValidatorSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetLatestValidatorSetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetLatestValidatorSetRequest message, length delimited. Does not implicitly {@link cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetLatestValidatorSetRequest} message GetLatestValidatorSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetLatestValidatorSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetLatestValidatorSetRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest} GetLatestValidatorSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetLatestValidatorSetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetLatestValidatorSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest} GetLatestValidatorSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetLatestValidatorSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetLatestValidatorSetRequest message. + * @function verify + * @memberof cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetLatestValidatorSetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a GetLatestValidatorSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest} GetLatestValidatorSetRequest + */ + GetLatestValidatorSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest) + return object; + let message = new $root.cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest(); + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a GetLatestValidatorSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest + * @static + * @param {cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest} message GetLatestValidatorSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetLatestValidatorSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.pagination = null; + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this GetLatestValidatorSetRequest to JSON. + * @function toJSON + * @memberof cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest + * @instance + * @returns {Object.} JSON object + */ + GetLatestValidatorSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetLatestValidatorSetRequest; + })(v1beta1.GetLatestValidatorSetRequest || {}); + + v1beta1.GetLatestValidatorSetResponse = (function(GetLatestValidatorSetResponse) { + + /** + * Properties of a GetLatestValidatorSetResponse. + * @memberof cosmos.base.tendermint.v1beta1 + * @interface IGetLatestValidatorSetResponse + * @property {number|Long|null} [blockHeight] GetLatestValidatorSetResponse blockHeight + * @property {Array.|null} [validators] GetLatestValidatorSetResponse validators + * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] GetLatestValidatorSetResponse pagination + */ + + /** + * Constructs a new GetLatestValidatorSetResponse. + * @memberof cosmos.base.tendermint.v1beta1 + * @classdesc Represents a GetLatestValidatorSetResponse. + * @implements IGetLatestValidatorSetResponse + * @constructor + * @param {cosmos.base.tendermint.v1beta1.IGetLatestValidatorSetResponse=} [properties] Properties to set + */ + function GetLatestValidatorSetResponse(properties) { + this.validators = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetLatestValidatorSetResponse blockHeight. + * @member {number|Long} blockHeight + * @memberof cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse + * @instance + */ + GetLatestValidatorSetResponse.prototype.blockHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * GetLatestValidatorSetResponse validators. + * @member {Array.} validators + * @memberof cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse + * @instance + */ + GetLatestValidatorSetResponse.prototype.validators = $util.emptyArray; + + /** + * GetLatestValidatorSetResponse pagination. + * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination + * @memberof cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse + * @instance + */ + GetLatestValidatorSetResponse.prototype.pagination = null; + + /** + * Creates a new GetLatestValidatorSetResponse instance using the specified properties. + * @function create + * @memberof cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetLatestValidatorSetResponse=} [properties] Properties to set + * @returns {cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse} GetLatestValidatorSetResponse instance + */ + GetLatestValidatorSetResponse.create = function create(properties) { + return new GetLatestValidatorSetResponse(properties); + }; + + /** + * Encodes the specified GetLatestValidatorSetResponse message. Does not implicitly {@link cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetLatestValidatorSetResponse} message GetLatestValidatorSetResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetLatestValidatorSetResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.blockHeight != null && Object.hasOwnProperty.call(message, "blockHeight")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.blockHeight); + if (message.validators != null && message.validators.length) + for (let i = 0; i < message.validators.length; ++i) + $root.cosmos.base.tendermint.v1beta1.Validator.encode(message.validators[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetLatestValidatorSetResponse message, length delimited. Does not implicitly {@link cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetLatestValidatorSetResponse} message GetLatestValidatorSetResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetLatestValidatorSetResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetLatestValidatorSetResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse} GetLatestValidatorSetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetLatestValidatorSetResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockHeight = reader.int64(); + break; + case 2: + if (!(message.validators && message.validators.length)) + message.validators = []; + message.validators.push($root.cosmos.base.tendermint.v1beta1.Validator.decode(reader, reader.uint32())); + break; + case 3: + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetLatestValidatorSetResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse} GetLatestValidatorSetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetLatestValidatorSetResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetLatestValidatorSetResponse message. + * @function verify + * @memberof cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetLatestValidatorSetResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.blockHeight != null && message.hasOwnProperty("blockHeight")) + if (!$util.isInteger(message.blockHeight) && !(message.blockHeight && $util.isInteger(message.blockHeight.low) && $util.isInteger(message.blockHeight.high))) + return "blockHeight: integer|Long expected"; + if (message.validators != null && message.hasOwnProperty("validators")) { + if (!Array.isArray(message.validators)) + return "validators: array expected"; + for (let i = 0; i < message.validators.length; ++i) { + let error = $root.cosmos.base.tendermint.v1beta1.Validator.verify(message.validators[i]); + if (error) + return "validators." + error; + } + } + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a GetLatestValidatorSetResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse} GetLatestValidatorSetResponse + */ + GetLatestValidatorSetResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse) + return object; + let message = new $root.cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse(); + if (object.blockHeight != null) + if ($util.Long) + (message.blockHeight = $util.Long.fromValue(object.blockHeight)).unsigned = false; + else if (typeof object.blockHeight === "string") + message.blockHeight = parseInt(object.blockHeight, 10); + else if (typeof object.blockHeight === "number") + message.blockHeight = object.blockHeight; + else if (typeof object.blockHeight === "object") + message.blockHeight = new $util.LongBits(object.blockHeight.low >>> 0, object.blockHeight.high >>> 0).toNumber(); + if (object.validators) { + if (!Array.isArray(object.validators)) + throw TypeError(".cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse.validators: array expected"); + message.validators = []; + for (let i = 0; i < object.validators.length; ++i) { + if (typeof object.validators[i] !== "object") + throw TypeError(".cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse.validators: object expected"); + message.validators[i] = $root.cosmos.base.tendermint.v1beta1.Validator.fromObject(object.validators[i]); + } + } + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a GetLatestValidatorSetResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse + * @static + * @param {cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse} message GetLatestValidatorSetResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetLatestValidatorSetResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.validators = []; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.blockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.blockHeight = options.longs === String ? "0" : 0; + object.pagination = null; + } + if (message.blockHeight != null && message.hasOwnProperty("blockHeight")) + if (typeof message.blockHeight === "number") + object.blockHeight = options.longs === String ? String(message.blockHeight) : message.blockHeight; + else + object.blockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.blockHeight) : options.longs === Number ? new $util.LongBits(message.blockHeight.low >>> 0, message.blockHeight.high >>> 0).toNumber() : message.blockHeight; + if (message.validators && message.validators.length) { + object.validators = []; + for (let j = 0; j < message.validators.length; ++j) + object.validators[j] = $root.cosmos.base.tendermint.v1beta1.Validator.toObject(message.validators[j], options); + } + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this GetLatestValidatorSetResponse to JSON. + * @function toJSON + * @memberof cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse + * @instance + * @returns {Object.} JSON object + */ + GetLatestValidatorSetResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetLatestValidatorSetResponse; + })(v1beta1.GetLatestValidatorSetResponse || {}); + + v1beta1.Validator = (function(Validator) { + + /** + * Properties of a Validator. + * @memberof cosmos.base.tendermint.v1beta1 + * @interface IValidator + * @property {string|null} [address] Validator address + * @property {google.protobuf.IAny|null} [pubKey] Validator pubKey + * @property {number|Long|null} [votingPower] Validator votingPower + * @property {number|Long|null} [proposerPriority] Validator proposerPriority + */ + + /** + * Constructs a new Validator. + * @memberof cosmos.base.tendermint.v1beta1 + * @classdesc Represents a Validator. + * @implements IValidator + * @constructor + * @param {cosmos.base.tendermint.v1beta1.IValidator=} [properties] Properties to set + */ + function Validator(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Validator address. + * @member {string} address + * @memberof cosmos.base.tendermint.v1beta1.Validator + * @instance + */ + Validator.prototype.address = ""; + + /** + * Validator pubKey. + * @member {google.protobuf.IAny|null|undefined} pubKey + * @memberof cosmos.base.tendermint.v1beta1.Validator + * @instance + */ + Validator.prototype.pubKey = null; + + /** + * Validator votingPower. + * @member {number|Long} votingPower + * @memberof cosmos.base.tendermint.v1beta1.Validator + * @instance + */ + Validator.prototype.votingPower = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Validator proposerPriority. + * @member {number|Long} proposerPriority + * @memberof cosmos.base.tendermint.v1beta1.Validator + * @instance + */ + Validator.prototype.proposerPriority = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Validator instance using the specified properties. + * @function create + * @memberof cosmos.base.tendermint.v1beta1.Validator + * @static + * @param {cosmos.base.tendermint.v1beta1.IValidator=} [properties] Properties to set + * @returns {cosmos.base.tendermint.v1beta1.Validator} Validator instance + */ + Validator.create = function create(properties) { + return new Validator(properties); + }; + + /** + * Encodes the specified Validator message. Does not implicitly {@link cosmos.base.tendermint.v1beta1.Validator.verify|verify} messages. + * @function encode + * @memberof cosmos.base.tendermint.v1beta1.Validator + * @static + * @param {cosmos.base.tendermint.v1beta1.IValidator} message Validator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Validator.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.address); + if (message.pubKey != null && Object.hasOwnProperty.call(message, "pubKey")) + $root.google.protobuf.Any.encode(message.pubKey, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.votingPower != null && Object.hasOwnProperty.call(message, "votingPower")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.votingPower); + if (message.proposerPriority != null && Object.hasOwnProperty.call(message, "proposerPriority")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.proposerPriority); + return writer; + }; + + /** + * Encodes the specified Validator message, length delimited. Does not implicitly {@link cosmos.base.tendermint.v1beta1.Validator.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.tendermint.v1beta1.Validator + * @static + * @param {cosmos.base.tendermint.v1beta1.IValidator} message Validator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Validator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Validator message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.tendermint.v1beta1.Validator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.tendermint.v1beta1.Validator} Validator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Validator.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.tendermint.v1beta1.Validator(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.pubKey = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 3: + message.votingPower = reader.int64(); + break; + case 4: + message.proposerPriority = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Validator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.tendermint.v1beta1.Validator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.tendermint.v1beta1.Validator} Validator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Validator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Validator message. + * @function verify + * @memberof cosmos.base.tendermint.v1beta1.Validator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Validator.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.pubKey != null && message.hasOwnProperty("pubKey")) { + let error = $root.google.protobuf.Any.verify(message.pubKey); + if (error) + return "pubKey." + error; + } + if (message.votingPower != null && message.hasOwnProperty("votingPower")) + if (!$util.isInteger(message.votingPower) && !(message.votingPower && $util.isInteger(message.votingPower.low) && $util.isInteger(message.votingPower.high))) + return "votingPower: integer|Long expected"; + if (message.proposerPriority != null && message.hasOwnProperty("proposerPriority")) + if (!$util.isInteger(message.proposerPriority) && !(message.proposerPriority && $util.isInteger(message.proposerPriority.low) && $util.isInteger(message.proposerPriority.high))) + return "proposerPriority: integer|Long expected"; + return null; + }; + + /** + * Creates a Validator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.tendermint.v1beta1.Validator + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.tendermint.v1beta1.Validator} Validator + */ + Validator.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.tendermint.v1beta1.Validator) + return object; + let message = new $root.cosmos.base.tendermint.v1beta1.Validator(); + if (object.address != null) + message.address = String(object.address); + if (object.pubKey != null) { + if (typeof object.pubKey !== "object") + throw TypeError(".cosmos.base.tendermint.v1beta1.Validator.pubKey: object expected"); + message.pubKey = $root.google.protobuf.Any.fromObject(object.pubKey); + } + if (object.votingPower != null) + if ($util.Long) + (message.votingPower = $util.Long.fromValue(object.votingPower)).unsigned = false; + else if (typeof object.votingPower === "string") + message.votingPower = parseInt(object.votingPower, 10); + else if (typeof object.votingPower === "number") + message.votingPower = object.votingPower; + else if (typeof object.votingPower === "object") + message.votingPower = new $util.LongBits(object.votingPower.low >>> 0, object.votingPower.high >>> 0).toNumber(); + if (object.proposerPriority != null) + if ($util.Long) + (message.proposerPriority = $util.Long.fromValue(object.proposerPriority)).unsigned = false; + else if (typeof object.proposerPriority === "string") + message.proposerPriority = parseInt(object.proposerPriority, 10); + else if (typeof object.proposerPriority === "number") + message.proposerPriority = object.proposerPriority; + else if (typeof object.proposerPriority === "object") + message.proposerPriority = new $util.LongBits(object.proposerPriority.low >>> 0, object.proposerPriority.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a Validator message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.tendermint.v1beta1.Validator + * @static + * @param {cosmos.base.tendermint.v1beta1.Validator} message Validator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Validator.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.address = ""; + object.pubKey = null; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.votingPower = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.votingPower = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.proposerPriority = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.proposerPriority = options.longs === String ? "0" : 0; + } + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + if (message.pubKey != null && message.hasOwnProperty("pubKey")) + object.pubKey = $root.google.protobuf.Any.toObject(message.pubKey, options); + if (message.votingPower != null && message.hasOwnProperty("votingPower")) + if (typeof message.votingPower === "number") + object.votingPower = options.longs === String ? String(message.votingPower) : message.votingPower; + else + object.votingPower = options.longs === String ? $util.Long.prototype.toString.call(message.votingPower) : options.longs === Number ? new $util.LongBits(message.votingPower.low >>> 0, message.votingPower.high >>> 0).toNumber() : message.votingPower; + if (message.proposerPriority != null && message.hasOwnProperty("proposerPriority")) + if (typeof message.proposerPriority === "number") + object.proposerPriority = options.longs === String ? String(message.proposerPriority) : message.proposerPriority; + else + object.proposerPriority = options.longs === String ? $util.Long.prototype.toString.call(message.proposerPriority) : options.longs === Number ? new $util.LongBits(message.proposerPriority.low >>> 0, message.proposerPriority.high >>> 0).toNumber() : message.proposerPriority; + return object; + }; + + /** + * Converts this Validator to JSON. + * @function toJSON + * @memberof cosmos.base.tendermint.v1beta1.Validator + * @instance + * @returns {Object.} JSON object + */ + Validator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Validator; + })(v1beta1.Validator || {}); + + v1beta1.GetBlockByHeightRequest = (function(GetBlockByHeightRequest) { + + /** + * Properties of a GetBlockByHeightRequest. + * @memberof cosmos.base.tendermint.v1beta1 + * @interface IGetBlockByHeightRequest + * @property {number|Long|null} [height] GetBlockByHeightRequest height + */ + + /** + * Constructs a new GetBlockByHeightRequest. + * @memberof cosmos.base.tendermint.v1beta1 + * @classdesc Represents a GetBlockByHeightRequest. + * @implements IGetBlockByHeightRequest + * @constructor + * @param {cosmos.base.tendermint.v1beta1.IGetBlockByHeightRequest=} [properties] Properties to set + */ + function GetBlockByHeightRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBlockByHeightRequest height. + * @member {number|Long} height + * @memberof cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest + * @instance + */ + GetBlockByHeightRequest.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new GetBlockByHeightRequest instance using the specified properties. + * @function create + * @memberof cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetBlockByHeightRequest=} [properties] Properties to set + * @returns {cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest} GetBlockByHeightRequest instance + */ + GetBlockByHeightRequest.create = function create(properties) { + return new GetBlockByHeightRequest(properties); + }; + + /** + * Encodes the specified GetBlockByHeightRequest message. Does not implicitly {@link cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetBlockByHeightRequest} message GetBlockByHeightRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBlockByHeightRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.height); + return writer; + }; + + /** + * Encodes the specified GetBlockByHeightRequest message, length delimited. Does not implicitly {@link cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetBlockByHeightRequest} message GetBlockByHeightRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBlockByHeightRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBlockByHeightRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest} GetBlockByHeightRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBlockByHeightRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBlockByHeightRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest} GetBlockByHeightRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBlockByHeightRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBlockByHeightRequest message. + * @function verify + * @memberof cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBlockByHeightRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + return null; + }; + + /** + * Creates a GetBlockByHeightRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest} GetBlockByHeightRequest + */ + GetBlockByHeightRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest) + return object; + let message = new $root.cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest(); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a GetBlockByHeightRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest + * @static + * @param {cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest} message GetBlockByHeightRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBlockByHeightRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + return object; + }; + + /** + * Converts this GetBlockByHeightRequest to JSON. + * @function toJSON + * @memberof cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest + * @instance + * @returns {Object.} JSON object + */ + GetBlockByHeightRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetBlockByHeightRequest; + })(v1beta1.GetBlockByHeightRequest || {}); + + v1beta1.GetBlockByHeightResponse = (function(GetBlockByHeightResponse) { + + /** + * Properties of a GetBlockByHeightResponse. + * @memberof cosmos.base.tendermint.v1beta1 + * @interface IGetBlockByHeightResponse + * @property {tendermint.types.IBlockID|null} [blockId] GetBlockByHeightResponse blockId + * @property {tendermint.types.IBlock|null} [block] GetBlockByHeightResponse block + */ + + /** + * Constructs a new GetBlockByHeightResponse. + * @memberof cosmos.base.tendermint.v1beta1 + * @classdesc Represents a GetBlockByHeightResponse. + * @implements IGetBlockByHeightResponse + * @constructor + * @param {cosmos.base.tendermint.v1beta1.IGetBlockByHeightResponse=} [properties] Properties to set + */ + function GetBlockByHeightResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBlockByHeightResponse blockId. + * @member {tendermint.types.IBlockID|null|undefined} blockId + * @memberof cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse + * @instance + */ + GetBlockByHeightResponse.prototype.blockId = null; + + /** + * GetBlockByHeightResponse block. + * @member {tendermint.types.IBlock|null|undefined} block + * @memberof cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse + * @instance + */ + GetBlockByHeightResponse.prototype.block = null; + + /** + * Creates a new GetBlockByHeightResponse instance using the specified properties. + * @function create + * @memberof cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetBlockByHeightResponse=} [properties] Properties to set + * @returns {cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse} GetBlockByHeightResponse instance + */ + GetBlockByHeightResponse.create = function create(properties) { + return new GetBlockByHeightResponse(properties); + }; + + /** + * Encodes the specified GetBlockByHeightResponse message. Does not implicitly {@link cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetBlockByHeightResponse} message GetBlockByHeightResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBlockByHeightResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.blockId != null && Object.hasOwnProperty.call(message, "blockId")) + $root.tendermint.types.BlockID.encode(message.blockId, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.block != null && Object.hasOwnProperty.call(message, "block")) + $root.tendermint.types.Block.encode(message.block, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetBlockByHeightResponse message, length delimited. Does not implicitly {@link cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetBlockByHeightResponse} message GetBlockByHeightResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBlockByHeightResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBlockByHeightResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse} GetBlockByHeightResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBlockByHeightResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockId = $root.tendermint.types.BlockID.decode(reader, reader.uint32()); + break; + case 2: + message.block = $root.tendermint.types.Block.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBlockByHeightResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse} GetBlockByHeightResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBlockByHeightResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBlockByHeightResponse message. + * @function verify + * @memberof cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBlockByHeightResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.blockId != null && message.hasOwnProperty("blockId")) { + let error = $root.tendermint.types.BlockID.verify(message.blockId); + if (error) + return "blockId." + error; + } + if (message.block != null && message.hasOwnProperty("block")) { + let error = $root.tendermint.types.Block.verify(message.block); + if (error) + return "block." + error; + } + return null; + }; + + /** + * Creates a GetBlockByHeightResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse} GetBlockByHeightResponse + */ + GetBlockByHeightResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse) + return object; + let message = new $root.cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse(); + if (object.blockId != null) { + if (typeof object.blockId !== "object") + throw TypeError(".cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse.blockId: object expected"); + message.blockId = $root.tendermint.types.BlockID.fromObject(object.blockId); + } + if (object.block != null) { + if (typeof object.block !== "object") + throw TypeError(".cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse.block: object expected"); + message.block = $root.tendermint.types.Block.fromObject(object.block); + } + return message; + }; + + /** + * Creates a plain object from a GetBlockByHeightResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse + * @static + * @param {cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse} message GetBlockByHeightResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBlockByHeightResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.blockId = null; + object.block = null; + } + if (message.blockId != null && message.hasOwnProperty("blockId")) + object.blockId = $root.tendermint.types.BlockID.toObject(message.blockId, options); + if (message.block != null && message.hasOwnProperty("block")) + object.block = $root.tendermint.types.Block.toObject(message.block, options); + return object; + }; + + /** + * Converts this GetBlockByHeightResponse to JSON. + * @function toJSON + * @memberof cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse + * @instance + * @returns {Object.} JSON object + */ + GetBlockByHeightResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetBlockByHeightResponse; + })(v1beta1.GetBlockByHeightResponse || {}); + + v1beta1.GetLatestBlockRequest = (function(GetLatestBlockRequest) { + + /** + * Properties of a GetLatestBlockRequest. + * @memberof cosmos.base.tendermint.v1beta1 + * @interface IGetLatestBlockRequest + */ + + /** + * Constructs a new GetLatestBlockRequest. + * @memberof cosmos.base.tendermint.v1beta1 + * @classdesc Represents a GetLatestBlockRequest. + * @implements IGetLatestBlockRequest + * @constructor + * @param {cosmos.base.tendermint.v1beta1.IGetLatestBlockRequest=} [properties] Properties to set + */ + function GetLatestBlockRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new GetLatestBlockRequest instance using the specified properties. + * @function create + * @memberof cosmos.base.tendermint.v1beta1.GetLatestBlockRequest + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetLatestBlockRequest=} [properties] Properties to set + * @returns {cosmos.base.tendermint.v1beta1.GetLatestBlockRequest} GetLatestBlockRequest instance + */ + GetLatestBlockRequest.create = function create(properties) { + return new GetLatestBlockRequest(properties); + }; + + /** + * Encodes the specified GetLatestBlockRequest message. Does not implicitly {@link cosmos.base.tendermint.v1beta1.GetLatestBlockRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.base.tendermint.v1beta1.GetLatestBlockRequest + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetLatestBlockRequest} message GetLatestBlockRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetLatestBlockRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified GetLatestBlockRequest message, length delimited. Does not implicitly {@link cosmos.base.tendermint.v1beta1.GetLatestBlockRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.tendermint.v1beta1.GetLatestBlockRequest + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetLatestBlockRequest} message GetLatestBlockRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetLatestBlockRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetLatestBlockRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.tendermint.v1beta1.GetLatestBlockRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.tendermint.v1beta1.GetLatestBlockRequest} GetLatestBlockRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetLatestBlockRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.tendermint.v1beta1.GetLatestBlockRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetLatestBlockRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.tendermint.v1beta1.GetLatestBlockRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.tendermint.v1beta1.GetLatestBlockRequest} GetLatestBlockRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetLatestBlockRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetLatestBlockRequest message. + * @function verify + * @memberof cosmos.base.tendermint.v1beta1.GetLatestBlockRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetLatestBlockRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a GetLatestBlockRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.tendermint.v1beta1.GetLatestBlockRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.tendermint.v1beta1.GetLatestBlockRequest} GetLatestBlockRequest + */ + GetLatestBlockRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.tendermint.v1beta1.GetLatestBlockRequest) + return object; + return new $root.cosmos.base.tendermint.v1beta1.GetLatestBlockRequest(); + }; + + /** + * Creates a plain object from a GetLatestBlockRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.tendermint.v1beta1.GetLatestBlockRequest + * @static + * @param {cosmos.base.tendermint.v1beta1.GetLatestBlockRequest} message GetLatestBlockRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetLatestBlockRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this GetLatestBlockRequest to JSON. + * @function toJSON + * @memberof cosmos.base.tendermint.v1beta1.GetLatestBlockRequest + * @instance + * @returns {Object.} JSON object + */ + GetLatestBlockRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetLatestBlockRequest; + })(v1beta1.GetLatestBlockRequest || {}); + + v1beta1.GetLatestBlockResponse = (function(GetLatestBlockResponse) { + + /** + * Properties of a GetLatestBlockResponse. + * @memberof cosmos.base.tendermint.v1beta1 + * @interface IGetLatestBlockResponse + * @property {tendermint.types.IBlockID|null} [blockId] GetLatestBlockResponse blockId + * @property {tendermint.types.IBlock|null} [block] GetLatestBlockResponse block + */ + + /** + * Constructs a new GetLatestBlockResponse. + * @memberof cosmos.base.tendermint.v1beta1 + * @classdesc Represents a GetLatestBlockResponse. + * @implements IGetLatestBlockResponse + * @constructor + * @param {cosmos.base.tendermint.v1beta1.IGetLatestBlockResponse=} [properties] Properties to set + */ + function GetLatestBlockResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetLatestBlockResponse blockId. + * @member {tendermint.types.IBlockID|null|undefined} blockId + * @memberof cosmos.base.tendermint.v1beta1.GetLatestBlockResponse + * @instance + */ + GetLatestBlockResponse.prototype.blockId = null; + + /** + * GetLatestBlockResponse block. + * @member {tendermint.types.IBlock|null|undefined} block + * @memberof cosmos.base.tendermint.v1beta1.GetLatestBlockResponse + * @instance + */ + GetLatestBlockResponse.prototype.block = null; + + /** + * Creates a new GetLatestBlockResponse instance using the specified properties. + * @function create + * @memberof cosmos.base.tendermint.v1beta1.GetLatestBlockResponse + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetLatestBlockResponse=} [properties] Properties to set + * @returns {cosmos.base.tendermint.v1beta1.GetLatestBlockResponse} GetLatestBlockResponse instance + */ + GetLatestBlockResponse.create = function create(properties) { + return new GetLatestBlockResponse(properties); + }; + + /** + * Encodes the specified GetLatestBlockResponse message. Does not implicitly {@link cosmos.base.tendermint.v1beta1.GetLatestBlockResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.base.tendermint.v1beta1.GetLatestBlockResponse + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetLatestBlockResponse} message GetLatestBlockResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetLatestBlockResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.blockId != null && Object.hasOwnProperty.call(message, "blockId")) + $root.tendermint.types.BlockID.encode(message.blockId, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.block != null && Object.hasOwnProperty.call(message, "block")) + $root.tendermint.types.Block.encode(message.block, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetLatestBlockResponse message, length delimited. Does not implicitly {@link cosmos.base.tendermint.v1beta1.GetLatestBlockResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.tendermint.v1beta1.GetLatestBlockResponse + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetLatestBlockResponse} message GetLatestBlockResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetLatestBlockResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetLatestBlockResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.tendermint.v1beta1.GetLatestBlockResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.tendermint.v1beta1.GetLatestBlockResponse} GetLatestBlockResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetLatestBlockResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.tendermint.v1beta1.GetLatestBlockResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockId = $root.tendermint.types.BlockID.decode(reader, reader.uint32()); + break; + case 2: + message.block = $root.tendermint.types.Block.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetLatestBlockResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.tendermint.v1beta1.GetLatestBlockResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.tendermint.v1beta1.GetLatestBlockResponse} GetLatestBlockResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetLatestBlockResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetLatestBlockResponse message. + * @function verify + * @memberof cosmos.base.tendermint.v1beta1.GetLatestBlockResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetLatestBlockResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.blockId != null && message.hasOwnProperty("blockId")) { + let error = $root.tendermint.types.BlockID.verify(message.blockId); + if (error) + return "blockId." + error; + } + if (message.block != null && message.hasOwnProperty("block")) { + let error = $root.tendermint.types.Block.verify(message.block); + if (error) + return "block." + error; + } + return null; + }; + + /** + * Creates a GetLatestBlockResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.tendermint.v1beta1.GetLatestBlockResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.tendermint.v1beta1.GetLatestBlockResponse} GetLatestBlockResponse + */ + GetLatestBlockResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.tendermint.v1beta1.GetLatestBlockResponse) + return object; + let message = new $root.cosmos.base.tendermint.v1beta1.GetLatestBlockResponse(); + if (object.blockId != null) { + if (typeof object.blockId !== "object") + throw TypeError(".cosmos.base.tendermint.v1beta1.GetLatestBlockResponse.blockId: object expected"); + message.blockId = $root.tendermint.types.BlockID.fromObject(object.blockId); + } + if (object.block != null) { + if (typeof object.block !== "object") + throw TypeError(".cosmos.base.tendermint.v1beta1.GetLatestBlockResponse.block: object expected"); + message.block = $root.tendermint.types.Block.fromObject(object.block); + } + return message; + }; + + /** + * Creates a plain object from a GetLatestBlockResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.tendermint.v1beta1.GetLatestBlockResponse + * @static + * @param {cosmos.base.tendermint.v1beta1.GetLatestBlockResponse} message GetLatestBlockResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetLatestBlockResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.blockId = null; + object.block = null; + } + if (message.blockId != null && message.hasOwnProperty("blockId")) + object.blockId = $root.tendermint.types.BlockID.toObject(message.blockId, options); + if (message.block != null && message.hasOwnProperty("block")) + object.block = $root.tendermint.types.Block.toObject(message.block, options); + return object; + }; + + /** + * Converts this GetLatestBlockResponse to JSON. + * @function toJSON + * @memberof cosmos.base.tendermint.v1beta1.GetLatestBlockResponse + * @instance + * @returns {Object.} JSON object + */ + GetLatestBlockResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetLatestBlockResponse; + })(v1beta1.GetLatestBlockResponse || {}); + + v1beta1.GetSyncingRequest = (function(GetSyncingRequest) { + + /** + * Properties of a GetSyncingRequest. + * @memberof cosmos.base.tendermint.v1beta1 + * @interface IGetSyncingRequest + */ + + /** + * Constructs a new GetSyncingRequest. + * @memberof cosmos.base.tendermint.v1beta1 + * @classdesc Represents a GetSyncingRequest. + * @implements IGetSyncingRequest + * @constructor + * @param {cosmos.base.tendermint.v1beta1.IGetSyncingRequest=} [properties] Properties to set + */ + function GetSyncingRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new GetSyncingRequest instance using the specified properties. + * @function create + * @memberof cosmos.base.tendermint.v1beta1.GetSyncingRequest + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetSyncingRequest=} [properties] Properties to set + * @returns {cosmos.base.tendermint.v1beta1.GetSyncingRequest} GetSyncingRequest instance + */ + GetSyncingRequest.create = function create(properties) { + return new GetSyncingRequest(properties); + }; + + /** + * Encodes the specified GetSyncingRequest message. Does not implicitly {@link cosmos.base.tendermint.v1beta1.GetSyncingRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.base.tendermint.v1beta1.GetSyncingRequest + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetSyncingRequest} message GetSyncingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSyncingRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified GetSyncingRequest message, length delimited. Does not implicitly {@link cosmos.base.tendermint.v1beta1.GetSyncingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.tendermint.v1beta1.GetSyncingRequest + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetSyncingRequest} message GetSyncingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSyncingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSyncingRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.tendermint.v1beta1.GetSyncingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.tendermint.v1beta1.GetSyncingRequest} GetSyncingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSyncingRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.tendermint.v1beta1.GetSyncingRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSyncingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.tendermint.v1beta1.GetSyncingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.tendermint.v1beta1.GetSyncingRequest} GetSyncingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSyncingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSyncingRequest message. + * @function verify + * @memberof cosmos.base.tendermint.v1beta1.GetSyncingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSyncingRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a GetSyncingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.tendermint.v1beta1.GetSyncingRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.tendermint.v1beta1.GetSyncingRequest} GetSyncingRequest + */ + GetSyncingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.tendermint.v1beta1.GetSyncingRequest) + return object; + return new $root.cosmos.base.tendermint.v1beta1.GetSyncingRequest(); + }; + + /** + * Creates a plain object from a GetSyncingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.tendermint.v1beta1.GetSyncingRequest + * @static + * @param {cosmos.base.tendermint.v1beta1.GetSyncingRequest} message GetSyncingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSyncingRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this GetSyncingRequest to JSON. + * @function toJSON + * @memberof cosmos.base.tendermint.v1beta1.GetSyncingRequest + * @instance + * @returns {Object.} JSON object + */ + GetSyncingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetSyncingRequest; + })(v1beta1.GetSyncingRequest || {}); + + v1beta1.GetSyncingResponse = (function(GetSyncingResponse) { + + /** + * Properties of a GetSyncingResponse. + * @memberof cosmos.base.tendermint.v1beta1 + * @interface IGetSyncingResponse + * @property {boolean|null} [syncing] GetSyncingResponse syncing + */ + + /** + * Constructs a new GetSyncingResponse. + * @memberof cosmos.base.tendermint.v1beta1 + * @classdesc Represents a GetSyncingResponse. + * @implements IGetSyncingResponse + * @constructor + * @param {cosmos.base.tendermint.v1beta1.IGetSyncingResponse=} [properties] Properties to set + */ + function GetSyncingResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSyncingResponse syncing. + * @member {boolean} syncing + * @memberof cosmos.base.tendermint.v1beta1.GetSyncingResponse + * @instance + */ + GetSyncingResponse.prototype.syncing = false; + + /** + * Creates a new GetSyncingResponse instance using the specified properties. + * @function create + * @memberof cosmos.base.tendermint.v1beta1.GetSyncingResponse + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetSyncingResponse=} [properties] Properties to set + * @returns {cosmos.base.tendermint.v1beta1.GetSyncingResponse} GetSyncingResponse instance + */ + GetSyncingResponse.create = function create(properties) { + return new GetSyncingResponse(properties); + }; + + /** + * Encodes the specified GetSyncingResponse message. Does not implicitly {@link cosmos.base.tendermint.v1beta1.GetSyncingResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.base.tendermint.v1beta1.GetSyncingResponse + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetSyncingResponse} message GetSyncingResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSyncingResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.syncing != null && Object.hasOwnProperty.call(message, "syncing")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.syncing); + return writer; + }; + + /** + * Encodes the specified GetSyncingResponse message, length delimited. Does not implicitly {@link cosmos.base.tendermint.v1beta1.GetSyncingResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.tendermint.v1beta1.GetSyncingResponse + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetSyncingResponse} message GetSyncingResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSyncingResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSyncingResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.tendermint.v1beta1.GetSyncingResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.tendermint.v1beta1.GetSyncingResponse} GetSyncingResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSyncingResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.tendermint.v1beta1.GetSyncingResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.syncing = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSyncingResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.tendermint.v1beta1.GetSyncingResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.tendermint.v1beta1.GetSyncingResponse} GetSyncingResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSyncingResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSyncingResponse message. + * @function verify + * @memberof cosmos.base.tendermint.v1beta1.GetSyncingResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSyncingResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.syncing != null && message.hasOwnProperty("syncing")) + if (typeof message.syncing !== "boolean") + return "syncing: boolean expected"; + return null; + }; + + /** + * Creates a GetSyncingResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.tendermint.v1beta1.GetSyncingResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.tendermint.v1beta1.GetSyncingResponse} GetSyncingResponse + */ + GetSyncingResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.tendermint.v1beta1.GetSyncingResponse) + return object; + let message = new $root.cosmos.base.tendermint.v1beta1.GetSyncingResponse(); + if (object.syncing != null) + message.syncing = Boolean(object.syncing); + return message; + }; + + /** + * Creates a plain object from a GetSyncingResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.tendermint.v1beta1.GetSyncingResponse + * @static + * @param {cosmos.base.tendermint.v1beta1.GetSyncingResponse} message GetSyncingResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSyncingResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.syncing = false; + if (message.syncing != null && message.hasOwnProperty("syncing")) + object.syncing = message.syncing; + return object; + }; + + /** + * Converts this GetSyncingResponse to JSON. + * @function toJSON + * @memberof cosmos.base.tendermint.v1beta1.GetSyncingResponse + * @instance + * @returns {Object.} JSON object + */ + GetSyncingResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetSyncingResponse; + })(v1beta1.GetSyncingResponse || {}); + + v1beta1.GetNodeInfoRequest = (function(GetNodeInfoRequest) { + + /** + * Properties of a GetNodeInfoRequest. + * @memberof cosmos.base.tendermint.v1beta1 + * @interface IGetNodeInfoRequest + */ + + /** + * Constructs a new GetNodeInfoRequest. + * @memberof cosmos.base.tendermint.v1beta1 + * @classdesc Represents a GetNodeInfoRequest. + * @implements IGetNodeInfoRequest + * @constructor + * @param {cosmos.base.tendermint.v1beta1.IGetNodeInfoRequest=} [properties] Properties to set + */ + function GetNodeInfoRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new GetNodeInfoRequest instance using the specified properties. + * @function create + * @memberof cosmos.base.tendermint.v1beta1.GetNodeInfoRequest + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetNodeInfoRequest=} [properties] Properties to set + * @returns {cosmos.base.tendermint.v1beta1.GetNodeInfoRequest} GetNodeInfoRequest instance + */ + GetNodeInfoRequest.create = function create(properties) { + return new GetNodeInfoRequest(properties); + }; + + /** + * Encodes the specified GetNodeInfoRequest message. Does not implicitly {@link cosmos.base.tendermint.v1beta1.GetNodeInfoRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.base.tendermint.v1beta1.GetNodeInfoRequest + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetNodeInfoRequest} message GetNodeInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNodeInfoRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified GetNodeInfoRequest message, length delimited. Does not implicitly {@link cosmos.base.tendermint.v1beta1.GetNodeInfoRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.tendermint.v1beta1.GetNodeInfoRequest + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetNodeInfoRequest} message GetNodeInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNodeInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetNodeInfoRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.tendermint.v1beta1.GetNodeInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.tendermint.v1beta1.GetNodeInfoRequest} GetNodeInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNodeInfoRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.tendermint.v1beta1.GetNodeInfoRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetNodeInfoRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.tendermint.v1beta1.GetNodeInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.tendermint.v1beta1.GetNodeInfoRequest} GetNodeInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNodeInfoRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetNodeInfoRequest message. + * @function verify + * @memberof cosmos.base.tendermint.v1beta1.GetNodeInfoRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetNodeInfoRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a GetNodeInfoRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.tendermint.v1beta1.GetNodeInfoRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.tendermint.v1beta1.GetNodeInfoRequest} GetNodeInfoRequest + */ + GetNodeInfoRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.tendermint.v1beta1.GetNodeInfoRequest) + return object; + return new $root.cosmos.base.tendermint.v1beta1.GetNodeInfoRequest(); + }; + + /** + * Creates a plain object from a GetNodeInfoRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.tendermint.v1beta1.GetNodeInfoRequest + * @static + * @param {cosmos.base.tendermint.v1beta1.GetNodeInfoRequest} message GetNodeInfoRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetNodeInfoRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this GetNodeInfoRequest to JSON. + * @function toJSON + * @memberof cosmos.base.tendermint.v1beta1.GetNodeInfoRequest + * @instance + * @returns {Object.} JSON object + */ + GetNodeInfoRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetNodeInfoRequest; + })(v1beta1.GetNodeInfoRequest || {}); + + v1beta1.GetNodeInfoResponse = (function(GetNodeInfoResponse) { + + /** + * Properties of a GetNodeInfoResponse. + * @memberof cosmos.base.tendermint.v1beta1 + * @interface IGetNodeInfoResponse + * @property {tendermint.p2p.IDefaultNodeInfo|null} [defaultNodeInfo] GetNodeInfoResponse defaultNodeInfo + * @property {cosmos.base.tendermint.v1beta1.IVersionInfo|null} [applicationVersion] GetNodeInfoResponse applicationVersion + */ + + /** + * Constructs a new GetNodeInfoResponse. + * @memberof cosmos.base.tendermint.v1beta1 + * @classdesc Represents a GetNodeInfoResponse. + * @implements IGetNodeInfoResponse + * @constructor + * @param {cosmos.base.tendermint.v1beta1.IGetNodeInfoResponse=} [properties] Properties to set + */ + function GetNodeInfoResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetNodeInfoResponse defaultNodeInfo. + * @member {tendermint.p2p.IDefaultNodeInfo|null|undefined} defaultNodeInfo + * @memberof cosmos.base.tendermint.v1beta1.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.defaultNodeInfo = null; + + /** + * GetNodeInfoResponse applicationVersion. + * @member {cosmos.base.tendermint.v1beta1.IVersionInfo|null|undefined} applicationVersion + * @memberof cosmos.base.tendermint.v1beta1.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.applicationVersion = null; + + /** + * Creates a new GetNodeInfoResponse instance using the specified properties. + * @function create + * @memberof cosmos.base.tendermint.v1beta1.GetNodeInfoResponse + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetNodeInfoResponse=} [properties] Properties to set + * @returns {cosmos.base.tendermint.v1beta1.GetNodeInfoResponse} GetNodeInfoResponse instance + */ + GetNodeInfoResponse.create = function create(properties) { + return new GetNodeInfoResponse(properties); + }; + + /** + * Encodes the specified GetNodeInfoResponse message. Does not implicitly {@link cosmos.base.tendermint.v1beta1.GetNodeInfoResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.base.tendermint.v1beta1.GetNodeInfoResponse + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetNodeInfoResponse} message GetNodeInfoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNodeInfoResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaultNodeInfo != null && Object.hasOwnProperty.call(message, "defaultNodeInfo")) + $root.tendermint.p2p.DefaultNodeInfo.encode(message.defaultNodeInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.applicationVersion != null && Object.hasOwnProperty.call(message, "applicationVersion")) + $root.cosmos.base.tendermint.v1beta1.VersionInfo.encode(message.applicationVersion, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetNodeInfoResponse message, length delimited. Does not implicitly {@link cosmos.base.tendermint.v1beta1.GetNodeInfoResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.tendermint.v1beta1.GetNodeInfoResponse + * @static + * @param {cosmos.base.tendermint.v1beta1.IGetNodeInfoResponse} message GetNodeInfoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNodeInfoResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetNodeInfoResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.tendermint.v1beta1.GetNodeInfoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.tendermint.v1beta1.GetNodeInfoResponse} GetNodeInfoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNodeInfoResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.tendermint.v1beta1.GetNodeInfoResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.defaultNodeInfo = $root.tendermint.p2p.DefaultNodeInfo.decode(reader, reader.uint32()); + break; + case 2: + message.applicationVersion = $root.cosmos.base.tendermint.v1beta1.VersionInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetNodeInfoResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.tendermint.v1beta1.GetNodeInfoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.tendermint.v1beta1.GetNodeInfoResponse} GetNodeInfoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNodeInfoResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetNodeInfoResponse message. + * @function verify + * @memberof cosmos.base.tendermint.v1beta1.GetNodeInfoResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetNodeInfoResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaultNodeInfo != null && message.hasOwnProperty("defaultNodeInfo")) { + let error = $root.tendermint.p2p.DefaultNodeInfo.verify(message.defaultNodeInfo); + if (error) + return "defaultNodeInfo." + error; + } + if (message.applicationVersion != null && message.hasOwnProperty("applicationVersion")) { + let error = $root.cosmos.base.tendermint.v1beta1.VersionInfo.verify(message.applicationVersion); + if (error) + return "applicationVersion." + error; + } + return null; + }; + + /** + * Creates a GetNodeInfoResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.tendermint.v1beta1.GetNodeInfoResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.tendermint.v1beta1.GetNodeInfoResponse} GetNodeInfoResponse + */ + GetNodeInfoResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.tendermint.v1beta1.GetNodeInfoResponse) + return object; + let message = new $root.cosmos.base.tendermint.v1beta1.GetNodeInfoResponse(); + if (object.defaultNodeInfo != null) { + if (typeof object.defaultNodeInfo !== "object") + throw TypeError(".cosmos.base.tendermint.v1beta1.GetNodeInfoResponse.defaultNodeInfo: object expected"); + message.defaultNodeInfo = $root.tendermint.p2p.DefaultNodeInfo.fromObject(object.defaultNodeInfo); + } + if (object.applicationVersion != null) { + if (typeof object.applicationVersion !== "object") + throw TypeError(".cosmos.base.tendermint.v1beta1.GetNodeInfoResponse.applicationVersion: object expected"); + message.applicationVersion = $root.cosmos.base.tendermint.v1beta1.VersionInfo.fromObject(object.applicationVersion); + } + return message; + }; + + /** + * Creates a plain object from a GetNodeInfoResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.tendermint.v1beta1.GetNodeInfoResponse + * @static + * @param {cosmos.base.tendermint.v1beta1.GetNodeInfoResponse} message GetNodeInfoResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetNodeInfoResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.defaultNodeInfo = null; + object.applicationVersion = null; + } + if (message.defaultNodeInfo != null && message.hasOwnProperty("defaultNodeInfo")) + object.defaultNodeInfo = $root.tendermint.p2p.DefaultNodeInfo.toObject(message.defaultNodeInfo, options); + if (message.applicationVersion != null && message.hasOwnProperty("applicationVersion")) + object.applicationVersion = $root.cosmos.base.tendermint.v1beta1.VersionInfo.toObject(message.applicationVersion, options); + return object; + }; + + /** + * Converts this GetNodeInfoResponse to JSON. + * @function toJSON + * @memberof cosmos.base.tendermint.v1beta1.GetNodeInfoResponse + * @instance + * @returns {Object.} JSON object + */ + GetNodeInfoResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetNodeInfoResponse; + })(v1beta1.GetNodeInfoResponse || {}); + + v1beta1.VersionInfo = (function(VersionInfo) { + + /** + * Properties of a VersionInfo. + * @memberof cosmos.base.tendermint.v1beta1 + * @interface IVersionInfo + * @property {string|null} [name] VersionInfo name + * @property {string|null} [appName] VersionInfo appName + * @property {string|null} [version] VersionInfo version + * @property {string|null} [gitCommit] VersionInfo gitCommit + * @property {string|null} [buildTags] VersionInfo buildTags + * @property {string|null} [goVersion] VersionInfo goVersion + * @property {Array.|null} [buildDeps] VersionInfo buildDeps + */ + + /** + * Constructs a new VersionInfo. + * @memberof cosmos.base.tendermint.v1beta1 + * @classdesc Represents a VersionInfo. + * @implements IVersionInfo + * @constructor + * @param {cosmos.base.tendermint.v1beta1.IVersionInfo=} [properties] Properties to set + */ + function VersionInfo(properties) { + this.buildDeps = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VersionInfo name. + * @member {string} name + * @memberof cosmos.base.tendermint.v1beta1.VersionInfo + * @instance + */ + VersionInfo.prototype.name = ""; + + /** + * VersionInfo appName. + * @member {string} appName + * @memberof cosmos.base.tendermint.v1beta1.VersionInfo + * @instance + */ + VersionInfo.prototype.appName = ""; + + /** + * VersionInfo version. + * @member {string} version + * @memberof cosmos.base.tendermint.v1beta1.VersionInfo + * @instance + */ + VersionInfo.prototype.version = ""; + + /** + * VersionInfo gitCommit. + * @member {string} gitCommit + * @memberof cosmos.base.tendermint.v1beta1.VersionInfo + * @instance + */ + VersionInfo.prototype.gitCommit = ""; + + /** + * VersionInfo buildTags. + * @member {string} buildTags + * @memberof cosmos.base.tendermint.v1beta1.VersionInfo + * @instance + */ + VersionInfo.prototype.buildTags = ""; + + /** + * VersionInfo goVersion. + * @member {string} goVersion + * @memberof cosmos.base.tendermint.v1beta1.VersionInfo + * @instance + */ + VersionInfo.prototype.goVersion = ""; + + /** + * VersionInfo buildDeps. + * @member {Array.} buildDeps + * @memberof cosmos.base.tendermint.v1beta1.VersionInfo + * @instance + */ + VersionInfo.prototype.buildDeps = $util.emptyArray; + + /** + * Creates a new VersionInfo instance using the specified properties. + * @function create + * @memberof cosmos.base.tendermint.v1beta1.VersionInfo + * @static + * @param {cosmos.base.tendermint.v1beta1.IVersionInfo=} [properties] Properties to set + * @returns {cosmos.base.tendermint.v1beta1.VersionInfo} VersionInfo instance + */ + VersionInfo.create = function create(properties) { + return new VersionInfo(properties); + }; + + /** + * Encodes the specified VersionInfo message. Does not implicitly {@link cosmos.base.tendermint.v1beta1.VersionInfo.verify|verify} messages. + * @function encode + * @memberof cosmos.base.tendermint.v1beta1.VersionInfo + * @static + * @param {cosmos.base.tendermint.v1beta1.IVersionInfo} message VersionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.appName != null && Object.hasOwnProperty.call(message, "appName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.appName); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.version); + if (message.gitCommit != null && Object.hasOwnProperty.call(message, "gitCommit")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.gitCommit); + if (message.buildTags != null && Object.hasOwnProperty.call(message, "buildTags")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.buildTags); + if (message.goVersion != null && Object.hasOwnProperty.call(message, "goVersion")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.goVersion); + if (message.buildDeps != null && message.buildDeps.length) + for (let i = 0; i < message.buildDeps.length; ++i) + $root.cosmos.base.tendermint.v1beta1.Module.encode(message.buildDeps[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VersionInfo message, length delimited. Does not implicitly {@link cosmos.base.tendermint.v1beta1.VersionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.tendermint.v1beta1.VersionInfo + * @static + * @param {cosmos.base.tendermint.v1beta1.IVersionInfo} message VersionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VersionInfo message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.tendermint.v1beta1.VersionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.tendermint.v1beta1.VersionInfo} VersionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.tendermint.v1beta1.VersionInfo(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.appName = reader.string(); + break; + case 3: + message.version = reader.string(); + break; + case 4: + message.gitCommit = reader.string(); + break; + case 5: + message.buildTags = reader.string(); + break; + case 6: + message.goVersion = reader.string(); + break; + case 7: + if (!(message.buildDeps && message.buildDeps.length)) + message.buildDeps = []; + message.buildDeps.push($root.cosmos.base.tendermint.v1beta1.Module.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VersionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.tendermint.v1beta1.VersionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.tendermint.v1beta1.VersionInfo} VersionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VersionInfo message. + * @function verify + * @memberof cosmos.base.tendermint.v1beta1.VersionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VersionInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.appName != null && message.hasOwnProperty("appName")) + if (!$util.isString(message.appName)) + return "appName: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.gitCommit != null && message.hasOwnProperty("gitCommit")) + if (!$util.isString(message.gitCommit)) + return "gitCommit: string expected"; + if (message.buildTags != null && message.hasOwnProperty("buildTags")) + if (!$util.isString(message.buildTags)) + return "buildTags: string expected"; + if (message.goVersion != null && message.hasOwnProperty("goVersion")) + if (!$util.isString(message.goVersion)) + return "goVersion: string expected"; + if (message.buildDeps != null && message.hasOwnProperty("buildDeps")) { + if (!Array.isArray(message.buildDeps)) + return "buildDeps: array expected"; + for (let i = 0; i < message.buildDeps.length; ++i) { + let error = $root.cosmos.base.tendermint.v1beta1.Module.verify(message.buildDeps[i]); + if (error) + return "buildDeps." + error; + } + } + return null; + }; + + /** + * Creates a VersionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.tendermint.v1beta1.VersionInfo + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.tendermint.v1beta1.VersionInfo} VersionInfo + */ + VersionInfo.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.tendermint.v1beta1.VersionInfo) + return object; + let message = new $root.cosmos.base.tendermint.v1beta1.VersionInfo(); + if (object.name != null) + message.name = String(object.name); + if (object.appName != null) + message.appName = String(object.appName); + if (object.version != null) + message.version = String(object.version); + if (object.gitCommit != null) + message.gitCommit = String(object.gitCommit); + if (object.buildTags != null) + message.buildTags = String(object.buildTags); + if (object.goVersion != null) + message.goVersion = String(object.goVersion); + if (object.buildDeps) { + if (!Array.isArray(object.buildDeps)) + throw TypeError(".cosmos.base.tendermint.v1beta1.VersionInfo.buildDeps: array expected"); + message.buildDeps = []; + for (let i = 0; i < object.buildDeps.length; ++i) { + if (typeof object.buildDeps[i] !== "object") + throw TypeError(".cosmos.base.tendermint.v1beta1.VersionInfo.buildDeps: object expected"); + message.buildDeps[i] = $root.cosmos.base.tendermint.v1beta1.Module.fromObject(object.buildDeps[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a VersionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.tendermint.v1beta1.VersionInfo + * @static + * @param {cosmos.base.tendermint.v1beta1.VersionInfo} message VersionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VersionInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.buildDeps = []; + if (options.defaults) { + object.name = ""; + object.appName = ""; + object.version = ""; + object.gitCommit = ""; + object.buildTags = ""; + object.goVersion = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.appName != null && message.hasOwnProperty("appName")) + object.appName = message.appName; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.gitCommit != null && message.hasOwnProperty("gitCommit")) + object.gitCommit = message.gitCommit; + if (message.buildTags != null && message.hasOwnProperty("buildTags")) + object.buildTags = message.buildTags; + if (message.goVersion != null && message.hasOwnProperty("goVersion")) + object.goVersion = message.goVersion; + if (message.buildDeps && message.buildDeps.length) { + object.buildDeps = []; + for (let j = 0; j < message.buildDeps.length; ++j) + object.buildDeps[j] = $root.cosmos.base.tendermint.v1beta1.Module.toObject(message.buildDeps[j], options); + } + return object; + }; + + /** + * Converts this VersionInfo to JSON. + * @function toJSON + * @memberof cosmos.base.tendermint.v1beta1.VersionInfo + * @instance + * @returns {Object.} JSON object + */ + VersionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VersionInfo; + })(v1beta1.VersionInfo || {}); + + v1beta1.Module = (function(Module) { + + /** + * Properties of a Module. + * @memberof cosmos.base.tendermint.v1beta1 + * @interface IModule + * @property {string|null} [path] Module path + * @property {string|null} [version] Module version + * @property {string|null} [sum] Module sum + */ + + /** + * Constructs a new Module. + * @memberof cosmos.base.tendermint.v1beta1 + * @classdesc Represents a Module. + * @implements IModule + * @constructor + * @param {cosmos.base.tendermint.v1beta1.IModule=} [properties] Properties to set + */ + function Module(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Module path. + * @member {string} path + * @memberof cosmos.base.tendermint.v1beta1.Module + * @instance + */ + Module.prototype.path = ""; + + /** + * Module version. + * @member {string} version + * @memberof cosmos.base.tendermint.v1beta1.Module + * @instance + */ + Module.prototype.version = ""; + + /** + * Module sum. + * @member {string} sum + * @memberof cosmos.base.tendermint.v1beta1.Module + * @instance + */ + Module.prototype.sum = ""; + + /** + * Creates a new Module instance using the specified properties. + * @function create + * @memberof cosmos.base.tendermint.v1beta1.Module + * @static + * @param {cosmos.base.tendermint.v1beta1.IModule=} [properties] Properties to set + * @returns {cosmos.base.tendermint.v1beta1.Module} Module instance + */ + Module.create = function create(properties) { + return new Module(properties); + }; + + /** + * Encodes the specified Module message. Does not implicitly {@link cosmos.base.tendermint.v1beta1.Module.verify|verify} messages. + * @function encode + * @memberof cosmos.base.tendermint.v1beta1.Module + * @static + * @param {cosmos.base.tendermint.v1beta1.IModule} message Module message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Module.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.path); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); + if (message.sum != null && Object.hasOwnProperty.call(message, "sum")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sum); + return writer; + }; + + /** + * Encodes the specified Module message, length delimited. Does not implicitly {@link cosmos.base.tendermint.v1beta1.Module.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.tendermint.v1beta1.Module + * @static + * @param {cosmos.base.tendermint.v1beta1.IModule} message Module message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Module.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Module message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.tendermint.v1beta1.Module + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.tendermint.v1beta1.Module} Module + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Module.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.tendermint.v1beta1.Module(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.string(); + break; + case 2: + message.version = reader.string(); + break; + case 3: + message.sum = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Module message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.tendermint.v1beta1.Module + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.tendermint.v1beta1.Module} Module + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Module.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Module message. + * @function verify + * @memberof cosmos.base.tendermint.v1beta1.Module + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Module.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.sum != null && message.hasOwnProperty("sum")) + if (!$util.isString(message.sum)) + return "sum: string expected"; + return null; + }; + + /** + * Creates a Module message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.tendermint.v1beta1.Module + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.tendermint.v1beta1.Module} Module + */ + Module.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.tendermint.v1beta1.Module) + return object; + let message = new $root.cosmos.base.tendermint.v1beta1.Module(); + if (object.path != null) + message.path = String(object.path); + if (object.version != null) + message.version = String(object.version); + if (object.sum != null) + message.sum = String(object.sum); + return message; + }; + + /** + * Creates a plain object from a Module message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.tendermint.v1beta1.Module + * @static + * @param {cosmos.base.tendermint.v1beta1.Module} message Module + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Module.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.path = ""; + object.version = ""; + object.sum = ""; + } + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.sum != null && message.hasOwnProperty("sum")) + object.sum = message.sum; + return object; + }; + + /** + * Converts this Module to JSON. + * @function toJSON + * @memberof cosmos.base.tendermint.v1beta1.Module + * @instance + * @returns {Object.} JSON object + */ + Module.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Module; + })(v1beta1.Module || {}); + + return v1beta1; + })(tendermint.v1beta1 || {}); + + return tendermint; + })(base.tendermint || {}); + + /** + * Namespace v1beta1. + * @memberof cosmos.base + * @namespace + */ + + base.v1beta1 = (function(v1beta1) { + + v1beta1.Coin = (function(Coin) { + + /** + * Properties of a Coin. + * @memberof cosmos.base.v1beta1 + * @interface ICoin + * @property {string|null} [denom] Coin denom + * @property {string|null} [amount] Coin amount + */ + + /** + * Constructs a new Coin. + * @memberof cosmos.base.v1beta1 + * @classdesc Represents a Coin. + * @implements ICoin + * @constructor + * @param {cosmos.base.v1beta1.ICoin=} [properties] Properties to set + */ + function Coin(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Coin denom. + * @member {string} denom + * @memberof cosmos.base.v1beta1.Coin + * @instance + */ + Coin.prototype.denom = ""; + + /** + * Coin amount. + * @member {string} amount + * @memberof cosmos.base.v1beta1.Coin + * @instance + */ + Coin.prototype.amount = ""; + + /** + * Creates a new Coin instance using the specified properties. + * @function create + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {cosmos.base.v1beta1.ICoin=} [properties] Properties to set + * @returns {cosmos.base.v1beta1.Coin} Coin instance + */ + Coin.create = function create(properties) { + return new Coin(properties); + }; + + /** + * Encodes the specified Coin message. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. + * @function encode + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {cosmos.base.v1beta1.ICoin} message Coin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Coin.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.amount); + return writer; + }; + + /** + * Encodes the specified Coin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {cosmos.base.v1beta1.ICoin} message Coin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Coin.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Coin message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.v1beta1.Coin} Coin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Coin.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.Coin(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Coin message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.v1beta1.Coin} Coin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Coin.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Coin message. + * @function verify + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Coin.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.denom != null && message.hasOwnProperty("denom")) + if (!$util.isString(message.denom)) + return "denom: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) + if (!$util.isString(message.amount)) + return "amount: string expected"; + return null; + }; + + /** + * Creates a Coin message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.v1beta1.Coin} Coin + */ + Coin.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.v1beta1.Coin) + return object; + let message = new $root.cosmos.base.v1beta1.Coin(); + if (object.denom != null) + message.denom = String(object.denom); + if (object.amount != null) + message.amount = String(object.amount); + return message; + }; + + /** + * Creates a plain object from a Coin message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {cosmos.base.v1beta1.Coin} message Coin + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Coin.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.denom = ""; + object.amount = ""; + } + if (message.denom != null && message.hasOwnProperty("denom")) + object.denom = message.denom; + if (message.amount != null && message.hasOwnProperty("amount")) + object.amount = message.amount; + return object; + }; + + /** + * Converts this Coin to JSON. + * @function toJSON + * @memberof cosmos.base.v1beta1.Coin + * @instance + * @returns {Object.} JSON object + */ + Coin.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Coin; + })(v1beta1.Coin || {}); + + v1beta1.DecCoin = (function(DecCoin) { + + /** + * Properties of a DecCoin. + * @memberof cosmos.base.v1beta1 + * @interface IDecCoin + * @property {string|null} [denom] DecCoin denom + * @property {string|null} [amount] DecCoin amount + */ + + /** + * Constructs a new DecCoin. + * @memberof cosmos.base.v1beta1 + * @classdesc Represents a DecCoin. + * @implements IDecCoin + * @constructor + * @param {cosmos.base.v1beta1.IDecCoin=} [properties] Properties to set + */ + function DecCoin(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DecCoin denom. + * @member {string} denom + * @memberof cosmos.base.v1beta1.DecCoin + * @instance + */ + DecCoin.prototype.denom = ""; + + /** + * DecCoin amount. + * @member {string} amount + * @memberof cosmos.base.v1beta1.DecCoin + * @instance + */ + DecCoin.prototype.amount = ""; + + /** + * Creates a new DecCoin instance using the specified properties. + * @function create + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {cosmos.base.v1beta1.IDecCoin=} [properties] Properties to set + * @returns {cosmos.base.v1beta1.DecCoin} DecCoin instance + */ + DecCoin.create = function create(properties) { + return new DecCoin(properties); + }; + + /** + * Encodes the specified DecCoin message. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. + * @function encode + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {cosmos.base.v1beta1.IDecCoin} message DecCoin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecCoin.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.amount); + return writer; + }; + + /** + * Encodes the specified DecCoin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {cosmos.base.v1beta1.IDecCoin} message DecCoin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecCoin.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DecCoin message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.v1beta1.DecCoin} DecCoin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecCoin.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.DecCoin(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DecCoin message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.v1beta1.DecCoin} DecCoin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecCoin.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DecCoin message. + * @function verify + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DecCoin.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.denom != null && message.hasOwnProperty("denom")) + if (!$util.isString(message.denom)) + return "denom: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) + if (!$util.isString(message.amount)) + return "amount: string expected"; + return null; + }; + + /** + * Creates a DecCoin message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.v1beta1.DecCoin} DecCoin + */ + DecCoin.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.v1beta1.DecCoin) + return object; + let message = new $root.cosmos.base.v1beta1.DecCoin(); + if (object.denom != null) + message.denom = String(object.denom); + if (object.amount != null) + message.amount = String(object.amount); + return message; + }; + + /** + * Creates a plain object from a DecCoin message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {cosmos.base.v1beta1.DecCoin} message DecCoin + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DecCoin.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.denom = ""; + object.amount = ""; + } + if (message.denom != null && message.hasOwnProperty("denom")) + object.denom = message.denom; + if (message.amount != null && message.hasOwnProperty("amount")) + object.amount = message.amount; + return object; + }; + + /** + * Converts this DecCoin to JSON. + * @function toJSON + * @memberof cosmos.base.v1beta1.DecCoin + * @instance + * @returns {Object.} JSON object + */ + DecCoin.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DecCoin; + })(v1beta1.DecCoin || {}); + + v1beta1.IntProto = (function(IntProto) { + + /** + * Properties of an IntProto. + * @memberof cosmos.base.v1beta1 + * @interface IIntProto + * @property {string|null} [int] IntProto int + */ + + /** + * Constructs a new IntProto. + * @memberof cosmos.base.v1beta1 + * @classdesc Represents an IntProto. + * @implements IIntProto + * @constructor + * @param {cosmos.base.v1beta1.IIntProto=} [properties] Properties to set + */ + function IntProto(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IntProto int. + * @member {string} int + * @memberof cosmos.base.v1beta1.IntProto + * @instance + */ + IntProto.prototype.int = ""; + + /** + * Creates a new IntProto instance using the specified properties. + * @function create + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {cosmos.base.v1beta1.IIntProto=} [properties] Properties to set + * @returns {cosmos.base.v1beta1.IntProto} IntProto instance + */ + IntProto.create = function create(properties) { + return new IntProto(properties); + }; + + /** + * Encodes the specified IntProto message. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. + * @function encode + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {cosmos.base.v1beta1.IIntProto} message IntProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.int != null && Object.hasOwnProperty.call(message, "int")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.int); + return writer; + }; + + /** + * Encodes the specified IntProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {cosmos.base.v1beta1.IIntProto} message IntProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IntProto message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.v1beta1.IntProto} IntProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.IntProto(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.int = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IntProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.v1beta1.IntProto} IntProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntProto message. + * @function verify + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.int != null && message.hasOwnProperty("int")) + if (!$util.isString(message.int)) + return "int: string expected"; + return null; + }; + + /** + * Creates an IntProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.v1beta1.IntProto} IntProto + */ + IntProto.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.v1beta1.IntProto) + return object; + let message = new $root.cosmos.base.v1beta1.IntProto(); + if (object.int != null) + message.int = String(object.int); + return message; + }; + + /** + * Creates a plain object from an IntProto message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {cosmos.base.v1beta1.IntProto} message IntProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.int = ""; + if (message.int != null && message.hasOwnProperty("int")) + object.int = message.int; + return object; + }; + + /** + * Converts this IntProto to JSON. + * @function toJSON + * @memberof cosmos.base.v1beta1.IntProto + * @instance + * @returns {Object.} JSON object + */ + IntProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IntProto; + })(v1beta1.IntProto || {}); + + v1beta1.DecProto = (function(DecProto) { + + /** + * Properties of a DecProto. + * @memberof cosmos.base.v1beta1 + * @interface IDecProto + * @property {string|null} [dec] DecProto dec + */ + + /** + * Constructs a new DecProto. + * @memberof cosmos.base.v1beta1 + * @classdesc Represents a DecProto. + * @implements IDecProto + * @constructor + * @param {cosmos.base.v1beta1.IDecProto=} [properties] Properties to set + */ + function DecProto(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DecProto dec. + * @member {string} dec + * @memberof cosmos.base.v1beta1.DecProto + * @instance + */ + DecProto.prototype.dec = ""; + + /** + * Creates a new DecProto instance using the specified properties. + * @function create + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {cosmos.base.v1beta1.IDecProto=} [properties] Properties to set + * @returns {cosmos.base.v1beta1.DecProto} DecProto instance + */ + DecProto.create = function create(properties) { + return new DecProto(properties); + }; + + /** + * Encodes the specified DecProto message. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. + * @function encode + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {cosmos.base.v1beta1.IDecProto} message DecProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dec != null && Object.hasOwnProperty.call(message, "dec")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dec); + return writer; + }; + + /** + * Encodes the specified DecProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {cosmos.base.v1beta1.IDecProto} message DecProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DecProto message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.v1beta1.DecProto} DecProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.DecProto(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dec = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DecProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.v1beta1.DecProto} DecProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DecProto message. + * @function verify + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DecProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dec != null && message.hasOwnProperty("dec")) + if (!$util.isString(message.dec)) + return "dec: string expected"; + return null; + }; + + /** + * Creates a DecProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.v1beta1.DecProto} DecProto + */ + DecProto.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.v1beta1.DecProto) + return object; + let message = new $root.cosmos.base.v1beta1.DecProto(); + if (object.dec != null) + message.dec = String(object.dec); + return message; + }; + + /** + * Creates a plain object from a DecProto message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {cosmos.base.v1beta1.DecProto} message DecProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DecProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.dec = ""; + if (message.dec != null && message.hasOwnProperty("dec")) + object.dec = message.dec; + return object; + }; + + /** + * Converts this DecProto to JSON. + * @function toJSON + * @memberof cosmos.base.v1beta1.DecProto + * @instance + * @returns {Object.} JSON object + */ + DecProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DecProto; + })(v1beta1.DecProto || {}); + + return v1beta1; + })(base.v1beta1 || {}); + + return base; + })(cosmos.base || {}); + + /** + * Namespace capability. + * @memberof cosmos + * @namespace + */ + + cosmos.capability = (function(capability) { + + /** + * Namespace v1beta1. + * @memberof cosmos.capability + * @namespace + */ + + capability.v1beta1 = (function(v1beta1) { + + v1beta1.Capability = (function(Capability) { + + /** + * Properties of a Capability. + * @memberof cosmos.capability.v1beta1 + * @interface ICapability + * @property {number|Long|null} [index] Capability index + */ + + /** + * Constructs a new Capability. + * @memberof cosmos.capability.v1beta1 + * @classdesc Represents a Capability. + * @implements ICapability + * @constructor + * @param {cosmos.capability.v1beta1.ICapability=} [properties] Properties to set + */ + function Capability(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Capability index. + * @member {number|Long} index + * @memberof cosmos.capability.v1beta1.Capability + * @instance + */ + Capability.prototype.index = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new Capability instance using the specified properties. + * @function create + * @memberof cosmos.capability.v1beta1.Capability + * @static + * @param {cosmos.capability.v1beta1.ICapability=} [properties] Properties to set + * @returns {cosmos.capability.v1beta1.Capability} Capability instance + */ + Capability.create = function create(properties) { + return new Capability(properties); + }; + + /** + * Encodes the specified Capability message. Does not implicitly {@link cosmos.capability.v1beta1.Capability.verify|verify} messages. + * @function encode + * @memberof cosmos.capability.v1beta1.Capability + * @static + * @param {cosmos.capability.v1beta1.ICapability} message Capability message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Capability.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.index); + return writer; + }; + + /** + * Encodes the specified Capability message, length delimited. Does not implicitly {@link cosmos.capability.v1beta1.Capability.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.capability.v1beta1.Capability + * @static + * @param {cosmos.capability.v1beta1.ICapability} message Capability message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Capability.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Capability message from the specified reader or buffer. + * @function decode + * @memberof cosmos.capability.v1beta1.Capability + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.capability.v1beta1.Capability} Capability + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Capability.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.capability.v1beta1.Capability(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Capability message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.capability.v1beta1.Capability + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.capability.v1beta1.Capability} Capability + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Capability.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Capability message. + * @function verify + * @memberof cosmos.capability.v1beta1.Capability + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Capability.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index) && !(message.index && $util.isInteger(message.index.low) && $util.isInteger(message.index.high))) + return "index: integer|Long expected"; + return null; + }; + + /** + * Creates a Capability message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.capability.v1beta1.Capability + * @static + * @param {Object.} object Plain object + * @returns {cosmos.capability.v1beta1.Capability} Capability + */ + Capability.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.capability.v1beta1.Capability) + return object; + let message = new $root.cosmos.capability.v1beta1.Capability(); + if (object.index != null) + if ($util.Long) + (message.index = $util.Long.fromValue(object.index)).unsigned = true; + else if (typeof object.index === "string") + message.index = parseInt(object.index, 10); + else if (typeof object.index === "number") + message.index = object.index; + else if (typeof object.index === "object") + message.index = new $util.LongBits(object.index.low >>> 0, object.index.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a Capability message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.capability.v1beta1.Capability + * @static + * @param {cosmos.capability.v1beta1.Capability} message Capability + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Capability.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.index = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.index = options.longs === String ? "0" : 0; + if (message.index != null && message.hasOwnProperty("index")) + if (typeof message.index === "number") + object.index = options.longs === String ? String(message.index) : message.index; + else + object.index = options.longs === String ? $util.Long.prototype.toString.call(message.index) : options.longs === Number ? new $util.LongBits(message.index.low >>> 0, message.index.high >>> 0).toNumber(true) : message.index; + return object; + }; + + /** + * Converts this Capability to JSON. + * @function toJSON + * @memberof cosmos.capability.v1beta1.Capability + * @instance + * @returns {Object.} JSON object + */ + Capability.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Capability; + })(v1beta1.Capability || {}); + + v1beta1.Owner = (function(Owner) { + + /** + * Properties of an Owner. + * @memberof cosmos.capability.v1beta1 + * @interface IOwner + * @property {string|null} [module] Owner module + * @property {string|null} [name] Owner name + */ + + /** + * Constructs a new Owner. + * @memberof cosmos.capability.v1beta1 + * @classdesc Represents an Owner. + * @implements IOwner + * @constructor + * @param {cosmos.capability.v1beta1.IOwner=} [properties] Properties to set + */ + function Owner(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Owner module. + * @member {string} module + * @memberof cosmos.capability.v1beta1.Owner + * @instance + */ + Owner.prototype.module = ""; + + /** + * Owner name. + * @member {string} name + * @memberof cosmos.capability.v1beta1.Owner + * @instance + */ + Owner.prototype.name = ""; + + /** + * Creates a new Owner instance using the specified properties. + * @function create + * @memberof cosmos.capability.v1beta1.Owner + * @static + * @param {cosmos.capability.v1beta1.IOwner=} [properties] Properties to set + * @returns {cosmos.capability.v1beta1.Owner} Owner instance + */ + Owner.create = function create(properties) { + return new Owner(properties); + }; + + /** + * Encodes the specified Owner message. Does not implicitly {@link cosmos.capability.v1beta1.Owner.verify|verify} messages. + * @function encode + * @memberof cosmos.capability.v1beta1.Owner + * @static + * @param {cosmos.capability.v1beta1.IOwner} message Owner message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Owner.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.module != null && Object.hasOwnProperty.call(message, "module")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.module); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + return writer; + }; + + /** + * Encodes the specified Owner message, length delimited. Does not implicitly {@link cosmos.capability.v1beta1.Owner.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.capability.v1beta1.Owner + * @static + * @param {cosmos.capability.v1beta1.IOwner} message Owner message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Owner.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Owner message from the specified reader or buffer. + * @function decode + * @memberof cosmos.capability.v1beta1.Owner + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.capability.v1beta1.Owner} Owner + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Owner.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.capability.v1beta1.Owner(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.module = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Owner message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.capability.v1beta1.Owner + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.capability.v1beta1.Owner} Owner + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Owner.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Owner message. + * @function verify + * @memberof cosmos.capability.v1beta1.Owner + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Owner.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.module != null && message.hasOwnProperty("module")) + if (!$util.isString(message.module)) + return "module: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates an Owner message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.capability.v1beta1.Owner + * @static + * @param {Object.} object Plain object + * @returns {cosmos.capability.v1beta1.Owner} Owner + */ + Owner.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.capability.v1beta1.Owner) + return object; + let message = new $root.cosmos.capability.v1beta1.Owner(); + if (object.module != null) + message.module = String(object.module); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an Owner message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.capability.v1beta1.Owner + * @static + * @param {cosmos.capability.v1beta1.Owner} message Owner + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Owner.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.module = ""; + object.name = ""; + } + if (message.module != null && message.hasOwnProperty("module")) + object.module = message.module; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this Owner to JSON. + * @function toJSON + * @memberof cosmos.capability.v1beta1.Owner + * @instance + * @returns {Object.} JSON object + */ + Owner.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Owner; + })(v1beta1.Owner || {}); + + v1beta1.CapabilityOwners = (function(CapabilityOwners) { + + /** + * Properties of a CapabilityOwners. + * @memberof cosmos.capability.v1beta1 + * @interface ICapabilityOwners + * @property {Array.|null} [owners] CapabilityOwners owners + */ + + /** + * Constructs a new CapabilityOwners. + * @memberof cosmos.capability.v1beta1 + * @classdesc Represents a CapabilityOwners. + * @implements ICapabilityOwners + * @constructor + * @param {cosmos.capability.v1beta1.ICapabilityOwners=} [properties] Properties to set + */ + function CapabilityOwners(properties) { + this.owners = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CapabilityOwners owners. + * @member {Array.} owners + * @memberof cosmos.capability.v1beta1.CapabilityOwners + * @instance + */ + CapabilityOwners.prototype.owners = $util.emptyArray; + + /** + * Creates a new CapabilityOwners instance using the specified properties. + * @function create + * @memberof cosmos.capability.v1beta1.CapabilityOwners + * @static + * @param {cosmos.capability.v1beta1.ICapabilityOwners=} [properties] Properties to set + * @returns {cosmos.capability.v1beta1.CapabilityOwners} CapabilityOwners instance + */ + CapabilityOwners.create = function create(properties) { + return new CapabilityOwners(properties); + }; + + /** + * Encodes the specified CapabilityOwners message. Does not implicitly {@link cosmos.capability.v1beta1.CapabilityOwners.verify|verify} messages. + * @function encode + * @memberof cosmos.capability.v1beta1.CapabilityOwners + * @static + * @param {cosmos.capability.v1beta1.ICapabilityOwners} message CapabilityOwners message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CapabilityOwners.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.owners != null && message.owners.length) + for (let i = 0; i < message.owners.length; ++i) + $root.cosmos.capability.v1beta1.Owner.encode(message.owners[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CapabilityOwners message, length delimited. Does not implicitly {@link cosmos.capability.v1beta1.CapabilityOwners.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.capability.v1beta1.CapabilityOwners + * @static + * @param {cosmos.capability.v1beta1.ICapabilityOwners} message CapabilityOwners message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CapabilityOwners.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CapabilityOwners message from the specified reader or buffer. + * @function decode + * @memberof cosmos.capability.v1beta1.CapabilityOwners + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.capability.v1beta1.CapabilityOwners} CapabilityOwners + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CapabilityOwners.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.capability.v1beta1.CapabilityOwners(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.owners && message.owners.length)) + message.owners = []; + message.owners.push($root.cosmos.capability.v1beta1.Owner.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CapabilityOwners message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.capability.v1beta1.CapabilityOwners + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.capability.v1beta1.CapabilityOwners} CapabilityOwners + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CapabilityOwners.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CapabilityOwners message. + * @function verify + * @memberof cosmos.capability.v1beta1.CapabilityOwners + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CapabilityOwners.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.owners != null && message.hasOwnProperty("owners")) { + if (!Array.isArray(message.owners)) + return "owners: array expected"; + for (let i = 0; i < message.owners.length; ++i) { + let error = $root.cosmos.capability.v1beta1.Owner.verify(message.owners[i]); + if (error) + return "owners." + error; + } + } + return null; + }; + + /** + * Creates a CapabilityOwners message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.capability.v1beta1.CapabilityOwners + * @static + * @param {Object.} object Plain object + * @returns {cosmos.capability.v1beta1.CapabilityOwners} CapabilityOwners + */ + CapabilityOwners.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.capability.v1beta1.CapabilityOwners) + return object; + let message = new $root.cosmos.capability.v1beta1.CapabilityOwners(); + if (object.owners) { + if (!Array.isArray(object.owners)) + throw TypeError(".cosmos.capability.v1beta1.CapabilityOwners.owners: array expected"); + message.owners = []; + for (let i = 0; i < object.owners.length; ++i) { + if (typeof object.owners[i] !== "object") + throw TypeError(".cosmos.capability.v1beta1.CapabilityOwners.owners: object expected"); + message.owners[i] = $root.cosmos.capability.v1beta1.Owner.fromObject(object.owners[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CapabilityOwners message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.capability.v1beta1.CapabilityOwners + * @static + * @param {cosmos.capability.v1beta1.CapabilityOwners} message CapabilityOwners + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CapabilityOwners.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.owners = []; + if (message.owners && message.owners.length) { + object.owners = []; + for (let j = 0; j < message.owners.length; ++j) + object.owners[j] = $root.cosmos.capability.v1beta1.Owner.toObject(message.owners[j], options); + } + return object; + }; + + /** + * Converts this CapabilityOwners to JSON. + * @function toJSON + * @memberof cosmos.capability.v1beta1.CapabilityOwners + * @instance + * @returns {Object.} JSON object + */ + CapabilityOwners.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CapabilityOwners; + })(v1beta1.CapabilityOwners || {}); + + v1beta1.GenesisOwners = (function(GenesisOwners) { + + /** + * Properties of a GenesisOwners. + * @memberof cosmos.capability.v1beta1 + * @interface IGenesisOwners + * @property {number|Long|null} [index] GenesisOwners index + * @property {cosmos.capability.v1beta1.ICapabilityOwners|null} [indexOwners] GenesisOwners indexOwners + */ + + /** + * Constructs a new GenesisOwners. + * @memberof cosmos.capability.v1beta1 + * @classdesc Represents a GenesisOwners. + * @implements IGenesisOwners + * @constructor + * @param {cosmos.capability.v1beta1.IGenesisOwners=} [properties] Properties to set + */ + function GenesisOwners(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenesisOwners index. + * @member {number|Long} index + * @memberof cosmos.capability.v1beta1.GenesisOwners + * @instance + */ + GenesisOwners.prototype.index = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GenesisOwners indexOwners. + * @member {cosmos.capability.v1beta1.ICapabilityOwners|null|undefined} indexOwners + * @memberof cosmos.capability.v1beta1.GenesisOwners + * @instance + */ + GenesisOwners.prototype.indexOwners = null; + + /** + * Creates a new GenesisOwners instance using the specified properties. + * @function create + * @memberof cosmos.capability.v1beta1.GenesisOwners + * @static + * @param {cosmos.capability.v1beta1.IGenesisOwners=} [properties] Properties to set + * @returns {cosmos.capability.v1beta1.GenesisOwners} GenesisOwners instance + */ + GenesisOwners.create = function create(properties) { + return new GenesisOwners(properties); + }; + + /** + * Encodes the specified GenesisOwners message. Does not implicitly {@link cosmos.capability.v1beta1.GenesisOwners.verify|verify} messages. + * @function encode + * @memberof cosmos.capability.v1beta1.GenesisOwners + * @static + * @param {cosmos.capability.v1beta1.IGenesisOwners} message GenesisOwners message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisOwners.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.index); + if (message.indexOwners != null && Object.hasOwnProperty.call(message, "indexOwners")) + $root.cosmos.capability.v1beta1.CapabilityOwners.encode(message.indexOwners, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenesisOwners message, length delimited. Does not implicitly {@link cosmos.capability.v1beta1.GenesisOwners.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.capability.v1beta1.GenesisOwners + * @static + * @param {cosmos.capability.v1beta1.IGenesisOwners} message GenesisOwners message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisOwners.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenesisOwners message from the specified reader or buffer. + * @function decode + * @memberof cosmos.capability.v1beta1.GenesisOwners + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.capability.v1beta1.GenesisOwners} GenesisOwners + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisOwners.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.capability.v1beta1.GenesisOwners(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.uint64(); + break; + case 2: + message.indexOwners = $root.cosmos.capability.v1beta1.CapabilityOwners.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenesisOwners message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.capability.v1beta1.GenesisOwners + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.capability.v1beta1.GenesisOwners} GenesisOwners + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisOwners.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenesisOwners message. + * @function verify + * @memberof cosmos.capability.v1beta1.GenesisOwners + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenesisOwners.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index) && !(message.index && $util.isInteger(message.index.low) && $util.isInteger(message.index.high))) + return "index: integer|Long expected"; + if (message.indexOwners != null && message.hasOwnProperty("indexOwners")) { + let error = $root.cosmos.capability.v1beta1.CapabilityOwners.verify(message.indexOwners); + if (error) + return "indexOwners." + error; + } + return null; + }; + + /** + * Creates a GenesisOwners message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.capability.v1beta1.GenesisOwners + * @static + * @param {Object.} object Plain object + * @returns {cosmos.capability.v1beta1.GenesisOwners} GenesisOwners + */ + GenesisOwners.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.capability.v1beta1.GenesisOwners) + return object; + let message = new $root.cosmos.capability.v1beta1.GenesisOwners(); + if (object.index != null) + if ($util.Long) + (message.index = $util.Long.fromValue(object.index)).unsigned = true; + else if (typeof object.index === "string") + message.index = parseInt(object.index, 10); + else if (typeof object.index === "number") + message.index = object.index; + else if (typeof object.index === "object") + message.index = new $util.LongBits(object.index.low >>> 0, object.index.high >>> 0).toNumber(true); + if (object.indexOwners != null) { + if (typeof object.indexOwners !== "object") + throw TypeError(".cosmos.capability.v1beta1.GenesisOwners.indexOwners: object expected"); + message.indexOwners = $root.cosmos.capability.v1beta1.CapabilityOwners.fromObject(object.indexOwners); + } + return message; + }; + + /** + * Creates a plain object from a GenesisOwners message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.capability.v1beta1.GenesisOwners + * @static + * @param {cosmos.capability.v1beta1.GenesisOwners} message GenesisOwners + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenesisOwners.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.index = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.index = options.longs === String ? "0" : 0; + object.indexOwners = null; + } + if (message.index != null && message.hasOwnProperty("index")) + if (typeof message.index === "number") + object.index = options.longs === String ? String(message.index) : message.index; + else + object.index = options.longs === String ? $util.Long.prototype.toString.call(message.index) : options.longs === Number ? new $util.LongBits(message.index.low >>> 0, message.index.high >>> 0).toNumber(true) : message.index; + if (message.indexOwners != null && message.hasOwnProperty("indexOwners")) + object.indexOwners = $root.cosmos.capability.v1beta1.CapabilityOwners.toObject(message.indexOwners, options); + return object; + }; + + /** + * Converts this GenesisOwners to JSON. + * @function toJSON + * @memberof cosmos.capability.v1beta1.GenesisOwners + * @instance + * @returns {Object.} JSON object + */ + GenesisOwners.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GenesisOwners; + })(v1beta1.GenesisOwners || {}); + + v1beta1.GenesisState = (function(GenesisState) { + + /** + * Properties of a GenesisState. + * @memberof cosmos.capability.v1beta1 + * @interface IGenesisState + * @property {number|Long|null} [index] GenesisState index + * @property {Array.|null} [owners] GenesisState owners + */ + + /** + * Constructs a new GenesisState. + * @memberof cosmos.capability.v1beta1 + * @classdesc Represents a GenesisState. + * @implements IGenesisState + * @constructor + * @param {cosmos.capability.v1beta1.IGenesisState=} [properties] Properties to set + */ + function GenesisState(properties) { + this.owners = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenesisState index. + * @member {number|Long} index + * @memberof cosmos.capability.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.index = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GenesisState owners. + * @member {Array.} owners + * @memberof cosmos.capability.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.owners = $util.emptyArray; + + /** + * Creates a new GenesisState instance using the specified properties. + * @function create + * @memberof cosmos.capability.v1beta1.GenesisState + * @static + * @param {cosmos.capability.v1beta1.IGenesisState=} [properties] Properties to set + * @returns {cosmos.capability.v1beta1.GenesisState} GenesisState instance + */ + GenesisState.create = function create(properties) { + return new GenesisState(properties); + }; + + /** + * Encodes the specified GenesisState message. Does not implicitly {@link cosmos.capability.v1beta1.GenesisState.verify|verify} messages. + * @function encode + * @memberof cosmos.capability.v1beta1.GenesisState + * @static + * @param {cosmos.capability.v1beta1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.index); + if (message.owners != null && message.owners.length) + for (let i = 0; i < message.owners.length; ++i) + $root.cosmos.capability.v1beta1.GenesisOwners.encode(message.owners[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link cosmos.capability.v1beta1.GenesisState.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.capability.v1beta1.GenesisState + * @static + * @param {cosmos.capability.v1beta1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer. + * @function decode + * @memberof cosmos.capability.v1beta1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.capability.v1beta1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.capability.v1beta1.GenesisState(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.uint64(); + break; + case 2: + if (!(message.owners && message.owners.length)) + message.owners = []; + message.owners.push($root.cosmos.capability.v1beta1.GenesisOwners.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.capability.v1beta1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.capability.v1beta1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenesisState message. + * @function verify + * @memberof cosmos.capability.v1beta1.GenesisState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenesisState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index) && !(message.index && $util.isInteger(message.index.low) && $util.isInteger(message.index.high))) + return "index: integer|Long expected"; + if (message.owners != null && message.hasOwnProperty("owners")) { + if (!Array.isArray(message.owners)) + return "owners: array expected"; + for (let i = 0; i < message.owners.length; ++i) { + let error = $root.cosmos.capability.v1beta1.GenesisOwners.verify(message.owners[i]); + if (error) + return "owners." + error; + } + } + return null; + }; + + /** + * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.capability.v1beta1.GenesisState + * @static + * @param {Object.} object Plain object + * @returns {cosmos.capability.v1beta1.GenesisState} GenesisState + */ + GenesisState.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.capability.v1beta1.GenesisState) + return object; + let message = new $root.cosmos.capability.v1beta1.GenesisState(); + if (object.index != null) + if ($util.Long) + (message.index = $util.Long.fromValue(object.index)).unsigned = true; + else if (typeof object.index === "string") + message.index = parseInt(object.index, 10); + else if (typeof object.index === "number") + message.index = object.index; + else if (typeof object.index === "object") + message.index = new $util.LongBits(object.index.low >>> 0, object.index.high >>> 0).toNumber(true); + if (object.owners) { + if (!Array.isArray(object.owners)) + throw TypeError(".cosmos.capability.v1beta1.GenesisState.owners: array expected"); + message.owners = []; + for (let i = 0; i < object.owners.length; ++i) { + if (typeof object.owners[i] !== "object") + throw TypeError(".cosmos.capability.v1beta1.GenesisState.owners: object expected"); + message.owners[i] = $root.cosmos.capability.v1beta1.GenesisOwners.fromObject(object.owners[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GenesisState message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.capability.v1beta1.GenesisState + * @static + * @param {cosmos.capability.v1beta1.GenesisState} message GenesisState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenesisState.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.owners = []; + if (options.defaults) + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.index = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.index = options.longs === String ? "0" : 0; + if (message.index != null && message.hasOwnProperty("index")) + if (typeof message.index === "number") + object.index = options.longs === String ? String(message.index) : message.index; + else + object.index = options.longs === String ? $util.Long.prototype.toString.call(message.index) : options.longs === Number ? new $util.LongBits(message.index.low >>> 0, message.index.high >>> 0).toNumber(true) : message.index; + if (message.owners && message.owners.length) { + object.owners = []; + for (let j = 0; j < message.owners.length; ++j) + object.owners[j] = $root.cosmos.capability.v1beta1.GenesisOwners.toObject(message.owners[j], options); + } + return object; + }; + + /** + * Converts this GenesisState to JSON. + * @function toJSON + * @memberof cosmos.capability.v1beta1.GenesisState + * @instance + * @returns {Object.} JSON object + */ + GenesisState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GenesisState; + })(v1beta1.GenesisState || {}); + + return v1beta1; + })(capability.v1beta1 || {}); + + return capability; + })(cosmos.capability || {}); + + /** + * Namespace crisis. + * @memberof cosmos + * @namespace + */ + + cosmos.crisis = (function(crisis) { + + /** + * Namespace v1beta1. + * @memberof cosmos.crisis + * @namespace + */ + + crisis.v1beta1 = (function(v1beta1) { + + v1beta1.GenesisState = (function(GenesisState) { + + /** + * Properties of a GenesisState. + * @memberof cosmos.crisis.v1beta1 + * @interface IGenesisState + * @property {cosmos.base.v1beta1.ICoin|null} [constantFee] GenesisState constantFee + */ + + /** + * Constructs a new GenesisState. + * @memberof cosmos.crisis.v1beta1 + * @classdesc Represents a GenesisState. + * @implements IGenesisState + * @constructor + * @param {cosmos.crisis.v1beta1.IGenesisState=} [properties] Properties to set + */ + function GenesisState(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenesisState constantFee. + * @member {cosmos.base.v1beta1.ICoin|null|undefined} constantFee + * @memberof cosmos.crisis.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.constantFee = null; + + /** + * Creates a new GenesisState instance using the specified properties. + * @function create + * @memberof cosmos.crisis.v1beta1.GenesisState + * @static + * @param {cosmos.crisis.v1beta1.IGenesisState=} [properties] Properties to set + * @returns {cosmos.crisis.v1beta1.GenesisState} GenesisState instance + */ + GenesisState.create = function create(properties) { + return new GenesisState(properties); + }; + + /** + * Encodes the specified GenesisState message. Does not implicitly {@link cosmos.crisis.v1beta1.GenesisState.verify|verify} messages. + * @function encode + * @memberof cosmos.crisis.v1beta1.GenesisState + * @static + * @param {cosmos.crisis.v1beta1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.constantFee != null && Object.hasOwnProperty.call(message, "constantFee")) + $root.cosmos.base.v1beta1.Coin.encode(message.constantFee, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link cosmos.crisis.v1beta1.GenesisState.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.crisis.v1beta1.GenesisState + * @static + * @param {cosmos.crisis.v1beta1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer. + * @function decode + * @memberof cosmos.crisis.v1beta1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.crisis.v1beta1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.crisis.v1beta1.GenesisState(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.constantFee = $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.crisis.v1beta1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.crisis.v1beta1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenesisState message. + * @function verify + * @memberof cosmos.crisis.v1beta1.GenesisState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenesisState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.constantFee != null && message.hasOwnProperty("constantFee")) { + let error = $root.cosmos.base.v1beta1.Coin.verify(message.constantFee); + if (error) + return "constantFee." + error; + } + return null; + }; + + /** + * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.crisis.v1beta1.GenesisState + * @static + * @param {Object.} object Plain object + * @returns {cosmos.crisis.v1beta1.GenesisState} GenesisState + */ + GenesisState.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.crisis.v1beta1.GenesisState) + return object; + let message = new $root.cosmos.crisis.v1beta1.GenesisState(); + if (object.constantFee != null) { + if (typeof object.constantFee !== "object") + throw TypeError(".cosmos.crisis.v1beta1.GenesisState.constantFee: object expected"); + message.constantFee = $root.cosmos.base.v1beta1.Coin.fromObject(object.constantFee); + } + return message; + }; + + /** + * Creates a plain object from a GenesisState message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.crisis.v1beta1.GenesisState + * @static + * @param {cosmos.crisis.v1beta1.GenesisState} message GenesisState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenesisState.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.constantFee = null; + if (message.constantFee != null && message.hasOwnProperty("constantFee")) + object.constantFee = $root.cosmos.base.v1beta1.Coin.toObject(message.constantFee, options); + return object; + }; + + /** + * Converts this GenesisState to JSON. + * @function toJSON + * @memberof cosmos.crisis.v1beta1.GenesisState + * @instance + * @returns {Object.} JSON object + */ + GenesisState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GenesisState; + })(v1beta1.GenesisState || {}); + + v1beta1.Msg = (function(Msg) { + + /** + * Constructs a new Msg service. + * @memberof cosmos.crisis.v1beta1 + * @classdesc Represents a Msg + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Msg(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; + + /** + * Creates new Msg service using the specified rpc implementation. + * @function create + * @memberof cosmos.crisis.v1beta1.Msg + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Msg} RPC service. Useful where requests and/or responses are streamed. + */ + Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.crisis.v1beta1.Msg#verifyInvariant}. + * @memberof cosmos.crisis.v1beta1.Msg + * @typedef VerifyInvariantCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariantResponse} [response] MsgVerifyInvariantResponse + */ + + /** + * Calls VerifyInvariant. + * @function verifyInvariant + * @memberof cosmos.crisis.v1beta1.Msg + * @instance + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariant} request MsgVerifyInvariant message or plain object + * @param {cosmos.crisis.v1beta1.Msg.VerifyInvariantCallback} callback Node-style callback called with the error, if any, and MsgVerifyInvariantResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.verifyInvariant = function verifyInvariant(request, callback) { + return this.rpcCall(verifyInvariant, $root.cosmos.crisis.v1beta1.MsgVerifyInvariant, $root.cosmos.crisis.v1beta1.MsgVerifyInvariantResponse, request, callback); + }, "name", { value: "VerifyInvariant" }); + + /** + * Calls VerifyInvariant. + * @function verifyInvariant + * @memberof cosmos.crisis.v1beta1.Msg + * @instance + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariant} request MsgVerifyInvariant message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Msg; + })(v1beta1.Msg || {}); + + v1beta1.MsgVerifyInvariant = (function(MsgVerifyInvariant) { + + /** + * Properties of a MsgVerifyInvariant. + * @memberof cosmos.crisis.v1beta1 + * @interface IMsgVerifyInvariant + * @property {string|null} [sender] MsgVerifyInvariant sender + * @property {string|null} [invariantModuleName] MsgVerifyInvariant invariantModuleName + * @property {string|null} [invariantRoute] MsgVerifyInvariant invariantRoute + */ + + /** + * Constructs a new MsgVerifyInvariant. + * @memberof cosmos.crisis.v1beta1 + * @classdesc Represents a MsgVerifyInvariant. + * @implements IMsgVerifyInvariant + * @constructor + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariant=} [properties] Properties to set + */ + function MsgVerifyInvariant(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgVerifyInvariant sender. + * @member {string} sender + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @instance + */ + MsgVerifyInvariant.prototype.sender = ""; + + /** + * MsgVerifyInvariant invariantModuleName. + * @member {string} invariantModuleName + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @instance + */ + MsgVerifyInvariant.prototype.invariantModuleName = ""; + + /** + * MsgVerifyInvariant invariantRoute. + * @member {string} invariantRoute + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @instance + */ + MsgVerifyInvariant.prototype.invariantRoute = ""; + + /** + * Creates a new MsgVerifyInvariant instance using the specified properties. + * @function create + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @static + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariant=} [properties] Properties to set + * @returns {cosmos.crisis.v1beta1.MsgVerifyInvariant} MsgVerifyInvariant instance + */ + MsgVerifyInvariant.create = function create(properties) { + return new MsgVerifyInvariant(properties); + }; + + /** + * Encodes the specified MsgVerifyInvariant message. Does not implicitly {@link cosmos.crisis.v1beta1.MsgVerifyInvariant.verify|verify} messages. + * @function encode + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @static + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariant} message MsgVerifyInvariant message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgVerifyInvariant.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sender != null && Object.hasOwnProperty.call(message, "sender")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sender); + if (message.invariantModuleName != null && Object.hasOwnProperty.call(message, "invariantModuleName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.invariantModuleName); + if (message.invariantRoute != null && Object.hasOwnProperty.call(message, "invariantRoute")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.invariantRoute); + return writer; + }; + + /** + * Encodes the specified MsgVerifyInvariant message, length delimited. Does not implicitly {@link cosmos.crisis.v1beta1.MsgVerifyInvariant.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @static + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariant} message MsgVerifyInvariant message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgVerifyInvariant.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgVerifyInvariant message from the specified reader or buffer. + * @function decode + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.crisis.v1beta1.MsgVerifyInvariant} MsgVerifyInvariant + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgVerifyInvariant.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.crisis.v1beta1.MsgVerifyInvariant(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.invariantModuleName = reader.string(); + break; + case 3: + message.invariantRoute = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgVerifyInvariant message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.crisis.v1beta1.MsgVerifyInvariant} MsgVerifyInvariant + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgVerifyInvariant.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgVerifyInvariant message. + * @function verify + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgVerifyInvariant.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sender != null && message.hasOwnProperty("sender")) + if (!$util.isString(message.sender)) + return "sender: string expected"; + if (message.invariantModuleName != null && message.hasOwnProperty("invariantModuleName")) + if (!$util.isString(message.invariantModuleName)) + return "invariantModuleName: string expected"; + if (message.invariantRoute != null && message.hasOwnProperty("invariantRoute")) + if (!$util.isString(message.invariantRoute)) + return "invariantRoute: string expected"; + return null; + }; + + /** + * Creates a MsgVerifyInvariant message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @static + * @param {Object.} object Plain object + * @returns {cosmos.crisis.v1beta1.MsgVerifyInvariant} MsgVerifyInvariant + */ + MsgVerifyInvariant.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.crisis.v1beta1.MsgVerifyInvariant) + return object; + let message = new $root.cosmos.crisis.v1beta1.MsgVerifyInvariant(); + if (object.sender != null) + message.sender = String(object.sender); + if (object.invariantModuleName != null) + message.invariantModuleName = String(object.invariantModuleName); + if (object.invariantRoute != null) + message.invariantRoute = String(object.invariantRoute); + return message; + }; + + /** + * Creates a plain object from a MsgVerifyInvariant message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @static + * @param {cosmos.crisis.v1beta1.MsgVerifyInvariant} message MsgVerifyInvariant + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgVerifyInvariant.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.sender = ""; + object.invariantModuleName = ""; + object.invariantRoute = ""; + } + if (message.sender != null && message.hasOwnProperty("sender")) + object.sender = message.sender; + if (message.invariantModuleName != null && message.hasOwnProperty("invariantModuleName")) + object.invariantModuleName = message.invariantModuleName; + if (message.invariantRoute != null && message.hasOwnProperty("invariantRoute")) + object.invariantRoute = message.invariantRoute; + return object; + }; + + /** + * Converts this MsgVerifyInvariant to JSON. + * @function toJSON + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant + * @instance + * @returns {Object.} JSON object + */ + MsgVerifyInvariant.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgVerifyInvariant; + })(v1beta1.MsgVerifyInvariant || {}); + + v1beta1.MsgVerifyInvariantResponse = (function(MsgVerifyInvariantResponse) { + + /** + * Properties of a MsgVerifyInvariantResponse. + * @memberof cosmos.crisis.v1beta1 + * @interface IMsgVerifyInvariantResponse + */ + + /** + * Constructs a new MsgVerifyInvariantResponse. + * @memberof cosmos.crisis.v1beta1 + * @classdesc Represents a MsgVerifyInvariantResponse. + * @implements IMsgVerifyInvariantResponse + * @constructor + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariantResponse=} [properties] Properties to set + */ + function MsgVerifyInvariantResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgVerifyInvariantResponse instance using the specified properties. + * @function create + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse + * @static + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariantResponse=} [properties] Properties to set + * @returns {cosmos.crisis.v1beta1.MsgVerifyInvariantResponse} MsgVerifyInvariantResponse instance + */ + MsgVerifyInvariantResponse.create = function create(properties) { + return new MsgVerifyInvariantResponse(properties); + }; + + /** + * Encodes the specified MsgVerifyInvariantResponse message. Does not implicitly {@link cosmos.crisis.v1beta1.MsgVerifyInvariantResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse + * @static + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariantResponse} message MsgVerifyInvariantResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgVerifyInvariantResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgVerifyInvariantResponse message, length delimited. Does not implicitly {@link cosmos.crisis.v1beta1.MsgVerifyInvariantResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse + * @static + * @param {cosmos.crisis.v1beta1.IMsgVerifyInvariantResponse} message MsgVerifyInvariantResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgVerifyInvariantResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgVerifyInvariantResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.crisis.v1beta1.MsgVerifyInvariantResponse} MsgVerifyInvariantResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgVerifyInvariantResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.crisis.v1beta1.MsgVerifyInvariantResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgVerifyInvariantResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.crisis.v1beta1.MsgVerifyInvariantResponse} MsgVerifyInvariantResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgVerifyInvariantResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgVerifyInvariantResponse message. + * @function verify + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgVerifyInvariantResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgVerifyInvariantResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.crisis.v1beta1.MsgVerifyInvariantResponse} MsgVerifyInvariantResponse + */ + MsgVerifyInvariantResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.crisis.v1beta1.MsgVerifyInvariantResponse) + return object; + return new $root.cosmos.crisis.v1beta1.MsgVerifyInvariantResponse(); + }; + + /** + * Creates a plain object from a MsgVerifyInvariantResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse + * @static + * @param {cosmos.crisis.v1beta1.MsgVerifyInvariantResponse} message MsgVerifyInvariantResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgVerifyInvariantResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgVerifyInvariantResponse to JSON. + * @function toJSON + * @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse + * @instance + * @returns {Object.} JSON object + */ + MsgVerifyInvariantResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgVerifyInvariantResponse; + })(v1beta1.MsgVerifyInvariantResponse || {}); + + return v1beta1; + })(crisis.v1beta1 || {}); + + return crisis; + })(cosmos.crisis || {}); + + /** + * Namespace crypto. + * @memberof cosmos + * @namespace + */ + + cosmos.crypto = (function(crypto) { + + /** + * Namespace ed25519. + * @memberof cosmos.crypto + * @namespace + */ + + crypto.ed25519 = (function(ed25519) { + + ed25519.PubKey = (function(PubKey) { + + /** + * Properties of a PubKey. + * @memberof cosmos.crypto.ed25519 + * @interface IPubKey + * @property {Uint8Array|null} [key] PubKey key + */ + + /** + * Constructs a new PubKey. + * @memberof cosmos.crypto.ed25519 + * @classdesc Represents a PubKey. + * @implements IPubKey + * @constructor + * @param {cosmos.crypto.ed25519.IPubKey=} [properties] Properties to set + */ + function PubKey(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PubKey key. + * @member {Uint8Array} key + * @memberof cosmos.crypto.ed25519.PubKey + * @instance + */ + PubKey.prototype.key = $util.newBuffer([]); + + /** + * Creates a new PubKey instance using the specified properties. + * @function create + * @memberof cosmos.crypto.ed25519.PubKey + * @static + * @param {cosmos.crypto.ed25519.IPubKey=} [properties] Properties to set + * @returns {cosmos.crypto.ed25519.PubKey} PubKey instance + */ + PubKey.create = function create(properties) { + return new PubKey(properties); + }; + + /** + * Encodes the specified PubKey message. Does not implicitly {@link cosmos.crypto.ed25519.PubKey.verify|verify} messages. + * @function encode + * @memberof cosmos.crypto.ed25519.PubKey + * @static + * @param {cosmos.crypto.ed25519.IPubKey} message PubKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); + return writer; + }; + + /** + * Encodes the specified PubKey message, length delimited. Does not implicitly {@link cosmos.crypto.ed25519.PubKey.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.crypto.ed25519.PubKey + * @static + * @param {cosmos.crypto.ed25519.IPubKey} message PubKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PubKey message from the specified reader or buffer. + * @function decode + * @memberof cosmos.crypto.ed25519.PubKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.crypto.ed25519.PubKey} PubKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubKey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.crypto.ed25519.PubKey(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PubKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.crypto.ed25519.PubKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.crypto.ed25519.PubKey} PubKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PubKey message. + * @function verify + * @memberof cosmos.crypto.ed25519.PubKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PubKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + return null; + }; + + /** + * Creates a PubKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.crypto.ed25519.PubKey + * @static + * @param {Object.} object Plain object + * @returns {cosmos.crypto.ed25519.PubKey} PubKey + */ + PubKey.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.crypto.ed25519.PubKey) + return object; + let message = new $root.cosmos.crypto.ed25519.PubKey(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length) + message.key = object.key; + return message; + }; + + /** + * Creates a plain object from a PubKey message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.crypto.ed25519.PubKey + * @static + * @param {cosmos.crypto.ed25519.PubKey} message PubKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PubKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + return object; + }; + + /** + * Converts this PubKey to JSON. + * @function toJSON + * @memberof cosmos.crypto.ed25519.PubKey + * @instance + * @returns {Object.} JSON object + */ + PubKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PubKey; + })(ed25519.PubKey || {}); + + ed25519.PrivKey = (function(PrivKey) { + + /** + * Properties of a PrivKey. + * @memberof cosmos.crypto.ed25519 + * @interface IPrivKey + * @property {Uint8Array|null} [key] PrivKey key + */ + + /** + * Constructs a new PrivKey. + * @memberof cosmos.crypto.ed25519 + * @classdesc Represents a PrivKey. + * @implements IPrivKey + * @constructor + * @param {cosmos.crypto.ed25519.IPrivKey=} [properties] Properties to set + */ + function PrivKey(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrivKey key. + * @member {Uint8Array} key + * @memberof cosmos.crypto.ed25519.PrivKey + * @instance + */ + PrivKey.prototype.key = $util.newBuffer([]); + + /** + * Creates a new PrivKey instance using the specified properties. + * @function create + * @memberof cosmos.crypto.ed25519.PrivKey + * @static + * @param {cosmos.crypto.ed25519.IPrivKey=} [properties] Properties to set + * @returns {cosmos.crypto.ed25519.PrivKey} PrivKey instance + */ + PrivKey.create = function create(properties) { + return new PrivKey(properties); + }; + + /** + * Encodes the specified PrivKey message. Does not implicitly {@link cosmos.crypto.ed25519.PrivKey.verify|verify} messages. + * @function encode + * @memberof cosmos.crypto.ed25519.PrivKey + * @static + * @param {cosmos.crypto.ed25519.IPrivKey} message PrivKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); + return writer; + }; + + /** + * Encodes the specified PrivKey message, length delimited. Does not implicitly {@link cosmos.crypto.ed25519.PrivKey.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.crypto.ed25519.PrivKey + * @static + * @param {cosmos.crypto.ed25519.IPrivKey} message PrivKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrivKey message from the specified reader or buffer. + * @function decode + * @memberof cosmos.crypto.ed25519.PrivKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.crypto.ed25519.PrivKey} PrivKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivKey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.crypto.ed25519.PrivKey(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrivKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.crypto.ed25519.PrivKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.crypto.ed25519.PrivKey} PrivKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrivKey message. + * @function verify + * @memberof cosmos.crypto.ed25519.PrivKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrivKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + return null; + }; + + /** + * Creates a PrivKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.crypto.ed25519.PrivKey + * @static + * @param {Object.} object Plain object + * @returns {cosmos.crypto.ed25519.PrivKey} PrivKey + */ + PrivKey.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.crypto.ed25519.PrivKey) + return object; + let message = new $root.cosmos.crypto.ed25519.PrivKey(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length) + message.key = object.key; + return message; + }; + + /** + * Creates a plain object from a PrivKey message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.crypto.ed25519.PrivKey + * @static + * @param {cosmos.crypto.ed25519.PrivKey} message PrivKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrivKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + return object; + }; + + /** + * Converts this PrivKey to JSON. + * @function toJSON + * @memberof cosmos.crypto.ed25519.PrivKey + * @instance + * @returns {Object.} JSON object + */ + PrivKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PrivKey; + })(ed25519.PrivKey || {}); + + return ed25519; + })(crypto.ed25519 || {}); + + /** + * Namespace multisig. + * @memberof cosmos.crypto + * @namespace + */ + + crypto.multisig = (function(multisig) { + + multisig.LegacyAminoPubKey = (function(LegacyAminoPubKey) { + + /** + * Properties of a LegacyAminoPubKey. + * @memberof cosmos.crypto.multisig + * @interface ILegacyAminoPubKey + * @property {number|null} [threshold] LegacyAminoPubKey threshold + * @property {Array.|null} [publicKeys] LegacyAminoPubKey publicKeys + */ + + /** + * Constructs a new LegacyAminoPubKey. + * @memberof cosmos.crypto.multisig + * @classdesc Represents a LegacyAminoPubKey. + * @implements ILegacyAminoPubKey + * @constructor + * @param {cosmos.crypto.multisig.ILegacyAminoPubKey=} [properties] Properties to set + */ + function LegacyAminoPubKey(properties) { + this.publicKeys = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LegacyAminoPubKey threshold. + * @member {number} threshold + * @memberof cosmos.crypto.multisig.LegacyAminoPubKey + * @instance + */ + LegacyAminoPubKey.prototype.threshold = 0; + + /** + * LegacyAminoPubKey publicKeys. + * @member {Array.} publicKeys + * @memberof cosmos.crypto.multisig.LegacyAminoPubKey + * @instance + */ + LegacyAminoPubKey.prototype.publicKeys = $util.emptyArray; + + /** + * Creates a new LegacyAminoPubKey instance using the specified properties. + * @function create + * @memberof cosmos.crypto.multisig.LegacyAminoPubKey + * @static + * @param {cosmos.crypto.multisig.ILegacyAminoPubKey=} [properties] Properties to set + * @returns {cosmos.crypto.multisig.LegacyAminoPubKey} LegacyAminoPubKey instance + */ + LegacyAminoPubKey.create = function create(properties) { + return new LegacyAminoPubKey(properties); + }; + + /** + * Encodes the specified LegacyAminoPubKey message. Does not implicitly {@link cosmos.crypto.multisig.LegacyAminoPubKey.verify|verify} messages. + * @function encode + * @memberof cosmos.crypto.multisig.LegacyAminoPubKey + * @static + * @param {cosmos.crypto.multisig.ILegacyAminoPubKey} message LegacyAminoPubKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LegacyAminoPubKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.threshold != null && Object.hasOwnProperty.call(message, "threshold")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.threshold); + if (message.publicKeys != null && message.publicKeys.length) + for (let i = 0; i < message.publicKeys.length; ++i) + $root.google.protobuf.Any.encode(message.publicKeys[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LegacyAminoPubKey message, length delimited. Does not implicitly {@link cosmos.crypto.multisig.LegacyAminoPubKey.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.crypto.multisig.LegacyAminoPubKey + * @static + * @param {cosmos.crypto.multisig.ILegacyAminoPubKey} message LegacyAminoPubKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LegacyAminoPubKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LegacyAminoPubKey message from the specified reader or buffer. + * @function decode + * @memberof cosmos.crypto.multisig.LegacyAminoPubKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.crypto.multisig.LegacyAminoPubKey} LegacyAminoPubKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LegacyAminoPubKey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.crypto.multisig.LegacyAminoPubKey(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.threshold = reader.uint32(); + break; + case 2: + if (!(message.publicKeys && message.publicKeys.length)) + message.publicKeys = []; + message.publicKeys.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LegacyAminoPubKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.crypto.multisig.LegacyAminoPubKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.crypto.multisig.LegacyAminoPubKey} LegacyAminoPubKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LegacyAminoPubKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LegacyAminoPubKey message. + * @function verify + * @memberof cosmos.crypto.multisig.LegacyAminoPubKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LegacyAminoPubKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.threshold != null && message.hasOwnProperty("threshold")) + if (!$util.isInteger(message.threshold)) + return "threshold: integer expected"; + if (message.publicKeys != null && message.hasOwnProperty("publicKeys")) { + if (!Array.isArray(message.publicKeys)) + return "publicKeys: array expected"; + for (let i = 0; i < message.publicKeys.length; ++i) { + let error = $root.google.protobuf.Any.verify(message.publicKeys[i]); + if (error) + return "publicKeys." + error; + } + } + return null; + }; + + /** + * Creates a LegacyAminoPubKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.crypto.multisig.LegacyAminoPubKey + * @static + * @param {Object.} object Plain object + * @returns {cosmos.crypto.multisig.LegacyAminoPubKey} LegacyAminoPubKey + */ + LegacyAminoPubKey.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.crypto.multisig.LegacyAminoPubKey) + return object; + let message = new $root.cosmos.crypto.multisig.LegacyAminoPubKey(); + if (object.threshold != null) + message.threshold = object.threshold >>> 0; + if (object.publicKeys) { + if (!Array.isArray(object.publicKeys)) + throw TypeError(".cosmos.crypto.multisig.LegacyAminoPubKey.publicKeys: array expected"); + message.publicKeys = []; + for (let i = 0; i < object.publicKeys.length; ++i) { + if (typeof object.publicKeys[i] !== "object") + throw TypeError(".cosmos.crypto.multisig.LegacyAminoPubKey.publicKeys: object expected"); + message.publicKeys[i] = $root.google.protobuf.Any.fromObject(object.publicKeys[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a LegacyAminoPubKey message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.crypto.multisig.LegacyAminoPubKey + * @static + * @param {cosmos.crypto.multisig.LegacyAminoPubKey} message LegacyAminoPubKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LegacyAminoPubKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.publicKeys = []; + if (options.defaults) + object.threshold = 0; + if (message.threshold != null && message.hasOwnProperty("threshold")) + object.threshold = message.threshold; + if (message.publicKeys && message.publicKeys.length) { + object.publicKeys = []; + for (let j = 0; j < message.publicKeys.length; ++j) + object.publicKeys[j] = $root.google.protobuf.Any.toObject(message.publicKeys[j], options); + } + return object; + }; + + /** + * Converts this LegacyAminoPubKey to JSON. + * @function toJSON + * @memberof cosmos.crypto.multisig.LegacyAminoPubKey + * @instance + * @returns {Object.} JSON object + */ + LegacyAminoPubKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LegacyAminoPubKey; + })(multisig.LegacyAminoPubKey || {}); + + /** + * Namespace v1beta1. + * @memberof cosmos.crypto.multisig + * @namespace + */ + + multisig.v1beta1 = (function(v1beta1) { + + v1beta1.MultiSignature = (function(MultiSignature) { + + /** + * Properties of a MultiSignature. + * @memberof cosmos.crypto.multisig.v1beta1 + * @interface IMultiSignature + * @property {Array.|null} [signatures] MultiSignature signatures + */ + + /** + * Constructs a new MultiSignature. + * @memberof cosmos.crypto.multisig.v1beta1 + * @classdesc Represents a MultiSignature. + * @implements IMultiSignature + * @constructor + * @param {cosmos.crypto.multisig.v1beta1.IMultiSignature=} [properties] Properties to set + */ + function MultiSignature(properties) { + this.signatures = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MultiSignature signatures. + * @member {Array.} signatures + * @memberof cosmos.crypto.multisig.v1beta1.MultiSignature + * @instance + */ + MultiSignature.prototype.signatures = $util.emptyArray; + + /** + * Creates a new MultiSignature instance using the specified properties. + * @function create + * @memberof cosmos.crypto.multisig.v1beta1.MultiSignature + * @static + * @param {cosmos.crypto.multisig.v1beta1.IMultiSignature=} [properties] Properties to set + * @returns {cosmos.crypto.multisig.v1beta1.MultiSignature} MultiSignature instance + */ + MultiSignature.create = function create(properties) { + return new MultiSignature(properties); + }; + + /** + * Encodes the specified MultiSignature message. Does not implicitly {@link cosmos.crypto.multisig.v1beta1.MultiSignature.verify|verify} messages. + * @function encode + * @memberof cosmos.crypto.multisig.v1beta1.MultiSignature + * @static + * @param {cosmos.crypto.multisig.v1beta1.IMultiSignature} message MultiSignature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiSignature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.signatures != null && message.signatures.length) + for (let i = 0; i < message.signatures.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.signatures[i]); + return writer; + }; + + /** + * Encodes the specified MultiSignature message, length delimited. Does not implicitly {@link cosmos.crypto.multisig.v1beta1.MultiSignature.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.crypto.multisig.v1beta1.MultiSignature + * @static + * @param {cosmos.crypto.multisig.v1beta1.IMultiSignature} message MultiSignature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiSignature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MultiSignature message from the specified reader or buffer. + * @function decode + * @memberof cosmos.crypto.multisig.v1beta1.MultiSignature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.crypto.multisig.v1beta1.MultiSignature} MultiSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiSignature.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.crypto.multisig.v1beta1.MultiSignature(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.signatures && message.signatures.length)) + message.signatures = []; + message.signatures.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MultiSignature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.crypto.multisig.v1beta1.MultiSignature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.crypto.multisig.v1beta1.MultiSignature} MultiSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiSignature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MultiSignature message. + * @function verify + * @memberof cosmos.crypto.multisig.v1beta1.MultiSignature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MultiSignature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.signatures != null && message.hasOwnProperty("signatures")) { + if (!Array.isArray(message.signatures)) + return "signatures: array expected"; + for (let i = 0; i < message.signatures.length; ++i) + if (!(message.signatures[i] && typeof message.signatures[i].length === "number" || $util.isString(message.signatures[i]))) + return "signatures: buffer[] expected"; + } + return null; + }; + + /** + * Creates a MultiSignature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.crypto.multisig.v1beta1.MultiSignature + * @static + * @param {Object.} object Plain object + * @returns {cosmos.crypto.multisig.v1beta1.MultiSignature} MultiSignature + */ + MultiSignature.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.crypto.multisig.v1beta1.MultiSignature) + return object; + let message = new $root.cosmos.crypto.multisig.v1beta1.MultiSignature(); + if (object.signatures) { + if (!Array.isArray(object.signatures)) + throw TypeError(".cosmos.crypto.multisig.v1beta1.MultiSignature.signatures: array expected"); + message.signatures = []; + for (let i = 0; i < object.signatures.length; ++i) + if (typeof object.signatures[i] === "string") + $util.base64.decode(object.signatures[i], message.signatures[i] = $util.newBuffer($util.base64.length(object.signatures[i])), 0); + else if (object.signatures[i].length) + message.signatures[i] = object.signatures[i]; + } + return message; + }; + + /** + * Creates a plain object from a MultiSignature message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.crypto.multisig.v1beta1.MultiSignature + * @static + * @param {cosmos.crypto.multisig.v1beta1.MultiSignature} message MultiSignature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MultiSignature.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.signatures = []; + if (message.signatures && message.signatures.length) { + object.signatures = []; + for (let j = 0; j < message.signatures.length; ++j) + object.signatures[j] = options.bytes === String ? $util.base64.encode(message.signatures[j], 0, message.signatures[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.signatures[j]) : message.signatures[j]; + } + return object; + }; + + /** + * Converts this MultiSignature to JSON. + * @function toJSON + * @memberof cosmos.crypto.multisig.v1beta1.MultiSignature + * @instance + * @returns {Object.} JSON object + */ + MultiSignature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MultiSignature; + })(v1beta1.MultiSignature || {}); + + v1beta1.CompactBitArray = (function(CompactBitArray) { + + /** + * Properties of a CompactBitArray. + * @memberof cosmos.crypto.multisig.v1beta1 + * @interface ICompactBitArray + * @property {number|null} [extraBitsStored] CompactBitArray extraBitsStored + * @property {Uint8Array|null} [elems] CompactBitArray elems + */ + + /** + * Constructs a new CompactBitArray. + * @memberof cosmos.crypto.multisig.v1beta1 + * @classdesc Represents a CompactBitArray. + * @implements ICompactBitArray + * @constructor + * @param {cosmos.crypto.multisig.v1beta1.ICompactBitArray=} [properties] Properties to set + */ + function CompactBitArray(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompactBitArray extraBitsStored. + * @member {number} extraBitsStored + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @instance + */ + CompactBitArray.prototype.extraBitsStored = 0; + + /** + * CompactBitArray elems. + * @member {Uint8Array} elems + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @instance + */ + CompactBitArray.prototype.elems = $util.newBuffer([]); + + /** + * Creates a new CompactBitArray instance using the specified properties. + * @function create + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @static + * @param {cosmos.crypto.multisig.v1beta1.ICompactBitArray=} [properties] Properties to set + * @returns {cosmos.crypto.multisig.v1beta1.CompactBitArray} CompactBitArray instance + */ + CompactBitArray.create = function create(properties) { + return new CompactBitArray(properties); + }; + + /** + * Encodes the specified CompactBitArray message. Does not implicitly {@link cosmos.crypto.multisig.v1beta1.CompactBitArray.verify|verify} messages. + * @function encode + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @static + * @param {cosmos.crypto.multisig.v1beta1.ICompactBitArray} message CompactBitArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompactBitArray.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.extraBitsStored != null && Object.hasOwnProperty.call(message, "extraBitsStored")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.extraBitsStored); + if (message.elems != null && Object.hasOwnProperty.call(message, "elems")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.elems); + return writer; + }; + + /** + * Encodes the specified CompactBitArray message, length delimited. Does not implicitly {@link cosmos.crypto.multisig.v1beta1.CompactBitArray.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @static + * @param {cosmos.crypto.multisig.v1beta1.ICompactBitArray} message CompactBitArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompactBitArray.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompactBitArray message from the specified reader or buffer. + * @function decode + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.crypto.multisig.v1beta1.CompactBitArray} CompactBitArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompactBitArray.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.crypto.multisig.v1beta1.CompactBitArray(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.extraBitsStored = reader.uint32(); + break; + case 2: + message.elems = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompactBitArray message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.crypto.multisig.v1beta1.CompactBitArray} CompactBitArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompactBitArray.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompactBitArray message. + * @function verify + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompactBitArray.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.extraBitsStored != null && message.hasOwnProperty("extraBitsStored")) + if (!$util.isInteger(message.extraBitsStored)) + return "extraBitsStored: integer expected"; + if (message.elems != null && message.hasOwnProperty("elems")) + if (!(message.elems && typeof message.elems.length === "number" || $util.isString(message.elems))) + return "elems: buffer expected"; + return null; + }; + + /** + * Creates a CompactBitArray message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @static + * @param {Object.} object Plain object + * @returns {cosmos.crypto.multisig.v1beta1.CompactBitArray} CompactBitArray + */ + CompactBitArray.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.crypto.multisig.v1beta1.CompactBitArray) + return object; + let message = new $root.cosmos.crypto.multisig.v1beta1.CompactBitArray(); + if (object.extraBitsStored != null) + message.extraBitsStored = object.extraBitsStored >>> 0; + if (object.elems != null) + if (typeof object.elems === "string") + $util.base64.decode(object.elems, message.elems = $util.newBuffer($util.base64.length(object.elems)), 0); + else if (object.elems.length) + message.elems = object.elems; + return message; + }; + + /** + * Creates a plain object from a CompactBitArray message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @static + * @param {cosmos.crypto.multisig.v1beta1.CompactBitArray} message CompactBitArray + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompactBitArray.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.extraBitsStored = 0; + if (options.bytes === String) + object.elems = ""; + else { + object.elems = []; + if (options.bytes !== Array) + object.elems = $util.newBuffer(object.elems); + } + } + if (message.extraBitsStored != null && message.hasOwnProperty("extraBitsStored")) + object.extraBitsStored = message.extraBitsStored; + if (message.elems != null && message.hasOwnProperty("elems")) + object.elems = options.bytes === String ? $util.base64.encode(message.elems, 0, message.elems.length) : options.bytes === Array ? Array.prototype.slice.call(message.elems) : message.elems; + return object; + }; + + /** + * Converts this CompactBitArray to JSON. + * @function toJSON + * @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray + * @instance + * @returns {Object.} JSON object + */ + CompactBitArray.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CompactBitArray; + })(v1beta1.CompactBitArray || {}); + + return v1beta1; + })(multisig.v1beta1 || {}); + + return multisig; + })(crypto.multisig || {}); + + /** + * Namespace secp256k1. + * @memberof cosmos.crypto + * @namespace + */ + + crypto.secp256k1 = (function(secp256k1) { + + secp256k1.PubKey = (function(PubKey) { + + /** + * Properties of a PubKey. + * @memberof cosmos.crypto.secp256k1 + * @interface IPubKey + * @property {Uint8Array|null} [key] PubKey key + */ + + /** + * Constructs a new PubKey. + * @memberof cosmos.crypto.secp256k1 + * @classdesc Represents a PubKey. + * @implements IPubKey + * @constructor + * @param {cosmos.crypto.secp256k1.IPubKey=} [properties] Properties to set + */ + function PubKey(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PubKey key. + * @member {Uint8Array} key + * @memberof cosmos.crypto.secp256k1.PubKey + * @instance + */ + PubKey.prototype.key = $util.newBuffer([]); + + /** + * Creates a new PubKey instance using the specified properties. + * @function create + * @memberof cosmos.crypto.secp256k1.PubKey + * @static + * @param {cosmos.crypto.secp256k1.IPubKey=} [properties] Properties to set + * @returns {cosmos.crypto.secp256k1.PubKey} PubKey instance + */ + PubKey.create = function create(properties) { + return new PubKey(properties); + }; + + /** + * Encodes the specified PubKey message. Does not implicitly {@link cosmos.crypto.secp256k1.PubKey.verify|verify} messages. + * @function encode + * @memberof cosmos.crypto.secp256k1.PubKey + * @static + * @param {cosmos.crypto.secp256k1.IPubKey} message PubKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); + return writer; + }; + + /** + * Encodes the specified PubKey message, length delimited. Does not implicitly {@link cosmos.crypto.secp256k1.PubKey.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.crypto.secp256k1.PubKey + * @static + * @param {cosmos.crypto.secp256k1.IPubKey} message PubKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PubKey message from the specified reader or buffer. + * @function decode + * @memberof cosmos.crypto.secp256k1.PubKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.crypto.secp256k1.PubKey} PubKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubKey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.crypto.secp256k1.PubKey(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PubKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.crypto.secp256k1.PubKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.crypto.secp256k1.PubKey} PubKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PubKey message. + * @function verify + * @memberof cosmos.crypto.secp256k1.PubKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PubKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + return null; + }; + + /** + * Creates a PubKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.crypto.secp256k1.PubKey + * @static + * @param {Object.} object Plain object + * @returns {cosmos.crypto.secp256k1.PubKey} PubKey + */ + PubKey.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.crypto.secp256k1.PubKey) + return object; + let message = new $root.cosmos.crypto.secp256k1.PubKey(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length) + message.key = object.key; + return message; + }; + + /** + * Creates a plain object from a PubKey message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.crypto.secp256k1.PubKey + * @static + * @param {cosmos.crypto.secp256k1.PubKey} message PubKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PubKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + return object; + }; + + /** + * Converts this PubKey to JSON. + * @function toJSON + * @memberof cosmos.crypto.secp256k1.PubKey + * @instance + * @returns {Object.} JSON object + */ + PubKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PubKey; + })(secp256k1.PubKey || {}); + + secp256k1.PrivKey = (function(PrivKey) { + + /** + * Properties of a PrivKey. + * @memberof cosmos.crypto.secp256k1 + * @interface IPrivKey + * @property {Uint8Array|null} [key] PrivKey key + */ + + /** + * Constructs a new PrivKey. + * @memberof cosmos.crypto.secp256k1 + * @classdesc Represents a PrivKey. + * @implements IPrivKey + * @constructor + * @param {cosmos.crypto.secp256k1.IPrivKey=} [properties] Properties to set + */ + function PrivKey(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrivKey key. + * @member {Uint8Array} key + * @memberof cosmos.crypto.secp256k1.PrivKey + * @instance + */ + PrivKey.prototype.key = $util.newBuffer([]); + + /** + * Creates a new PrivKey instance using the specified properties. + * @function create + * @memberof cosmos.crypto.secp256k1.PrivKey + * @static + * @param {cosmos.crypto.secp256k1.IPrivKey=} [properties] Properties to set + * @returns {cosmos.crypto.secp256k1.PrivKey} PrivKey instance + */ + PrivKey.create = function create(properties) { + return new PrivKey(properties); + }; + + /** + * Encodes the specified PrivKey message. Does not implicitly {@link cosmos.crypto.secp256k1.PrivKey.verify|verify} messages. + * @function encode + * @memberof cosmos.crypto.secp256k1.PrivKey + * @static + * @param {cosmos.crypto.secp256k1.IPrivKey} message PrivKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); + return writer; + }; + + /** + * Encodes the specified PrivKey message, length delimited. Does not implicitly {@link cosmos.crypto.secp256k1.PrivKey.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.crypto.secp256k1.PrivKey + * @static + * @param {cosmos.crypto.secp256k1.IPrivKey} message PrivKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrivKey message from the specified reader or buffer. + * @function decode + * @memberof cosmos.crypto.secp256k1.PrivKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.crypto.secp256k1.PrivKey} PrivKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivKey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.crypto.secp256k1.PrivKey(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrivKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.crypto.secp256k1.PrivKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.crypto.secp256k1.PrivKey} PrivKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrivKey message. + * @function verify + * @memberof cosmos.crypto.secp256k1.PrivKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrivKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + return null; + }; + + /** + * Creates a PrivKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.crypto.secp256k1.PrivKey + * @static + * @param {Object.} object Plain object + * @returns {cosmos.crypto.secp256k1.PrivKey} PrivKey + */ + PrivKey.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.crypto.secp256k1.PrivKey) + return object; + let message = new $root.cosmos.crypto.secp256k1.PrivKey(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length) + message.key = object.key; + return message; + }; + + /** + * Creates a plain object from a PrivKey message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.crypto.secp256k1.PrivKey + * @static + * @param {cosmos.crypto.secp256k1.PrivKey} message PrivKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrivKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + return object; + }; + + /** + * Converts this PrivKey to JSON. + * @function toJSON + * @memberof cosmos.crypto.secp256k1.PrivKey + * @instance + * @returns {Object.} JSON object + */ + PrivKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PrivKey; + })(secp256k1.PrivKey || {}); + + return secp256k1; + })(crypto.secp256k1 || {}); + + return crypto; + })(cosmos.crypto || {}); + + /** + * Namespace distribution. + * @memberof cosmos + * @namespace + */ + + cosmos.distribution = (function(distribution) { + + /** + * Namespace v1beta1. + * @memberof cosmos.distribution + * @namespace + */ + + distribution.v1beta1 = (function(v1beta1) { + + v1beta1.Params = (function(Params) { + + /** + * Properties of a Params. + * @memberof cosmos.distribution.v1beta1 + * @interface IParams + * @property {string|null} [communityTax] Params communityTax + * @property {string|null} [baseProposerReward] Params baseProposerReward + * @property {string|null} [bonusProposerReward] Params bonusProposerReward + * @property {boolean|null} [withdrawAddrEnabled] Params withdrawAddrEnabled + */ + + /** + * Constructs a new Params. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a Params. + * @implements IParams + * @constructor + * @param {cosmos.distribution.v1beta1.IParams=} [properties] Properties to set + */ + function Params(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Params communityTax. + * @member {string} communityTax + * @memberof cosmos.distribution.v1beta1.Params + * @instance + */ + Params.prototype.communityTax = ""; + + /** + * Params baseProposerReward. + * @member {string} baseProposerReward + * @memberof cosmos.distribution.v1beta1.Params + * @instance + */ + Params.prototype.baseProposerReward = ""; + + /** + * Params bonusProposerReward. + * @member {string} bonusProposerReward + * @memberof cosmos.distribution.v1beta1.Params + * @instance + */ + Params.prototype.bonusProposerReward = ""; + + /** + * Params withdrawAddrEnabled. + * @member {boolean} withdrawAddrEnabled + * @memberof cosmos.distribution.v1beta1.Params + * @instance + */ + Params.prototype.withdrawAddrEnabled = false; + + /** + * Creates a new Params instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.Params + * @static + * @param {cosmos.distribution.v1beta1.IParams=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.Params} Params instance + */ + Params.create = function create(properties) { + return new Params(properties); + }; + + /** + * Encodes the specified Params message. Does not implicitly {@link cosmos.distribution.v1beta1.Params.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.Params + * @static + * @param {cosmos.distribution.v1beta1.IParams} message Params message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Params.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.communityTax != null && Object.hasOwnProperty.call(message, "communityTax")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.communityTax); + if (message.baseProposerReward != null && Object.hasOwnProperty.call(message, "baseProposerReward")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.baseProposerReward); + if (message.bonusProposerReward != null && Object.hasOwnProperty.call(message, "bonusProposerReward")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.bonusProposerReward); + if (message.withdrawAddrEnabled != null && Object.hasOwnProperty.call(message, "withdrawAddrEnabled")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.withdrawAddrEnabled); + return writer; + }; + + /** + * Encodes the specified Params message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.Params.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.Params + * @static + * @param {cosmos.distribution.v1beta1.IParams} message Params message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Params.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Params message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.Params + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.Params} Params + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Params.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.Params(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.communityTax = reader.string(); + break; + case 2: + message.baseProposerReward = reader.string(); + break; + case 3: + message.bonusProposerReward = reader.string(); + break; + case 4: + message.withdrawAddrEnabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Params message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.Params + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.Params} Params + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Params.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Params message. + * @function verify + * @memberof cosmos.distribution.v1beta1.Params + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Params.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.communityTax != null && message.hasOwnProperty("communityTax")) + if (!$util.isString(message.communityTax)) + return "communityTax: string expected"; + if (message.baseProposerReward != null && message.hasOwnProperty("baseProposerReward")) + if (!$util.isString(message.baseProposerReward)) + return "baseProposerReward: string expected"; + if (message.bonusProposerReward != null && message.hasOwnProperty("bonusProposerReward")) + if (!$util.isString(message.bonusProposerReward)) + return "bonusProposerReward: string expected"; + if (message.withdrawAddrEnabled != null && message.hasOwnProperty("withdrawAddrEnabled")) + if (typeof message.withdrawAddrEnabled !== "boolean") + return "withdrawAddrEnabled: boolean expected"; + return null; + }; + + /** + * Creates a Params message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.Params + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.Params} Params + */ + Params.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.Params) + return object; + let message = new $root.cosmos.distribution.v1beta1.Params(); + if (object.communityTax != null) + message.communityTax = String(object.communityTax); + if (object.baseProposerReward != null) + message.baseProposerReward = String(object.baseProposerReward); + if (object.bonusProposerReward != null) + message.bonusProposerReward = String(object.bonusProposerReward); + if (object.withdrawAddrEnabled != null) + message.withdrawAddrEnabled = Boolean(object.withdrawAddrEnabled); + return message; + }; + + /** + * Creates a plain object from a Params message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.Params + * @static + * @param {cosmos.distribution.v1beta1.Params} message Params + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Params.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.communityTax = ""; + object.baseProposerReward = ""; + object.bonusProposerReward = ""; + object.withdrawAddrEnabled = false; + } + if (message.communityTax != null && message.hasOwnProperty("communityTax")) + object.communityTax = message.communityTax; + if (message.baseProposerReward != null && message.hasOwnProperty("baseProposerReward")) + object.baseProposerReward = message.baseProposerReward; + if (message.bonusProposerReward != null && message.hasOwnProperty("bonusProposerReward")) + object.bonusProposerReward = message.bonusProposerReward; + if (message.withdrawAddrEnabled != null && message.hasOwnProperty("withdrawAddrEnabled")) + object.withdrawAddrEnabled = message.withdrawAddrEnabled; + return object; + }; + + /** + * Converts this Params to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.Params + * @instance + * @returns {Object.} JSON object + */ + Params.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Params; + })(v1beta1.Params || {}); + + v1beta1.ValidatorHistoricalRewards = (function(ValidatorHistoricalRewards) { + + /** + * Properties of a ValidatorHistoricalRewards. + * @memberof cosmos.distribution.v1beta1 + * @interface IValidatorHistoricalRewards + * @property {Array.|null} [cumulativeRewardRatio] ValidatorHistoricalRewards cumulativeRewardRatio + * @property {number|null} [referenceCount] ValidatorHistoricalRewards referenceCount + */ + + /** + * Constructs a new ValidatorHistoricalRewards. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a ValidatorHistoricalRewards. + * @implements IValidatorHistoricalRewards + * @constructor + * @param {cosmos.distribution.v1beta1.IValidatorHistoricalRewards=} [properties] Properties to set + */ + function ValidatorHistoricalRewards(properties) { + this.cumulativeRewardRatio = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidatorHistoricalRewards cumulativeRewardRatio. + * @member {Array.} cumulativeRewardRatio + * @memberof cosmos.distribution.v1beta1.ValidatorHistoricalRewards + * @instance + */ + ValidatorHistoricalRewards.prototype.cumulativeRewardRatio = $util.emptyArray; + + /** + * ValidatorHistoricalRewards referenceCount. + * @member {number} referenceCount + * @memberof cosmos.distribution.v1beta1.ValidatorHistoricalRewards + * @instance + */ + ValidatorHistoricalRewards.prototype.referenceCount = 0; + + /** + * Creates a new ValidatorHistoricalRewards instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.ValidatorHistoricalRewards + * @static + * @param {cosmos.distribution.v1beta1.IValidatorHistoricalRewards=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.ValidatorHistoricalRewards} ValidatorHistoricalRewards instance + */ + ValidatorHistoricalRewards.create = function create(properties) { + return new ValidatorHistoricalRewards(properties); + }; + + /** + * Encodes the specified ValidatorHistoricalRewards message. Does not implicitly {@link cosmos.distribution.v1beta1.ValidatorHistoricalRewards.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.ValidatorHistoricalRewards + * @static + * @param {cosmos.distribution.v1beta1.IValidatorHistoricalRewards} message ValidatorHistoricalRewards message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorHistoricalRewards.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cumulativeRewardRatio != null && message.cumulativeRewardRatio.length) + for (let i = 0; i < message.cumulativeRewardRatio.length; ++i) + $root.cosmos.base.v1beta1.DecCoin.encode(message.cumulativeRewardRatio[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.referenceCount != null && Object.hasOwnProperty.call(message, "referenceCount")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.referenceCount); + return writer; + }; + + /** + * Encodes the specified ValidatorHistoricalRewards message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.ValidatorHistoricalRewards.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.ValidatorHistoricalRewards + * @static + * @param {cosmos.distribution.v1beta1.IValidatorHistoricalRewards} message ValidatorHistoricalRewards message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorHistoricalRewards.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidatorHistoricalRewards message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.ValidatorHistoricalRewards + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.ValidatorHistoricalRewards} ValidatorHistoricalRewards + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorHistoricalRewards.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.ValidatorHistoricalRewards(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.cumulativeRewardRatio && message.cumulativeRewardRatio.length)) + message.cumulativeRewardRatio = []; + message.cumulativeRewardRatio.push($root.cosmos.base.v1beta1.DecCoin.decode(reader, reader.uint32())); + break; + case 2: + message.referenceCount = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidatorHistoricalRewards message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.ValidatorHistoricalRewards + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.ValidatorHistoricalRewards} ValidatorHistoricalRewards + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorHistoricalRewards.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidatorHistoricalRewards message. + * @function verify + * @memberof cosmos.distribution.v1beta1.ValidatorHistoricalRewards + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidatorHistoricalRewards.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cumulativeRewardRatio != null && message.hasOwnProperty("cumulativeRewardRatio")) { + if (!Array.isArray(message.cumulativeRewardRatio)) + return "cumulativeRewardRatio: array expected"; + for (let i = 0; i < message.cumulativeRewardRatio.length; ++i) { + let error = $root.cosmos.base.v1beta1.DecCoin.verify(message.cumulativeRewardRatio[i]); + if (error) + return "cumulativeRewardRatio." + error; + } + } + if (message.referenceCount != null && message.hasOwnProperty("referenceCount")) + if (!$util.isInteger(message.referenceCount)) + return "referenceCount: integer expected"; + return null; + }; + + /** + * Creates a ValidatorHistoricalRewards message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.ValidatorHistoricalRewards + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.ValidatorHistoricalRewards} ValidatorHistoricalRewards + */ + ValidatorHistoricalRewards.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.ValidatorHistoricalRewards) + return object; + let message = new $root.cosmos.distribution.v1beta1.ValidatorHistoricalRewards(); + if (object.cumulativeRewardRatio) { + if (!Array.isArray(object.cumulativeRewardRatio)) + throw TypeError(".cosmos.distribution.v1beta1.ValidatorHistoricalRewards.cumulativeRewardRatio: array expected"); + message.cumulativeRewardRatio = []; + for (let i = 0; i < object.cumulativeRewardRatio.length; ++i) { + if (typeof object.cumulativeRewardRatio[i] !== "object") + throw TypeError(".cosmos.distribution.v1beta1.ValidatorHistoricalRewards.cumulativeRewardRatio: object expected"); + message.cumulativeRewardRatio[i] = $root.cosmos.base.v1beta1.DecCoin.fromObject(object.cumulativeRewardRatio[i]); + } + } + if (object.referenceCount != null) + message.referenceCount = object.referenceCount >>> 0; + return message; + }; + + /** + * Creates a plain object from a ValidatorHistoricalRewards message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.ValidatorHistoricalRewards + * @static + * @param {cosmos.distribution.v1beta1.ValidatorHistoricalRewards} message ValidatorHistoricalRewards + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidatorHistoricalRewards.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.cumulativeRewardRatio = []; + if (options.defaults) + object.referenceCount = 0; + if (message.cumulativeRewardRatio && message.cumulativeRewardRatio.length) { + object.cumulativeRewardRatio = []; + for (let j = 0; j < message.cumulativeRewardRatio.length; ++j) + object.cumulativeRewardRatio[j] = $root.cosmos.base.v1beta1.DecCoin.toObject(message.cumulativeRewardRatio[j], options); + } + if (message.referenceCount != null && message.hasOwnProperty("referenceCount")) + object.referenceCount = message.referenceCount; + return object; + }; + + /** + * Converts this ValidatorHistoricalRewards to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.ValidatorHistoricalRewards + * @instance + * @returns {Object.} JSON object + */ + ValidatorHistoricalRewards.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidatorHistoricalRewards; + })(v1beta1.ValidatorHistoricalRewards || {}); + + v1beta1.ValidatorCurrentRewards = (function(ValidatorCurrentRewards) { + + /** + * Properties of a ValidatorCurrentRewards. + * @memberof cosmos.distribution.v1beta1 + * @interface IValidatorCurrentRewards + * @property {Array.|null} [rewards] ValidatorCurrentRewards rewards + * @property {number|Long|null} [period] ValidatorCurrentRewards period + */ + + /** + * Constructs a new ValidatorCurrentRewards. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a ValidatorCurrentRewards. + * @implements IValidatorCurrentRewards + * @constructor + * @param {cosmos.distribution.v1beta1.IValidatorCurrentRewards=} [properties] Properties to set + */ + function ValidatorCurrentRewards(properties) { + this.rewards = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidatorCurrentRewards rewards. + * @member {Array.} rewards + * @memberof cosmos.distribution.v1beta1.ValidatorCurrentRewards + * @instance + */ + ValidatorCurrentRewards.prototype.rewards = $util.emptyArray; + + /** + * ValidatorCurrentRewards period. + * @member {number|Long} period + * @memberof cosmos.distribution.v1beta1.ValidatorCurrentRewards + * @instance + */ + ValidatorCurrentRewards.prototype.period = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new ValidatorCurrentRewards instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.ValidatorCurrentRewards + * @static + * @param {cosmos.distribution.v1beta1.IValidatorCurrentRewards=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.ValidatorCurrentRewards} ValidatorCurrentRewards instance + */ + ValidatorCurrentRewards.create = function create(properties) { + return new ValidatorCurrentRewards(properties); + }; + + /** + * Encodes the specified ValidatorCurrentRewards message. Does not implicitly {@link cosmos.distribution.v1beta1.ValidatorCurrentRewards.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.ValidatorCurrentRewards + * @static + * @param {cosmos.distribution.v1beta1.IValidatorCurrentRewards} message ValidatorCurrentRewards message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorCurrentRewards.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rewards != null && message.rewards.length) + for (let i = 0; i < message.rewards.length; ++i) + $root.cosmos.base.v1beta1.DecCoin.encode(message.rewards[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.period != null && Object.hasOwnProperty.call(message, "period")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.period); + return writer; + }; + + /** + * Encodes the specified ValidatorCurrentRewards message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.ValidatorCurrentRewards.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.ValidatorCurrentRewards + * @static + * @param {cosmos.distribution.v1beta1.IValidatorCurrentRewards} message ValidatorCurrentRewards message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorCurrentRewards.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidatorCurrentRewards message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.ValidatorCurrentRewards + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.ValidatorCurrentRewards} ValidatorCurrentRewards + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorCurrentRewards.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.ValidatorCurrentRewards(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.rewards && message.rewards.length)) + message.rewards = []; + message.rewards.push($root.cosmos.base.v1beta1.DecCoin.decode(reader, reader.uint32())); + break; + case 2: + message.period = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidatorCurrentRewards message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.ValidatorCurrentRewards + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.ValidatorCurrentRewards} ValidatorCurrentRewards + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorCurrentRewards.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidatorCurrentRewards message. + * @function verify + * @memberof cosmos.distribution.v1beta1.ValidatorCurrentRewards + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidatorCurrentRewards.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rewards != null && message.hasOwnProperty("rewards")) { + if (!Array.isArray(message.rewards)) + return "rewards: array expected"; + for (let i = 0; i < message.rewards.length; ++i) { + let error = $root.cosmos.base.v1beta1.DecCoin.verify(message.rewards[i]); + if (error) + return "rewards." + error; + } + } + if (message.period != null && message.hasOwnProperty("period")) + if (!$util.isInteger(message.period) && !(message.period && $util.isInteger(message.period.low) && $util.isInteger(message.period.high))) + return "period: integer|Long expected"; + return null; + }; + + /** + * Creates a ValidatorCurrentRewards message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.ValidatorCurrentRewards + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.ValidatorCurrentRewards} ValidatorCurrentRewards + */ + ValidatorCurrentRewards.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.ValidatorCurrentRewards) + return object; + let message = new $root.cosmos.distribution.v1beta1.ValidatorCurrentRewards(); + if (object.rewards) { + if (!Array.isArray(object.rewards)) + throw TypeError(".cosmos.distribution.v1beta1.ValidatorCurrentRewards.rewards: array expected"); + message.rewards = []; + for (let i = 0; i < object.rewards.length; ++i) { + if (typeof object.rewards[i] !== "object") + throw TypeError(".cosmos.distribution.v1beta1.ValidatorCurrentRewards.rewards: object expected"); + message.rewards[i] = $root.cosmos.base.v1beta1.DecCoin.fromObject(object.rewards[i]); + } + } + if (object.period != null) + if ($util.Long) + (message.period = $util.Long.fromValue(object.period)).unsigned = true; + else if (typeof object.period === "string") + message.period = parseInt(object.period, 10); + else if (typeof object.period === "number") + message.period = object.period; + else if (typeof object.period === "object") + message.period = new $util.LongBits(object.period.low >>> 0, object.period.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a ValidatorCurrentRewards message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.ValidatorCurrentRewards + * @static + * @param {cosmos.distribution.v1beta1.ValidatorCurrentRewards} message ValidatorCurrentRewards + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidatorCurrentRewards.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.rewards = []; + if (options.defaults) + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.period = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.period = options.longs === String ? "0" : 0; + if (message.rewards && message.rewards.length) { + object.rewards = []; + for (let j = 0; j < message.rewards.length; ++j) + object.rewards[j] = $root.cosmos.base.v1beta1.DecCoin.toObject(message.rewards[j], options); + } + if (message.period != null && message.hasOwnProperty("period")) + if (typeof message.period === "number") + object.period = options.longs === String ? String(message.period) : message.period; + else + object.period = options.longs === String ? $util.Long.prototype.toString.call(message.period) : options.longs === Number ? new $util.LongBits(message.period.low >>> 0, message.period.high >>> 0).toNumber(true) : message.period; + return object; + }; + + /** + * Converts this ValidatorCurrentRewards to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.ValidatorCurrentRewards + * @instance + * @returns {Object.} JSON object + */ + ValidatorCurrentRewards.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidatorCurrentRewards; + })(v1beta1.ValidatorCurrentRewards || {}); + + v1beta1.ValidatorAccumulatedCommission = (function(ValidatorAccumulatedCommission) { + + /** + * Properties of a ValidatorAccumulatedCommission. + * @memberof cosmos.distribution.v1beta1 + * @interface IValidatorAccumulatedCommission + * @property {Array.|null} [commission] ValidatorAccumulatedCommission commission + */ + + /** + * Constructs a new ValidatorAccumulatedCommission. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a ValidatorAccumulatedCommission. + * @implements IValidatorAccumulatedCommission + * @constructor + * @param {cosmos.distribution.v1beta1.IValidatorAccumulatedCommission=} [properties] Properties to set + */ + function ValidatorAccumulatedCommission(properties) { + this.commission = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidatorAccumulatedCommission commission. + * @member {Array.} commission + * @memberof cosmos.distribution.v1beta1.ValidatorAccumulatedCommission + * @instance + */ + ValidatorAccumulatedCommission.prototype.commission = $util.emptyArray; + + /** + * Creates a new ValidatorAccumulatedCommission instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.ValidatorAccumulatedCommission + * @static + * @param {cosmos.distribution.v1beta1.IValidatorAccumulatedCommission=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.ValidatorAccumulatedCommission} ValidatorAccumulatedCommission instance + */ + ValidatorAccumulatedCommission.create = function create(properties) { + return new ValidatorAccumulatedCommission(properties); + }; + + /** + * Encodes the specified ValidatorAccumulatedCommission message. Does not implicitly {@link cosmos.distribution.v1beta1.ValidatorAccumulatedCommission.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.ValidatorAccumulatedCommission + * @static + * @param {cosmos.distribution.v1beta1.IValidatorAccumulatedCommission} message ValidatorAccumulatedCommission message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorAccumulatedCommission.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commission != null && message.commission.length) + for (let i = 0; i < message.commission.length; ++i) + $root.cosmos.base.v1beta1.DecCoin.encode(message.commission[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ValidatorAccumulatedCommission message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.ValidatorAccumulatedCommission.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.ValidatorAccumulatedCommission + * @static + * @param {cosmos.distribution.v1beta1.IValidatorAccumulatedCommission} message ValidatorAccumulatedCommission message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorAccumulatedCommission.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidatorAccumulatedCommission message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.ValidatorAccumulatedCommission + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.ValidatorAccumulatedCommission} ValidatorAccumulatedCommission + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorAccumulatedCommission.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.ValidatorAccumulatedCommission(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.commission && message.commission.length)) + message.commission = []; + message.commission.push($root.cosmos.base.v1beta1.DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidatorAccumulatedCommission message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.ValidatorAccumulatedCommission + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.ValidatorAccumulatedCommission} ValidatorAccumulatedCommission + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorAccumulatedCommission.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidatorAccumulatedCommission message. + * @function verify + * @memberof cosmos.distribution.v1beta1.ValidatorAccumulatedCommission + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidatorAccumulatedCommission.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commission != null && message.hasOwnProperty("commission")) { + if (!Array.isArray(message.commission)) + return "commission: array expected"; + for (let i = 0; i < message.commission.length; ++i) { + let error = $root.cosmos.base.v1beta1.DecCoin.verify(message.commission[i]); + if (error) + return "commission." + error; + } + } + return null; + }; + + /** + * Creates a ValidatorAccumulatedCommission message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.ValidatorAccumulatedCommission + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.ValidatorAccumulatedCommission} ValidatorAccumulatedCommission + */ + ValidatorAccumulatedCommission.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.ValidatorAccumulatedCommission) + return object; + let message = new $root.cosmos.distribution.v1beta1.ValidatorAccumulatedCommission(); + if (object.commission) { + if (!Array.isArray(object.commission)) + throw TypeError(".cosmos.distribution.v1beta1.ValidatorAccumulatedCommission.commission: array expected"); + message.commission = []; + for (let i = 0; i < object.commission.length; ++i) { + if (typeof object.commission[i] !== "object") + throw TypeError(".cosmos.distribution.v1beta1.ValidatorAccumulatedCommission.commission: object expected"); + message.commission[i] = $root.cosmos.base.v1beta1.DecCoin.fromObject(object.commission[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ValidatorAccumulatedCommission message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.ValidatorAccumulatedCommission + * @static + * @param {cosmos.distribution.v1beta1.ValidatorAccumulatedCommission} message ValidatorAccumulatedCommission + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidatorAccumulatedCommission.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.commission = []; + if (message.commission && message.commission.length) { + object.commission = []; + for (let j = 0; j < message.commission.length; ++j) + object.commission[j] = $root.cosmos.base.v1beta1.DecCoin.toObject(message.commission[j], options); + } + return object; + }; + + /** + * Converts this ValidatorAccumulatedCommission to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.ValidatorAccumulatedCommission + * @instance + * @returns {Object.} JSON object + */ + ValidatorAccumulatedCommission.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidatorAccumulatedCommission; + })(v1beta1.ValidatorAccumulatedCommission || {}); + + v1beta1.ValidatorOutstandingRewards = (function(ValidatorOutstandingRewards) { + + /** + * Properties of a ValidatorOutstandingRewards. + * @memberof cosmos.distribution.v1beta1 + * @interface IValidatorOutstandingRewards + * @property {Array.|null} [rewards] ValidatorOutstandingRewards rewards + */ + + /** + * Constructs a new ValidatorOutstandingRewards. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a ValidatorOutstandingRewards. + * @implements IValidatorOutstandingRewards + * @constructor + * @param {cosmos.distribution.v1beta1.IValidatorOutstandingRewards=} [properties] Properties to set + */ + function ValidatorOutstandingRewards(properties) { + this.rewards = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidatorOutstandingRewards rewards. + * @member {Array.} rewards + * @memberof cosmos.distribution.v1beta1.ValidatorOutstandingRewards + * @instance + */ + ValidatorOutstandingRewards.prototype.rewards = $util.emptyArray; + + /** + * Creates a new ValidatorOutstandingRewards instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.ValidatorOutstandingRewards + * @static + * @param {cosmos.distribution.v1beta1.IValidatorOutstandingRewards=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.ValidatorOutstandingRewards} ValidatorOutstandingRewards instance + */ + ValidatorOutstandingRewards.create = function create(properties) { + return new ValidatorOutstandingRewards(properties); + }; + + /** + * Encodes the specified ValidatorOutstandingRewards message. Does not implicitly {@link cosmos.distribution.v1beta1.ValidatorOutstandingRewards.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.ValidatorOutstandingRewards + * @static + * @param {cosmos.distribution.v1beta1.IValidatorOutstandingRewards} message ValidatorOutstandingRewards message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorOutstandingRewards.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rewards != null && message.rewards.length) + for (let i = 0; i < message.rewards.length; ++i) + $root.cosmos.base.v1beta1.DecCoin.encode(message.rewards[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ValidatorOutstandingRewards message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.ValidatorOutstandingRewards.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.ValidatorOutstandingRewards + * @static + * @param {cosmos.distribution.v1beta1.IValidatorOutstandingRewards} message ValidatorOutstandingRewards message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorOutstandingRewards.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidatorOutstandingRewards message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.ValidatorOutstandingRewards + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.ValidatorOutstandingRewards} ValidatorOutstandingRewards + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorOutstandingRewards.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.ValidatorOutstandingRewards(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.rewards && message.rewards.length)) + message.rewards = []; + message.rewards.push($root.cosmos.base.v1beta1.DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidatorOutstandingRewards message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.ValidatorOutstandingRewards + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.ValidatorOutstandingRewards} ValidatorOutstandingRewards + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorOutstandingRewards.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidatorOutstandingRewards message. + * @function verify + * @memberof cosmos.distribution.v1beta1.ValidatorOutstandingRewards + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidatorOutstandingRewards.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rewards != null && message.hasOwnProperty("rewards")) { + if (!Array.isArray(message.rewards)) + return "rewards: array expected"; + for (let i = 0; i < message.rewards.length; ++i) { + let error = $root.cosmos.base.v1beta1.DecCoin.verify(message.rewards[i]); + if (error) + return "rewards." + error; + } + } + return null; + }; + + /** + * Creates a ValidatorOutstandingRewards message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.ValidatorOutstandingRewards + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.ValidatorOutstandingRewards} ValidatorOutstandingRewards + */ + ValidatorOutstandingRewards.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.ValidatorOutstandingRewards) + return object; + let message = new $root.cosmos.distribution.v1beta1.ValidatorOutstandingRewards(); + if (object.rewards) { + if (!Array.isArray(object.rewards)) + throw TypeError(".cosmos.distribution.v1beta1.ValidatorOutstandingRewards.rewards: array expected"); + message.rewards = []; + for (let i = 0; i < object.rewards.length; ++i) { + if (typeof object.rewards[i] !== "object") + throw TypeError(".cosmos.distribution.v1beta1.ValidatorOutstandingRewards.rewards: object expected"); + message.rewards[i] = $root.cosmos.base.v1beta1.DecCoin.fromObject(object.rewards[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ValidatorOutstandingRewards message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.ValidatorOutstandingRewards + * @static + * @param {cosmos.distribution.v1beta1.ValidatorOutstandingRewards} message ValidatorOutstandingRewards + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidatorOutstandingRewards.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.rewards = []; + if (message.rewards && message.rewards.length) { + object.rewards = []; + for (let j = 0; j < message.rewards.length; ++j) + object.rewards[j] = $root.cosmos.base.v1beta1.DecCoin.toObject(message.rewards[j], options); + } + return object; + }; + + /** + * Converts this ValidatorOutstandingRewards to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.ValidatorOutstandingRewards + * @instance + * @returns {Object.} JSON object + */ + ValidatorOutstandingRewards.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidatorOutstandingRewards; + })(v1beta1.ValidatorOutstandingRewards || {}); + + v1beta1.ValidatorSlashEvent = (function(ValidatorSlashEvent) { + + /** + * Properties of a ValidatorSlashEvent. + * @memberof cosmos.distribution.v1beta1 + * @interface IValidatorSlashEvent + * @property {number|Long|null} [validatorPeriod] ValidatorSlashEvent validatorPeriod + * @property {string|null} [fraction] ValidatorSlashEvent fraction + */ + + /** + * Constructs a new ValidatorSlashEvent. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a ValidatorSlashEvent. + * @implements IValidatorSlashEvent + * @constructor + * @param {cosmos.distribution.v1beta1.IValidatorSlashEvent=} [properties] Properties to set + */ + function ValidatorSlashEvent(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidatorSlashEvent validatorPeriod. + * @member {number|Long} validatorPeriod + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEvent + * @instance + */ + ValidatorSlashEvent.prototype.validatorPeriod = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ValidatorSlashEvent fraction. + * @member {string} fraction + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEvent + * @instance + */ + ValidatorSlashEvent.prototype.fraction = ""; + + /** + * Creates a new ValidatorSlashEvent instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEvent + * @static + * @param {cosmos.distribution.v1beta1.IValidatorSlashEvent=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.ValidatorSlashEvent} ValidatorSlashEvent instance + */ + ValidatorSlashEvent.create = function create(properties) { + return new ValidatorSlashEvent(properties); + }; + + /** + * Encodes the specified ValidatorSlashEvent message. Does not implicitly {@link cosmos.distribution.v1beta1.ValidatorSlashEvent.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEvent + * @static + * @param {cosmos.distribution.v1beta1.IValidatorSlashEvent} message ValidatorSlashEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorSlashEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validatorPeriod != null && Object.hasOwnProperty.call(message, "validatorPeriod")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.validatorPeriod); + if (message.fraction != null && Object.hasOwnProperty.call(message, "fraction")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fraction); + return writer; + }; + + /** + * Encodes the specified ValidatorSlashEvent message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.ValidatorSlashEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEvent + * @static + * @param {cosmos.distribution.v1beta1.IValidatorSlashEvent} message ValidatorSlashEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorSlashEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidatorSlashEvent message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.ValidatorSlashEvent} ValidatorSlashEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorSlashEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.ValidatorSlashEvent(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorPeriod = reader.uint64(); + break; + case 2: + message.fraction = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidatorSlashEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.ValidatorSlashEvent} ValidatorSlashEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorSlashEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidatorSlashEvent message. + * @function verify + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidatorSlashEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validatorPeriod != null && message.hasOwnProperty("validatorPeriod")) + if (!$util.isInteger(message.validatorPeriod) && !(message.validatorPeriod && $util.isInteger(message.validatorPeriod.low) && $util.isInteger(message.validatorPeriod.high))) + return "validatorPeriod: integer|Long expected"; + if (message.fraction != null && message.hasOwnProperty("fraction")) + if (!$util.isString(message.fraction)) + return "fraction: string expected"; + return null; + }; + + /** + * Creates a ValidatorSlashEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEvent + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.ValidatorSlashEvent} ValidatorSlashEvent + */ + ValidatorSlashEvent.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.ValidatorSlashEvent) + return object; + let message = new $root.cosmos.distribution.v1beta1.ValidatorSlashEvent(); + if (object.validatorPeriod != null) + if ($util.Long) + (message.validatorPeriod = $util.Long.fromValue(object.validatorPeriod)).unsigned = true; + else if (typeof object.validatorPeriod === "string") + message.validatorPeriod = parseInt(object.validatorPeriod, 10); + else if (typeof object.validatorPeriod === "number") + message.validatorPeriod = object.validatorPeriod; + else if (typeof object.validatorPeriod === "object") + message.validatorPeriod = new $util.LongBits(object.validatorPeriod.low >>> 0, object.validatorPeriod.high >>> 0).toNumber(true); + if (object.fraction != null) + message.fraction = String(object.fraction); + return message; + }; + + /** + * Creates a plain object from a ValidatorSlashEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEvent + * @static + * @param {cosmos.distribution.v1beta1.ValidatorSlashEvent} message ValidatorSlashEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidatorSlashEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.validatorPeriod = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.validatorPeriod = options.longs === String ? "0" : 0; + object.fraction = ""; + } + if (message.validatorPeriod != null && message.hasOwnProperty("validatorPeriod")) + if (typeof message.validatorPeriod === "number") + object.validatorPeriod = options.longs === String ? String(message.validatorPeriod) : message.validatorPeriod; + else + object.validatorPeriod = options.longs === String ? $util.Long.prototype.toString.call(message.validatorPeriod) : options.longs === Number ? new $util.LongBits(message.validatorPeriod.low >>> 0, message.validatorPeriod.high >>> 0).toNumber(true) : message.validatorPeriod; + if (message.fraction != null && message.hasOwnProperty("fraction")) + object.fraction = message.fraction; + return object; + }; + + /** + * Converts this ValidatorSlashEvent to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEvent + * @instance + * @returns {Object.} JSON object + */ + ValidatorSlashEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidatorSlashEvent; + })(v1beta1.ValidatorSlashEvent || {}); + + v1beta1.ValidatorSlashEvents = (function(ValidatorSlashEvents) { + + /** + * Properties of a ValidatorSlashEvents. + * @memberof cosmos.distribution.v1beta1 + * @interface IValidatorSlashEvents + * @property {Array.|null} [validatorSlashEvents] ValidatorSlashEvents validatorSlashEvents + */ + + /** + * Constructs a new ValidatorSlashEvents. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a ValidatorSlashEvents. + * @implements IValidatorSlashEvents + * @constructor + * @param {cosmos.distribution.v1beta1.IValidatorSlashEvents=} [properties] Properties to set + */ + function ValidatorSlashEvents(properties) { + this.validatorSlashEvents = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidatorSlashEvents validatorSlashEvents. + * @member {Array.} validatorSlashEvents + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEvents + * @instance + */ + ValidatorSlashEvents.prototype.validatorSlashEvents = $util.emptyArray; + + /** + * Creates a new ValidatorSlashEvents instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEvents + * @static + * @param {cosmos.distribution.v1beta1.IValidatorSlashEvents=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.ValidatorSlashEvents} ValidatorSlashEvents instance + */ + ValidatorSlashEvents.create = function create(properties) { + return new ValidatorSlashEvents(properties); + }; + + /** + * Encodes the specified ValidatorSlashEvents message. Does not implicitly {@link cosmos.distribution.v1beta1.ValidatorSlashEvents.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEvents + * @static + * @param {cosmos.distribution.v1beta1.IValidatorSlashEvents} message ValidatorSlashEvents message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorSlashEvents.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validatorSlashEvents != null && message.validatorSlashEvents.length) + for (let i = 0; i < message.validatorSlashEvents.length; ++i) + $root.cosmos.distribution.v1beta1.ValidatorSlashEvent.encode(message.validatorSlashEvents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ValidatorSlashEvents message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.ValidatorSlashEvents.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEvents + * @static + * @param {cosmos.distribution.v1beta1.IValidatorSlashEvents} message ValidatorSlashEvents message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorSlashEvents.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidatorSlashEvents message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEvents + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.ValidatorSlashEvents} ValidatorSlashEvents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorSlashEvents.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.ValidatorSlashEvents(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.validatorSlashEvents && message.validatorSlashEvents.length)) + message.validatorSlashEvents = []; + message.validatorSlashEvents.push($root.cosmos.distribution.v1beta1.ValidatorSlashEvent.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidatorSlashEvents message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEvents + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.ValidatorSlashEvents} ValidatorSlashEvents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorSlashEvents.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidatorSlashEvents message. + * @function verify + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEvents + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidatorSlashEvents.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validatorSlashEvents != null && message.hasOwnProperty("validatorSlashEvents")) { + if (!Array.isArray(message.validatorSlashEvents)) + return "validatorSlashEvents: array expected"; + for (let i = 0; i < message.validatorSlashEvents.length; ++i) { + let error = $root.cosmos.distribution.v1beta1.ValidatorSlashEvent.verify(message.validatorSlashEvents[i]); + if (error) + return "validatorSlashEvents." + error; + } + } + return null; + }; + + /** + * Creates a ValidatorSlashEvents message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEvents + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.ValidatorSlashEvents} ValidatorSlashEvents + */ + ValidatorSlashEvents.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.ValidatorSlashEvents) + return object; + let message = new $root.cosmos.distribution.v1beta1.ValidatorSlashEvents(); + if (object.validatorSlashEvents) { + if (!Array.isArray(object.validatorSlashEvents)) + throw TypeError(".cosmos.distribution.v1beta1.ValidatorSlashEvents.validatorSlashEvents: array expected"); + message.validatorSlashEvents = []; + for (let i = 0; i < object.validatorSlashEvents.length; ++i) { + if (typeof object.validatorSlashEvents[i] !== "object") + throw TypeError(".cosmos.distribution.v1beta1.ValidatorSlashEvents.validatorSlashEvents: object expected"); + message.validatorSlashEvents[i] = $root.cosmos.distribution.v1beta1.ValidatorSlashEvent.fromObject(object.validatorSlashEvents[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ValidatorSlashEvents message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEvents + * @static + * @param {cosmos.distribution.v1beta1.ValidatorSlashEvents} message ValidatorSlashEvents + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidatorSlashEvents.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.validatorSlashEvents = []; + if (message.validatorSlashEvents && message.validatorSlashEvents.length) { + object.validatorSlashEvents = []; + for (let j = 0; j < message.validatorSlashEvents.length; ++j) + object.validatorSlashEvents[j] = $root.cosmos.distribution.v1beta1.ValidatorSlashEvent.toObject(message.validatorSlashEvents[j], options); + } + return object; + }; + + /** + * Converts this ValidatorSlashEvents to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEvents + * @instance + * @returns {Object.} JSON object + */ + ValidatorSlashEvents.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidatorSlashEvents; + })(v1beta1.ValidatorSlashEvents || {}); + + v1beta1.FeePool = (function(FeePool) { + + /** + * Properties of a FeePool. + * @memberof cosmos.distribution.v1beta1 + * @interface IFeePool + * @property {Array.|null} [communityPool] FeePool communityPool + */ + + /** + * Constructs a new FeePool. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a FeePool. + * @implements IFeePool + * @constructor + * @param {cosmos.distribution.v1beta1.IFeePool=} [properties] Properties to set + */ + function FeePool(properties) { + this.communityPool = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeePool communityPool. + * @member {Array.} communityPool + * @memberof cosmos.distribution.v1beta1.FeePool + * @instance + */ + FeePool.prototype.communityPool = $util.emptyArray; + + /** + * Creates a new FeePool instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.FeePool + * @static + * @param {cosmos.distribution.v1beta1.IFeePool=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.FeePool} FeePool instance + */ + FeePool.create = function create(properties) { + return new FeePool(properties); + }; + + /** + * Encodes the specified FeePool message. Does not implicitly {@link cosmos.distribution.v1beta1.FeePool.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.FeePool + * @static + * @param {cosmos.distribution.v1beta1.IFeePool} message FeePool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeePool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.communityPool != null && message.communityPool.length) + for (let i = 0; i < message.communityPool.length; ++i) + $root.cosmos.base.v1beta1.DecCoin.encode(message.communityPool[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FeePool message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.FeePool.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.FeePool + * @static + * @param {cosmos.distribution.v1beta1.IFeePool} message FeePool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeePool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeePool message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.FeePool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.FeePool} FeePool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeePool.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.FeePool(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.communityPool && message.communityPool.length)) + message.communityPool = []; + message.communityPool.push($root.cosmos.base.v1beta1.DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeePool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.FeePool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.FeePool} FeePool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeePool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeePool message. + * @function verify + * @memberof cosmos.distribution.v1beta1.FeePool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeePool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.communityPool != null && message.hasOwnProperty("communityPool")) { + if (!Array.isArray(message.communityPool)) + return "communityPool: array expected"; + for (let i = 0; i < message.communityPool.length; ++i) { + let error = $root.cosmos.base.v1beta1.DecCoin.verify(message.communityPool[i]); + if (error) + return "communityPool." + error; + } + } + return null; + }; + + /** + * Creates a FeePool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.FeePool + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.FeePool} FeePool + */ + FeePool.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.FeePool) + return object; + let message = new $root.cosmos.distribution.v1beta1.FeePool(); + if (object.communityPool) { + if (!Array.isArray(object.communityPool)) + throw TypeError(".cosmos.distribution.v1beta1.FeePool.communityPool: array expected"); + message.communityPool = []; + for (let i = 0; i < object.communityPool.length; ++i) { + if (typeof object.communityPool[i] !== "object") + throw TypeError(".cosmos.distribution.v1beta1.FeePool.communityPool: object expected"); + message.communityPool[i] = $root.cosmos.base.v1beta1.DecCoin.fromObject(object.communityPool[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FeePool message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.FeePool + * @static + * @param {cosmos.distribution.v1beta1.FeePool} message FeePool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeePool.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.communityPool = []; + if (message.communityPool && message.communityPool.length) { + object.communityPool = []; + for (let j = 0; j < message.communityPool.length; ++j) + object.communityPool[j] = $root.cosmos.base.v1beta1.DecCoin.toObject(message.communityPool[j], options); + } + return object; + }; + + /** + * Converts this FeePool to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.FeePool + * @instance + * @returns {Object.} JSON object + */ + FeePool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FeePool; + })(v1beta1.FeePool || {}); + + v1beta1.CommunityPoolSpendProposal = (function(CommunityPoolSpendProposal) { + + /** + * Properties of a CommunityPoolSpendProposal. + * @memberof cosmos.distribution.v1beta1 + * @interface ICommunityPoolSpendProposal + * @property {string|null} [title] CommunityPoolSpendProposal title + * @property {string|null} [description] CommunityPoolSpendProposal description + * @property {string|null} [recipient] CommunityPoolSpendProposal recipient + * @property {Array.|null} [amount] CommunityPoolSpendProposal amount + */ + + /** + * Constructs a new CommunityPoolSpendProposal. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a CommunityPoolSpendProposal. + * @implements ICommunityPoolSpendProposal + * @constructor + * @param {cosmos.distribution.v1beta1.ICommunityPoolSpendProposal=} [properties] Properties to set + */ + function CommunityPoolSpendProposal(properties) { + this.amount = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommunityPoolSpendProposal title. + * @member {string} title + * @memberof cosmos.distribution.v1beta1.CommunityPoolSpendProposal + * @instance + */ + CommunityPoolSpendProposal.prototype.title = ""; + + /** + * CommunityPoolSpendProposal description. + * @member {string} description + * @memberof cosmos.distribution.v1beta1.CommunityPoolSpendProposal + * @instance + */ + CommunityPoolSpendProposal.prototype.description = ""; + + /** + * CommunityPoolSpendProposal recipient. + * @member {string} recipient + * @memberof cosmos.distribution.v1beta1.CommunityPoolSpendProposal + * @instance + */ + CommunityPoolSpendProposal.prototype.recipient = ""; + + /** + * CommunityPoolSpendProposal amount. + * @member {Array.} amount + * @memberof cosmos.distribution.v1beta1.CommunityPoolSpendProposal + * @instance + */ + CommunityPoolSpendProposal.prototype.amount = $util.emptyArray; + + /** + * Creates a new CommunityPoolSpendProposal instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.CommunityPoolSpendProposal + * @static + * @param {cosmos.distribution.v1beta1.ICommunityPoolSpendProposal=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.CommunityPoolSpendProposal} CommunityPoolSpendProposal instance + */ + CommunityPoolSpendProposal.create = function create(properties) { + return new CommunityPoolSpendProposal(properties); + }; + + /** + * Encodes the specified CommunityPoolSpendProposal message. Does not implicitly {@link cosmos.distribution.v1beta1.CommunityPoolSpendProposal.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.CommunityPoolSpendProposal + * @static + * @param {cosmos.distribution.v1beta1.ICommunityPoolSpendProposal} message CommunityPoolSpendProposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommunityPoolSpendProposal.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.recipient != null && Object.hasOwnProperty.call(message, "recipient")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.recipient); + if (message.amount != null && message.amount.length) + for (let i = 0; i < message.amount.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.amount[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CommunityPoolSpendProposal message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.CommunityPoolSpendProposal.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.CommunityPoolSpendProposal + * @static + * @param {cosmos.distribution.v1beta1.ICommunityPoolSpendProposal} message CommunityPoolSpendProposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommunityPoolSpendProposal.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommunityPoolSpendProposal message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.CommunityPoolSpendProposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.CommunityPoolSpendProposal} CommunityPoolSpendProposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommunityPoolSpendProposal.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.CommunityPoolSpendProposal(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.recipient = reader.string(); + break; + case 4: + if (!(message.amount && message.amount.length)) + message.amount = []; + message.amount.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommunityPoolSpendProposal message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.CommunityPoolSpendProposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.CommunityPoolSpendProposal} CommunityPoolSpendProposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommunityPoolSpendProposal.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommunityPoolSpendProposal message. + * @function verify + * @memberof cosmos.distribution.v1beta1.CommunityPoolSpendProposal + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommunityPoolSpendProposal.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.recipient != null && message.hasOwnProperty("recipient")) + if (!$util.isString(message.recipient)) + return "recipient: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + if (!Array.isArray(message.amount)) + return "amount: array expected"; + for (let i = 0; i < message.amount.length; ++i) { + let error = $root.cosmos.base.v1beta1.Coin.verify(message.amount[i]); + if (error) + return "amount." + error; + } + } + return null; + }; + + /** + * Creates a CommunityPoolSpendProposal message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.CommunityPoolSpendProposal + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.CommunityPoolSpendProposal} CommunityPoolSpendProposal + */ + CommunityPoolSpendProposal.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.CommunityPoolSpendProposal) + return object; + let message = new $root.cosmos.distribution.v1beta1.CommunityPoolSpendProposal(); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.recipient != null) + message.recipient = String(object.recipient); + if (object.amount) { + if (!Array.isArray(object.amount)) + throw TypeError(".cosmos.distribution.v1beta1.CommunityPoolSpendProposal.amount: array expected"); + message.amount = []; + for (let i = 0; i < object.amount.length; ++i) { + if (typeof object.amount[i] !== "object") + throw TypeError(".cosmos.distribution.v1beta1.CommunityPoolSpendProposal.amount: object expected"); + message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CommunityPoolSpendProposal message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.CommunityPoolSpendProposal + * @static + * @param {cosmos.distribution.v1beta1.CommunityPoolSpendProposal} message CommunityPoolSpendProposal + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommunityPoolSpendProposal.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.amount = []; + if (options.defaults) { + object.title = ""; + object.description = ""; + object.recipient = ""; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.recipient != null && message.hasOwnProperty("recipient")) + object.recipient = message.recipient; + if (message.amount && message.amount.length) { + object.amount = []; + for (let j = 0; j < message.amount.length; ++j) + object.amount[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.amount[j], options); + } + return object; + }; + + /** + * Converts this CommunityPoolSpendProposal to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.CommunityPoolSpendProposal + * @instance + * @returns {Object.} JSON object + */ + CommunityPoolSpendProposal.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CommunityPoolSpendProposal; + })(v1beta1.CommunityPoolSpendProposal || {}); + + v1beta1.DelegatorStartingInfo = (function(DelegatorStartingInfo) { + + /** + * Properties of a DelegatorStartingInfo. + * @memberof cosmos.distribution.v1beta1 + * @interface IDelegatorStartingInfo + * @property {number|Long|null} [previousPeriod] DelegatorStartingInfo previousPeriod + * @property {string|null} [stake] DelegatorStartingInfo stake + * @property {number|Long|null} [height] DelegatorStartingInfo height + */ + + /** + * Constructs a new DelegatorStartingInfo. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a DelegatorStartingInfo. + * @implements IDelegatorStartingInfo + * @constructor + * @param {cosmos.distribution.v1beta1.IDelegatorStartingInfo=} [properties] Properties to set + */ + function DelegatorStartingInfo(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DelegatorStartingInfo previousPeriod. + * @member {number|Long} previousPeriod + * @memberof cosmos.distribution.v1beta1.DelegatorStartingInfo + * @instance + */ + DelegatorStartingInfo.prototype.previousPeriod = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * DelegatorStartingInfo stake. + * @member {string} stake + * @memberof cosmos.distribution.v1beta1.DelegatorStartingInfo + * @instance + */ + DelegatorStartingInfo.prototype.stake = ""; + + /** + * DelegatorStartingInfo height. + * @member {number|Long} height + * @memberof cosmos.distribution.v1beta1.DelegatorStartingInfo + * @instance + */ + DelegatorStartingInfo.prototype.height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new DelegatorStartingInfo instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.DelegatorStartingInfo + * @static + * @param {cosmos.distribution.v1beta1.IDelegatorStartingInfo=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.DelegatorStartingInfo} DelegatorStartingInfo instance + */ + DelegatorStartingInfo.create = function create(properties) { + return new DelegatorStartingInfo(properties); + }; + + /** + * Encodes the specified DelegatorStartingInfo message. Does not implicitly {@link cosmos.distribution.v1beta1.DelegatorStartingInfo.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.DelegatorStartingInfo + * @static + * @param {cosmos.distribution.v1beta1.IDelegatorStartingInfo} message DelegatorStartingInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DelegatorStartingInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.previousPeriod != null && Object.hasOwnProperty.call(message, "previousPeriod")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.previousPeriod); + if (message.stake != null && Object.hasOwnProperty.call(message, "stake")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.stake); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.height); + return writer; + }; + + /** + * Encodes the specified DelegatorStartingInfo message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.DelegatorStartingInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.DelegatorStartingInfo + * @static + * @param {cosmos.distribution.v1beta1.IDelegatorStartingInfo} message DelegatorStartingInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DelegatorStartingInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DelegatorStartingInfo message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.DelegatorStartingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.DelegatorStartingInfo} DelegatorStartingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DelegatorStartingInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.DelegatorStartingInfo(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.previousPeriod = reader.uint64(); + break; + case 2: + message.stake = reader.string(); + break; + case 3: + message.height = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DelegatorStartingInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.DelegatorStartingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.DelegatorStartingInfo} DelegatorStartingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DelegatorStartingInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DelegatorStartingInfo message. + * @function verify + * @memberof cosmos.distribution.v1beta1.DelegatorStartingInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DelegatorStartingInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.previousPeriod != null && message.hasOwnProperty("previousPeriod")) + if (!$util.isInteger(message.previousPeriod) && !(message.previousPeriod && $util.isInteger(message.previousPeriod.low) && $util.isInteger(message.previousPeriod.high))) + return "previousPeriod: integer|Long expected"; + if (message.stake != null && message.hasOwnProperty("stake")) + if (!$util.isString(message.stake)) + return "stake: string expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + return null; + }; + + /** + * Creates a DelegatorStartingInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.DelegatorStartingInfo + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.DelegatorStartingInfo} DelegatorStartingInfo + */ + DelegatorStartingInfo.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.DelegatorStartingInfo) + return object; + let message = new $root.cosmos.distribution.v1beta1.DelegatorStartingInfo(); + if (object.previousPeriod != null) + if ($util.Long) + (message.previousPeriod = $util.Long.fromValue(object.previousPeriod)).unsigned = true; + else if (typeof object.previousPeriod === "string") + message.previousPeriod = parseInt(object.previousPeriod, 10); + else if (typeof object.previousPeriod === "number") + message.previousPeriod = object.previousPeriod; + else if (typeof object.previousPeriod === "object") + message.previousPeriod = new $util.LongBits(object.previousPeriod.low >>> 0, object.previousPeriod.high >>> 0).toNumber(true); + if (object.stake != null) + message.stake = String(object.stake); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = true; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a DelegatorStartingInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.DelegatorStartingInfo + * @static + * @param {cosmos.distribution.v1beta1.DelegatorStartingInfo} message DelegatorStartingInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DelegatorStartingInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.previousPeriod = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.previousPeriod = options.longs === String ? "0" : 0; + object.stake = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + } + if (message.previousPeriod != null && message.hasOwnProperty("previousPeriod")) + if (typeof message.previousPeriod === "number") + object.previousPeriod = options.longs === String ? String(message.previousPeriod) : message.previousPeriod; + else + object.previousPeriod = options.longs === String ? $util.Long.prototype.toString.call(message.previousPeriod) : options.longs === Number ? new $util.LongBits(message.previousPeriod.low >>> 0, message.previousPeriod.high >>> 0).toNumber(true) : message.previousPeriod; + if (message.stake != null && message.hasOwnProperty("stake")) + object.stake = message.stake; + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber(true) : message.height; + return object; + }; + + /** + * Converts this DelegatorStartingInfo to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.DelegatorStartingInfo + * @instance + * @returns {Object.} JSON object + */ + DelegatorStartingInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DelegatorStartingInfo; + })(v1beta1.DelegatorStartingInfo || {}); + + v1beta1.DelegationDelegatorReward = (function(DelegationDelegatorReward) { + + /** + * Properties of a DelegationDelegatorReward. + * @memberof cosmos.distribution.v1beta1 + * @interface IDelegationDelegatorReward + * @property {string|null} [validatorAddress] DelegationDelegatorReward validatorAddress + * @property {Array.|null} [reward] DelegationDelegatorReward reward + */ + + /** + * Constructs a new DelegationDelegatorReward. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a DelegationDelegatorReward. + * @implements IDelegationDelegatorReward + * @constructor + * @param {cosmos.distribution.v1beta1.IDelegationDelegatorReward=} [properties] Properties to set + */ + function DelegationDelegatorReward(properties) { + this.reward = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DelegationDelegatorReward validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.distribution.v1beta1.DelegationDelegatorReward + * @instance + */ + DelegationDelegatorReward.prototype.validatorAddress = ""; + + /** + * DelegationDelegatorReward reward. + * @member {Array.} reward + * @memberof cosmos.distribution.v1beta1.DelegationDelegatorReward + * @instance + */ + DelegationDelegatorReward.prototype.reward = $util.emptyArray; + + /** + * Creates a new DelegationDelegatorReward instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.DelegationDelegatorReward + * @static + * @param {cosmos.distribution.v1beta1.IDelegationDelegatorReward=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.DelegationDelegatorReward} DelegationDelegatorReward instance + */ + DelegationDelegatorReward.create = function create(properties) { + return new DelegationDelegatorReward(properties); + }; + + /** + * Encodes the specified DelegationDelegatorReward message. Does not implicitly {@link cosmos.distribution.v1beta1.DelegationDelegatorReward.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.DelegationDelegatorReward + * @static + * @param {cosmos.distribution.v1beta1.IDelegationDelegatorReward} message DelegationDelegatorReward message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DelegationDelegatorReward.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.validatorAddress); + if (message.reward != null && message.reward.length) + for (let i = 0; i < message.reward.length; ++i) + $root.cosmos.base.v1beta1.DecCoin.encode(message.reward[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DelegationDelegatorReward message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.DelegationDelegatorReward.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.DelegationDelegatorReward + * @static + * @param {cosmos.distribution.v1beta1.IDelegationDelegatorReward} message DelegationDelegatorReward message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DelegationDelegatorReward.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DelegationDelegatorReward message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.DelegationDelegatorReward + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.DelegationDelegatorReward} DelegationDelegatorReward + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DelegationDelegatorReward.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.DelegationDelegatorReward(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + if (!(message.reward && message.reward.length)) + message.reward = []; + message.reward.push($root.cosmos.base.v1beta1.DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DelegationDelegatorReward message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.DelegationDelegatorReward + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.DelegationDelegatorReward} DelegationDelegatorReward + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DelegationDelegatorReward.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DelegationDelegatorReward message. + * @function verify + * @memberof cosmos.distribution.v1beta1.DelegationDelegatorReward + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DelegationDelegatorReward.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + if (message.reward != null && message.hasOwnProperty("reward")) { + if (!Array.isArray(message.reward)) + return "reward: array expected"; + for (let i = 0; i < message.reward.length; ++i) { + let error = $root.cosmos.base.v1beta1.DecCoin.verify(message.reward[i]); + if (error) + return "reward." + error; + } + } + return null; + }; + + /** + * Creates a DelegationDelegatorReward message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.DelegationDelegatorReward + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.DelegationDelegatorReward} DelegationDelegatorReward + */ + DelegationDelegatorReward.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.DelegationDelegatorReward) + return object; + let message = new $root.cosmos.distribution.v1beta1.DelegationDelegatorReward(); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + if (object.reward) { + if (!Array.isArray(object.reward)) + throw TypeError(".cosmos.distribution.v1beta1.DelegationDelegatorReward.reward: array expected"); + message.reward = []; + for (let i = 0; i < object.reward.length; ++i) { + if (typeof object.reward[i] !== "object") + throw TypeError(".cosmos.distribution.v1beta1.DelegationDelegatorReward.reward: object expected"); + message.reward[i] = $root.cosmos.base.v1beta1.DecCoin.fromObject(object.reward[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DelegationDelegatorReward message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.DelegationDelegatorReward + * @static + * @param {cosmos.distribution.v1beta1.DelegationDelegatorReward} message DelegationDelegatorReward + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DelegationDelegatorReward.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.reward = []; + if (options.defaults) + object.validatorAddress = ""; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + if (message.reward && message.reward.length) { + object.reward = []; + for (let j = 0; j < message.reward.length; ++j) + object.reward[j] = $root.cosmos.base.v1beta1.DecCoin.toObject(message.reward[j], options); + } + return object; + }; + + /** + * Converts this DelegationDelegatorReward to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.DelegationDelegatorReward + * @instance + * @returns {Object.} JSON object + */ + DelegationDelegatorReward.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DelegationDelegatorReward; + })(v1beta1.DelegationDelegatorReward || {}); + + v1beta1.CommunityPoolSpendProposalWithDeposit = (function(CommunityPoolSpendProposalWithDeposit) { + + /** + * Properties of a CommunityPoolSpendProposalWithDeposit. + * @memberof cosmos.distribution.v1beta1 + * @interface ICommunityPoolSpendProposalWithDeposit + * @property {string|null} [title] CommunityPoolSpendProposalWithDeposit title + * @property {string|null} [description] CommunityPoolSpendProposalWithDeposit description + * @property {string|null} [recipient] CommunityPoolSpendProposalWithDeposit recipient + * @property {string|null} [amount] CommunityPoolSpendProposalWithDeposit amount + * @property {string|null} [deposit] CommunityPoolSpendProposalWithDeposit deposit + */ + + /** + * Constructs a new CommunityPoolSpendProposalWithDeposit. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a CommunityPoolSpendProposalWithDeposit. + * @implements ICommunityPoolSpendProposalWithDeposit + * @constructor + * @param {cosmos.distribution.v1beta1.ICommunityPoolSpendProposalWithDeposit=} [properties] Properties to set + */ + function CommunityPoolSpendProposalWithDeposit(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommunityPoolSpendProposalWithDeposit title. + * @member {string} title + * @memberof cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit + * @instance + */ + CommunityPoolSpendProposalWithDeposit.prototype.title = ""; + + /** + * CommunityPoolSpendProposalWithDeposit description. + * @member {string} description + * @memberof cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit + * @instance + */ + CommunityPoolSpendProposalWithDeposit.prototype.description = ""; + + /** + * CommunityPoolSpendProposalWithDeposit recipient. + * @member {string} recipient + * @memberof cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit + * @instance + */ + CommunityPoolSpendProposalWithDeposit.prototype.recipient = ""; + + /** + * CommunityPoolSpendProposalWithDeposit amount. + * @member {string} amount + * @memberof cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit + * @instance + */ + CommunityPoolSpendProposalWithDeposit.prototype.amount = ""; + + /** + * CommunityPoolSpendProposalWithDeposit deposit. + * @member {string} deposit + * @memberof cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit + * @instance + */ + CommunityPoolSpendProposalWithDeposit.prototype.deposit = ""; + + /** + * Creates a new CommunityPoolSpendProposalWithDeposit instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit + * @static + * @param {cosmos.distribution.v1beta1.ICommunityPoolSpendProposalWithDeposit=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit} CommunityPoolSpendProposalWithDeposit instance + */ + CommunityPoolSpendProposalWithDeposit.create = function create(properties) { + return new CommunityPoolSpendProposalWithDeposit(properties); + }; + + /** + * Encodes the specified CommunityPoolSpendProposalWithDeposit message. Does not implicitly {@link cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit + * @static + * @param {cosmos.distribution.v1beta1.ICommunityPoolSpendProposalWithDeposit} message CommunityPoolSpendProposalWithDeposit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommunityPoolSpendProposalWithDeposit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.recipient != null && Object.hasOwnProperty.call(message, "recipient")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.recipient); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.amount); + if (message.deposit != null && Object.hasOwnProperty.call(message, "deposit")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.deposit); + return writer; + }; + + /** + * Encodes the specified CommunityPoolSpendProposalWithDeposit message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit + * @static + * @param {cosmos.distribution.v1beta1.ICommunityPoolSpendProposalWithDeposit} message CommunityPoolSpendProposalWithDeposit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommunityPoolSpendProposalWithDeposit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommunityPoolSpendProposalWithDeposit message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit} CommunityPoolSpendProposalWithDeposit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommunityPoolSpendProposalWithDeposit.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.recipient = reader.string(); + break; + case 4: + message.amount = reader.string(); + break; + case 5: + message.deposit = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommunityPoolSpendProposalWithDeposit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit} CommunityPoolSpendProposalWithDeposit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommunityPoolSpendProposalWithDeposit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommunityPoolSpendProposalWithDeposit message. + * @function verify + * @memberof cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommunityPoolSpendProposalWithDeposit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.recipient != null && message.hasOwnProperty("recipient")) + if (!$util.isString(message.recipient)) + return "recipient: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) + if (!$util.isString(message.amount)) + return "amount: string expected"; + if (message.deposit != null && message.hasOwnProperty("deposit")) + if (!$util.isString(message.deposit)) + return "deposit: string expected"; + return null; + }; + + /** + * Creates a CommunityPoolSpendProposalWithDeposit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit} CommunityPoolSpendProposalWithDeposit + */ + CommunityPoolSpendProposalWithDeposit.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit) + return object; + let message = new $root.cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit(); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.recipient != null) + message.recipient = String(object.recipient); + if (object.amount != null) + message.amount = String(object.amount); + if (object.deposit != null) + message.deposit = String(object.deposit); + return message; + }; + + /** + * Creates a plain object from a CommunityPoolSpendProposalWithDeposit message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit + * @static + * @param {cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit} message CommunityPoolSpendProposalWithDeposit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommunityPoolSpendProposalWithDeposit.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.title = ""; + object.description = ""; + object.recipient = ""; + object.amount = ""; + object.deposit = ""; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.recipient != null && message.hasOwnProperty("recipient")) + object.recipient = message.recipient; + if (message.amount != null && message.hasOwnProperty("amount")) + object.amount = message.amount; + if (message.deposit != null && message.hasOwnProperty("deposit")) + object.deposit = message.deposit; + return object; + }; + + /** + * Converts this CommunityPoolSpendProposalWithDeposit to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit + * @instance + * @returns {Object.} JSON object + */ + CommunityPoolSpendProposalWithDeposit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CommunityPoolSpendProposalWithDeposit; + })(v1beta1.CommunityPoolSpendProposalWithDeposit || {}); + + v1beta1.DelegatorWithdrawInfo = (function(DelegatorWithdrawInfo) { + + /** + * Properties of a DelegatorWithdrawInfo. + * @memberof cosmos.distribution.v1beta1 + * @interface IDelegatorWithdrawInfo + * @property {string|null} [delegatorAddress] DelegatorWithdrawInfo delegatorAddress + * @property {string|null} [withdrawAddress] DelegatorWithdrawInfo withdrawAddress + */ + + /** + * Constructs a new DelegatorWithdrawInfo. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a DelegatorWithdrawInfo. + * @implements IDelegatorWithdrawInfo + * @constructor + * @param {cosmos.distribution.v1beta1.IDelegatorWithdrawInfo=} [properties] Properties to set + */ + function DelegatorWithdrawInfo(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DelegatorWithdrawInfo delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.distribution.v1beta1.DelegatorWithdrawInfo + * @instance + */ + DelegatorWithdrawInfo.prototype.delegatorAddress = ""; + + /** + * DelegatorWithdrawInfo withdrawAddress. + * @member {string} withdrawAddress + * @memberof cosmos.distribution.v1beta1.DelegatorWithdrawInfo + * @instance + */ + DelegatorWithdrawInfo.prototype.withdrawAddress = ""; + + /** + * Creates a new DelegatorWithdrawInfo instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.DelegatorWithdrawInfo + * @static + * @param {cosmos.distribution.v1beta1.IDelegatorWithdrawInfo=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.DelegatorWithdrawInfo} DelegatorWithdrawInfo instance + */ + DelegatorWithdrawInfo.create = function create(properties) { + return new DelegatorWithdrawInfo(properties); + }; + + /** + * Encodes the specified DelegatorWithdrawInfo message. Does not implicitly {@link cosmos.distribution.v1beta1.DelegatorWithdrawInfo.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.DelegatorWithdrawInfo + * @static + * @param {cosmos.distribution.v1beta1.IDelegatorWithdrawInfo} message DelegatorWithdrawInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DelegatorWithdrawInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.withdrawAddress != null && Object.hasOwnProperty.call(message, "withdrawAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.withdrawAddress); + return writer; + }; + + /** + * Encodes the specified DelegatorWithdrawInfo message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.DelegatorWithdrawInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.DelegatorWithdrawInfo + * @static + * @param {cosmos.distribution.v1beta1.IDelegatorWithdrawInfo} message DelegatorWithdrawInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DelegatorWithdrawInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DelegatorWithdrawInfo message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.DelegatorWithdrawInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.DelegatorWithdrawInfo} DelegatorWithdrawInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DelegatorWithdrawInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.DelegatorWithdrawInfo(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.withdrawAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DelegatorWithdrawInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.DelegatorWithdrawInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.DelegatorWithdrawInfo} DelegatorWithdrawInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DelegatorWithdrawInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DelegatorWithdrawInfo message. + * @function verify + * @memberof cosmos.distribution.v1beta1.DelegatorWithdrawInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DelegatorWithdrawInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.withdrawAddress != null && message.hasOwnProperty("withdrawAddress")) + if (!$util.isString(message.withdrawAddress)) + return "withdrawAddress: string expected"; + return null; + }; + + /** + * Creates a DelegatorWithdrawInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.DelegatorWithdrawInfo + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.DelegatorWithdrawInfo} DelegatorWithdrawInfo + */ + DelegatorWithdrawInfo.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.DelegatorWithdrawInfo) + return object; + let message = new $root.cosmos.distribution.v1beta1.DelegatorWithdrawInfo(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.withdrawAddress != null) + message.withdrawAddress = String(object.withdrawAddress); + return message; + }; + + /** + * Creates a plain object from a DelegatorWithdrawInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.DelegatorWithdrawInfo + * @static + * @param {cosmos.distribution.v1beta1.DelegatorWithdrawInfo} message DelegatorWithdrawInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DelegatorWithdrawInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.delegatorAddress = ""; + object.withdrawAddress = ""; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.withdrawAddress != null && message.hasOwnProperty("withdrawAddress")) + object.withdrawAddress = message.withdrawAddress; + return object; + }; + + /** + * Converts this DelegatorWithdrawInfo to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.DelegatorWithdrawInfo + * @instance + * @returns {Object.} JSON object + */ + DelegatorWithdrawInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DelegatorWithdrawInfo; + })(v1beta1.DelegatorWithdrawInfo || {}); + + v1beta1.ValidatorOutstandingRewardsRecord = (function(ValidatorOutstandingRewardsRecord) { + + /** + * Properties of a ValidatorOutstandingRewardsRecord. + * @memberof cosmos.distribution.v1beta1 + * @interface IValidatorOutstandingRewardsRecord + * @property {string|null} [validatorAddress] ValidatorOutstandingRewardsRecord validatorAddress + * @property {Array.|null} [outstandingRewards] ValidatorOutstandingRewardsRecord outstandingRewards + */ + + /** + * Constructs a new ValidatorOutstandingRewardsRecord. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a ValidatorOutstandingRewardsRecord. + * @implements IValidatorOutstandingRewardsRecord + * @constructor + * @param {cosmos.distribution.v1beta1.IValidatorOutstandingRewardsRecord=} [properties] Properties to set + */ + function ValidatorOutstandingRewardsRecord(properties) { + this.outstandingRewards = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidatorOutstandingRewardsRecord validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord + * @instance + */ + ValidatorOutstandingRewardsRecord.prototype.validatorAddress = ""; + + /** + * ValidatorOutstandingRewardsRecord outstandingRewards. + * @member {Array.} outstandingRewards + * @memberof cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord + * @instance + */ + ValidatorOutstandingRewardsRecord.prototype.outstandingRewards = $util.emptyArray; + + /** + * Creates a new ValidatorOutstandingRewardsRecord instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord + * @static + * @param {cosmos.distribution.v1beta1.IValidatorOutstandingRewardsRecord=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord} ValidatorOutstandingRewardsRecord instance + */ + ValidatorOutstandingRewardsRecord.create = function create(properties) { + return new ValidatorOutstandingRewardsRecord(properties); + }; + + /** + * Encodes the specified ValidatorOutstandingRewardsRecord message. Does not implicitly {@link cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord + * @static + * @param {cosmos.distribution.v1beta1.IValidatorOutstandingRewardsRecord} message ValidatorOutstandingRewardsRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorOutstandingRewardsRecord.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.validatorAddress); + if (message.outstandingRewards != null && message.outstandingRewards.length) + for (let i = 0; i < message.outstandingRewards.length; ++i) + $root.cosmos.base.v1beta1.DecCoin.encode(message.outstandingRewards[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ValidatorOutstandingRewardsRecord message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord + * @static + * @param {cosmos.distribution.v1beta1.IValidatorOutstandingRewardsRecord} message ValidatorOutstandingRewardsRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorOutstandingRewardsRecord.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidatorOutstandingRewardsRecord message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord} ValidatorOutstandingRewardsRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorOutstandingRewardsRecord.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + if (!(message.outstandingRewards && message.outstandingRewards.length)) + message.outstandingRewards = []; + message.outstandingRewards.push($root.cosmos.base.v1beta1.DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidatorOutstandingRewardsRecord message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord} ValidatorOutstandingRewardsRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorOutstandingRewardsRecord.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidatorOutstandingRewardsRecord message. + * @function verify + * @memberof cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidatorOutstandingRewardsRecord.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + if (message.outstandingRewards != null && message.hasOwnProperty("outstandingRewards")) { + if (!Array.isArray(message.outstandingRewards)) + return "outstandingRewards: array expected"; + for (let i = 0; i < message.outstandingRewards.length; ++i) { + let error = $root.cosmos.base.v1beta1.DecCoin.verify(message.outstandingRewards[i]); + if (error) + return "outstandingRewards." + error; + } + } + return null; + }; + + /** + * Creates a ValidatorOutstandingRewardsRecord message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord} ValidatorOutstandingRewardsRecord + */ + ValidatorOutstandingRewardsRecord.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord) + return object; + let message = new $root.cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord(); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + if (object.outstandingRewards) { + if (!Array.isArray(object.outstandingRewards)) + throw TypeError(".cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord.outstandingRewards: array expected"); + message.outstandingRewards = []; + for (let i = 0; i < object.outstandingRewards.length; ++i) { + if (typeof object.outstandingRewards[i] !== "object") + throw TypeError(".cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord.outstandingRewards: object expected"); + message.outstandingRewards[i] = $root.cosmos.base.v1beta1.DecCoin.fromObject(object.outstandingRewards[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ValidatorOutstandingRewardsRecord message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord + * @static + * @param {cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord} message ValidatorOutstandingRewardsRecord + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidatorOutstandingRewardsRecord.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.outstandingRewards = []; + if (options.defaults) + object.validatorAddress = ""; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + if (message.outstandingRewards && message.outstandingRewards.length) { + object.outstandingRewards = []; + for (let j = 0; j < message.outstandingRewards.length; ++j) + object.outstandingRewards[j] = $root.cosmos.base.v1beta1.DecCoin.toObject(message.outstandingRewards[j], options); + } + return object; + }; + + /** + * Converts this ValidatorOutstandingRewardsRecord to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord + * @instance + * @returns {Object.} JSON object + */ + ValidatorOutstandingRewardsRecord.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidatorOutstandingRewardsRecord; + })(v1beta1.ValidatorOutstandingRewardsRecord || {}); + + v1beta1.ValidatorAccumulatedCommissionRecord = (function(ValidatorAccumulatedCommissionRecord) { + + /** + * Properties of a ValidatorAccumulatedCommissionRecord. + * @memberof cosmos.distribution.v1beta1 + * @interface IValidatorAccumulatedCommissionRecord + * @property {string|null} [validatorAddress] ValidatorAccumulatedCommissionRecord validatorAddress + * @property {cosmos.distribution.v1beta1.IValidatorAccumulatedCommission|null} [accumulated] ValidatorAccumulatedCommissionRecord accumulated + */ + + /** + * Constructs a new ValidatorAccumulatedCommissionRecord. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a ValidatorAccumulatedCommissionRecord. + * @implements IValidatorAccumulatedCommissionRecord + * @constructor + * @param {cosmos.distribution.v1beta1.IValidatorAccumulatedCommissionRecord=} [properties] Properties to set + */ + function ValidatorAccumulatedCommissionRecord(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidatorAccumulatedCommissionRecord validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord + * @instance + */ + ValidatorAccumulatedCommissionRecord.prototype.validatorAddress = ""; + + /** + * ValidatorAccumulatedCommissionRecord accumulated. + * @member {cosmos.distribution.v1beta1.IValidatorAccumulatedCommission|null|undefined} accumulated + * @memberof cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord + * @instance + */ + ValidatorAccumulatedCommissionRecord.prototype.accumulated = null; + + /** + * Creates a new ValidatorAccumulatedCommissionRecord instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord + * @static + * @param {cosmos.distribution.v1beta1.IValidatorAccumulatedCommissionRecord=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord} ValidatorAccumulatedCommissionRecord instance + */ + ValidatorAccumulatedCommissionRecord.create = function create(properties) { + return new ValidatorAccumulatedCommissionRecord(properties); + }; + + /** + * Encodes the specified ValidatorAccumulatedCommissionRecord message. Does not implicitly {@link cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord + * @static + * @param {cosmos.distribution.v1beta1.IValidatorAccumulatedCommissionRecord} message ValidatorAccumulatedCommissionRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorAccumulatedCommissionRecord.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.validatorAddress); + if (message.accumulated != null && Object.hasOwnProperty.call(message, "accumulated")) + $root.cosmos.distribution.v1beta1.ValidatorAccumulatedCommission.encode(message.accumulated, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ValidatorAccumulatedCommissionRecord message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord + * @static + * @param {cosmos.distribution.v1beta1.IValidatorAccumulatedCommissionRecord} message ValidatorAccumulatedCommissionRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorAccumulatedCommissionRecord.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidatorAccumulatedCommissionRecord message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord} ValidatorAccumulatedCommissionRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorAccumulatedCommissionRecord.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.accumulated = $root.cosmos.distribution.v1beta1.ValidatorAccumulatedCommission.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidatorAccumulatedCommissionRecord message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord} ValidatorAccumulatedCommissionRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorAccumulatedCommissionRecord.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidatorAccumulatedCommissionRecord message. + * @function verify + * @memberof cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidatorAccumulatedCommissionRecord.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + if (message.accumulated != null && message.hasOwnProperty("accumulated")) { + let error = $root.cosmos.distribution.v1beta1.ValidatorAccumulatedCommission.verify(message.accumulated); + if (error) + return "accumulated." + error; + } + return null; + }; + + /** + * Creates a ValidatorAccumulatedCommissionRecord message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord} ValidatorAccumulatedCommissionRecord + */ + ValidatorAccumulatedCommissionRecord.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord) + return object; + let message = new $root.cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord(); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + if (object.accumulated != null) { + if (typeof object.accumulated !== "object") + throw TypeError(".cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord.accumulated: object expected"); + message.accumulated = $root.cosmos.distribution.v1beta1.ValidatorAccumulatedCommission.fromObject(object.accumulated); + } + return message; + }; + + /** + * Creates a plain object from a ValidatorAccumulatedCommissionRecord message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord + * @static + * @param {cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord} message ValidatorAccumulatedCommissionRecord + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidatorAccumulatedCommissionRecord.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.validatorAddress = ""; + object.accumulated = null; + } + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + if (message.accumulated != null && message.hasOwnProperty("accumulated")) + object.accumulated = $root.cosmos.distribution.v1beta1.ValidatorAccumulatedCommission.toObject(message.accumulated, options); + return object; + }; + + /** + * Converts this ValidatorAccumulatedCommissionRecord to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord + * @instance + * @returns {Object.} JSON object + */ + ValidatorAccumulatedCommissionRecord.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidatorAccumulatedCommissionRecord; + })(v1beta1.ValidatorAccumulatedCommissionRecord || {}); + + v1beta1.ValidatorHistoricalRewardsRecord = (function(ValidatorHistoricalRewardsRecord) { + + /** + * Properties of a ValidatorHistoricalRewardsRecord. + * @memberof cosmos.distribution.v1beta1 + * @interface IValidatorHistoricalRewardsRecord + * @property {string|null} [validatorAddress] ValidatorHistoricalRewardsRecord validatorAddress + * @property {number|Long|null} [period] ValidatorHistoricalRewardsRecord period + * @property {cosmos.distribution.v1beta1.IValidatorHistoricalRewards|null} [rewards] ValidatorHistoricalRewardsRecord rewards + */ + + /** + * Constructs a new ValidatorHistoricalRewardsRecord. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a ValidatorHistoricalRewardsRecord. + * @implements IValidatorHistoricalRewardsRecord + * @constructor + * @param {cosmos.distribution.v1beta1.IValidatorHistoricalRewardsRecord=} [properties] Properties to set + */ + function ValidatorHistoricalRewardsRecord(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidatorHistoricalRewardsRecord validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord + * @instance + */ + ValidatorHistoricalRewardsRecord.prototype.validatorAddress = ""; + + /** + * ValidatorHistoricalRewardsRecord period. + * @member {number|Long} period + * @memberof cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord + * @instance + */ + ValidatorHistoricalRewardsRecord.prototype.period = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ValidatorHistoricalRewardsRecord rewards. + * @member {cosmos.distribution.v1beta1.IValidatorHistoricalRewards|null|undefined} rewards + * @memberof cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord + * @instance + */ + ValidatorHistoricalRewardsRecord.prototype.rewards = null; + + /** + * Creates a new ValidatorHistoricalRewardsRecord instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord + * @static + * @param {cosmos.distribution.v1beta1.IValidatorHistoricalRewardsRecord=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord} ValidatorHistoricalRewardsRecord instance + */ + ValidatorHistoricalRewardsRecord.create = function create(properties) { + return new ValidatorHistoricalRewardsRecord(properties); + }; + + /** + * Encodes the specified ValidatorHistoricalRewardsRecord message. Does not implicitly {@link cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord + * @static + * @param {cosmos.distribution.v1beta1.IValidatorHistoricalRewardsRecord} message ValidatorHistoricalRewardsRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorHistoricalRewardsRecord.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.validatorAddress); + if (message.period != null && Object.hasOwnProperty.call(message, "period")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.period); + if (message.rewards != null && Object.hasOwnProperty.call(message, "rewards")) + $root.cosmos.distribution.v1beta1.ValidatorHistoricalRewards.encode(message.rewards, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ValidatorHistoricalRewardsRecord message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord + * @static + * @param {cosmos.distribution.v1beta1.IValidatorHistoricalRewardsRecord} message ValidatorHistoricalRewardsRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorHistoricalRewardsRecord.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidatorHistoricalRewardsRecord message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord} ValidatorHistoricalRewardsRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorHistoricalRewardsRecord.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.period = reader.uint64(); + break; + case 3: + message.rewards = $root.cosmos.distribution.v1beta1.ValidatorHistoricalRewards.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidatorHistoricalRewardsRecord message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord} ValidatorHistoricalRewardsRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorHistoricalRewardsRecord.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidatorHistoricalRewardsRecord message. + * @function verify + * @memberof cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidatorHistoricalRewardsRecord.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + if (message.period != null && message.hasOwnProperty("period")) + if (!$util.isInteger(message.period) && !(message.period && $util.isInteger(message.period.low) && $util.isInteger(message.period.high))) + return "period: integer|Long expected"; + if (message.rewards != null && message.hasOwnProperty("rewards")) { + let error = $root.cosmos.distribution.v1beta1.ValidatorHistoricalRewards.verify(message.rewards); + if (error) + return "rewards." + error; + } + return null; + }; + + /** + * Creates a ValidatorHistoricalRewardsRecord message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord} ValidatorHistoricalRewardsRecord + */ + ValidatorHistoricalRewardsRecord.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord) + return object; + let message = new $root.cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord(); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + if (object.period != null) + if ($util.Long) + (message.period = $util.Long.fromValue(object.period)).unsigned = true; + else if (typeof object.period === "string") + message.period = parseInt(object.period, 10); + else if (typeof object.period === "number") + message.period = object.period; + else if (typeof object.period === "object") + message.period = new $util.LongBits(object.period.low >>> 0, object.period.high >>> 0).toNumber(true); + if (object.rewards != null) { + if (typeof object.rewards !== "object") + throw TypeError(".cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord.rewards: object expected"); + message.rewards = $root.cosmos.distribution.v1beta1.ValidatorHistoricalRewards.fromObject(object.rewards); + } + return message; + }; + + /** + * Creates a plain object from a ValidatorHistoricalRewardsRecord message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord + * @static + * @param {cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord} message ValidatorHistoricalRewardsRecord + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidatorHistoricalRewardsRecord.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.validatorAddress = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.period = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.period = options.longs === String ? "0" : 0; + object.rewards = null; + } + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + if (message.period != null && message.hasOwnProperty("period")) + if (typeof message.period === "number") + object.period = options.longs === String ? String(message.period) : message.period; + else + object.period = options.longs === String ? $util.Long.prototype.toString.call(message.period) : options.longs === Number ? new $util.LongBits(message.period.low >>> 0, message.period.high >>> 0).toNumber(true) : message.period; + if (message.rewards != null && message.hasOwnProperty("rewards")) + object.rewards = $root.cosmos.distribution.v1beta1.ValidatorHistoricalRewards.toObject(message.rewards, options); + return object; + }; + + /** + * Converts this ValidatorHistoricalRewardsRecord to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord + * @instance + * @returns {Object.} JSON object + */ + ValidatorHistoricalRewardsRecord.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidatorHistoricalRewardsRecord; + })(v1beta1.ValidatorHistoricalRewardsRecord || {}); + + v1beta1.ValidatorCurrentRewardsRecord = (function(ValidatorCurrentRewardsRecord) { + + /** + * Properties of a ValidatorCurrentRewardsRecord. + * @memberof cosmos.distribution.v1beta1 + * @interface IValidatorCurrentRewardsRecord + * @property {string|null} [validatorAddress] ValidatorCurrentRewardsRecord validatorAddress + * @property {cosmos.distribution.v1beta1.IValidatorCurrentRewards|null} [rewards] ValidatorCurrentRewardsRecord rewards + */ + + /** + * Constructs a new ValidatorCurrentRewardsRecord. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a ValidatorCurrentRewardsRecord. + * @implements IValidatorCurrentRewardsRecord + * @constructor + * @param {cosmos.distribution.v1beta1.IValidatorCurrentRewardsRecord=} [properties] Properties to set + */ + function ValidatorCurrentRewardsRecord(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidatorCurrentRewardsRecord validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord + * @instance + */ + ValidatorCurrentRewardsRecord.prototype.validatorAddress = ""; + + /** + * ValidatorCurrentRewardsRecord rewards. + * @member {cosmos.distribution.v1beta1.IValidatorCurrentRewards|null|undefined} rewards + * @memberof cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord + * @instance + */ + ValidatorCurrentRewardsRecord.prototype.rewards = null; + + /** + * Creates a new ValidatorCurrentRewardsRecord instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord + * @static + * @param {cosmos.distribution.v1beta1.IValidatorCurrentRewardsRecord=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord} ValidatorCurrentRewardsRecord instance + */ + ValidatorCurrentRewardsRecord.create = function create(properties) { + return new ValidatorCurrentRewardsRecord(properties); + }; + + /** + * Encodes the specified ValidatorCurrentRewardsRecord message. Does not implicitly {@link cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord + * @static + * @param {cosmos.distribution.v1beta1.IValidatorCurrentRewardsRecord} message ValidatorCurrentRewardsRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorCurrentRewardsRecord.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.validatorAddress); + if (message.rewards != null && Object.hasOwnProperty.call(message, "rewards")) + $root.cosmos.distribution.v1beta1.ValidatorCurrentRewards.encode(message.rewards, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ValidatorCurrentRewardsRecord message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord + * @static + * @param {cosmos.distribution.v1beta1.IValidatorCurrentRewardsRecord} message ValidatorCurrentRewardsRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorCurrentRewardsRecord.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidatorCurrentRewardsRecord message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord} ValidatorCurrentRewardsRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorCurrentRewardsRecord.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.rewards = $root.cosmos.distribution.v1beta1.ValidatorCurrentRewards.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidatorCurrentRewardsRecord message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord} ValidatorCurrentRewardsRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorCurrentRewardsRecord.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidatorCurrentRewardsRecord message. + * @function verify + * @memberof cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidatorCurrentRewardsRecord.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + if (message.rewards != null && message.hasOwnProperty("rewards")) { + let error = $root.cosmos.distribution.v1beta1.ValidatorCurrentRewards.verify(message.rewards); + if (error) + return "rewards." + error; + } + return null; + }; + + /** + * Creates a ValidatorCurrentRewardsRecord message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord} ValidatorCurrentRewardsRecord + */ + ValidatorCurrentRewardsRecord.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord) + return object; + let message = new $root.cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord(); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + if (object.rewards != null) { + if (typeof object.rewards !== "object") + throw TypeError(".cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord.rewards: object expected"); + message.rewards = $root.cosmos.distribution.v1beta1.ValidatorCurrentRewards.fromObject(object.rewards); + } + return message; + }; + + /** + * Creates a plain object from a ValidatorCurrentRewardsRecord message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord + * @static + * @param {cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord} message ValidatorCurrentRewardsRecord + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidatorCurrentRewardsRecord.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.validatorAddress = ""; + object.rewards = null; + } + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + if (message.rewards != null && message.hasOwnProperty("rewards")) + object.rewards = $root.cosmos.distribution.v1beta1.ValidatorCurrentRewards.toObject(message.rewards, options); + return object; + }; + + /** + * Converts this ValidatorCurrentRewardsRecord to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord + * @instance + * @returns {Object.} JSON object + */ + ValidatorCurrentRewardsRecord.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidatorCurrentRewardsRecord; + })(v1beta1.ValidatorCurrentRewardsRecord || {}); + + v1beta1.DelegatorStartingInfoRecord = (function(DelegatorStartingInfoRecord) { + + /** + * Properties of a DelegatorStartingInfoRecord. + * @memberof cosmos.distribution.v1beta1 + * @interface IDelegatorStartingInfoRecord + * @property {string|null} [delegatorAddress] DelegatorStartingInfoRecord delegatorAddress + * @property {string|null} [validatorAddress] DelegatorStartingInfoRecord validatorAddress + * @property {cosmos.distribution.v1beta1.IDelegatorStartingInfo|null} [startingInfo] DelegatorStartingInfoRecord startingInfo + */ + + /** + * Constructs a new DelegatorStartingInfoRecord. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a DelegatorStartingInfoRecord. + * @implements IDelegatorStartingInfoRecord + * @constructor + * @param {cosmos.distribution.v1beta1.IDelegatorStartingInfoRecord=} [properties] Properties to set + */ + function DelegatorStartingInfoRecord(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DelegatorStartingInfoRecord delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.distribution.v1beta1.DelegatorStartingInfoRecord + * @instance + */ + DelegatorStartingInfoRecord.prototype.delegatorAddress = ""; + + /** + * DelegatorStartingInfoRecord validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.distribution.v1beta1.DelegatorStartingInfoRecord + * @instance + */ + DelegatorStartingInfoRecord.prototype.validatorAddress = ""; + + /** + * DelegatorStartingInfoRecord startingInfo. + * @member {cosmos.distribution.v1beta1.IDelegatorStartingInfo|null|undefined} startingInfo + * @memberof cosmos.distribution.v1beta1.DelegatorStartingInfoRecord + * @instance + */ + DelegatorStartingInfoRecord.prototype.startingInfo = null; + + /** + * Creates a new DelegatorStartingInfoRecord instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.DelegatorStartingInfoRecord + * @static + * @param {cosmos.distribution.v1beta1.IDelegatorStartingInfoRecord=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.DelegatorStartingInfoRecord} DelegatorStartingInfoRecord instance + */ + DelegatorStartingInfoRecord.create = function create(properties) { + return new DelegatorStartingInfoRecord(properties); + }; + + /** + * Encodes the specified DelegatorStartingInfoRecord message. Does not implicitly {@link cosmos.distribution.v1beta1.DelegatorStartingInfoRecord.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.DelegatorStartingInfoRecord + * @static + * @param {cosmos.distribution.v1beta1.IDelegatorStartingInfoRecord} message DelegatorStartingInfoRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DelegatorStartingInfoRecord.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddress); + if (message.startingInfo != null && Object.hasOwnProperty.call(message, "startingInfo")) + $root.cosmos.distribution.v1beta1.DelegatorStartingInfo.encode(message.startingInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DelegatorStartingInfoRecord message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.DelegatorStartingInfoRecord.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.DelegatorStartingInfoRecord + * @static + * @param {cosmos.distribution.v1beta1.IDelegatorStartingInfoRecord} message DelegatorStartingInfoRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DelegatorStartingInfoRecord.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DelegatorStartingInfoRecord message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.DelegatorStartingInfoRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.DelegatorStartingInfoRecord} DelegatorStartingInfoRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DelegatorStartingInfoRecord.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.DelegatorStartingInfoRecord(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.startingInfo = $root.cosmos.distribution.v1beta1.DelegatorStartingInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DelegatorStartingInfoRecord message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.DelegatorStartingInfoRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.DelegatorStartingInfoRecord} DelegatorStartingInfoRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DelegatorStartingInfoRecord.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DelegatorStartingInfoRecord message. + * @function verify + * @memberof cosmos.distribution.v1beta1.DelegatorStartingInfoRecord + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DelegatorStartingInfoRecord.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + if (message.startingInfo != null && message.hasOwnProperty("startingInfo")) { + let error = $root.cosmos.distribution.v1beta1.DelegatorStartingInfo.verify(message.startingInfo); + if (error) + return "startingInfo." + error; + } + return null; + }; + + /** + * Creates a DelegatorStartingInfoRecord message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.DelegatorStartingInfoRecord + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.DelegatorStartingInfoRecord} DelegatorStartingInfoRecord + */ + DelegatorStartingInfoRecord.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.DelegatorStartingInfoRecord) + return object; + let message = new $root.cosmos.distribution.v1beta1.DelegatorStartingInfoRecord(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + if (object.startingInfo != null) { + if (typeof object.startingInfo !== "object") + throw TypeError(".cosmos.distribution.v1beta1.DelegatorStartingInfoRecord.startingInfo: object expected"); + message.startingInfo = $root.cosmos.distribution.v1beta1.DelegatorStartingInfo.fromObject(object.startingInfo); + } + return message; + }; + + /** + * Creates a plain object from a DelegatorStartingInfoRecord message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.DelegatorStartingInfoRecord + * @static + * @param {cosmos.distribution.v1beta1.DelegatorStartingInfoRecord} message DelegatorStartingInfoRecord + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DelegatorStartingInfoRecord.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.delegatorAddress = ""; + object.validatorAddress = ""; + object.startingInfo = null; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + if (message.startingInfo != null && message.hasOwnProperty("startingInfo")) + object.startingInfo = $root.cosmos.distribution.v1beta1.DelegatorStartingInfo.toObject(message.startingInfo, options); + return object; + }; + + /** + * Converts this DelegatorStartingInfoRecord to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.DelegatorStartingInfoRecord + * @instance + * @returns {Object.} JSON object + */ + DelegatorStartingInfoRecord.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DelegatorStartingInfoRecord; + })(v1beta1.DelegatorStartingInfoRecord || {}); + + v1beta1.ValidatorSlashEventRecord = (function(ValidatorSlashEventRecord) { + + /** + * Properties of a ValidatorSlashEventRecord. + * @memberof cosmos.distribution.v1beta1 + * @interface IValidatorSlashEventRecord + * @property {string|null} [validatorAddress] ValidatorSlashEventRecord validatorAddress + * @property {number|Long|null} [height] ValidatorSlashEventRecord height + * @property {number|Long|null} [period] ValidatorSlashEventRecord period + * @property {cosmos.distribution.v1beta1.IValidatorSlashEvent|null} [validatorSlashEvent] ValidatorSlashEventRecord validatorSlashEvent + */ + + /** + * Constructs a new ValidatorSlashEventRecord. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a ValidatorSlashEventRecord. + * @implements IValidatorSlashEventRecord + * @constructor + * @param {cosmos.distribution.v1beta1.IValidatorSlashEventRecord=} [properties] Properties to set + */ + function ValidatorSlashEventRecord(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidatorSlashEventRecord validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEventRecord + * @instance + */ + ValidatorSlashEventRecord.prototype.validatorAddress = ""; + + /** + * ValidatorSlashEventRecord height. + * @member {number|Long} height + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEventRecord + * @instance + */ + ValidatorSlashEventRecord.prototype.height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ValidatorSlashEventRecord period. + * @member {number|Long} period + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEventRecord + * @instance + */ + ValidatorSlashEventRecord.prototype.period = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ValidatorSlashEventRecord validatorSlashEvent. + * @member {cosmos.distribution.v1beta1.IValidatorSlashEvent|null|undefined} validatorSlashEvent + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEventRecord + * @instance + */ + ValidatorSlashEventRecord.prototype.validatorSlashEvent = null; + + /** + * Creates a new ValidatorSlashEventRecord instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEventRecord + * @static + * @param {cosmos.distribution.v1beta1.IValidatorSlashEventRecord=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.ValidatorSlashEventRecord} ValidatorSlashEventRecord instance + */ + ValidatorSlashEventRecord.create = function create(properties) { + return new ValidatorSlashEventRecord(properties); + }; + + /** + * Encodes the specified ValidatorSlashEventRecord message. Does not implicitly {@link cosmos.distribution.v1beta1.ValidatorSlashEventRecord.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEventRecord + * @static + * @param {cosmos.distribution.v1beta1.IValidatorSlashEventRecord} message ValidatorSlashEventRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorSlashEventRecord.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.validatorAddress); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.height); + if (message.period != null && Object.hasOwnProperty.call(message, "period")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.period); + if (message.validatorSlashEvent != null && Object.hasOwnProperty.call(message, "validatorSlashEvent")) + $root.cosmos.distribution.v1beta1.ValidatorSlashEvent.encode(message.validatorSlashEvent, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ValidatorSlashEventRecord message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.ValidatorSlashEventRecord.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEventRecord + * @static + * @param {cosmos.distribution.v1beta1.IValidatorSlashEventRecord} message ValidatorSlashEventRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorSlashEventRecord.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidatorSlashEventRecord message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEventRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.ValidatorSlashEventRecord} ValidatorSlashEventRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorSlashEventRecord.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.ValidatorSlashEventRecord(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.height = reader.uint64(); + break; + case 3: + message.period = reader.uint64(); + break; + case 4: + message.validatorSlashEvent = $root.cosmos.distribution.v1beta1.ValidatorSlashEvent.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidatorSlashEventRecord message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEventRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.ValidatorSlashEventRecord} ValidatorSlashEventRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorSlashEventRecord.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidatorSlashEventRecord message. + * @function verify + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEventRecord + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidatorSlashEventRecord.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.period != null && message.hasOwnProperty("period")) + if (!$util.isInteger(message.period) && !(message.period && $util.isInteger(message.period.low) && $util.isInteger(message.period.high))) + return "period: integer|Long expected"; + if (message.validatorSlashEvent != null && message.hasOwnProperty("validatorSlashEvent")) { + let error = $root.cosmos.distribution.v1beta1.ValidatorSlashEvent.verify(message.validatorSlashEvent); + if (error) + return "validatorSlashEvent." + error; + } + return null; + }; + + /** + * Creates a ValidatorSlashEventRecord message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEventRecord + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.ValidatorSlashEventRecord} ValidatorSlashEventRecord + */ + ValidatorSlashEventRecord.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.ValidatorSlashEventRecord) + return object; + let message = new $root.cosmos.distribution.v1beta1.ValidatorSlashEventRecord(); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = true; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(true); + if (object.period != null) + if ($util.Long) + (message.period = $util.Long.fromValue(object.period)).unsigned = true; + else if (typeof object.period === "string") + message.period = parseInt(object.period, 10); + else if (typeof object.period === "number") + message.period = object.period; + else if (typeof object.period === "object") + message.period = new $util.LongBits(object.period.low >>> 0, object.period.high >>> 0).toNumber(true); + if (object.validatorSlashEvent != null) { + if (typeof object.validatorSlashEvent !== "object") + throw TypeError(".cosmos.distribution.v1beta1.ValidatorSlashEventRecord.validatorSlashEvent: object expected"); + message.validatorSlashEvent = $root.cosmos.distribution.v1beta1.ValidatorSlashEvent.fromObject(object.validatorSlashEvent); + } + return message; + }; + + /** + * Creates a plain object from a ValidatorSlashEventRecord message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEventRecord + * @static + * @param {cosmos.distribution.v1beta1.ValidatorSlashEventRecord} message ValidatorSlashEventRecord + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidatorSlashEventRecord.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.validatorAddress = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.period = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.period = options.longs === String ? "0" : 0; + object.validatorSlashEvent = null; + } + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber(true) : message.height; + if (message.period != null && message.hasOwnProperty("period")) + if (typeof message.period === "number") + object.period = options.longs === String ? String(message.period) : message.period; + else + object.period = options.longs === String ? $util.Long.prototype.toString.call(message.period) : options.longs === Number ? new $util.LongBits(message.period.low >>> 0, message.period.high >>> 0).toNumber(true) : message.period; + if (message.validatorSlashEvent != null && message.hasOwnProperty("validatorSlashEvent")) + object.validatorSlashEvent = $root.cosmos.distribution.v1beta1.ValidatorSlashEvent.toObject(message.validatorSlashEvent, options); + return object; + }; + + /** + * Converts this ValidatorSlashEventRecord to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.ValidatorSlashEventRecord + * @instance + * @returns {Object.} JSON object + */ + ValidatorSlashEventRecord.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidatorSlashEventRecord; + })(v1beta1.ValidatorSlashEventRecord || {}); + + v1beta1.GenesisState = (function(GenesisState) { + + /** + * Properties of a GenesisState. + * @memberof cosmos.distribution.v1beta1 + * @interface IGenesisState + * @property {cosmos.distribution.v1beta1.IParams|null} [params] GenesisState params + * @property {cosmos.distribution.v1beta1.IFeePool|null} [feePool] GenesisState feePool + * @property {Array.|null} [delegatorWithdrawInfos] GenesisState delegatorWithdrawInfos + * @property {string|null} [previousProposer] GenesisState previousProposer + * @property {Array.|null} [outstandingRewards] GenesisState outstandingRewards + * @property {Array.|null} [validatorAccumulatedCommissions] GenesisState validatorAccumulatedCommissions + * @property {Array.|null} [validatorHistoricalRewards] GenesisState validatorHistoricalRewards + * @property {Array.|null} [validatorCurrentRewards] GenesisState validatorCurrentRewards + * @property {Array.|null} [delegatorStartingInfos] GenesisState delegatorStartingInfos + * @property {Array.|null} [validatorSlashEvents] GenesisState validatorSlashEvents + */ + + /** + * Constructs a new GenesisState. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a GenesisState. + * @implements IGenesisState + * @constructor + * @param {cosmos.distribution.v1beta1.IGenesisState=} [properties] Properties to set + */ + function GenesisState(properties) { + this.delegatorWithdrawInfos = []; + this.outstandingRewards = []; + this.validatorAccumulatedCommissions = []; + this.validatorHistoricalRewards = []; + this.validatorCurrentRewards = []; + this.delegatorStartingInfos = []; + this.validatorSlashEvents = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenesisState params. + * @member {cosmos.distribution.v1beta1.IParams|null|undefined} params + * @memberof cosmos.distribution.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.params = null; + + /** + * GenesisState feePool. + * @member {cosmos.distribution.v1beta1.IFeePool|null|undefined} feePool + * @memberof cosmos.distribution.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.feePool = null; + + /** + * GenesisState delegatorWithdrawInfos. + * @member {Array.} delegatorWithdrawInfos + * @memberof cosmos.distribution.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.delegatorWithdrawInfos = $util.emptyArray; + + /** + * GenesisState previousProposer. + * @member {string} previousProposer + * @memberof cosmos.distribution.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.previousProposer = ""; + + /** + * GenesisState outstandingRewards. + * @member {Array.} outstandingRewards + * @memberof cosmos.distribution.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.outstandingRewards = $util.emptyArray; + + /** + * GenesisState validatorAccumulatedCommissions. + * @member {Array.} validatorAccumulatedCommissions + * @memberof cosmos.distribution.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.validatorAccumulatedCommissions = $util.emptyArray; + + /** + * GenesisState validatorHistoricalRewards. + * @member {Array.} validatorHistoricalRewards + * @memberof cosmos.distribution.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.validatorHistoricalRewards = $util.emptyArray; + + /** + * GenesisState validatorCurrentRewards. + * @member {Array.} validatorCurrentRewards + * @memberof cosmos.distribution.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.validatorCurrentRewards = $util.emptyArray; + + /** + * GenesisState delegatorStartingInfos. + * @member {Array.} delegatorStartingInfos + * @memberof cosmos.distribution.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.delegatorStartingInfos = $util.emptyArray; + + /** + * GenesisState validatorSlashEvents. + * @member {Array.} validatorSlashEvents + * @memberof cosmos.distribution.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.validatorSlashEvents = $util.emptyArray; + + /** + * Creates a new GenesisState instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.GenesisState + * @static + * @param {cosmos.distribution.v1beta1.IGenesisState=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.GenesisState} GenesisState instance + */ + GenesisState.create = function create(properties) { + return new GenesisState(properties); + }; + + /** + * Encodes the specified GenesisState message. Does not implicitly {@link cosmos.distribution.v1beta1.GenesisState.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.GenesisState + * @static + * @param {cosmos.distribution.v1beta1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.cosmos.distribution.v1beta1.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.feePool != null && Object.hasOwnProperty.call(message, "feePool")) + $root.cosmos.distribution.v1beta1.FeePool.encode(message.feePool, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.delegatorWithdrawInfos != null && message.delegatorWithdrawInfos.length) + for (let i = 0; i < message.delegatorWithdrawInfos.length; ++i) + $root.cosmos.distribution.v1beta1.DelegatorWithdrawInfo.encode(message.delegatorWithdrawInfos[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.previousProposer != null && Object.hasOwnProperty.call(message, "previousProposer")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.previousProposer); + if (message.outstandingRewards != null && message.outstandingRewards.length) + for (let i = 0; i < message.outstandingRewards.length; ++i) + $root.cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord.encode(message.outstandingRewards[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.validatorAccumulatedCommissions != null && message.validatorAccumulatedCommissions.length) + for (let i = 0; i < message.validatorAccumulatedCommissions.length; ++i) + $root.cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord.encode(message.validatorAccumulatedCommissions[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.validatorHistoricalRewards != null && message.validatorHistoricalRewards.length) + for (let i = 0; i < message.validatorHistoricalRewards.length; ++i) + $root.cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord.encode(message.validatorHistoricalRewards[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.validatorCurrentRewards != null && message.validatorCurrentRewards.length) + for (let i = 0; i < message.validatorCurrentRewards.length; ++i) + $root.cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord.encode(message.validatorCurrentRewards[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.delegatorStartingInfos != null && message.delegatorStartingInfos.length) + for (let i = 0; i < message.delegatorStartingInfos.length; ++i) + $root.cosmos.distribution.v1beta1.DelegatorStartingInfoRecord.encode(message.delegatorStartingInfos[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.validatorSlashEvents != null && message.validatorSlashEvents.length) + for (let i = 0; i < message.validatorSlashEvents.length; ++i) + $root.cosmos.distribution.v1beta1.ValidatorSlashEventRecord.encode(message.validatorSlashEvents[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.GenesisState.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.GenesisState + * @static + * @param {cosmos.distribution.v1beta1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.GenesisState(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = $root.cosmos.distribution.v1beta1.Params.decode(reader, reader.uint32()); + break; + case 2: + message.feePool = $root.cosmos.distribution.v1beta1.FeePool.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.delegatorWithdrawInfos && message.delegatorWithdrawInfos.length)) + message.delegatorWithdrawInfos = []; + message.delegatorWithdrawInfos.push($root.cosmos.distribution.v1beta1.DelegatorWithdrawInfo.decode(reader, reader.uint32())); + break; + case 4: + message.previousProposer = reader.string(); + break; + case 5: + if (!(message.outstandingRewards && message.outstandingRewards.length)) + message.outstandingRewards = []; + message.outstandingRewards.push($root.cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.validatorAccumulatedCommissions && message.validatorAccumulatedCommissions.length)) + message.validatorAccumulatedCommissions = []; + message.validatorAccumulatedCommissions.push($root.cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord.decode(reader, reader.uint32())); + break; + case 7: + if (!(message.validatorHistoricalRewards && message.validatorHistoricalRewards.length)) + message.validatorHistoricalRewards = []; + message.validatorHistoricalRewards.push($root.cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord.decode(reader, reader.uint32())); + break; + case 8: + if (!(message.validatorCurrentRewards && message.validatorCurrentRewards.length)) + message.validatorCurrentRewards = []; + message.validatorCurrentRewards.push($root.cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord.decode(reader, reader.uint32())); + break; + case 9: + if (!(message.delegatorStartingInfos && message.delegatorStartingInfos.length)) + message.delegatorStartingInfos = []; + message.delegatorStartingInfos.push($root.cosmos.distribution.v1beta1.DelegatorStartingInfoRecord.decode(reader, reader.uint32())); + break; + case 10: + if (!(message.validatorSlashEvents && message.validatorSlashEvents.length)) + message.validatorSlashEvents = []; + message.validatorSlashEvents.push($root.cosmos.distribution.v1beta1.ValidatorSlashEventRecord.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenesisState message. + * @function verify + * @memberof cosmos.distribution.v1beta1.GenesisState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenesisState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.params != null && message.hasOwnProperty("params")) { + let error = $root.cosmos.distribution.v1beta1.Params.verify(message.params); + if (error) + return "params." + error; + } + if (message.feePool != null && message.hasOwnProperty("feePool")) { + let error = $root.cosmos.distribution.v1beta1.FeePool.verify(message.feePool); + if (error) + return "feePool." + error; + } + if (message.delegatorWithdrawInfos != null && message.hasOwnProperty("delegatorWithdrawInfos")) { + if (!Array.isArray(message.delegatorWithdrawInfos)) + return "delegatorWithdrawInfos: array expected"; + for (let i = 0; i < message.delegatorWithdrawInfos.length; ++i) { + let error = $root.cosmos.distribution.v1beta1.DelegatorWithdrawInfo.verify(message.delegatorWithdrawInfos[i]); + if (error) + return "delegatorWithdrawInfos." + error; + } + } + if (message.previousProposer != null && message.hasOwnProperty("previousProposer")) + if (!$util.isString(message.previousProposer)) + return "previousProposer: string expected"; + if (message.outstandingRewards != null && message.hasOwnProperty("outstandingRewards")) { + if (!Array.isArray(message.outstandingRewards)) + return "outstandingRewards: array expected"; + for (let i = 0; i < message.outstandingRewards.length; ++i) { + let error = $root.cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord.verify(message.outstandingRewards[i]); + if (error) + return "outstandingRewards." + error; + } + } + if (message.validatorAccumulatedCommissions != null && message.hasOwnProperty("validatorAccumulatedCommissions")) { + if (!Array.isArray(message.validatorAccumulatedCommissions)) + return "validatorAccumulatedCommissions: array expected"; + for (let i = 0; i < message.validatorAccumulatedCommissions.length; ++i) { + let error = $root.cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord.verify(message.validatorAccumulatedCommissions[i]); + if (error) + return "validatorAccumulatedCommissions." + error; + } + } + if (message.validatorHistoricalRewards != null && message.hasOwnProperty("validatorHistoricalRewards")) { + if (!Array.isArray(message.validatorHistoricalRewards)) + return "validatorHistoricalRewards: array expected"; + for (let i = 0; i < message.validatorHistoricalRewards.length; ++i) { + let error = $root.cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord.verify(message.validatorHistoricalRewards[i]); + if (error) + return "validatorHistoricalRewards." + error; + } + } + if (message.validatorCurrentRewards != null && message.hasOwnProperty("validatorCurrentRewards")) { + if (!Array.isArray(message.validatorCurrentRewards)) + return "validatorCurrentRewards: array expected"; + for (let i = 0; i < message.validatorCurrentRewards.length; ++i) { + let error = $root.cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord.verify(message.validatorCurrentRewards[i]); + if (error) + return "validatorCurrentRewards." + error; + } + } + if (message.delegatorStartingInfos != null && message.hasOwnProperty("delegatorStartingInfos")) { + if (!Array.isArray(message.delegatorStartingInfos)) + return "delegatorStartingInfos: array expected"; + for (let i = 0; i < message.delegatorStartingInfos.length; ++i) { + let error = $root.cosmos.distribution.v1beta1.DelegatorStartingInfoRecord.verify(message.delegatorStartingInfos[i]); + if (error) + return "delegatorStartingInfos." + error; + } + } + if (message.validatorSlashEvents != null && message.hasOwnProperty("validatorSlashEvents")) { + if (!Array.isArray(message.validatorSlashEvents)) + return "validatorSlashEvents: array expected"; + for (let i = 0; i < message.validatorSlashEvents.length; ++i) { + let error = $root.cosmos.distribution.v1beta1.ValidatorSlashEventRecord.verify(message.validatorSlashEvents[i]); + if (error) + return "validatorSlashEvents." + error; + } + } + return null; + }; + + /** + * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.GenesisState + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.GenesisState} GenesisState + */ + GenesisState.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.GenesisState) + return object; + let message = new $root.cosmos.distribution.v1beta1.GenesisState(); + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".cosmos.distribution.v1beta1.GenesisState.params: object expected"); + message.params = $root.cosmos.distribution.v1beta1.Params.fromObject(object.params); + } + if (object.feePool != null) { + if (typeof object.feePool !== "object") + throw TypeError(".cosmos.distribution.v1beta1.GenesisState.feePool: object expected"); + message.feePool = $root.cosmos.distribution.v1beta1.FeePool.fromObject(object.feePool); + } + if (object.delegatorWithdrawInfos) { + if (!Array.isArray(object.delegatorWithdrawInfos)) + throw TypeError(".cosmos.distribution.v1beta1.GenesisState.delegatorWithdrawInfos: array expected"); + message.delegatorWithdrawInfos = []; + for (let i = 0; i < object.delegatorWithdrawInfos.length; ++i) { + if (typeof object.delegatorWithdrawInfos[i] !== "object") + throw TypeError(".cosmos.distribution.v1beta1.GenesisState.delegatorWithdrawInfos: object expected"); + message.delegatorWithdrawInfos[i] = $root.cosmos.distribution.v1beta1.DelegatorWithdrawInfo.fromObject(object.delegatorWithdrawInfos[i]); + } + } + if (object.previousProposer != null) + message.previousProposer = String(object.previousProposer); + if (object.outstandingRewards) { + if (!Array.isArray(object.outstandingRewards)) + throw TypeError(".cosmos.distribution.v1beta1.GenesisState.outstandingRewards: array expected"); + message.outstandingRewards = []; + for (let i = 0; i < object.outstandingRewards.length; ++i) { + if (typeof object.outstandingRewards[i] !== "object") + throw TypeError(".cosmos.distribution.v1beta1.GenesisState.outstandingRewards: object expected"); + message.outstandingRewards[i] = $root.cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord.fromObject(object.outstandingRewards[i]); + } + } + if (object.validatorAccumulatedCommissions) { + if (!Array.isArray(object.validatorAccumulatedCommissions)) + throw TypeError(".cosmos.distribution.v1beta1.GenesisState.validatorAccumulatedCommissions: array expected"); + message.validatorAccumulatedCommissions = []; + for (let i = 0; i < object.validatorAccumulatedCommissions.length; ++i) { + if (typeof object.validatorAccumulatedCommissions[i] !== "object") + throw TypeError(".cosmos.distribution.v1beta1.GenesisState.validatorAccumulatedCommissions: object expected"); + message.validatorAccumulatedCommissions[i] = $root.cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord.fromObject(object.validatorAccumulatedCommissions[i]); + } + } + if (object.validatorHistoricalRewards) { + if (!Array.isArray(object.validatorHistoricalRewards)) + throw TypeError(".cosmos.distribution.v1beta1.GenesisState.validatorHistoricalRewards: array expected"); + message.validatorHistoricalRewards = []; + for (let i = 0; i < object.validatorHistoricalRewards.length; ++i) { + if (typeof object.validatorHistoricalRewards[i] !== "object") + throw TypeError(".cosmos.distribution.v1beta1.GenesisState.validatorHistoricalRewards: object expected"); + message.validatorHistoricalRewards[i] = $root.cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord.fromObject(object.validatorHistoricalRewards[i]); + } + } + if (object.validatorCurrentRewards) { + if (!Array.isArray(object.validatorCurrentRewards)) + throw TypeError(".cosmos.distribution.v1beta1.GenesisState.validatorCurrentRewards: array expected"); + message.validatorCurrentRewards = []; + for (let i = 0; i < object.validatorCurrentRewards.length; ++i) { + if (typeof object.validatorCurrentRewards[i] !== "object") + throw TypeError(".cosmos.distribution.v1beta1.GenesisState.validatorCurrentRewards: object expected"); + message.validatorCurrentRewards[i] = $root.cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord.fromObject(object.validatorCurrentRewards[i]); + } + } + if (object.delegatorStartingInfos) { + if (!Array.isArray(object.delegatorStartingInfos)) + throw TypeError(".cosmos.distribution.v1beta1.GenesisState.delegatorStartingInfos: array expected"); + message.delegatorStartingInfos = []; + for (let i = 0; i < object.delegatorStartingInfos.length; ++i) { + if (typeof object.delegatorStartingInfos[i] !== "object") + throw TypeError(".cosmos.distribution.v1beta1.GenesisState.delegatorStartingInfos: object expected"); + message.delegatorStartingInfos[i] = $root.cosmos.distribution.v1beta1.DelegatorStartingInfoRecord.fromObject(object.delegatorStartingInfos[i]); + } + } + if (object.validatorSlashEvents) { + if (!Array.isArray(object.validatorSlashEvents)) + throw TypeError(".cosmos.distribution.v1beta1.GenesisState.validatorSlashEvents: array expected"); + message.validatorSlashEvents = []; + for (let i = 0; i < object.validatorSlashEvents.length; ++i) { + if (typeof object.validatorSlashEvents[i] !== "object") + throw TypeError(".cosmos.distribution.v1beta1.GenesisState.validatorSlashEvents: object expected"); + message.validatorSlashEvents[i] = $root.cosmos.distribution.v1beta1.ValidatorSlashEventRecord.fromObject(object.validatorSlashEvents[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GenesisState message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.GenesisState + * @static + * @param {cosmos.distribution.v1beta1.GenesisState} message GenesisState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenesisState.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) { + object.delegatorWithdrawInfos = []; + object.outstandingRewards = []; + object.validatorAccumulatedCommissions = []; + object.validatorHistoricalRewards = []; + object.validatorCurrentRewards = []; + object.delegatorStartingInfos = []; + object.validatorSlashEvents = []; + } + if (options.defaults) { + object.params = null; + object.feePool = null; + object.previousProposer = ""; + } + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.cosmos.distribution.v1beta1.Params.toObject(message.params, options); + if (message.feePool != null && message.hasOwnProperty("feePool")) + object.feePool = $root.cosmos.distribution.v1beta1.FeePool.toObject(message.feePool, options); + if (message.delegatorWithdrawInfos && message.delegatorWithdrawInfos.length) { + object.delegatorWithdrawInfos = []; + for (let j = 0; j < message.delegatorWithdrawInfos.length; ++j) + object.delegatorWithdrawInfos[j] = $root.cosmos.distribution.v1beta1.DelegatorWithdrawInfo.toObject(message.delegatorWithdrawInfos[j], options); + } + if (message.previousProposer != null && message.hasOwnProperty("previousProposer")) + object.previousProposer = message.previousProposer; + if (message.outstandingRewards && message.outstandingRewards.length) { + object.outstandingRewards = []; + for (let j = 0; j < message.outstandingRewards.length; ++j) + object.outstandingRewards[j] = $root.cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord.toObject(message.outstandingRewards[j], options); + } + if (message.validatorAccumulatedCommissions && message.validatorAccumulatedCommissions.length) { + object.validatorAccumulatedCommissions = []; + for (let j = 0; j < message.validatorAccumulatedCommissions.length; ++j) + object.validatorAccumulatedCommissions[j] = $root.cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord.toObject(message.validatorAccumulatedCommissions[j], options); + } + if (message.validatorHistoricalRewards && message.validatorHistoricalRewards.length) { + object.validatorHistoricalRewards = []; + for (let j = 0; j < message.validatorHistoricalRewards.length; ++j) + object.validatorHistoricalRewards[j] = $root.cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord.toObject(message.validatorHistoricalRewards[j], options); + } + if (message.validatorCurrentRewards && message.validatorCurrentRewards.length) { + object.validatorCurrentRewards = []; + for (let j = 0; j < message.validatorCurrentRewards.length; ++j) + object.validatorCurrentRewards[j] = $root.cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord.toObject(message.validatorCurrentRewards[j], options); + } + if (message.delegatorStartingInfos && message.delegatorStartingInfos.length) { + object.delegatorStartingInfos = []; + for (let j = 0; j < message.delegatorStartingInfos.length; ++j) + object.delegatorStartingInfos[j] = $root.cosmos.distribution.v1beta1.DelegatorStartingInfoRecord.toObject(message.delegatorStartingInfos[j], options); + } + if (message.validatorSlashEvents && message.validatorSlashEvents.length) { + object.validatorSlashEvents = []; + for (let j = 0; j < message.validatorSlashEvents.length; ++j) + object.validatorSlashEvents[j] = $root.cosmos.distribution.v1beta1.ValidatorSlashEventRecord.toObject(message.validatorSlashEvents[j], options); + } + return object; + }; + + /** + * Converts this GenesisState to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.GenesisState + * @instance + * @returns {Object.} JSON object + */ + GenesisState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GenesisState; + })(v1beta1.GenesisState || {}); + + v1beta1.Query = (function(Query) { + + /** + * Constructs a new Query service. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a Query + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Query(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; + + /** + * Creates new Query service using the specified rpc implementation. + * @function create + * @memberof cosmos.distribution.v1beta1.Query + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Query} RPC service. Useful where requests and/or responses are streamed. + */ + Query.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.distribution.v1beta1.Query#params}. + * @memberof cosmos.distribution.v1beta1.Query + * @typedef ParamsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.distribution.v1beta1.IQueryParamsResponse} [response] QueryParamsResponse + */ + + /** + * Calls Params. + * @function params + * @memberof cosmos.distribution.v1beta1.Query + * @instance + * @param {cosmos.distribution.v1beta1.IQueryParamsRequest} request QueryParamsRequest message or plain object + * @param {cosmos.distribution.v1beta1.Query.ParamsCallback} callback Node-style callback called with the error, if any, and QueryParamsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.params = function params(request, callback) { + return this.rpcCall(params, $root.cosmos.distribution.v1beta1.QueryParamsRequest, $root.cosmos.distribution.v1beta1.QueryParamsResponse, request, callback); + }, "name", { value: "Params" }); + + /** + * Calls Params. + * @function params + * @memberof cosmos.distribution.v1beta1.Query + * @instance + * @param {cosmos.distribution.v1beta1.IQueryParamsRequest} request QueryParamsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.distribution.v1beta1.Query#validatorOutstandingRewards}. + * @memberof cosmos.distribution.v1beta1.Query + * @typedef ValidatorOutstandingRewardsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.distribution.v1beta1.IQueryValidatorOutstandingRewardsResponse} [response] QueryValidatorOutstandingRewardsResponse + */ + + /** + * Calls ValidatorOutstandingRewards. + * @function validatorOutstandingRewards + * @memberof cosmos.distribution.v1beta1.Query + * @instance + * @param {cosmos.distribution.v1beta1.IQueryValidatorOutstandingRewardsRequest} request QueryValidatorOutstandingRewardsRequest message or plain object + * @param {cosmos.distribution.v1beta1.Query.ValidatorOutstandingRewardsCallback} callback Node-style callback called with the error, if any, and QueryValidatorOutstandingRewardsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.validatorOutstandingRewards = function validatorOutstandingRewards(request, callback) { + return this.rpcCall(validatorOutstandingRewards, $root.cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest, $root.cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse, request, callback); + }, "name", { value: "ValidatorOutstandingRewards" }); + + /** + * Calls ValidatorOutstandingRewards. + * @function validatorOutstandingRewards + * @memberof cosmos.distribution.v1beta1.Query + * @instance + * @param {cosmos.distribution.v1beta1.IQueryValidatorOutstandingRewardsRequest} request QueryValidatorOutstandingRewardsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.distribution.v1beta1.Query#validatorCommission}. + * @memberof cosmos.distribution.v1beta1.Query + * @typedef ValidatorCommissionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.distribution.v1beta1.IQueryValidatorCommissionResponse} [response] QueryValidatorCommissionResponse + */ + + /** + * Calls ValidatorCommission. + * @function validatorCommission + * @memberof cosmos.distribution.v1beta1.Query + * @instance + * @param {cosmos.distribution.v1beta1.IQueryValidatorCommissionRequest} request QueryValidatorCommissionRequest message or plain object + * @param {cosmos.distribution.v1beta1.Query.ValidatorCommissionCallback} callback Node-style callback called with the error, if any, and QueryValidatorCommissionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.validatorCommission = function validatorCommission(request, callback) { + return this.rpcCall(validatorCommission, $root.cosmos.distribution.v1beta1.QueryValidatorCommissionRequest, $root.cosmos.distribution.v1beta1.QueryValidatorCommissionResponse, request, callback); + }, "name", { value: "ValidatorCommission" }); + + /** + * Calls ValidatorCommission. + * @function validatorCommission + * @memberof cosmos.distribution.v1beta1.Query + * @instance + * @param {cosmos.distribution.v1beta1.IQueryValidatorCommissionRequest} request QueryValidatorCommissionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.distribution.v1beta1.Query#validatorSlashes}. + * @memberof cosmos.distribution.v1beta1.Query + * @typedef ValidatorSlashesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.distribution.v1beta1.IQueryValidatorSlashesResponse} [response] QueryValidatorSlashesResponse + */ + + /** + * Calls ValidatorSlashes. + * @function validatorSlashes + * @memberof cosmos.distribution.v1beta1.Query + * @instance + * @param {cosmos.distribution.v1beta1.IQueryValidatorSlashesRequest} request QueryValidatorSlashesRequest message or plain object + * @param {cosmos.distribution.v1beta1.Query.ValidatorSlashesCallback} callback Node-style callback called with the error, if any, and QueryValidatorSlashesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.validatorSlashes = function validatorSlashes(request, callback) { + return this.rpcCall(validatorSlashes, $root.cosmos.distribution.v1beta1.QueryValidatorSlashesRequest, $root.cosmos.distribution.v1beta1.QueryValidatorSlashesResponse, request, callback); + }, "name", { value: "ValidatorSlashes" }); + + /** + * Calls ValidatorSlashes. + * @function validatorSlashes + * @memberof cosmos.distribution.v1beta1.Query + * @instance + * @param {cosmos.distribution.v1beta1.IQueryValidatorSlashesRequest} request QueryValidatorSlashesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.distribution.v1beta1.Query#delegationRewards}. + * @memberof cosmos.distribution.v1beta1.Query + * @typedef DelegationRewardsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.distribution.v1beta1.IQueryDelegationRewardsResponse} [response] QueryDelegationRewardsResponse + */ + + /** + * Calls DelegationRewards. + * @function delegationRewards + * @memberof cosmos.distribution.v1beta1.Query + * @instance + * @param {cosmos.distribution.v1beta1.IQueryDelegationRewardsRequest} request QueryDelegationRewardsRequest message or plain object + * @param {cosmos.distribution.v1beta1.Query.DelegationRewardsCallback} callback Node-style callback called with the error, if any, and QueryDelegationRewardsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.delegationRewards = function delegationRewards(request, callback) { + return this.rpcCall(delegationRewards, $root.cosmos.distribution.v1beta1.QueryDelegationRewardsRequest, $root.cosmos.distribution.v1beta1.QueryDelegationRewardsResponse, request, callback); + }, "name", { value: "DelegationRewards" }); + + /** + * Calls DelegationRewards. + * @function delegationRewards + * @memberof cosmos.distribution.v1beta1.Query + * @instance + * @param {cosmos.distribution.v1beta1.IQueryDelegationRewardsRequest} request QueryDelegationRewardsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.distribution.v1beta1.Query#delegationTotalRewards}. + * @memberof cosmos.distribution.v1beta1.Query + * @typedef DelegationTotalRewardsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.distribution.v1beta1.IQueryDelegationTotalRewardsResponse} [response] QueryDelegationTotalRewardsResponse + */ + + /** + * Calls DelegationTotalRewards. + * @function delegationTotalRewards + * @memberof cosmos.distribution.v1beta1.Query + * @instance + * @param {cosmos.distribution.v1beta1.IQueryDelegationTotalRewardsRequest} request QueryDelegationTotalRewardsRequest message or plain object + * @param {cosmos.distribution.v1beta1.Query.DelegationTotalRewardsCallback} callback Node-style callback called with the error, if any, and QueryDelegationTotalRewardsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.delegationTotalRewards = function delegationTotalRewards(request, callback) { + return this.rpcCall(delegationTotalRewards, $root.cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest, $root.cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse, request, callback); + }, "name", { value: "DelegationTotalRewards" }); + + /** + * Calls DelegationTotalRewards. + * @function delegationTotalRewards + * @memberof cosmos.distribution.v1beta1.Query + * @instance + * @param {cosmos.distribution.v1beta1.IQueryDelegationTotalRewardsRequest} request QueryDelegationTotalRewardsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.distribution.v1beta1.Query#delegatorValidators}. + * @memberof cosmos.distribution.v1beta1.Query + * @typedef DelegatorValidatorsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.distribution.v1beta1.IQueryDelegatorValidatorsResponse} [response] QueryDelegatorValidatorsResponse + */ + + /** + * Calls DelegatorValidators. + * @function delegatorValidators + * @memberof cosmos.distribution.v1beta1.Query + * @instance + * @param {cosmos.distribution.v1beta1.IQueryDelegatorValidatorsRequest} request QueryDelegatorValidatorsRequest message or plain object + * @param {cosmos.distribution.v1beta1.Query.DelegatorValidatorsCallback} callback Node-style callback called with the error, if any, and QueryDelegatorValidatorsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.delegatorValidators = function delegatorValidators(request, callback) { + return this.rpcCall(delegatorValidators, $root.cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest, $root.cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse, request, callback); + }, "name", { value: "DelegatorValidators" }); + + /** + * Calls DelegatorValidators. + * @function delegatorValidators + * @memberof cosmos.distribution.v1beta1.Query + * @instance + * @param {cosmos.distribution.v1beta1.IQueryDelegatorValidatorsRequest} request QueryDelegatorValidatorsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.distribution.v1beta1.Query#delegatorWithdrawAddress}. + * @memberof cosmos.distribution.v1beta1.Query + * @typedef DelegatorWithdrawAddressCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.distribution.v1beta1.IQueryDelegatorWithdrawAddressResponse} [response] QueryDelegatorWithdrawAddressResponse + */ + + /** + * Calls DelegatorWithdrawAddress. + * @function delegatorWithdrawAddress + * @memberof cosmos.distribution.v1beta1.Query + * @instance + * @param {cosmos.distribution.v1beta1.IQueryDelegatorWithdrawAddressRequest} request QueryDelegatorWithdrawAddressRequest message or plain object + * @param {cosmos.distribution.v1beta1.Query.DelegatorWithdrawAddressCallback} callback Node-style callback called with the error, if any, and QueryDelegatorWithdrawAddressResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.delegatorWithdrawAddress = function delegatorWithdrawAddress(request, callback) { + return this.rpcCall(delegatorWithdrawAddress, $root.cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest, $root.cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse, request, callback); + }, "name", { value: "DelegatorWithdrawAddress" }); + + /** + * Calls DelegatorWithdrawAddress. + * @function delegatorWithdrawAddress + * @memberof cosmos.distribution.v1beta1.Query + * @instance + * @param {cosmos.distribution.v1beta1.IQueryDelegatorWithdrawAddressRequest} request QueryDelegatorWithdrawAddressRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.distribution.v1beta1.Query#communityPool}. + * @memberof cosmos.distribution.v1beta1.Query + * @typedef CommunityPoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.distribution.v1beta1.IQueryCommunityPoolResponse} [response] QueryCommunityPoolResponse + */ + + /** + * Calls CommunityPool. + * @function communityPool + * @memberof cosmos.distribution.v1beta1.Query + * @instance + * @param {cosmos.distribution.v1beta1.IQueryCommunityPoolRequest} request QueryCommunityPoolRequest message or plain object + * @param {cosmos.distribution.v1beta1.Query.CommunityPoolCallback} callback Node-style callback called with the error, if any, and QueryCommunityPoolResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.communityPool = function communityPool(request, callback) { + return this.rpcCall(communityPool, $root.cosmos.distribution.v1beta1.QueryCommunityPoolRequest, $root.cosmos.distribution.v1beta1.QueryCommunityPoolResponse, request, callback); + }, "name", { value: "CommunityPool" }); + + /** + * Calls CommunityPool. + * @function communityPool + * @memberof cosmos.distribution.v1beta1.Query + * @instance + * @param {cosmos.distribution.v1beta1.IQueryCommunityPoolRequest} request QueryCommunityPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Query; + })(v1beta1.Query || {}); + + v1beta1.QueryParamsRequest = (function(QueryParamsRequest) { + + /** + * Properties of a QueryParamsRequest. + * @memberof cosmos.distribution.v1beta1 + * @interface IQueryParamsRequest + */ + + /** + * Constructs a new QueryParamsRequest. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a QueryParamsRequest. + * @implements IQueryParamsRequest + * @constructor + * @param {cosmos.distribution.v1beta1.IQueryParamsRequest=} [properties] Properties to set + */ + function QueryParamsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new QueryParamsRequest instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.QueryParamsRequest + * @static + * @param {cosmos.distribution.v1beta1.IQueryParamsRequest=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.QueryParamsRequest} QueryParamsRequest instance + */ + QueryParamsRequest.create = function create(properties) { + return new QueryParamsRequest(properties); + }; + + /** + * Encodes the specified QueryParamsRequest message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryParamsRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.QueryParamsRequest + * @static + * @param {cosmos.distribution.v1beta1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.QueryParamsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryParamsRequest + * @static + * @param {cosmos.distribution.v1beta1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryParamsRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.QueryParamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.QueryParamsRequest} QueryParamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.QueryParamsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryParamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.QueryParamsRequest} QueryParamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryParamsRequest message. + * @function verify + * @memberof cosmos.distribution.v1beta1.QueryParamsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryParamsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.QueryParamsRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.QueryParamsRequest} QueryParamsRequest + */ + QueryParamsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.QueryParamsRequest) + return object; + return new $root.cosmos.distribution.v1beta1.QueryParamsRequest(); + }; + + /** + * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.QueryParamsRequest + * @static + * @param {cosmos.distribution.v1beta1.QueryParamsRequest} message QueryParamsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryParamsRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this QueryParamsRequest to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.QueryParamsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryParamsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryParamsRequest; + })(v1beta1.QueryParamsRequest || {}); + + v1beta1.QueryParamsResponse = (function(QueryParamsResponse) { + + /** + * Properties of a QueryParamsResponse. + * @memberof cosmos.distribution.v1beta1 + * @interface IQueryParamsResponse + * @property {cosmos.distribution.v1beta1.IParams|null} [params] QueryParamsResponse params + */ + + /** + * Constructs a new QueryParamsResponse. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a QueryParamsResponse. + * @implements IQueryParamsResponse + * @constructor + * @param {cosmos.distribution.v1beta1.IQueryParamsResponse=} [properties] Properties to set + */ + function QueryParamsResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryParamsResponse params. + * @member {cosmos.distribution.v1beta1.IParams|null|undefined} params + * @memberof cosmos.distribution.v1beta1.QueryParamsResponse + * @instance + */ + QueryParamsResponse.prototype.params = null; + + /** + * Creates a new QueryParamsResponse instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.QueryParamsResponse + * @static + * @param {cosmos.distribution.v1beta1.IQueryParamsResponse=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.QueryParamsResponse} QueryParamsResponse instance + */ + QueryParamsResponse.create = function create(properties) { + return new QueryParamsResponse(properties); + }; + + /** + * Encodes the specified QueryParamsResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryParamsResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.QueryParamsResponse + * @static + * @param {cosmos.distribution.v1beta1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.cosmos.distribution.v1beta1.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.QueryParamsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryParamsResponse + * @static + * @param {cosmos.distribution.v1beta1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryParamsResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.QueryParamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.QueryParamsResponse} QueryParamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.QueryParamsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = $root.cosmos.distribution.v1beta1.Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryParamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.QueryParamsResponse} QueryParamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryParamsResponse message. + * @function verify + * @memberof cosmos.distribution.v1beta1.QueryParamsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryParamsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.params != null && message.hasOwnProperty("params")) { + let error = $root.cosmos.distribution.v1beta1.Params.verify(message.params); + if (error) + return "params." + error; + } + return null; + }; + + /** + * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.QueryParamsResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.QueryParamsResponse} QueryParamsResponse + */ + QueryParamsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.QueryParamsResponse) + return object; + let message = new $root.cosmos.distribution.v1beta1.QueryParamsResponse(); + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".cosmos.distribution.v1beta1.QueryParamsResponse.params: object expected"); + message.params = $root.cosmos.distribution.v1beta1.Params.fromObject(object.params); + } + return message; + }; + + /** + * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.QueryParamsResponse + * @static + * @param {cosmos.distribution.v1beta1.QueryParamsResponse} message QueryParamsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryParamsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.params = null; + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.cosmos.distribution.v1beta1.Params.toObject(message.params, options); + return object; + }; + + /** + * Converts this QueryParamsResponse to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.QueryParamsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryParamsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryParamsResponse; + })(v1beta1.QueryParamsResponse || {}); + + v1beta1.QueryValidatorOutstandingRewardsRequest = (function(QueryValidatorOutstandingRewardsRequest) { + + /** + * Properties of a QueryValidatorOutstandingRewardsRequest. + * @memberof cosmos.distribution.v1beta1 + * @interface IQueryValidatorOutstandingRewardsRequest + * @property {string|null} [validatorAddress] QueryValidatorOutstandingRewardsRequest validatorAddress + */ + + /** + * Constructs a new QueryValidatorOutstandingRewardsRequest. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a QueryValidatorOutstandingRewardsRequest. + * @implements IQueryValidatorOutstandingRewardsRequest + * @constructor + * @param {cosmos.distribution.v1beta1.IQueryValidatorOutstandingRewardsRequest=} [properties] Properties to set + */ + function QueryValidatorOutstandingRewardsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryValidatorOutstandingRewardsRequest validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest + * @instance + */ + QueryValidatorOutstandingRewardsRequest.prototype.validatorAddress = ""; + + /** + * Creates a new QueryValidatorOutstandingRewardsRequest instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest + * @static + * @param {cosmos.distribution.v1beta1.IQueryValidatorOutstandingRewardsRequest=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest} QueryValidatorOutstandingRewardsRequest instance + */ + QueryValidatorOutstandingRewardsRequest.create = function create(properties) { + return new QueryValidatorOutstandingRewardsRequest(properties); + }; + + /** + * Encodes the specified QueryValidatorOutstandingRewardsRequest message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest + * @static + * @param {cosmos.distribution.v1beta1.IQueryValidatorOutstandingRewardsRequest} message QueryValidatorOutstandingRewardsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryValidatorOutstandingRewardsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.validatorAddress); + return writer; + }; + + /** + * Encodes the specified QueryValidatorOutstandingRewardsRequest message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest + * @static + * @param {cosmos.distribution.v1beta1.IQueryValidatorOutstandingRewardsRequest} message QueryValidatorOutstandingRewardsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryValidatorOutstandingRewardsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryValidatorOutstandingRewardsRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest} QueryValidatorOutstandingRewardsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryValidatorOutstandingRewardsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryValidatorOutstandingRewardsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest} QueryValidatorOutstandingRewardsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryValidatorOutstandingRewardsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryValidatorOutstandingRewardsRequest message. + * @function verify + * @memberof cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryValidatorOutstandingRewardsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + return null; + }; + + /** + * Creates a QueryValidatorOutstandingRewardsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest} QueryValidatorOutstandingRewardsRequest + */ + QueryValidatorOutstandingRewardsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest) + return object; + let message = new $root.cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest(); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + return message; + }; + + /** + * Creates a plain object from a QueryValidatorOutstandingRewardsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest + * @static + * @param {cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest} message QueryValidatorOutstandingRewardsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryValidatorOutstandingRewardsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.validatorAddress = ""; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + return object; + }; + + /** + * Converts this QueryValidatorOutstandingRewardsRequest to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryValidatorOutstandingRewardsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryValidatorOutstandingRewardsRequest; + })(v1beta1.QueryValidatorOutstandingRewardsRequest || {}); + + v1beta1.QueryValidatorOutstandingRewardsResponse = (function(QueryValidatorOutstandingRewardsResponse) { + + /** + * Properties of a QueryValidatorOutstandingRewardsResponse. + * @memberof cosmos.distribution.v1beta1 + * @interface IQueryValidatorOutstandingRewardsResponse + * @property {cosmos.distribution.v1beta1.IValidatorOutstandingRewards|null} [rewards] QueryValidatorOutstandingRewardsResponse rewards + */ + + /** + * Constructs a new QueryValidatorOutstandingRewardsResponse. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a QueryValidatorOutstandingRewardsResponse. + * @implements IQueryValidatorOutstandingRewardsResponse + * @constructor + * @param {cosmos.distribution.v1beta1.IQueryValidatorOutstandingRewardsResponse=} [properties] Properties to set + */ + function QueryValidatorOutstandingRewardsResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryValidatorOutstandingRewardsResponse rewards. + * @member {cosmos.distribution.v1beta1.IValidatorOutstandingRewards|null|undefined} rewards + * @memberof cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse + * @instance + */ + QueryValidatorOutstandingRewardsResponse.prototype.rewards = null; + + /** + * Creates a new QueryValidatorOutstandingRewardsResponse instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse + * @static + * @param {cosmos.distribution.v1beta1.IQueryValidatorOutstandingRewardsResponse=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse} QueryValidatorOutstandingRewardsResponse instance + */ + QueryValidatorOutstandingRewardsResponse.create = function create(properties) { + return new QueryValidatorOutstandingRewardsResponse(properties); + }; + + /** + * Encodes the specified QueryValidatorOutstandingRewardsResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse + * @static + * @param {cosmos.distribution.v1beta1.IQueryValidatorOutstandingRewardsResponse} message QueryValidatorOutstandingRewardsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryValidatorOutstandingRewardsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rewards != null && Object.hasOwnProperty.call(message, "rewards")) + $root.cosmos.distribution.v1beta1.ValidatorOutstandingRewards.encode(message.rewards, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryValidatorOutstandingRewardsResponse message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse + * @static + * @param {cosmos.distribution.v1beta1.IQueryValidatorOutstandingRewardsResponse} message QueryValidatorOutstandingRewardsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryValidatorOutstandingRewardsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryValidatorOutstandingRewardsResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse} QueryValidatorOutstandingRewardsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryValidatorOutstandingRewardsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rewards = $root.cosmos.distribution.v1beta1.ValidatorOutstandingRewards.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryValidatorOutstandingRewardsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse} QueryValidatorOutstandingRewardsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryValidatorOutstandingRewardsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryValidatorOutstandingRewardsResponse message. + * @function verify + * @memberof cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryValidatorOutstandingRewardsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rewards != null && message.hasOwnProperty("rewards")) { + let error = $root.cosmos.distribution.v1beta1.ValidatorOutstandingRewards.verify(message.rewards); + if (error) + return "rewards." + error; + } + return null; + }; + + /** + * Creates a QueryValidatorOutstandingRewardsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse} QueryValidatorOutstandingRewardsResponse + */ + QueryValidatorOutstandingRewardsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse) + return object; + let message = new $root.cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse(); + if (object.rewards != null) { + if (typeof object.rewards !== "object") + throw TypeError(".cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse.rewards: object expected"); + message.rewards = $root.cosmos.distribution.v1beta1.ValidatorOutstandingRewards.fromObject(object.rewards); + } + return message; + }; + + /** + * Creates a plain object from a QueryValidatorOutstandingRewardsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse + * @static + * @param {cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse} message QueryValidatorOutstandingRewardsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryValidatorOutstandingRewardsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.rewards = null; + if (message.rewards != null && message.hasOwnProperty("rewards")) + object.rewards = $root.cosmos.distribution.v1beta1.ValidatorOutstandingRewards.toObject(message.rewards, options); + return object; + }; + + /** + * Converts this QueryValidatorOutstandingRewardsResponse to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryValidatorOutstandingRewardsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryValidatorOutstandingRewardsResponse; + })(v1beta1.QueryValidatorOutstandingRewardsResponse || {}); + + v1beta1.QueryValidatorCommissionRequest = (function(QueryValidatorCommissionRequest) { + + /** + * Properties of a QueryValidatorCommissionRequest. + * @memberof cosmos.distribution.v1beta1 + * @interface IQueryValidatorCommissionRequest + * @property {string|null} [validatorAddress] QueryValidatorCommissionRequest validatorAddress + */ + + /** + * Constructs a new QueryValidatorCommissionRequest. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a QueryValidatorCommissionRequest. + * @implements IQueryValidatorCommissionRequest + * @constructor + * @param {cosmos.distribution.v1beta1.IQueryValidatorCommissionRequest=} [properties] Properties to set + */ + function QueryValidatorCommissionRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryValidatorCommissionRequest validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.distribution.v1beta1.QueryValidatorCommissionRequest + * @instance + */ + QueryValidatorCommissionRequest.prototype.validatorAddress = ""; + + /** + * Creates a new QueryValidatorCommissionRequest instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.QueryValidatorCommissionRequest + * @static + * @param {cosmos.distribution.v1beta1.IQueryValidatorCommissionRequest=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.QueryValidatorCommissionRequest} QueryValidatorCommissionRequest instance + */ + QueryValidatorCommissionRequest.create = function create(properties) { + return new QueryValidatorCommissionRequest(properties); + }; + + /** + * Encodes the specified QueryValidatorCommissionRequest message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryValidatorCommissionRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.QueryValidatorCommissionRequest + * @static + * @param {cosmos.distribution.v1beta1.IQueryValidatorCommissionRequest} message QueryValidatorCommissionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryValidatorCommissionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.validatorAddress); + return writer; + }; + + /** + * Encodes the specified QueryValidatorCommissionRequest message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.QueryValidatorCommissionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryValidatorCommissionRequest + * @static + * @param {cosmos.distribution.v1beta1.IQueryValidatorCommissionRequest} message QueryValidatorCommissionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryValidatorCommissionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryValidatorCommissionRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.QueryValidatorCommissionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.QueryValidatorCommissionRequest} QueryValidatorCommissionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryValidatorCommissionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.QueryValidatorCommissionRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryValidatorCommissionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryValidatorCommissionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.QueryValidatorCommissionRequest} QueryValidatorCommissionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryValidatorCommissionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryValidatorCommissionRequest message. + * @function verify + * @memberof cosmos.distribution.v1beta1.QueryValidatorCommissionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryValidatorCommissionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + return null; + }; + + /** + * Creates a QueryValidatorCommissionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.QueryValidatorCommissionRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.QueryValidatorCommissionRequest} QueryValidatorCommissionRequest + */ + QueryValidatorCommissionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.QueryValidatorCommissionRequest) + return object; + let message = new $root.cosmos.distribution.v1beta1.QueryValidatorCommissionRequest(); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + return message; + }; + + /** + * Creates a plain object from a QueryValidatorCommissionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.QueryValidatorCommissionRequest + * @static + * @param {cosmos.distribution.v1beta1.QueryValidatorCommissionRequest} message QueryValidatorCommissionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryValidatorCommissionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.validatorAddress = ""; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + return object; + }; + + /** + * Converts this QueryValidatorCommissionRequest to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.QueryValidatorCommissionRequest + * @instance + * @returns {Object.} JSON object + */ + QueryValidatorCommissionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryValidatorCommissionRequest; + })(v1beta1.QueryValidatorCommissionRequest || {}); + + v1beta1.QueryValidatorCommissionResponse = (function(QueryValidatorCommissionResponse) { + + /** + * Properties of a QueryValidatorCommissionResponse. + * @memberof cosmos.distribution.v1beta1 + * @interface IQueryValidatorCommissionResponse + * @property {cosmos.distribution.v1beta1.IValidatorAccumulatedCommission|null} [commission] QueryValidatorCommissionResponse commission + */ + + /** + * Constructs a new QueryValidatorCommissionResponse. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a QueryValidatorCommissionResponse. + * @implements IQueryValidatorCommissionResponse + * @constructor + * @param {cosmos.distribution.v1beta1.IQueryValidatorCommissionResponse=} [properties] Properties to set + */ + function QueryValidatorCommissionResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryValidatorCommissionResponse commission. + * @member {cosmos.distribution.v1beta1.IValidatorAccumulatedCommission|null|undefined} commission + * @memberof cosmos.distribution.v1beta1.QueryValidatorCommissionResponse + * @instance + */ + QueryValidatorCommissionResponse.prototype.commission = null; + + /** + * Creates a new QueryValidatorCommissionResponse instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.QueryValidatorCommissionResponse + * @static + * @param {cosmos.distribution.v1beta1.IQueryValidatorCommissionResponse=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.QueryValidatorCommissionResponse} QueryValidatorCommissionResponse instance + */ + QueryValidatorCommissionResponse.create = function create(properties) { + return new QueryValidatorCommissionResponse(properties); + }; + + /** + * Encodes the specified QueryValidatorCommissionResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryValidatorCommissionResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.QueryValidatorCommissionResponse + * @static + * @param {cosmos.distribution.v1beta1.IQueryValidatorCommissionResponse} message QueryValidatorCommissionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryValidatorCommissionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commission != null && Object.hasOwnProperty.call(message, "commission")) + $root.cosmos.distribution.v1beta1.ValidatorAccumulatedCommission.encode(message.commission, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryValidatorCommissionResponse message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.QueryValidatorCommissionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryValidatorCommissionResponse + * @static + * @param {cosmos.distribution.v1beta1.IQueryValidatorCommissionResponse} message QueryValidatorCommissionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryValidatorCommissionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryValidatorCommissionResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.QueryValidatorCommissionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.QueryValidatorCommissionResponse} QueryValidatorCommissionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryValidatorCommissionResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.QueryValidatorCommissionResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.commission = $root.cosmos.distribution.v1beta1.ValidatorAccumulatedCommission.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryValidatorCommissionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryValidatorCommissionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.QueryValidatorCommissionResponse} QueryValidatorCommissionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryValidatorCommissionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryValidatorCommissionResponse message. + * @function verify + * @memberof cosmos.distribution.v1beta1.QueryValidatorCommissionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryValidatorCommissionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commission != null && message.hasOwnProperty("commission")) { + let error = $root.cosmos.distribution.v1beta1.ValidatorAccumulatedCommission.verify(message.commission); + if (error) + return "commission." + error; + } + return null; + }; + + /** + * Creates a QueryValidatorCommissionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.QueryValidatorCommissionResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.QueryValidatorCommissionResponse} QueryValidatorCommissionResponse + */ + QueryValidatorCommissionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.QueryValidatorCommissionResponse) + return object; + let message = new $root.cosmos.distribution.v1beta1.QueryValidatorCommissionResponse(); + if (object.commission != null) { + if (typeof object.commission !== "object") + throw TypeError(".cosmos.distribution.v1beta1.QueryValidatorCommissionResponse.commission: object expected"); + message.commission = $root.cosmos.distribution.v1beta1.ValidatorAccumulatedCommission.fromObject(object.commission); + } + return message; + }; + + /** + * Creates a plain object from a QueryValidatorCommissionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.QueryValidatorCommissionResponse + * @static + * @param {cosmos.distribution.v1beta1.QueryValidatorCommissionResponse} message QueryValidatorCommissionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryValidatorCommissionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.commission = null; + if (message.commission != null && message.hasOwnProperty("commission")) + object.commission = $root.cosmos.distribution.v1beta1.ValidatorAccumulatedCommission.toObject(message.commission, options); + return object; + }; + + /** + * Converts this QueryValidatorCommissionResponse to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.QueryValidatorCommissionResponse + * @instance + * @returns {Object.} JSON object + */ + QueryValidatorCommissionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryValidatorCommissionResponse; + })(v1beta1.QueryValidatorCommissionResponse || {}); + + v1beta1.QueryValidatorSlashesRequest = (function(QueryValidatorSlashesRequest) { + + /** + * Properties of a QueryValidatorSlashesRequest. + * @memberof cosmos.distribution.v1beta1 + * @interface IQueryValidatorSlashesRequest + * @property {string|null} [validatorAddress] QueryValidatorSlashesRequest validatorAddress + * @property {number|Long|null} [startingHeight] QueryValidatorSlashesRequest startingHeight + * @property {number|Long|null} [endingHeight] QueryValidatorSlashesRequest endingHeight + * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryValidatorSlashesRequest pagination + */ + + /** + * Constructs a new QueryValidatorSlashesRequest. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a QueryValidatorSlashesRequest. + * @implements IQueryValidatorSlashesRequest + * @constructor + * @param {cosmos.distribution.v1beta1.IQueryValidatorSlashesRequest=} [properties] Properties to set + */ + function QueryValidatorSlashesRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryValidatorSlashesRequest validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.distribution.v1beta1.QueryValidatorSlashesRequest + * @instance + */ + QueryValidatorSlashesRequest.prototype.validatorAddress = ""; + + /** + * QueryValidatorSlashesRequest startingHeight. + * @member {number|Long} startingHeight + * @memberof cosmos.distribution.v1beta1.QueryValidatorSlashesRequest + * @instance + */ + QueryValidatorSlashesRequest.prototype.startingHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * QueryValidatorSlashesRequest endingHeight. + * @member {number|Long} endingHeight + * @memberof cosmos.distribution.v1beta1.QueryValidatorSlashesRequest + * @instance + */ + QueryValidatorSlashesRequest.prototype.endingHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * QueryValidatorSlashesRequest pagination. + * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination + * @memberof cosmos.distribution.v1beta1.QueryValidatorSlashesRequest + * @instance + */ + QueryValidatorSlashesRequest.prototype.pagination = null; + + /** + * Creates a new QueryValidatorSlashesRequest instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.QueryValidatorSlashesRequest + * @static + * @param {cosmos.distribution.v1beta1.IQueryValidatorSlashesRequest=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.QueryValidatorSlashesRequest} QueryValidatorSlashesRequest instance + */ + QueryValidatorSlashesRequest.create = function create(properties) { + return new QueryValidatorSlashesRequest(properties); + }; + + /** + * Encodes the specified QueryValidatorSlashesRequest message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryValidatorSlashesRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.QueryValidatorSlashesRequest + * @static + * @param {cosmos.distribution.v1beta1.IQueryValidatorSlashesRequest} message QueryValidatorSlashesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryValidatorSlashesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.validatorAddress); + if (message.startingHeight != null && Object.hasOwnProperty.call(message, "startingHeight")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.startingHeight); + if (message.endingHeight != null && Object.hasOwnProperty.call(message, "endingHeight")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.endingHeight); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryValidatorSlashesRequest message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.QueryValidatorSlashesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryValidatorSlashesRequest + * @static + * @param {cosmos.distribution.v1beta1.IQueryValidatorSlashesRequest} message QueryValidatorSlashesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryValidatorSlashesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryValidatorSlashesRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.QueryValidatorSlashesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.QueryValidatorSlashesRequest} QueryValidatorSlashesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryValidatorSlashesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.QueryValidatorSlashesRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.startingHeight = reader.uint64(); + break; + case 3: + message.endingHeight = reader.uint64(); + break; + case 4: + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryValidatorSlashesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryValidatorSlashesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.QueryValidatorSlashesRequest} QueryValidatorSlashesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryValidatorSlashesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryValidatorSlashesRequest message. + * @function verify + * @memberof cosmos.distribution.v1beta1.QueryValidatorSlashesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryValidatorSlashesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + if (message.startingHeight != null && message.hasOwnProperty("startingHeight")) + if (!$util.isInteger(message.startingHeight) && !(message.startingHeight && $util.isInteger(message.startingHeight.low) && $util.isInteger(message.startingHeight.high))) + return "startingHeight: integer|Long expected"; + if (message.endingHeight != null && message.hasOwnProperty("endingHeight")) + if (!$util.isInteger(message.endingHeight) && !(message.endingHeight && $util.isInteger(message.endingHeight.low) && $util.isInteger(message.endingHeight.high))) + return "endingHeight: integer|Long expected"; + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryValidatorSlashesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.QueryValidatorSlashesRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.QueryValidatorSlashesRequest} QueryValidatorSlashesRequest + */ + QueryValidatorSlashesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.QueryValidatorSlashesRequest) + return object; + let message = new $root.cosmos.distribution.v1beta1.QueryValidatorSlashesRequest(); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + if (object.startingHeight != null) + if ($util.Long) + (message.startingHeight = $util.Long.fromValue(object.startingHeight)).unsigned = true; + else if (typeof object.startingHeight === "string") + message.startingHeight = parseInt(object.startingHeight, 10); + else if (typeof object.startingHeight === "number") + message.startingHeight = object.startingHeight; + else if (typeof object.startingHeight === "object") + message.startingHeight = new $util.LongBits(object.startingHeight.low >>> 0, object.startingHeight.high >>> 0).toNumber(true); + if (object.endingHeight != null) + if ($util.Long) + (message.endingHeight = $util.Long.fromValue(object.endingHeight)).unsigned = true; + else if (typeof object.endingHeight === "string") + message.endingHeight = parseInt(object.endingHeight, 10); + else if (typeof object.endingHeight === "number") + message.endingHeight = object.endingHeight; + else if (typeof object.endingHeight === "object") + message.endingHeight = new $util.LongBits(object.endingHeight.low >>> 0, object.endingHeight.high >>> 0).toNumber(true); + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.distribution.v1beta1.QueryValidatorSlashesRequest.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryValidatorSlashesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.QueryValidatorSlashesRequest + * @static + * @param {cosmos.distribution.v1beta1.QueryValidatorSlashesRequest} message QueryValidatorSlashesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryValidatorSlashesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.validatorAddress = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.startingHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.startingHeight = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.endingHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.endingHeight = options.longs === String ? "0" : 0; + object.pagination = null; + } + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + if (message.startingHeight != null && message.hasOwnProperty("startingHeight")) + if (typeof message.startingHeight === "number") + object.startingHeight = options.longs === String ? String(message.startingHeight) : message.startingHeight; + else + object.startingHeight = options.longs === String ? $util.Long.prototype.toString.call(message.startingHeight) : options.longs === Number ? new $util.LongBits(message.startingHeight.low >>> 0, message.startingHeight.high >>> 0).toNumber(true) : message.startingHeight; + if (message.endingHeight != null && message.hasOwnProperty("endingHeight")) + if (typeof message.endingHeight === "number") + object.endingHeight = options.longs === String ? String(message.endingHeight) : message.endingHeight; + else + object.endingHeight = options.longs === String ? $util.Long.prototype.toString.call(message.endingHeight) : options.longs === Number ? new $util.LongBits(message.endingHeight.low >>> 0, message.endingHeight.high >>> 0).toNumber(true) : message.endingHeight; + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryValidatorSlashesRequest to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.QueryValidatorSlashesRequest + * @instance + * @returns {Object.} JSON object + */ + QueryValidatorSlashesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryValidatorSlashesRequest; + })(v1beta1.QueryValidatorSlashesRequest || {}); + + v1beta1.QueryValidatorSlashesResponse = (function(QueryValidatorSlashesResponse) { + + /** + * Properties of a QueryValidatorSlashesResponse. + * @memberof cosmos.distribution.v1beta1 + * @interface IQueryValidatorSlashesResponse + * @property {Array.|null} [slashes] QueryValidatorSlashesResponse slashes + * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryValidatorSlashesResponse pagination + */ + + /** + * Constructs a new QueryValidatorSlashesResponse. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a QueryValidatorSlashesResponse. + * @implements IQueryValidatorSlashesResponse + * @constructor + * @param {cosmos.distribution.v1beta1.IQueryValidatorSlashesResponse=} [properties] Properties to set + */ + function QueryValidatorSlashesResponse(properties) { + this.slashes = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryValidatorSlashesResponse slashes. + * @member {Array.} slashes + * @memberof cosmos.distribution.v1beta1.QueryValidatorSlashesResponse + * @instance + */ + QueryValidatorSlashesResponse.prototype.slashes = $util.emptyArray; + + /** + * QueryValidatorSlashesResponse pagination. + * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination + * @memberof cosmos.distribution.v1beta1.QueryValidatorSlashesResponse + * @instance + */ + QueryValidatorSlashesResponse.prototype.pagination = null; + + /** + * Creates a new QueryValidatorSlashesResponse instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.QueryValidatorSlashesResponse + * @static + * @param {cosmos.distribution.v1beta1.IQueryValidatorSlashesResponse=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.QueryValidatorSlashesResponse} QueryValidatorSlashesResponse instance + */ + QueryValidatorSlashesResponse.create = function create(properties) { + return new QueryValidatorSlashesResponse(properties); + }; + + /** + * Encodes the specified QueryValidatorSlashesResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryValidatorSlashesResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.QueryValidatorSlashesResponse + * @static + * @param {cosmos.distribution.v1beta1.IQueryValidatorSlashesResponse} message QueryValidatorSlashesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryValidatorSlashesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.slashes != null && message.slashes.length) + for (let i = 0; i < message.slashes.length; ++i) + $root.cosmos.distribution.v1beta1.ValidatorSlashEvent.encode(message.slashes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryValidatorSlashesResponse message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.QueryValidatorSlashesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryValidatorSlashesResponse + * @static + * @param {cosmos.distribution.v1beta1.IQueryValidatorSlashesResponse} message QueryValidatorSlashesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryValidatorSlashesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryValidatorSlashesResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.QueryValidatorSlashesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.QueryValidatorSlashesResponse} QueryValidatorSlashesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryValidatorSlashesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.QueryValidatorSlashesResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.slashes && message.slashes.length)) + message.slashes = []; + message.slashes.push($root.cosmos.distribution.v1beta1.ValidatorSlashEvent.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryValidatorSlashesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryValidatorSlashesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.QueryValidatorSlashesResponse} QueryValidatorSlashesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryValidatorSlashesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryValidatorSlashesResponse message. + * @function verify + * @memberof cosmos.distribution.v1beta1.QueryValidatorSlashesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryValidatorSlashesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.slashes != null && message.hasOwnProperty("slashes")) { + if (!Array.isArray(message.slashes)) + return "slashes: array expected"; + for (let i = 0; i < message.slashes.length; ++i) { + let error = $root.cosmos.distribution.v1beta1.ValidatorSlashEvent.verify(message.slashes[i]); + if (error) + return "slashes." + error; + } + } + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryValidatorSlashesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.QueryValidatorSlashesResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.QueryValidatorSlashesResponse} QueryValidatorSlashesResponse + */ + QueryValidatorSlashesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.QueryValidatorSlashesResponse) + return object; + let message = new $root.cosmos.distribution.v1beta1.QueryValidatorSlashesResponse(); + if (object.slashes) { + if (!Array.isArray(object.slashes)) + throw TypeError(".cosmos.distribution.v1beta1.QueryValidatorSlashesResponse.slashes: array expected"); + message.slashes = []; + for (let i = 0; i < object.slashes.length; ++i) { + if (typeof object.slashes[i] !== "object") + throw TypeError(".cosmos.distribution.v1beta1.QueryValidatorSlashesResponse.slashes: object expected"); + message.slashes[i] = $root.cosmos.distribution.v1beta1.ValidatorSlashEvent.fromObject(object.slashes[i]); + } + } + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.distribution.v1beta1.QueryValidatorSlashesResponse.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryValidatorSlashesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.QueryValidatorSlashesResponse + * @static + * @param {cosmos.distribution.v1beta1.QueryValidatorSlashesResponse} message QueryValidatorSlashesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryValidatorSlashesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.slashes = []; + if (options.defaults) + object.pagination = null; + if (message.slashes && message.slashes.length) { + object.slashes = []; + for (let j = 0; j < message.slashes.length; ++j) + object.slashes[j] = $root.cosmos.distribution.v1beta1.ValidatorSlashEvent.toObject(message.slashes[j], options); + } + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryValidatorSlashesResponse to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.QueryValidatorSlashesResponse + * @instance + * @returns {Object.} JSON object + */ + QueryValidatorSlashesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryValidatorSlashesResponse; + })(v1beta1.QueryValidatorSlashesResponse || {}); + + v1beta1.QueryDelegationRewardsRequest = (function(QueryDelegationRewardsRequest) { + + /** + * Properties of a QueryDelegationRewardsRequest. + * @memberof cosmos.distribution.v1beta1 + * @interface IQueryDelegationRewardsRequest + * @property {string|null} [delegatorAddress] QueryDelegationRewardsRequest delegatorAddress + * @property {string|null} [validatorAddress] QueryDelegationRewardsRequest validatorAddress + */ + + /** + * Constructs a new QueryDelegationRewardsRequest. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a QueryDelegationRewardsRequest. + * @implements IQueryDelegationRewardsRequest + * @constructor + * @param {cosmos.distribution.v1beta1.IQueryDelegationRewardsRequest=} [properties] Properties to set + */ + function QueryDelegationRewardsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryDelegationRewardsRequest delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.distribution.v1beta1.QueryDelegationRewardsRequest + * @instance + */ + QueryDelegationRewardsRequest.prototype.delegatorAddress = ""; + + /** + * QueryDelegationRewardsRequest validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.distribution.v1beta1.QueryDelegationRewardsRequest + * @instance + */ + QueryDelegationRewardsRequest.prototype.validatorAddress = ""; + + /** + * Creates a new QueryDelegationRewardsRequest instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.QueryDelegationRewardsRequest + * @static + * @param {cosmos.distribution.v1beta1.IQueryDelegationRewardsRequest=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.QueryDelegationRewardsRequest} QueryDelegationRewardsRequest instance + */ + QueryDelegationRewardsRequest.create = function create(properties) { + return new QueryDelegationRewardsRequest(properties); + }; + + /** + * Encodes the specified QueryDelegationRewardsRequest message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryDelegationRewardsRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.QueryDelegationRewardsRequest + * @static + * @param {cosmos.distribution.v1beta1.IQueryDelegationRewardsRequest} message QueryDelegationRewardsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegationRewardsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddress); + return writer; + }; + + /** + * Encodes the specified QueryDelegationRewardsRequest message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.QueryDelegationRewardsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryDelegationRewardsRequest + * @static + * @param {cosmos.distribution.v1beta1.IQueryDelegationRewardsRequest} message QueryDelegationRewardsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegationRewardsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDelegationRewardsRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.QueryDelegationRewardsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.QueryDelegationRewardsRequest} QueryDelegationRewardsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegationRewardsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.QueryDelegationRewardsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDelegationRewardsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryDelegationRewardsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.QueryDelegationRewardsRequest} QueryDelegationRewardsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegationRewardsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDelegationRewardsRequest message. + * @function verify + * @memberof cosmos.distribution.v1beta1.QueryDelegationRewardsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDelegationRewardsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + return null; + }; + + /** + * Creates a QueryDelegationRewardsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.QueryDelegationRewardsRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.QueryDelegationRewardsRequest} QueryDelegationRewardsRequest + */ + QueryDelegationRewardsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.QueryDelegationRewardsRequest) + return object; + let message = new $root.cosmos.distribution.v1beta1.QueryDelegationRewardsRequest(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + return message; + }; + + /** + * Creates a plain object from a QueryDelegationRewardsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.QueryDelegationRewardsRequest + * @static + * @param {cosmos.distribution.v1beta1.QueryDelegationRewardsRequest} message QueryDelegationRewardsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDelegationRewardsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.delegatorAddress = ""; + object.validatorAddress = ""; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + return object; + }; + + /** + * Converts this QueryDelegationRewardsRequest to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.QueryDelegationRewardsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryDelegationRewardsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryDelegationRewardsRequest; + })(v1beta1.QueryDelegationRewardsRequest || {}); + + v1beta1.QueryDelegationRewardsResponse = (function(QueryDelegationRewardsResponse) { + + /** + * Properties of a QueryDelegationRewardsResponse. + * @memberof cosmos.distribution.v1beta1 + * @interface IQueryDelegationRewardsResponse + * @property {Array.|null} [rewards] QueryDelegationRewardsResponse rewards + */ + + /** + * Constructs a new QueryDelegationRewardsResponse. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a QueryDelegationRewardsResponse. + * @implements IQueryDelegationRewardsResponse + * @constructor + * @param {cosmos.distribution.v1beta1.IQueryDelegationRewardsResponse=} [properties] Properties to set + */ + function QueryDelegationRewardsResponse(properties) { + this.rewards = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryDelegationRewardsResponse rewards. + * @member {Array.} rewards + * @memberof cosmos.distribution.v1beta1.QueryDelegationRewardsResponse + * @instance + */ + QueryDelegationRewardsResponse.prototype.rewards = $util.emptyArray; + + /** + * Creates a new QueryDelegationRewardsResponse instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.QueryDelegationRewardsResponse + * @static + * @param {cosmos.distribution.v1beta1.IQueryDelegationRewardsResponse=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.QueryDelegationRewardsResponse} QueryDelegationRewardsResponse instance + */ + QueryDelegationRewardsResponse.create = function create(properties) { + return new QueryDelegationRewardsResponse(properties); + }; + + /** + * Encodes the specified QueryDelegationRewardsResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryDelegationRewardsResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.QueryDelegationRewardsResponse + * @static + * @param {cosmos.distribution.v1beta1.IQueryDelegationRewardsResponse} message QueryDelegationRewardsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegationRewardsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rewards != null && message.rewards.length) + for (let i = 0; i < message.rewards.length; ++i) + $root.cosmos.base.v1beta1.DecCoin.encode(message.rewards[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryDelegationRewardsResponse message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.QueryDelegationRewardsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryDelegationRewardsResponse + * @static + * @param {cosmos.distribution.v1beta1.IQueryDelegationRewardsResponse} message QueryDelegationRewardsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegationRewardsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDelegationRewardsResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.QueryDelegationRewardsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.QueryDelegationRewardsResponse} QueryDelegationRewardsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegationRewardsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.QueryDelegationRewardsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.rewards && message.rewards.length)) + message.rewards = []; + message.rewards.push($root.cosmos.base.v1beta1.DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDelegationRewardsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryDelegationRewardsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.QueryDelegationRewardsResponse} QueryDelegationRewardsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegationRewardsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDelegationRewardsResponse message. + * @function verify + * @memberof cosmos.distribution.v1beta1.QueryDelegationRewardsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDelegationRewardsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rewards != null && message.hasOwnProperty("rewards")) { + if (!Array.isArray(message.rewards)) + return "rewards: array expected"; + for (let i = 0; i < message.rewards.length; ++i) { + let error = $root.cosmos.base.v1beta1.DecCoin.verify(message.rewards[i]); + if (error) + return "rewards." + error; + } + } + return null; + }; + + /** + * Creates a QueryDelegationRewardsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.QueryDelegationRewardsResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.QueryDelegationRewardsResponse} QueryDelegationRewardsResponse + */ + QueryDelegationRewardsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.QueryDelegationRewardsResponse) + return object; + let message = new $root.cosmos.distribution.v1beta1.QueryDelegationRewardsResponse(); + if (object.rewards) { + if (!Array.isArray(object.rewards)) + throw TypeError(".cosmos.distribution.v1beta1.QueryDelegationRewardsResponse.rewards: array expected"); + message.rewards = []; + for (let i = 0; i < object.rewards.length; ++i) { + if (typeof object.rewards[i] !== "object") + throw TypeError(".cosmos.distribution.v1beta1.QueryDelegationRewardsResponse.rewards: object expected"); + message.rewards[i] = $root.cosmos.base.v1beta1.DecCoin.fromObject(object.rewards[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a QueryDelegationRewardsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.QueryDelegationRewardsResponse + * @static + * @param {cosmos.distribution.v1beta1.QueryDelegationRewardsResponse} message QueryDelegationRewardsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDelegationRewardsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.rewards = []; + if (message.rewards && message.rewards.length) { + object.rewards = []; + for (let j = 0; j < message.rewards.length; ++j) + object.rewards[j] = $root.cosmos.base.v1beta1.DecCoin.toObject(message.rewards[j], options); + } + return object; + }; + + /** + * Converts this QueryDelegationRewardsResponse to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.QueryDelegationRewardsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryDelegationRewardsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryDelegationRewardsResponse; + })(v1beta1.QueryDelegationRewardsResponse || {}); + + v1beta1.QueryDelegationTotalRewardsRequest = (function(QueryDelegationTotalRewardsRequest) { + + /** + * Properties of a QueryDelegationTotalRewardsRequest. + * @memberof cosmos.distribution.v1beta1 + * @interface IQueryDelegationTotalRewardsRequest + * @property {string|null} [delegatorAddress] QueryDelegationTotalRewardsRequest delegatorAddress + */ + + /** + * Constructs a new QueryDelegationTotalRewardsRequest. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a QueryDelegationTotalRewardsRequest. + * @implements IQueryDelegationTotalRewardsRequest + * @constructor + * @param {cosmos.distribution.v1beta1.IQueryDelegationTotalRewardsRequest=} [properties] Properties to set + */ + function QueryDelegationTotalRewardsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryDelegationTotalRewardsRequest delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest + * @instance + */ + QueryDelegationTotalRewardsRequest.prototype.delegatorAddress = ""; + + /** + * Creates a new QueryDelegationTotalRewardsRequest instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest + * @static + * @param {cosmos.distribution.v1beta1.IQueryDelegationTotalRewardsRequest=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest} QueryDelegationTotalRewardsRequest instance + */ + QueryDelegationTotalRewardsRequest.create = function create(properties) { + return new QueryDelegationTotalRewardsRequest(properties); + }; + + /** + * Encodes the specified QueryDelegationTotalRewardsRequest message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest + * @static + * @param {cosmos.distribution.v1beta1.IQueryDelegationTotalRewardsRequest} message QueryDelegationTotalRewardsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegationTotalRewardsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + return writer; + }; + + /** + * Encodes the specified QueryDelegationTotalRewardsRequest message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest + * @static + * @param {cosmos.distribution.v1beta1.IQueryDelegationTotalRewardsRequest} message QueryDelegationTotalRewardsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegationTotalRewardsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDelegationTotalRewardsRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest} QueryDelegationTotalRewardsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegationTotalRewardsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDelegationTotalRewardsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest} QueryDelegationTotalRewardsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegationTotalRewardsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDelegationTotalRewardsRequest message. + * @function verify + * @memberof cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDelegationTotalRewardsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + return null; + }; + + /** + * Creates a QueryDelegationTotalRewardsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest} QueryDelegationTotalRewardsRequest + */ + QueryDelegationTotalRewardsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest) + return object; + let message = new $root.cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + return message; + }; + + /** + * Creates a plain object from a QueryDelegationTotalRewardsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest + * @static + * @param {cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest} message QueryDelegationTotalRewardsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDelegationTotalRewardsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.delegatorAddress = ""; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + return object; + }; + + /** + * Converts this QueryDelegationTotalRewardsRequest to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryDelegationTotalRewardsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryDelegationTotalRewardsRequest; + })(v1beta1.QueryDelegationTotalRewardsRequest || {}); + + v1beta1.QueryDelegationTotalRewardsResponse = (function(QueryDelegationTotalRewardsResponse) { + + /** + * Properties of a QueryDelegationTotalRewardsResponse. + * @memberof cosmos.distribution.v1beta1 + * @interface IQueryDelegationTotalRewardsResponse + * @property {Array.|null} [rewards] QueryDelegationTotalRewardsResponse rewards + * @property {Array.|null} [total] QueryDelegationTotalRewardsResponse total + */ + + /** + * Constructs a new QueryDelegationTotalRewardsResponse. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a QueryDelegationTotalRewardsResponse. + * @implements IQueryDelegationTotalRewardsResponse + * @constructor + * @param {cosmos.distribution.v1beta1.IQueryDelegationTotalRewardsResponse=} [properties] Properties to set + */ + function QueryDelegationTotalRewardsResponse(properties) { + this.rewards = []; + this.total = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryDelegationTotalRewardsResponse rewards. + * @member {Array.} rewards + * @memberof cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse + * @instance + */ + QueryDelegationTotalRewardsResponse.prototype.rewards = $util.emptyArray; + + /** + * QueryDelegationTotalRewardsResponse total. + * @member {Array.} total + * @memberof cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse + * @instance + */ + QueryDelegationTotalRewardsResponse.prototype.total = $util.emptyArray; + + /** + * Creates a new QueryDelegationTotalRewardsResponse instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse + * @static + * @param {cosmos.distribution.v1beta1.IQueryDelegationTotalRewardsResponse=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse} QueryDelegationTotalRewardsResponse instance + */ + QueryDelegationTotalRewardsResponse.create = function create(properties) { + return new QueryDelegationTotalRewardsResponse(properties); + }; + + /** + * Encodes the specified QueryDelegationTotalRewardsResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse + * @static + * @param {cosmos.distribution.v1beta1.IQueryDelegationTotalRewardsResponse} message QueryDelegationTotalRewardsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegationTotalRewardsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rewards != null && message.rewards.length) + for (let i = 0; i < message.rewards.length; ++i) + $root.cosmos.distribution.v1beta1.DelegationDelegatorReward.encode(message.rewards[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.total != null && message.total.length) + for (let i = 0; i < message.total.length; ++i) + $root.cosmos.base.v1beta1.DecCoin.encode(message.total[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryDelegationTotalRewardsResponse message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse + * @static + * @param {cosmos.distribution.v1beta1.IQueryDelegationTotalRewardsResponse} message QueryDelegationTotalRewardsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegationTotalRewardsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDelegationTotalRewardsResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse} QueryDelegationTotalRewardsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegationTotalRewardsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.rewards && message.rewards.length)) + message.rewards = []; + message.rewards.push($root.cosmos.distribution.v1beta1.DelegationDelegatorReward.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.total && message.total.length)) + message.total = []; + message.total.push($root.cosmos.base.v1beta1.DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDelegationTotalRewardsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse} QueryDelegationTotalRewardsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegationTotalRewardsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDelegationTotalRewardsResponse message. + * @function verify + * @memberof cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDelegationTotalRewardsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rewards != null && message.hasOwnProperty("rewards")) { + if (!Array.isArray(message.rewards)) + return "rewards: array expected"; + for (let i = 0; i < message.rewards.length; ++i) { + let error = $root.cosmos.distribution.v1beta1.DelegationDelegatorReward.verify(message.rewards[i]); + if (error) + return "rewards." + error; + } + } + if (message.total != null && message.hasOwnProperty("total")) { + if (!Array.isArray(message.total)) + return "total: array expected"; + for (let i = 0; i < message.total.length; ++i) { + let error = $root.cosmos.base.v1beta1.DecCoin.verify(message.total[i]); + if (error) + return "total." + error; + } + } + return null; + }; + + /** + * Creates a QueryDelegationTotalRewardsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse} QueryDelegationTotalRewardsResponse + */ + QueryDelegationTotalRewardsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse) + return object; + let message = new $root.cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse(); + if (object.rewards) { + if (!Array.isArray(object.rewards)) + throw TypeError(".cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse.rewards: array expected"); + message.rewards = []; + for (let i = 0; i < object.rewards.length; ++i) { + if (typeof object.rewards[i] !== "object") + throw TypeError(".cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse.rewards: object expected"); + message.rewards[i] = $root.cosmos.distribution.v1beta1.DelegationDelegatorReward.fromObject(object.rewards[i]); + } + } + if (object.total) { + if (!Array.isArray(object.total)) + throw TypeError(".cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse.total: array expected"); + message.total = []; + for (let i = 0; i < object.total.length; ++i) { + if (typeof object.total[i] !== "object") + throw TypeError(".cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse.total: object expected"); + message.total[i] = $root.cosmos.base.v1beta1.DecCoin.fromObject(object.total[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a QueryDelegationTotalRewardsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse + * @static + * @param {cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse} message QueryDelegationTotalRewardsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDelegationTotalRewardsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) { + object.rewards = []; + object.total = []; + } + if (message.rewards && message.rewards.length) { + object.rewards = []; + for (let j = 0; j < message.rewards.length; ++j) + object.rewards[j] = $root.cosmos.distribution.v1beta1.DelegationDelegatorReward.toObject(message.rewards[j], options); + } + if (message.total && message.total.length) { + object.total = []; + for (let j = 0; j < message.total.length; ++j) + object.total[j] = $root.cosmos.base.v1beta1.DecCoin.toObject(message.total[j], options); + } + return object; + }; + + /** + * Converts this QueryDelegationTotalRewardsResponse to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryDelegationTotalRewardsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryDelegationTotalRewardsResponse; + })(v1beta1.QueryDelegationTotalRewardsResponse || {}); + + v1beta1.QueryDelegatorValidatorsRequest = (function(QueryDelegatorValidatorsRequest) { + + /** + * Properties of a QueryDelegatorValidatorsRequest. + * @memberof cosmos.distribution.v1beta1 + * @interface IQueryDelegatorValidatorsRequest + * @property {string|null} [delegatorAddress] QueryDelegatorValidatorsRequest delegatorAddress + */ + + /** + * Constructs a new QueryDelegatorValidatorsRequest. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a QueryDelegatorValidatorsRequest. + * @implements IQueryDelegatorValidatorsRequest + * @constructor + * @param {cosmos.distribution.v1beta1.IQueryDelegatorValidatorsRequest=} [properties] Properties to set + */ + function QueryDelegatorValidatorsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryDelegatorValidatorsRequest delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest + * @instance + */ + QueryDelegatorValidatorsRequest.prototype.delegatorAddress = ""; + + /** + * Creates a new QueryDelegatorValidatorsRequest instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest + * @static + * @param {cosmos.distribution.v1beta1.IQueryDelegatorValidatorsRequest=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest} QueryDelegatorValidatorsRequest instance + */ + QueryDelegatorValidatorsRequest.create = function create(properties) { + return new QueryDelegatorValidatorsRequest(properties); + }; + + /** + * Encodes the specified QueryDelegatorValidatorsRequest message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest + * @static + * @param {cosmos.distribution.v1beta1.IQueryDelegatorValidatorsRequest} message QueryDelegatorValidatorsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegatorValidatorsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + return writer; + }; + + /** + * Encodes the specified QueryDelegatorValidatorsRequest message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest + * @static + * @param {cosmos.distribution.v1beta1.IQueryDelegatorValidatorsRequest} message QueryDelegatorValidatorsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegatorValidatorsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDelegatorValidatorsRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest} QueryDelegatorValidatorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegatorValidatorsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDelegatorValidatorsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest} QueryDelegatorValidatorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegatorValidatorsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDelegatorValidatorsRequest message. + * @function verify + * @memberof cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDelegatorValidatorsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + return null; + }; + + /** + * Creates a QueryDelegatorValidatorsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest} QueryDelegatorValidatorsRequest + */ + QueryDelegatorValidatorsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest) + return object; + let message = new $root.cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + return message; + }; + + /** + * Creates a plain object from a QueryDelegatorValidatorsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest + * @static + * @param {cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest} message QueryDelegatorValidatorsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDelegatorValidatorsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.delegatorAddress = ""; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + return object; + }; + + /** + * Converts this QueryDelegatorValidatorsRequest to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryDelegatorValidatorsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryDelegatorValidatorsRequest; + })(v1beta1.QueryDelegatorValidatorsRequest || {}); + + v1beta1.QueryDelegatorValidatorsResponse = (function(QueryDelegatorValidatorsResponse) { + + /** + * Properties of a QueryDelegatorValidatorsResponse. + * @memberof cosmos.distribution.v1beta1 + * @interface IQueryDelegatorValidatorsResponse + * @property {Array.|null} [validators] QueryDelegatorValidatorsResponse validators + */ + + /** + * Constructs a new QueryDelegatorValidatorsResponse. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a QueryDelegatorValidatorsResponse. + * @implements IQueryDelegatorValidatorsResponse + * @constructor + * @param {cosmos.distribution.v1beta1.IQueryDelegatorValidatorsResponse=} [properties] Properties to set + */ + function QueryDelegatorValidatorsResponse(properties) { + this.validators = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryDelegatorValidatorsResponse validators. + * @member {Array.} validators + * @memberof cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse + * @instance + */ + QueryDelegatorValidatorsResponse.prototype.validators = $util.emptyArray; + + /** + * Creates a new QueryDelegatorValidatorsResponse instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse + * @static + * @param {cosmos.distribution.v1beta1.IQueryDelegatorValidatorsResponse=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse} QueryDelegatorValidatorsResponse instance + */ + QueryDelegatorValidatorsResponse.create = function create(properties) { + return new QueryDelegatorValidatorsResponse(properties); + }; + + /** + * Encodes the specified QueryDelegatorValidatorsResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse + * @static + * @param {cosmos.distribution.v1beta1.IQueryDelegatorValidatorsResponse} message QueryDelegatorValidatorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegatorValidatorsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validators != null && message.validators.length) + for (let i = 0; i < message.validators.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.validators[i]); + return writer; + }; + + /** + * Encodes the specified QueryDelegatorValidatorsResponse message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse + * @static + * @param {cosmos.distribution.v1beta1.IQueryDelegatorValidatorsResponse} message QueryDelegatorValidatorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegatorValidatorsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDelegatorValidatorsResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse} QueryDelegatorValidatorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegatorValidatorsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.validators && message.validators.length)) + message.validators = []; + message.validators.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDelegatorValidatorsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse} QueryDelegatorValidatorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegatorValidatorsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDelegatorValidatorsResponse message. + * @function verify + * @memberof cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDelegatorValidatorsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validators != null && message.hasOwnProperty("validators")) { + if (!Array.isArray(message.validators)) + return "validators: array expected"; + for (let i = 0; i < message.validators.length; ++i) + if (!$util.isString(message.validators[i])) + return "validators: string[] expected"; + } + return null; + }; + + /** + * Creates a QueryDelegatorValidatorsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse} QueryDelegatorValidatorsResponse + */ + QueryDelegatorValidatorsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse) + return object; + let message = new $root.cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse(); + if (object.validators) { + if (!Array.isArray(object.validators)) + throw TypeError(".cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse.validators: array expected"); + message.validators = []; + for (let i = 0; i < object.validators.length; ++i) + message.validators[i] = String(object.validators[i]); + } + return message; + }; + + /** + * Creates a plain object from a QueryDelegatorValidatorsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse + * @static + * @param {cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse} message QueryDelegatorValidatorsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDelegatorValidatorsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.validators = []; + if (message.validators && message.validators.length) { + object.validators = []; + for (let j = 0; j < message.validators.length; ++j) + object.validators[j] = message.validators[j]; + } + return object; + }; + + /** + * Converts this QueryDelegatorValidatorsResponse to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryDelegatorValidatorsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryDelegatorValidatorsResponse; + })(v1beta1.QueryDelegatorValidatorsResponse || {}); + + v1beta1.QueryDelegatorWithdrawAddressRequest = (function(QueryDelegatorWithdrawAddressRequest) { + + /** + * Properties of a QueryDelegatorWithdrawAddressRequest. + * @memberof cosmos.distribution.v1beta1 + * @interface IQueryDelegatorWithdrawAddressRequest + * @property {string|null} [delegatorAddress] QueryDelegatorWithdrawAddressRequest delegatorAddress + */ + + /** + * Constructs a new QueryDelegatorWithdrawAddressRequest. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a QueryDelegatorWithdrawAddressRequest. + * @implements IQueryDelegatorWithdrawAddressRequest + * @constructor + * @param {cosmos.distribution.v1beta1.IQueryDelegatorWithdrawAddressRequest=} [properties] Properties to set + */ + function QueryDelegatorWithdrawAddressRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryDelegatorWithdrawAddressRequest delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest + * @instance + */ + QueryDelegatorWithdrawAddressRequest.prototype.delegatorAddress = ""; + + /** + * Creates a new QueryDelegatorWithdrawAddressRequest instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest + * @static + * @param {cosmos.distribution.v1beta1.IQueryDelegatorWithdrawAddressRequest=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest} QueryDelegatorWithdrawAddressRequest instance + */ + QueryDelegatorWithdrawAddressRequest.create = function create(properties) { + return new QueryDelegatorWithdrawAddressRequest(properties); + }; + + /** + * Encodes the specified QueryDelegatorWithdrawAddressRequest message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest + * @static + * @param {cosmos.distribution.v1beta1.IQueryDelegatorWithdrawAddressRequest} message QueryDelegatorWithdrawAddressRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegatorWithdrawAddressRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + return writer; + }; + + /** + * Encodes the specified QueryDelegatorWithdrawAddressRequest message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest + * @static + * @param {cosmos.distribution.v1beta1.IQueryDelegatorWithdrawAddressRequest} message QueryDelegatorWithdrawAddressRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegatorWithdrawAddressRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDelegatorWithdrawAddressRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest} QueryDelegatorWithdrawAddressRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegatorWithdrawAddressRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDelegatorWithdrawAddressRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest} QueryDelegatorWithdrawAddressRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegatorWithdrawAddressRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDelegatorWithdrawAddressRequest message. + * @function verify + * @memberof cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDelegatorWithdrawAddressRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + return null; + }; + + /** + * Creates a QueryDelegatorWithdrawAddressRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest} QueryDelegatorWithdrawAddressRequest + */ + QueryDelegatorWithdrawAddressRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest) + return object; + let message = new $root.cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + return message; + }; + + /** + * Creates a plain object from a QueryDelegatorWithdrawAddressRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest + * @static + * @param {cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest} message QueryDelegatorWithdrawAddressRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDelegatorWithdrawAddressRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.delegatorAddress = ""; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + return object; + }; + + /** + * Converts this QueryDelegatorWithdrawAddressRequest to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest + * @instance + * @returns {Object.} JSON object + */ + QueryDelegatorWithdrawAddressRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryDelegatorWithdrawAddressRequest; + })(v1beta1.QueryDelegatorWithdrawAddressRequest || {}); + + v1beta1.QueryDelegatorWithdrawAddressResponse = (function(QueryDelegatorWithdrawAddressResponse) { + + /** + * Properties of a QueryDelegatorWithdrawAddressResponse. + * @memberof cosmos.distribution.v1beta1 + * @interface IQueryDelegatorWithdrawAddressResponse + * @property {string|null} [withdrawAddress] QueryDelegatorWithdrawAddressResponse withdrawAddress + */ + + /** + * Constructs a new QueryDelegatorWithdrawAddressResponse. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a QueryDelegatorWithdrawAddressResponse. + * @implements IQueryDelegatorWithdrawAddressResponse + * @constructor + * @param {cosmos.distribution.v1beta1.IQueryDelegatorWithdrawAddressResponse=} [properties] Properties to set + */ + function QueryDelegatorWithdrawAddressResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryDelegatorWithdrawAddressResponse withdrawAddress. + * @member {string} withdrawAddress + * @memberof cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse + * @instance + */ + QueryDelegatorWithdrawAddressResponse.prototype.withdrawAddress = ""; + + /** + * Creates a new QueryDelegatorWithdrawAddressResponse instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse + * @static + * @param {cosmos.distribution.v1beta1.IQueryDelegatorWithdrawAddressResponse=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse} QueryDelegatorWithdrawAddressResponse instance + */ + QueryDelegatorWithdrawAddressResponse.create = function create(properties) { + return new QueryDelegatorWithdrawAddressResponse(properties); + }; + + /** + * Encodes the specified QueryDelegatorWithdrawAddressResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse + * @static + * @param {cosmos.distribution.v1beta1.IQueryDelegatorWithdrawAddressResponse} message QueryDelegatorWithdrawAddressResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegatorWithdrawAddressResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.withdrawAddress != null && Object.hasOwnProperty.call(message, "withdrawAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.withdrawAddress); + return writer; + }; + + /** + * Encodes the specified QueryDelegatorWithdrawAddressResponse message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse + * @static + * @param {cosmos.distribution.v1beta1.IQueryDelegatorWithdrawAddressResponse} message QueryDelegatorWithdrawAddressResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegatorWithdrawAddressResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDelegatorWithdrawAddressResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse} QueryDelegatorWithdrawAddressResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegatorWithdrawAddressResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.withdrawAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDelegatorWithdrawAddressResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse} QueryDelegatorWithdrawAddressResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegatorWithdrawAddressResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDelegatorWithdrawAddressResponse message. + * @function verify + * @memberof cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDelegatorWithdrawAddressResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.withdrawAddress != null && message.hasOwnProperty("withdrawAddress")) + if (!$util.isString(message.withdrawAddress)) + return "withdrawAddress: string expected"; + return null; + }; + + /** + * Creates a QueryDelegatorWithdrawAddressResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse} QueryDelegatorWithdrawAddressResponse + */ + QueryDelegatorWithdrawAddressResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse) + return object; + let message = new $root.cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse(); + if (object.withdrawAddress != null) + message.withdrawAddress = String(object.withdrawAddress); + return message; + }; + + /** + * Creates a plain object from a QueryDelegatorWithdrawAddressResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse + * @static + * @param {cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse} message QueryDelegatorWithdrawAddressResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDelegatorWithdrawAddressResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.withdrawAddress = ""; + if (message.withdrawAddress != null && message.hasOwnProperty("withdrawAddress")) + object.withdrawAddress = message.withdrawAddress; + return object; + }; + + /** + * Converts this QueryDelegatorWithdrawAddressResponse to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse + * @instance + * @returns {Object.} JSON object + */ + QueryDelegatorWithdrawAddressResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryDelegatorWithdrawAddressResponse; + })(v1beta1.QueryDelegatorWithdrawAddressResponse || {}); + + v1beta1.QueryCommunityPoolRequest = (function(QueryCommunityPoolRequest) { + + /** + * Properties of a QueryCommunityPoolRequest. + * @memberof cosmos.distribution.v1beta1 + * @interface IQueryCommunityPoolRequest + */ + + /** + * Constructs a new QueryCommunityPoolRequest. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a QueryCommunityPoolRequest. + * @implements IQueryCommunityPoolRequest + * @constructor + * @param {cosmos.distribution.v1beta1.IQueryCommunityPoolRequest=} [properties] Properties to set + */ + function QueryCommunityPoolRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new QueryCommunityPoolRequest instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.QueryCommunityPoolRequest + * @static + * @param {cosmos.distribution.v1beta1.IQueryCommunityPoolRequest=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.QueryCommunityPoolRequest} QueryCommunityPoolRequest instance + */ + QueryCommunityPoolRequest.create = function create(properties) { + return new QueryCommunityPoolRequest(properties); + }; + + /** + * Encodes the specified QueryCommunityPoolRequest message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryCommunityPoolRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.QueryCommunityPoolRequest + * @static + * @param {cosmos.distribution.v1beta1.IQueryCommunityPoolRequest} message QueryCommunityPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryCommunityPoolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified QueryCommunityPoolRequest message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.QueryCommunityPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryCommunityPoolRequest + * @static + * @param {cosmos.distribution.v1beta1.IQueryCommunityPoolRequest} message QueryCommunityPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryCommunityPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryCommunityPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.QueryCommunityPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.QueryCommunityPoolRequest} QueryCommunityPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryCommunityPoolRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.QueryCommunityPoolRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryCommunityPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryCommunityPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.QueryCommunityPoolRequest} QueryCommunityPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryCommunityPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryCommunityPoolRequest message. + * @function verify + * @memberof cosmos.distribution.v1beta1.QueryCommunityPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryCommunityPoolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a QueryCommunityPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.QueryCommunityPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.QueryCommunityPoolRequest} QueryCommunityPoolRequest + */ + QueryCommunityPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.QueryCommunityPoolRequest) + return object; + return new $root.cosmos.distribution.v1beta1.QueryCommunityPoolRequest(); + }; + + /** + * Creates a plain object from a QueryCommunityPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.QueryCommunityPoolRequest + * @static + * @param {cosmos.distribution.v1beta1.QueryCommunityPoolRequest} message QueryCommunityPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryCommunityPoolRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this QueryCommunityPoolRequest to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.QueryCommunityPoolRequest + * @instance + * @returns {Object.} JSON object + */ + QueryCommunityPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryCommunityPoolRequest; + })(v1beta1.QueryCommunityPoolRequest || {}); + + v1beta1.QueryCommunityPoolResponse = (function(QueryCommunityPoolResponse) { + + /** + * Properties of a QueryCommunityPoolResponse. + * @memberof cosmos.distribution.v1beta1 + * @interface IQueryCommunityPoolResponse + * @property {Array.|null} [pool] QueryCommunityPoolResponse pool + */ + + /** + * Constructs a new QueryCommunityPoolResponse. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a QueryCommunityPoolResponse. + * @implements IQueryCommunityPoolResponse + * @constructor + * @param {cosmos.distribution.v1beta1.IQueryCommunityPoolResponse=} [properties] Properties to set + */ + function QueryCommunityPoolResponse(properties) { + this.pool = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryCommunityPoolResponse pool. + * @member {Array.} pool + * @memberof cosmos.distribution.v1beta1.QueryCommunityPoolResponse + * @instance + */ + QueryCommunityPoolResponse.prototype.pool = $util.emptyArray; + + /** + * Creates a new QueryCommunityPoolResponse instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.QueryCommunityPoolResponse + * @static + * @param {cosmos.distribution.v1beta1.IQueryCommunityPoolResponse=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.QueryCommunityPoolResponse} QueryCommunityPoolResponse instance + */ + QueryCommunityPoolResponse.create = function create(properties) { + return new QueryCommunityPoolResponse(properties); + }; + + /** + * Encodes the specified QueryCommunityPoolResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryCommunityPoolResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.QueryCommunityPoolResponse + * @static + * @param {cosmos.distribution.v1beta1.IQueryCommunityPoolResponse} message QueryCommunityPoolResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryCommunityPoolResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pool != null && message.pool.length) + for (let i = 0; i < message.pool.length; ++i) + $root.cosmos.base.v1beta1.DecCoin.encode(message.pool[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryCommunityPoolResponse message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.QueryCommunityPoolResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryCommunityPoolResponse + * @static + * @param {cosmos.distribution.v1beta1.IQueryCommunityPoolResponse} message QueryCommunityPoolResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryCommunityPoolResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryCommunityPoolResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.QueryCommunityPoolResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.QueryCommunityPoolResponse} QueryCommunityPoolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryCommunityPoolResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.QueryCommunityPoolResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.pool && message.pool.length)) + message.pool = []; + message.pool.push($root.cosmos.base.v1beta1.DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryCommunityPoolResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.QueryCommunityPoolResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.QueryCommunityPoolResponse} QueryCommunityPoolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryCommunityPoolResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryCommunityPoolResponse message. + * @function verify + * @memberof cosmos.distribution.v1beta1.QueryCommunityPoolResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryCommunityPoolResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pool != null && message.hasOwnProperty("pool")) { + if (!Array.isArray(message.pool)) + return "pool: array expected"; + for (let i = 0; i < message.pool.length; ++i) { + let error = $root.cosmos.base.v1beta1.DecCoin.verify(message.pool[i]); + if (error) + return "pool." + error; + } + } + return null; + }; + + /** + * Creates a QueryCommunityPoolResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.QueryCommunityPoolResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.QueryCommunityPoolResponse} QueryCommunityPoolResponse + */ + QueryCommunityPoolResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.QueryCommunityPoolResponse) + return object; + let message = new $root.cosmos.distribution.v1beta1.QueryCommunityPoolResponse(); + if (object.pool) { + if (!Array.isArray(object.pool)) + throw TypeError(".cosmos.distribution.v1beta1.QueryCommunityPoolResponse.pool: array expected"); + message.pool = []; + for (let i = 0; i < object.pool.length; ++i) { + if (typeof object.pool[i] !== "object") + throw TypeError(".cosmos.distribution.v1beta1.QueryCommunityPoolResponse.pool: object expected"); + message.pool[i] = $root.cosmos.base.v1beta1.DecCoin.fromObject(object.pool[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a QueryCommunityPoolResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.QueryCommunityPoolResponse + * @static + * @param {cosmos.distribution.v1beta1.QueryCommunityPoolResponse} message QueryCommunityPoolResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryCommunityPoolResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.pool = []; + if (message.pool && message.pool.length) { + object.pool = []; + for (let j = 0; j < message.pool.length; ++j) + object.pool[j] = $root.cosmos.base.v1beta1.DecCoin.toObject(message.pool[j], options); + } + return object; + }; + + /** + * Converts this QueryCommunityPoolResponse to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.QueryCommunityPoolResponse + * @instance + * @returns {Object.} JSON object + */ + QueryCommunityPoolResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryCommunityPoolResponse; + })(v1beta1.QueryCommunityPoolResponse || {}); + + v1beta1.Msg = (function(Msg) { + + /** + * Constructs a new Msg service. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a Msg + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Msg(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; + + /** + * Creates new Msg service using the specified rpc implementation. + * @function create + * @memberof cosmos.distribution.v1beta1.Msg + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Msg} RPC service. Useful where requests and/or responses are streamed. + */ + Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.distribution.v1beta1.Msg#setWithdrawAddress}. + * @memberof cosmos.distribution.v1beta1.Msg + * @typedef SetWithdrawAddressCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddressResponse} [response] MsgSetWithdrawAddressResponse + */ + + /** + * Calls SetWithdrawAddress. + * @function setWithdrawAddress + * @memberof cosmos.distribution.v1beta1.Msg + * @instance + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddress} request MsgSetWithdrawAddress message or plain object + * @param {cosmos.distribution.v1beta1.Msg.SetWithdrawAddressCallback} callback Node-style callback called with the error, if any, and MsgSetWithdrawAddressResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.setWithdrawAddress = function setWithdrawAddress(request, callback) { + return this.rpcCall(setWithdrawAddress, $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddress, $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse, request, callback); + }, "name", { value: "SetWithdrawAddress" }); + + /** + * Calls SetWithdrawAddress. + * @function setWithdrawAddress + * @memberof cosmos.distribution.v1beta1.Msg + * @instance + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddress} request MsgSetWithdrawAddress message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.distribution.v1beta1.Msg#withdrawDelegatorReward}. + * @memberof cosmos.distribution.v1beta1.Msg + * @typedef WithdrawDelegatorRewardCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorRewardResponse} [response] MsgWithdrawDelegatorRewardResponse + */ + + /** + * Calls WithdrawDelegatorReward. + * @function withdrawDelegatorReward + * @memberof cosmos.distribution.v1beta1.Msg + * @instance + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorReward} request MsgWithdrawDelegatorReward message or plain object + * @param {cosmos.distribution.v1beta1.Msg.WithdrawDelegatorRewardCallback} callback Node-style callback called with the error, if any, and MsgWithdrawDelegatorRewardResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.withdrawDelegatorReward = function withdrawDelegatorReward(request, callback) { + return this.rpcCall(withdrawDelegatorReward, $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward, $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse, request, callback); + }, "name", { value: "WithdrawDelegatorReward" }); + + /** + * Calls WithdrawDelegatorReward. + * @function withdrawDelegatorReward + * @memberof cosmos.distribution.v1beta1.Msg + * @instance + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorReward} request MsgWithdrawDelegatorReward message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.distribution.v1beta1.Msg#withdrawValidatorCommission}. + * @memberof cosmos.distribution.v1beta1.Msg + * @typedef WithdrawValidatorCommissionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommissionResponse} [response] MsgWithdrawValidatorCommissionResponse + */ + + /** + * Calls WithdrawValidatorCommission. + * @function withdrawValidatorCommission + * @memberof cosmos.distribution.v1beta1.Msg + * @instance + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommission} request MsgWithdrawValidatorCommission message or plain object + * @param {cosmos.distribution.v1beta1.Msg.WithdrawValidatorCommissionCallback} callback Node-style callback called with the error, if any, and MsgWithdrawValidatorCommissionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.withdrawValidatorCommission = function withdrawValidatorCommission(request, callback) { + return this.rpcCall(withdrawValidatorCommission, $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission, $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse, request, callback); + }, "name", { value: "WithdrawValidatorCommission" }); + + /** + * Calls WithdrawValidatorCommission. + * @function withdrawValidatorCommission + * @memberof cosmos.distribution.v1beta1.Msg + * @instance + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommission} request MsgWithdrawValidatorCommission message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.distribution.v1beta1.Msg#fundCommunityPool}. + * @memberof cosmos.distribution.v1beta1.Msg + * @typedef FundCommunityPoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPoolResponse} [response] MsgFundCommunityPoolResponse + */ + + /** + * Calls FundCommunityPool. + * @function fundCommunityPool + * @memberof cosmos.distribution.v1beta1.Msg + * @instance + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPool} request MsgFundCommunityPool message or plain object + * @param {cosmos.distribution.v1beta1.Msg.FundCommunityPoolCallback} callback Node-style callback called with the error, if any, and MsgFundCommunityPoolResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.fundCommunityPool = function fundCommunityPool(request, callback) { + return this.rpcCall(fundCommunityPool, $root.cosmos.distribution.v1beta1.MsgFundCommunityPool, $root.cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse, request, callback); + }, "name", { value: "FundCommunityPool" }); + + /** + * Calls FundCommunityPool. + * @function fundCommunityPool + * @memberof cosmos.distribution.v1beta1.Msg + * @instance + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPool} request MsgFundCommunityPool message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Msg; + })(v1beta1.Msg || {}); + + v1beta1.MsgSetWithdrawAddress = (function(MsgSetWithdrawAddress) { + + /** + * Properties of a MsgSetWithdrawAddress. + * @memberof cosmos.distribution.v1beta1 + * @interface IMsgSetWithdrawAddress + * @property {string|null} [delegatorAddress] MsgSetWithdrawAddress delegatorAddress + * @property {string|null} [withdrawAddress] MsgSetWithdrawAddress withdrawAddress + */ + + /** + * Constructs a new MsgSetWithdrawAddress. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a MsgSetWithdrawAddress. + * @implements IMsgSetWithdrawAddress + * @constructor + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddress=} [properties] Properties to set + */ + function MsgSetWithdrawAddress(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgSetWithdrawAddress delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @instance + */ + MsgSetWithdrawAddress.prototype.delegatorAddress = ""; + + /** + * MsgSetWithdrawAddress withdrawAddress. + * @member {string} withdrawAddress + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @instance + */ + MsgSetWithdrawAddress.prototype.withdrawAddress = ""; + + /** + * Creates a new MsgSetWithdrawAddress instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @static + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddress=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.MsgSetWithdrawAddress} MsgSetWithdrawAddress instance + */ + MsgSetWithdrawAddress.create = function create(properties) { + return new MsgSetWithdrawAddress(properties); + }; + + /** + * Encodes the specified MsgSetWithdrawAddress message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgSetWithdrawAddress.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @static + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddress} message MsgSetWithdrawAddress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSetWithdrawAddress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.withdrawAddress != null && Object.hasOwnProperty.call(message, "withdrawAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.withdrawAddress); + return writer; + }; + + /** + * Encodes the specified MsgSetWithdrawAddress message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.MsgSetWithdrawAddress.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @static + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddress} message MsgSetWithdrawAddress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSetWithdrawAddress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgSetWithdrawAddress message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.MsgSetWithdrawAddress} MsgSetWithdrawAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSetWithdrawAddress.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddress(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.withdrawAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgSetWithdrawAddress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.MsgSetWithdrawAddress} MsgSetWithdrawAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSetWithdrawAddress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgSetWithdrawAddress message. + * @function verify + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgSetWithdrawAddress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.withdrawAddress != null && message.hasOwnProperty("withdrawAddress")) + if (!$util.isString(message.withdrawAddress)) + return "withdrawAddress: string expected"; + return null; + }; + + /** + * Creates a MsgSetWithdrawAddress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.MsgSetWithdrawAddress} MsgSetWithdrawAddress + */ + MsgSetWithdrawAddress.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddress) + return object; + let message = new $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddress(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.withdrawAddress != null) + message.withdrawAddress = String(object.withdrawAddress); + return message; + }; + + /** + * Creates a plain object from a MsgSetWithdrawAddress message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @static + * @param {cosmos.distribution.v1beta1.MsgSetWithdrawAddress} message MsgSetWithdrawAddress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSetWithdrawAddress.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.delegatorAddress = ""; + object.withdrawAddress = ""; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.withdrawAddress != null && message.hasOwnProperty("withdrawAddress")) + object.withdrawAddress = message.withdrawAddress; + return object; + }; + + /** + * Converts this MsgSetWithdrawAddress to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress + * @instance + * @returns {Object.} JSON object + */ + MsgSetWithdrawAddress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgSetWithdrawAddress; + })(v1beta1.MsgSetWithdrawAddress || {}); + + v1beta1.MsgSetWithdrawAddressResponse = (function(MsgSetWithdrawAddressResponse) { + + /** + * Properties of a MsgSetWithdrawAddressResponse. + * @memberof cosmos.distribution.v1beta1 + * @interface IMsgSetWithdrawAddressResponse + */ + + /** + * Constructs a new MsgSetWithdrawAddressResponse. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a MsgSetWithdrawAddressResponse. + * @implements IMsgSetWithdrawAddressResponse + * @constructor + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddressResponse=} [properties] Properties to set + */ + function MsgSetWithdrawAddressResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgSetWithdrawAddressResponse instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddressResponse=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse} MsgSetWithdrawAddressResponse instance + */ + MsgSetWithdrawAddressResponse.create = function create(properties) { + return new MsgSetWithdrawAddressResponse(properties); + }; + + /** + * Encodes the specified MsgSetWithdrawAddressResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddressResponse} message MsgSetWithdrawAddressResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSetWithdrawAddressResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgSetWithdrawAddressResponse message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddressResponse} message MsgSetWithdrawAddressResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSetWithdrawAddressResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgSetWithdrawAddressResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse} MsgSetWithdrawAddressResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSetWithdrawAddressResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgSetWithdrawAddressResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse} MsgSetWithdrawAddressResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSetWithdrawAddressResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgSetWithdrawAddressResponse message. + * @function verify + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgSetWithdrawAddressResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgSetWithdrawAddressResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse} MsgSetWithdrawAddressResponse + */ + MsgSetWithdrawAddressResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse) + return object; + return new $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse(); + }; + + /** + * Creates a plain object from a MsgSetWithdrawAddressResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse + * @static + * @param {cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse} message MsgSetWithdrawAddressResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSetWithdrawAddressResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgSetWithdrawAddressResponse to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse + * @instance + * @returns {Object.} JSON object + */ + MsgSetWithdrawAddressResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgSetWithdrawAddressResponse; + })(v1beta1.MsgSetWithdrawAddressResponse || {}); + + v1beta1.MsgWithdrawDelegatorReward = (function(MsgWithdrawDelegatorReward) { + + /** + * Properties of a MsgWithdrawDelegatorReward. + * @memberof cosmos.distribution.v1beta1 + * @interface IMsgWithdrawDelegatorReward + * @property {string|null} [delegatorAddress] MsgWithdrawDelegatorReward delegatorAddress + * @property {string|null} [validatorAddress] MsgWithdrawDelegatorReward validatorAddress + */ + + /** + * Constructs a new MsgWithdrawDelegatorReward. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a MsgWithdrawDelegatorReward. + * @implements IMsgWithdrawDelegatorReward + * @constructor + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorReward=} [properties] Properties to set + */ + function MsgWithdrawDelegatorReward(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgWithdrawDelegatorReward delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @instance + */ + MsgWithdrawDelegatorReward.prototype.delegatorAddress = ""; + + /** + * MsgWithdrawDelegatorReward validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @instance + */ + MsgWithdrawDelegatorReward.prototype.validatorAddress = ""; + + /** + * Creates a new MsgWithdrawDelegatorReward instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorReward=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward} MsgWithdrawDelegatorReward instance + */ + MsgWithdrawDelegatorReward.create = function create(properties) { + return new MsgWithdrawDelegatorReward(properties); + }; + + /** + * Encodes the specified MsgWithdrawDelegatorReward message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorReward} message MsgWithdrawDelegatorReward message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgWithdrawDelegatorReward.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddress); + return writer; + }; + + /** + * Encodes the specified MsgWithdrawDelegatorReward message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorReward} message MsgWithdrawDelegatorReward message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgWithdrawDelegatorReward.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgWithdrawDelegatorReward message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward} MsgWithdrawDelegatorReward + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgWithdrawDelegatorReward.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgWithdrawDelegatorReward message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward} MsgWithdrawDelegatorReward + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgWithdrawDelegatorReward.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgWithdrawDelegatorReward message. + * @function verify + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgWithdrawDelegatorReward.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + return null; + }; + + /** + * Creates a MsgWithdrawDelegatorReward message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward} MsgWithdrawDelegatorReward + */ + MsgWithdrawDelegatorReward.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward) + return object; + let message = new $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + return message; + }; + + /** + * Creates a plain object from a MsgWithdrawDelegatorReward message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @static + * @param {cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward} message MsgWithdrawDelegatorReward + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgWithdrawDelegatorReward.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.delegatorAddress = ""; + object.validatorAddress = ""; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + return object; + }; + + /** + * Converts this MsgWithdrawDelegatorReward to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward + * @instance + * @returns {Object.} JSON object + */ + MsgWithdrawDelegatorReward.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgWithdrawDelegatorReward; + })(v1beta1.MsgWithdrawDelegatorReward || {}); + + v1beta1.MsgWithdrawDelegatorRewardResponse = (function(MsgWithdrawDelegatorRewardResponse) { + + /** + * Properties of a MsgWithdrawDelegatorRewardResponse. + * @memberof cosmos.distribution.v1beta1 + * @interface IMsgWithdrawDelegatorRewardResponse + */ + + /** + * Constructs a new MsgWithdrawDelegatorRewardResponse. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a MsgWithdrawDelegatorRewardResponse. + * @implements IMsgWithdrawDelegatorRewardResponse + * @constructor + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorRewardResponse=} [properties] Properties to set + */ + function MsgWithdrawDelegatorRewardResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgWithdrawDelegatorRewardResponse instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorRewardResponse=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse} MsgWithdrawDelegatorRewardResponse instance + */ + MsgWithdrawDelegatorRewardResponse.create = function create(properties) { + return new MsgWithdrawDelegatorRewardResponse(properties); + }; + + /** + * Encodes the specified MsgWithdrawDelegatorRewardResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorRewardResponse} message MsgWithdrawDelegatorRewardResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgWithdrawDelegatorRewardResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgWithdrawDelegatorRewardResponse message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorRewardResponse} message MsgWithdrawDelegatorRewardResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgWithdrawDelegatorRewardResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgWithdrawDelegatorRewardResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse} MsgWithdrawDelegatorRewardResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgWithdrawDelegatorRewardResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgWithdrawDelegatorRewardResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse} MsgWithdrawDelegatorRewardResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgWithdrawDelegatorRewardResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgWithdrawDelegatorRewardResponse message. + * @function verify + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgWithdrawDelegatorRewardResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgWithdrawDelegatorRewardResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse} MsgWithdrawDelegatorRewardResponse + */ + MsgWithdrawDelegatorRewardResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse) + return object; + return new $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse(); + }; + + /** + * Creates a plain object from a MsgWithdrawDelegatorRewardResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse + * @static + * @param {cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse} message MsgWithdrawDelegatorRewardResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgWithdrawDelegatorRewardResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgWithdrawDelegatorRewardResponse to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse + * @instance + * @returns {Object.} JSON object + */ + MsgWithdrawDelegatorRewardResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgWithdrawDelegatorRewardResponse; + })(v1beta1.MsgWithdrawDelegatorRewardResponse || {}); + + v1beta1.MsgWithdrawValidatorCommission = (function(MsgWithdrawValidatorCommission) { + + /** + * Properties of a MsgWithdrawValidatorCommission. + * @memberof cosmos.distribution.v1beta1 + * @interface IMsgWithdrawValidatorCommission + * @property {string|null} [validatorAddress] MsgWithdrawValidatorCommission validatorAddress + */ + + /** + * Constructs a new MsgWithdrawValidatorCommission. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a MsgWithdrawValidatorCommission. + * @implements IMsgWithdrawValidatorCommission + * @constructor + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommission=} [properties] Properties to set + */ + function MsgWithdrawValidatorCommission(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgWithdrawValidatorCommission validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission + * @instance + */ + MsgWithdrawValidatorCommission.prototype.validatorAddress = ""; + + /** + * Creates a new MsgWithdrawValidatorCommission instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommission=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission} MsgWithdrawValidatorCommission instance + */ + MsgWithdrawValidatorCommission.create = function create(properties) { + return new MsgWithdrawValidatorCommission(properties); + }; + + /** + * Encodes the specified MsgWithdrawValidatorCommission message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommission} message MsgWithdrawValidatorCommission message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgWithdrawValidatorCommission.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.validatorAddress); + return writer; + }; + + /** + * Encodes the specified MsgWithdrawValidatorCommission message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommission} message MsgWithdrawValidatorCommission message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgWithdrawValidatorCommission.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgWithdrawValidatorCommission message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission} MsgWithdrawValidatorCommission + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgWithdrawValidatorCommission.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgWithdrawValidatorCommission message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission} MsgWithdrawValidatorCommission + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgWithdrawValidatorCommission.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgWithdrawValidatorCommission message. + * @function verify + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgWithdrawValidatorCommission.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + return null; + }; + + /** + * Creates a MsgWithdrawValidatorCommission message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission} MsgWithdrawValidatorCommission + */ + MsgWithdrawValidatorCommission.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission) + return object; + let message = new $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission(); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + return message; + }; + + /** + * Creates a plain object from a MsgWithdrawValidatorCommission message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission + * @static + * @param {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission} message MsgWithdrawValidatorCommission + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgWithdrawValidatorCommission.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.validatorAddress = ""; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + return object; + }; + + /** + * Converts this MsgWithdrawValidatorCommission to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission + * @instance + * @returns {Object.} JSON object + */ + MsgWithdrawValidatorCommission.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgWithdrawValidatorCommission; + })(v1beta1.MsgWithdrawValidatorCommission || {}); + + v1beta1.MsgWithdrawValidatorCommissionResponse = (function(MsgWithdrawValidatorCommissionResponse) { + + /** + * Properties of a MsgWithdrawValidatorCommissionResponse. + * @memberof cosmos.distribution.v1beta1 + * @interface IMsgWithdrawValidatorCommissionResponse + */ + + /** + * Constructs a new MsgWithdrawValidatorCommissionResponse. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a MsgWithdrawValidatorCommissionResponse. + * @implements IMsgWithdrawValidatorCommissionResponse + * @constructor + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommissionResponse=} [properties] Properties to set + */ + function MsgWithdrawValidatorCommissionResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgWithdrawValidatorCommissionResponse instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommissionResponse=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse} MsgWithdrawValidatorCommissionResponse instance + */ + MsgWithdrawValidatorCommissionResponse.create = function create(properties) { + return new MsgWithdrawValidatorCommissionResponse(properties); + }; + + /** + * Encodes the specified MsgWithdrawValidatorCommissionResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommissionResponse} message MsgWithdrawValidatorCommissionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgWithdrawValidatorCommissionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgWithdrawValidatorCommissionResponse message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommissionResponse} message MsgWithdrawValidatorCommissionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgWithdrawValidatorCommissionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgWithdrawValidatorCommissionResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse} MsgWithdrawValidatorCommissionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgWithdrawValidatorCommissionResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgWithdrawValidatorCommissionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse} MsgWithdrawValidatorCommissionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgWithdrawValidatorCommissionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgWithdrawValidatorCommissionResponse message. + * @function verify + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgWithdrawValidatorCommissionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgWithdrawValidatorCommissionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse} MsgWithdrawValidatorCommissionResponse + */ + MsgWithdrawValidatorCommissionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse) + return object; + return new $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse(); + }; + + /** + * Creates a plain object from a MsgWithdrawValidatorCommissionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse + * @static + * @param {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse} message MsgWithdrawValidatorCommissionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgWithdrawValidatorCommissionResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgWithdrawValidatorCommissionResponse to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse + * @instance + * @returns {Object.} JSON object + */ + MsgWithdrawValidatorCommissionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgWithdrawValidatorCommissionResponse; + })(v1beta1.MsgWithdrawValidatorCommissionResponse || {}); + + v1beta1.MsgFundCommunityPool = (function(MsgFundCommunityPool) { + + /** + * Properties of a MsgFundCommunityPool. + * @memberof cosmos.distribution.v1beta1 + * @interface IMsgFundCommunityPool + * @property {Array.|null} [amount] MsgFundCommunityPool amount + * @property {string|null} [depositor] MsgFundCommunityPool depositor + */ + + /** + * Constructs a new MsgFundCommunityPool. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a MsgFundCommunityPool. + * @implements IMsgFundCommunityPool + * @constructor + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPool=} [properties] Properties to set + */ + function MsgFundCommunityPool(properties) { + this.amount = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgFundCommunityPool amount. + * @member {Array.} amount + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @instance + */ + MsgFundCommunityPool.prototype.amount = $util.emptyArray; + + /** + * MsgFundCommunityPool depositor. + * @member {string} depositor + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @instance + */ + MsgFundCommunityPool.prototype.depositor = ""; + + /** + * Creates a new MsgFundCommunityPool instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @static + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPool=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.MsgFundCommunityPool} MsgFundCommunityPool instance + */ + MsgFundCommunityPool.create = function create(properties) { + return new MsgFundCommunityPool(properties); + }; + + /** + * Encodes the specified MsgFundCommunityPool message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgFundCommunityPool.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @static + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPool} message MsgFundCommunityPool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgFundCommunityPool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.amount != null && message.amount.length) + for (let i = 0; i < message.amount.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.amount[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.depositor != null && Object.hasOwnProperty.call(message, "depositor")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.depositor); + return writer; + }; + + /** + * Encodes the specified MsgFundCommunityPool message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.MsgFundCommunityPool.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @static + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPool} message MsgFundCommunityPool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgFundCommunityPool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgFundCommunityPool message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.MsgFundCommunityPool} MsgFundCommunityPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgFundCommunityPool.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.MsgFundCommunityPool(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.amount && message.amount.length)) + message.amount = []; + message.amount.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + case 2: + message.depositor = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgFundCommunityPool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.MsgFundCommunityPool} MsgFundCommunityPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgFundCommunityPool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgFundCommunityPool message. + * @function verify + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgFundCommunityPool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + if (!Array.isArray(message.amount)) + return "amount: array expected"; + for (let i = 0; i < message.amount.length; ++i) { + let error = $root.cosmos.base.v1beta1.Coin.verify(message.amount[i]); + if (error) + return "amount." + error; + } + } + if (message.depositor != null && message.hasOwnProperty("depositor")) + if (!$util.isString(message.depositor)) + return "depositor: string expected"; + return null; + }; + + /** + * Creates a MsgFundCommunityPool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.MsgFundCommunityPool} MsgFundCommunityPool + */ + MsgFundCommunityPool.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.MsgFundCommunityPool) + return object; + let message = new $root.cosmos.distribution.v1beta1.MsgFundCommunityPool(); + if (object.amount) { + if (!Array.isArray(object.amount)) + throw TypeError(".cosmos.distribution.v1beta1.MsgFundCommunityPool.amount: array expected"); + message.amount = []; + for (let i = 0; i < object.amount.length; ++i) { + if (typeof object.amount[i] !== "object") + throw TypeError(".cosmos.distribution.v1beta1.MsgFundCommunityPool.amount: object expected"); + message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]); + } + } + if (object.depositor != null) + message.depositor = String(object.depositor); + return message; + }; + + /** + * Creates a plain object from a MsgFundCommunityPool message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @static + * @param {cosmos.distribution.v1beta1.MsgFundCommunityPool} message MsgFundCommunityPool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgFundCommunityPool.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.amount = []; + if (options.defaults) + object.depositor = ""; + if (message.amount && message.amount.length) { + object.amount = []; + for (let j = 0; j < message.amount.length; ++j) + object.amount[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.amount[j], options); + } + if (message.depositor != null && message.hasOwnProperty("depositor")) + object.depositor = message.depositor; + return object; + }; + + /** + * Converts this MsgFundCommunityPool to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool + * @instance + * @returns {Object.} JSON object + */ + MsgFundCommunityPool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgFundCommunityPool; + })(v1beta1.MsgFundCommunityPool || {}); + + v1beta1.MsgFundCommunityPoolResponse = (function(MsgFundCommunityPoolResponse) { + + /** + * Properties of a MsgFundCommunityPoolResponse. + * @memberof cosmos.distribution.v1beta1 + * @interface IMsgFundCommunityPoolResponse + */ + + /** + * Constructs a new MsgFundCommunityPoolResponse. + * @memberof cosmos.distribution.v1beta1 + * @classdesc Represents a MsgFundCommunityPoolResponse. + * @implements IMsgFundCommunityPoolResponse + * @constructor + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPoolResponse=} [properties] Properties to set + */ + function MsgFundCommunityPoolResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgFundCommunityPoolResponse instance using the specified properties. + * @function create + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPoolResponse=} [properties] Properties to set + * @returns {cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse} MsgFundCommunityPoolResponse instance + */ + MsgFundCommunityPoolResponse.create = function create(properties) { + return new MsgFundCommunityPoolResponse(properties); + }; + + /** + * Encodes the specified MsgFundCommunityPoolResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPoolResponse} message MsgFundCommunityPoolResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgFundCommunityPoolResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgFundCommunityPoolResponse message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse + * @static + * @param {cosmos.distribution.v1beta1.IMsgFundCommunityPoolResponse} message MsgFundCommunityPoolResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgFundCommunityPoolResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgFundCommunityPoolResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse} MsgFundCommunityPoolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgFundCommunityPoolResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgFundCommunityPoolResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse} MsgFundCommunityPoolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgFundCommunityPoolResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgFundCommunityPoolResponse message. + * @function verify + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgFundCommunityPoolResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgFundCommunityPoolResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse} MsgFundCommunityPoolResponse + */ + MsgFundCommunityPoolResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse) + return object; + return new $root.cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse(); + }; + + /** + * Creates a plain object from a MsgFundCommunityPoolResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse + * @static + * @param {cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse} message MsgFundCommunityPoolResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgFundCommunityPoolResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgFundCommunityPoolResponse to JSON. + * @function toJSON + * @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse + * @instance + * @returns {Object.} JSON object + */ + MsgFundCommunityPoolResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgFundCommunityPoolResponse; + })(v1beta1.MsgFundCommunityPoolResponse || {}); + + return v1beta1; + })(distribution.v1beta1 || {}); + + return distribution; + })(cosmos.distribution || {}); + + /** + * Namespace evidence. + * @memberof cosmos + * @namespace + */ + + cosmos.evidence = (function(evidence) { + + /** + * Namespace v1beta1. + * @memberof cosmos.evidence + * @namespace + */ + + evidence.v1beta1 = (function(v1beta1) { + + v1beta1.Equivocation = (function(Equivocation) { + + /** + * Properties of an Equivocation. + * @memberof cosmos.evidence.v1beta1 + * @interface IEquivocation + * @property {number|Long|null} [height] Equivocation height + * @property {google.protobuf.ITimestamp|null} [time] Equivocation time + * @property {number|Long|null} [power] Equivocation power + * @property {string|null} [consensusAddress] Equivocation consensusAddress + */ + + /** + * Constructs a new Equivocation. + * @memberof cosmos.evidence.v1beta1 + * @classdesc Represents an Equivocation. + * @implements IEquivocation + * @constructor + * @param {cosmos.evidence.v1beta1.IEquivocation=} [properties] Properties to set + */ + function Equivocation(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Equivocation height. + * @member {number|Long} height + * @memberof cosmos.evidence.v1beta1.Equivocation + * @instance + */ + Equivocation.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Equivocation time. + * @member {google.protobuf.ITimestamp|null|undefined} time + * @memberof cosmos.evidence.v1beta1.Equivocation + * @instance + */ + Equivocation.prototype.time = null; + + /** + * Equivocation power. + * @member {number|Long} power + * @memberof cosmos.evidence.v1beta1.Equivocation + * @instance + */ + Equivocation.prototype.power = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Equivocation consensusAddress. + * @member {string} consensusAddress + * @memberof cosmos.evidence.v1beta1.Equivocation + * @instance + */ + Equivocation.prototype.consensusAddress = ""; + + /** + * Creates a new Equivocation instance using the specified properties. + * @function create + * @memberof cosmos.evidence.v1beta1.Equivocation + * @static + * @param {cosmos.evidence.v1beta1.IEquivocation=} [properties] Properties to set + * @returns {cosmos.evidence.v1beta1.Equivocation} Equivocation instance + */ + Equivocation.create = function create(properties) { + return new Equivocation(properties); + }; + + /** + * Encodes the specified Equivocation message. Does not implicitly {@link cosmos.evidence.v1beta1.Equivocation.verify|verify} messages. + * @function encode + * @memberof cosmos.evidence.v1beta1.Equivocation + * @static + * @param {cosmos.evidence.v1beta1.IEquivocation} message Equivocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Equivocation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.height); + if (message.time != null && Object.hasOwnProperty.call(message, "time")) + $root.google.protobuf.Timestamp.encode(message.time, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.power != null && Object.hasOwnProperty.call(message, "power")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.power); + if (message.consensusAddress != null && Object.hasOwnProperty.call(message, "consensusAddress")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.consensusAddress); + return writer; + }; + + /** + * Encodes the specified Equivocation message, length delimited. Does not implicitly {@link cosmos.evidence.v1beta1.Equivocation.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.evidence.v1beta1.Equivocation + * @static + * @param {cosmos.evidence.v1beta1.IEquivocation} message Equivocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Equivocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Equivocation message from the specified reader or buffer. + * @function decode + * @memberof cosmos.evidence.v1beta1.Equivocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.evidence.v1beta1.Equivocation} Equivocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Equivocation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.evidence.v1beta1.Equivocation(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + case 2: + message.time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.power = reader.int64(); + break; + case 4: + message.consensusAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Equivocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.evidence.v1beta1.Equivocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.evidence.v1beta1.Equivocation} Equivocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Equivocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Equivocation message. + * @function verify + * @memberof cosmos.evidence.v1beta1.Equivocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Equivocation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.time != null && message.hasOwnProperty("time")) { + let error = $root.google.protobuf.Timestamp.verify(message.time); + if (error) + return "time." + error; + } + if (message.power != null && message.hasOwnProperty("power")) + if (!$util.isInteger(message.power) && !(message.power && $util.isInteger(message.power.low) && $util.isInteger(message.power.high))) + return "power: integer|Long expected"; + if (message.consensusAddress != null && message.hasOwnProperty("consensusAddress")) + if (!$util.isString(message.consensusAddress)) + return "consensusAddress: string expected"; + return null; + }; + + /** + * Creates an Equivocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.evidence.v1beta1.Equivocation + * @static + * @param {Object.} object Plain object + * @returns {cosmos.evidence.v1beta1.Equivocation} Equivocation + */ + Equivocation.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.evidence.v1beta1.Equivocation) + return object; + let message = new $root.cosmos.evidence.v1beta1.Equivocation(); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + if (object.time != null) { + if (typeof object.time !== "object") + throw TypeError(".cosmos.evidence.v1beta1.Equivocation.time: object expected"); + message.time = $root.google.protobuf.Timestamp.fromObject(object.time); + } + if (object.power != null) + if ($util.Long) + (message.power = $util.Long.fromValue(object.power)).unsigned = false; + else if (typeof object.power === "string") + message.power = parseInt(object.power, 10); + else if (typeof object.power === "number") + message.power = object.power; + else if (typeof object.power === "object") + message.power = new $util.LongBits(object.power.low >>> 0, object.power.high >>> 0).toNumber(); + if (object.consensusAddress != null) + message.consensusAddress = String(object.consensusAddress); + return message; + }; + + /** + * Creates a plain object from an Equivocation message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.evidence.v1beta1.Equivocation + * @static + * @param {cosmos.evidence.v1beta1.Equivocation} message Equivocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Equivocation.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.time = null; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.power = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.power = options.longs === String ? "0" : 0; + object.consensusAddress = ""; + } + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + if (message.time != null && message.hasOwnProperty("time")) + object.time = $root.google.protobuf.Timestamp.toObject(message.time, options); + if (message.power != null && message.hasOwnProperty("power")) + if (typeof message.power === "number") + object.power = options.longs === String ? String(message.power) : message.power; + else + object.power = options.longs === String ? $util.Long.prototype.toString.call(message.power) : options.longs === Number ? new $util.LongBits(message.power.low >>> 0, message.power.high >>> 0).toNumber() : message.power; + if (message.consensusAddress != null && message.hasOwnProperty("consensusAddress")) + object.consensusAddress = message.consensusAddress; + return object; + }; + + /** + * Converts this Equivocation to JSON. + * @function toJSON + * @memberof cosmos.evidence.v1beta1.Equivocation + * @instance + * @returns {Object.} JSON object + */ + Equivocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Equivocation; + })(v1beta1.Equivocation || {}); + + v1beta1.GenesisState = (function(GenesisState) { + + /** + * Properties of a GenesisState. + * @memberof cosmos.evidence.v1beta1 + * @interface IGenesisState + * @property {Array.|null} [evidence] GenesisState evidence + */ + + /** + * Constructs a new GenesisState. + * @memberof cosmos.evidence.v1beta1 + * @classdesc Represents a GenesisState. + * @implements IGenesisState + * @constructor + * @param {cosmos.evidence.v1beta1.IGenesisState=} [properties] Properties to set + */ + function GenesisState(properties) { + this.evidence = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenesisState evidence. + * @member {Array.} evidence + * @memberof cosmos.evidence.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.evidence = $util.emptyArray; + + /** + * Creates a new GenesisState instance using the specified properties. + * @function create + * @memberof cosmos.evidence.v1beta1.GenesisState + * @static + * @param {cosmos.evidence.v1beta1.IGenesisState=} [properties] Properties to set + * @returns {cosmos.evidence.v1beta1.GenesisState} GenesisState instance + */ + GenesisState.create = function create(properties) { + return new GenesisState(properties); + }; + + /** + * Encodes the specified GenesisState message. Does not implicitly {@link cosmos.evidence.v1beta1.GenesisState.verify|verify} messages. + * @function encode + * @memberof cosmos.evidence.v1beta1.GenesisState + * @static + * @param {cosmos.evidence.v1beta1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evidence != null && message.evidence.length) + for (let i = 0; i < message.evidence.length; ++i) + $root.google.protobuf.Any.encode(message.evidence[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link cosmos.evidence.v1beta1.GenesisState.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.evidence.v1beta1.GenesisState + * @static + * @param {cosmos.evidence.v1beta1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer. + * @function decode + * @memberof cosmos.evidence.v1beta1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.evidence.v1beta1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.evidence.v1beta1.GenesisState(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.evidence && message.evidence.length)) + message.evidence = []; + message.evidence.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.evidence.v1beta1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.evidence.v1beta1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenesisState message. + * @function verify + * @memberof cosmos.evidence.v1beta1.GenesisState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenesisState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evidence != null && message.hasOwnProperty("evidence")) { + if (!Array.isArray(message.evidence)) + return "evidence: array expected"; + for (let i = 0; i < message.evidence.length; ++i) { + let error = $root.google.protobuf.Any.verify(message.evidence[i]); + if (error) + return "evidence." + error; + } + } + return null; + }; + + /** + * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.evidence.v1beta1.GenesisState + * @static + * @param {Object.} object Plain object + * @returns {cosmos.evidence.v1beta1.GenesisState} GenesisState + */ + GenesisState.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.evidence.v1beta1.GenesisState) + return object; + let message = new $root.cosmos.evidence.v1beta1.GenesisState(); + if (object.evidence) { + if (!Array.isArray(object.evidence)) + throw TypeError(".cosmos.evidence.v1beta1.GenesisState.evidence: array expected"); + message.evidence = []; + for (let i = 0; i < object.evidence.length; ++i) { + if (typeof object.evidence[i] !== "object") + throw TypeError(".cosmos.evidence.v1beta1.GenesisState.evidence: object expected"); + message.evidence[i] = $root.google.protobuf.Any.fromObject(object.evidence[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GenesisState message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.evidence.v1beta1.GenesisState + * @static + * @param {cosmos.evidence.v1beta1.GenesisState} message GenesisState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenesisState.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.evidence = []; + if (message.evidence && message.evidence.length) { + object.evidence = []; + for (let j = 0; j < message.evidence.length; ++j) + object.evidence[j] = $root.google.protobuf.Any.toObject(message.evidence[j], options); + } + return object; + }; + + /** + * Converts this GenesisState to JSON. + * @function toJSON + * @memberof cosmos.evidence.v1beta1.GenesisState + * @instance + * @returns {Object.} JSON object + */ + GenesisState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GenesisState; + })(v1beta1.GenesisState || {}); + + v1beta1.Query = (function(Query) { + + /** + * Constructs a new Query service. + * @memberof cosmos.evidence.v1beta1 + * @classdesc Represents a Query + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Query(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; + + /** + * Creates new Query service using the specified rpc implementation. + * @function create + * @memberof cosmos.evidence.v1beta1.Query + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Query} RPC service. Useful where requests and/or responses are streamed. + */ + Query.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.evidence.v1beta1.Query#evidence}. + * @memberof cosmos.evidence.v1beta1.Query + * @typedef EvidenceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.evidence.v1beta1.IQueryEvidenceResponse} [response] QueryEvidenceResponse + */ + + /** + * Calls Evidence. + * @function evidence + * @memberof cosmos.evidence.v1beta1.Query + * @instance + * @param {cosmos.evidence.v1beta1.IQueryEvidenceRequest} request QueryEvidenceRequest message or plain object + * @param {cosmos.evidence.v1beta1.Query.EvidenceCallback} callback Node-style callback called with the error, if any, and QueryEvidenceResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.evidence = function evidence(request, callback) { + return this.rpcCall(evidence, $root.cosmos.evidence.v1beta1.QueryEvidenceRequest, $root.cosmos.evidence.v1beta1.QueryEvidenceResponse, request, callback); + }, "name", { value: "Evidence" }); + + /** + * Calls Evidence. + * @function evidence + * @memberof cosmos.evidence.v1beta1.Query + * @instance + * @param {cosmos.evidence.v1beta1.IQueryEvidenceRequest} request QueryEvidenceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.evidence.v1beta1.Query#allEvidence}. + * @memberof cosmos.evidence.v1beta1.Query + * @typedef AllEvidenceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.evidence.v1beta1.IQueryAllEvidenceResponse} [response] QueryAllEvidenceResponse + */ + + /** + * Calls AllEvidence. + * @function allEvidence + * @memberof cosmos.evidence.v1beta1.Query + * @instance + * @param {cosmos.evidence.v1beta1.IQueryAllEvidenceRequest} request QueryAllEvidenceRequest message or plain object + * @param {cosmos.evidence.v1beta1.Query.AllEvidenceCallback} callback Node-style callback called with the error, if any, and QueryAllEvidenceResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.allEvidence = function allEvidence(request, callback) { + return this.rpcCall(allEvidence, $root.cosmos.evidence.v1beta1.QueryAllEvidenceRequest, $root.cosmos.evidence.v1beta1.QueryAllEvidenceResponse, request, callback); + }, "name", { value: "AllEvidence" }); + + /** + * Calls AllEvidence. + * @function allEvidence + * @memberof cosmos.evidence.v1beta1.Query + * @instance + * @param {cosmos.evidence.v1beta1.IQueryAllEvidenceRequest} request QueryAllEvidenceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Query; + })(v1beta1.Query || {}); + + v1beta1.QueryEvidenceRequest = (function(QueryEvidenceRequest) { + + /** + * Properties of a QueryEvidenceRequest. + * @memberof cosmos.evidence.v1beta1 + * @interface IQueryEvidenceRequest + * @property {Uint8Array|null} [evidenceHash] QueryEvidenceRequest evidenceHash + */ + + /** + * Constructs a new QueryEvidenceRequest. + * @memberof cosmos.evidence.v1beta1 + * @classdesc Represents a QueryEvidenceRequest. + * @implements IQueryEvidenceRequest + * @constructor + * @param {cosmos.evidence.v1beta1.IQueryEvidenceRequest=} [properties] Properties to set + */ + function QueryEvidenceRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryEvidenceRequest evidenceHash. + * @member {Uint8Array} evidenceHash + * @memberof cosmos.evidence.v1beta1.QueryEvidenceRequest + * @instance + */ + QueryEvidenceRequest.prototype.evidenceHash = $util.newBuffer([]); + + /** + * Creates a new QueryEvidenceRequest instance using the specified properties. + * @function create + * @memberof cosmos.evidence.v1beta1.QueryEvidenceRequest + * @static + * @param {cosmos.evidence.v1beta1.IQueryEvidenceRequest=} [properties] Properties to set + * @returns {cosmos.evidence.v1beta1.QueryEvidenceRequest} QueryEvidenceRequest instance + */ + QueryEvidenceRequest.create = function create(properties) { + return new QueryEvidenceRequest(properties); + }; + + /** + * Encodes the specified QueryEvidenceRequest message. Does not implicitly {@link cosmos.evidence.v1beta1.QueryEvidenceRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.evidence.v1beta1.QueryEvidenceRequest + * @static + * @param {cosmos.evidence.v1beta1.IQueryEvidenceRequest} message QueryEvidenceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryEvidenceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evidenceHash != null && Object.hasOwnProperty.call(message, "evidenceHash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.evidenceHash); + return writer; + }; + + /** + * Encodes the specified QueryEvidenceRequest message, length delimited. Does not implicitly {@link cosmos.evidence.v1beta1.QueryEvidenceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.evidence.v1beta1.QueryEvidenceRequest + * @static + * @param {cosmos.evidence.v1beta1.IQueryEvidenceRequest} message QueryEvidenceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryEvidenceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryEvidenceRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.evidence.v1beta1.QueryEvidenceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.evidence.v1beta1.QueryEvidenceRequest} QueryEvidenceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryEvidenceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.evidence.v1beta1.QueryEvidenceRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.evidenceHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryEvidenceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.evidence.v1beta1.QueryEvidenceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.evidence.v1beta1.QueryEvidenceRequest} QueryEvidenceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryEvidenceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryEvidenceRequest message. + * @function verify + * @memberof cosmos.evidence.v1beta1.QueryEvidenceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryEvidenceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evidenceHash != null && message.hasOwnProperty("evidenceHash")) + if (!(message.evidenceHash && typeof message.evidenceHash.length === "number" || $util.isString(message.evidenceHash))) + return "evidenceHash: buffer expected"; + return null; + }; + + /** + * Creates a QueryEvidenceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.evidence.v1beta1.QueryEvidenceRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.evidence.v1beta1.QueryEvidenceRequest} QueryEvidenceRequest + */ + QueryEvidenceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.evidence.v1beta1.QueryEvidenceRequest) + return object; + let message = new $root.cosmos.evidence.v1beta1.QueryEvidenceRequest(); + if (object.evidenceHash != null) + if (typeof object.evidenceHash === "string") + $util.base64.decode(object.evidenceHash, message.evidenceHash = $util.newBuffer($util.base64.length(object.evidenceHash)), 0); + else if (object.evidenceHash.length) + message.evidenceHash = object.evidenceHash; + return message; + }; + + /** + * Creates a plain object from a QueryEvidenceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.evidence.v1beta1.QueryEvidenceRequest + * @static + * @param {cosmos.evidence.v1beta1.QueryEvidenceRequest} message QueryEvidenceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryEvidenceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + if (options.bytes === String) + object.evidenceHash = ""; + else { + object.evidenceHash = []; + if (options.bytes !== Array) + object.evidenceHash = $util.newBuffer(object.evidenceHash); + } + if (message.evidenceHash != null && message.hasOwnProperty("evidenceHash")) + object.evidenceHash = options.bytes === String ? $util.base64.encode(message.evidenceHash, 0, message.evidenceHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.evidenceHash) : message.evidenceHash; + return object; + }; + + /** + * Converts this QueryEvidenceRequest to JSON. + * @function toJSON + * @memberof cosmos.evidence.v1beta1.QueryEvidenceRequest + * @instance + * @returns {Object.} JSON object + */ + QueryEvidenceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryEvidenceRequest; + })(v1beta1.QueryEvidenceRequest || {}); + + v1beta1.QueryEvidenceResponse = (function(QueryEvidenceResponse) { + + /** + * Properties of a QueryEvidenceResponse. + * @memberof cosmos.evidence.v1beta1 + * @interface IQueryEvidenceResponse + * @property {google.protobuf.IAny|null} [evidence] QueryEvidenceResponse evidence + */ + + /** + * Constructs a new QueryEvidenceResponse. + * @memberof cosmos.evidence.v1beta1 + * @classdesc Represents a QueryEvidenceResponse. + * @implements IQueryEvidenceResponse + * @constructor + * @param {cosmos.evidence.v1beta1.IQueryEvidenceResponse=} [properties] Properties to set + */ + function QueryEvidenceResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryEvidenceResponse evidence. + * @member {google.protobuf.IAny|null|undefined} evidence + * @memberof cosmos.evidence.v1beta1.QueryEvidenceResponse + * @instance + */ + QueryEvidenceResponse.prototype.evidence = null; + + /** + * Creates a new QueryEvidenceResponse instance using the specified properties. + * @function create + * @memberof cosmos.evidence.v1beta1.QueryEvidenceResponse + * @static + * @param {cosmos.evidence.v1beta1.IQueryEvidenceResponse=} [properties] Properties to set + * @returns {cosmos.evidence.v1beta1.QueryEvidenceResponse} QueryEvidenceResponse instance + */ + QueryEvidenceResponse.create = function create(properties) { + return new QueryEvidenceResponse(properties); + }; + + /** + * Encodes the specified QueryEvidenceResponse message. Does not implicitly {@link cosmos.evidence.v1beta1.QueryEvidenceResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.evidence.v1beta1.QueryEvidenceResponse + * @static + * @param {cosmos.evidence.v1beta1.IQueryEvidenceResponse} message QueryEvidenceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryEvidenceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evidence != null && Object.hasOwnProperty.call(message, "evidence")) + $root.google.protobuf.Any.encode(message.evidence, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryEvidenceResponse message, length delimited. Does not implicitly {@link cosmos.evidence.v1beta1.QueryEvidenceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.evidence.v1beta1.QueryEvidenceResponse + * @static + * @param {cosmos.evidence.v1beta1.IQueryEvidenceResponse} message QueryEvidenceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryEvidenceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryEvidenceResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.evidence.v1beta1.QueryEvidenceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.evidence.v1beta1.QueryEvidenceResponse} QueryEvidenceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryEvidenceResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.evidence.v1beta1.QueryEvidenceResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.evidence = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryEvidenceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.evidence.v1beta1.QueryEvidenceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.evidence.v1beta1.QueryEvidenceResponse} QueryEvidenceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryEvidenceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryEvidenceResponse message. + * @function verify + * @memberof cosmos.evidence.v1beta1.QueryEvidenceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryEvidenceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evidence != null && message.hasOwnProperty("evidence")) { + let error = $root.google.protobuf.Any.verify(message.evidence); + if (error) + return "evidence." + error; + } + return null; + }; + + /** + * Creates a QueryEvidenceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.evidence.v1beta1.QueryEvidenceResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.evidence.v1beta1.QueryEvidenceResponse} QueryEvidenceResponse + */ + QueryEvidenceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.evidence.v1beta1.QueryEvidenceResponse) + return object; + let message = new $root.cosmos.evidence.v1beta1.QueryEvidenceResponse(); + if (object.evidence != null) { + if (typeof object.evidence !== "object") + throw TypeError(".cosmos.evidence.v1beta1.QueryEvidenceResponse.evidence: object expected"); + message.evidence = $root.google.protobuf.Any.fromObject(object.evidence); + } + return message; + }; + + /** + * Creates a plain object from a QueryEvidenceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.evidence.v1beta1.QueryEvidenceResponse + * @static + * @param {cosmos.evidence.v1beta1.QueryEvidenceResponse} message QueryEvidenceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryEvidenceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.evidence = null; + if (message.evidence != null && message.hasOwnProperty("evidence")) + object.evidence = $root.google.protobuf.Any.toObject(message.evidence, options); + return object; + }; + + /** + * Converts this QueryEvidenceResponse to JSON. + * @function toJSON + * @memberof cosmos.evidence.v1beta1.QueryEvidenceResponse + * @instance + * @returns {Object.} JSON object + */ + QueryEvidenceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryEvidenceResponse; + })(v1beta1.QueryEvidenceResponse || {}); + + v1beta1.QueryAllEvidenceRequest = (function(QueryAllEvidenceRequest) { + + /** + * Properties of a QueryAllEvidenceRequest. + * @memberof cosmos.evidence.v1beta1 + * @interface IQueryAllEvidenceRequest + * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryAllEvidenceRequest pagination + */ + + /** + * Constructs a new QueryAllEvidenceRequest. + * @memberof cosmos.evidence.v1beta1 + * @classdesc Represents a QueryAllEvidenceRequest. + * @implements IQueryAllEvidenceRequest + * @constructor + * @param {cosmos.evidence.v1beta1.IQueryAllEvidenceRequest=} [properties] Properties to set + */ + function QueryAllEvidenceRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryAllEvidenceRequest pagination. + * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination + * @memberof cosmos.evidence.v1beta1.QueryAllEvidenceRequest + * @instance + */ + QueryAllEvidenceRequest.prototype.pagination = null; + + /** + * Creates a new QueryAllEvidenceRequest instance using the specified properties. + * @function create + * @memberof cosmos.evidence.v1beta1.QueryAllEvidenceRequest + * @static + * @param {cosmos.evidence.v1beta1.IQueryAllEvidenceRequest=} [properties] Properties to set + * @returns {cosmos.evidence.v1beta1.QueryAllEvidenceRequest} QueryAllEvidenceRequest instance + */ + QueryAllEvidenceRequest.create = function create(properties) { + return new QueryAllEvidenceRequest(properties); + }; + + /** + * Encodes the specified QueryAllEvidenceRequest message. Does not implicitly {@link cosmos.evidence.v1beta1.QueryAllEvidenceRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.evidence.v1beta1.QueryAllEvidenceRequest + * @static + * @param {cosmos.evidence.v1beta1.IQueryAllEvidenceRequest} message QueryAllEvidenceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAllEvidenceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryAllEvidenceRequest message, length delimited. Does not implicitly {@link cosmos.evidence.v1beta1.QueryAllEvidenceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.evidence.v1beta1.QueryAllEvidenceRequest + * @static + * @param {cosmos.evidence.v1beta1.IQueryAllEvidenceRequest} message QueryAllEvidenceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAllEvidenceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryAllEvidenceRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.evidence.v1beta1.QueryAllEvidenceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.evidence.v1beta1.QueryAllEvidenceRequest} QueryAllEvidenceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAllEvidenceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.evidence.v1beta1.QueryAllEvidenceRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryAllEvidenceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.evidence.v1beta1.QueryAllEvidenceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.evidence.v1beta1.QueryAllEvidenceRequest} QueryAllEvidenceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAllEvidenceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryAllEvidenceRequest message. + * @function verify + * @memberof cosmos.evidence.v1beta1.QueryAllEvidenceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryAllEvidenceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryAllEvidenceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.evidence.v1beta1.QueryAllEvidenceRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.evidence.v1beta1.QueryAllEvidenceRequest} QueryAllEvidenceRequest + */ + QueryAllEvidenceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.evidence.v1beta1.QueryAllEvidenceRequest) + return object; + let message = new $root.cosmos.evidence.v1beta1.QueryAllEvidenceRequest(); + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.evidence.v1beta1.QueryAllEvidenceRequest.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryAllEvidenceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.evidence.v1beta1.QueryAllEvidenceRequest + * @static + * @param {cosmos.evidence.v1beta1.QueryAllEvidenceRequest} message QueryAllEvidenceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryAllEvidenceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.pagination = null; + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryAllEvidenceRequest to JSON. + * @function toJSON + * @memberof cosmos.evidence.v1beta1.QueryAllEvidenceRequest + * @instance + * @returns {Object.} JSON object + */ + QueryAllEvidenceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryAllEvidenceRequest; + })(v1beta1.QueryAllEvidenceRequest || {}); + + v1beta1.QueryAllEvidenceResponse = (function(QueryAllEvidenceResponse) { + + /** + * Properties of a QueryAllEvidenceResponse. + * @memberof cosmos.evidence.v1beta1 + * @interface IQueryAllEvidenceResponse + * @property {Array.|null} [evidence] QueryAllEvidenceResponse evidence + * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryAllEvidenceResponse pagination + */ + + /** + * Constructs a new QueryAllEvidenceResponse. + * @memberof cosmos.evidence.v1beta1 + * @classdesc Represents a QueryAllEvidenceResponse. + * @implements IQueryAllEvidenceResponse + * @constructor + * @param {cosmos.evidence.v1beta1.IQueryAllEvidenceResponse=} [properties] Properties to set + */ + function QueryAllEvidenceResponse(properties) { + this.evidence = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryAllEvidenceResponse evidence. + * @member {Array.} evidence + * @memberof cosmos.evidence.v1beta1.QueryAllEvidenceResponse + * @instance + */ + QueryAllEvidenceResponse.prototype.evidence = $util.emptyArray; + + /** + * QueryAllEvidenceResponse pagination. + * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination + * @memberof cosmos.evidence.v1beta1.QueryAllEvidenceResponse + * @instance + */ + QueryAllEvidenceResponse.prototype.pagination = null; + + /** + * Creates a new QueryAllEvidenceResponse instance using the specified properties. + * @function create + * @memberof cosmos.evidence.v1beta1.QueryAllEvidenceResponse + * @static + * @param {cosmos.evidence.v1beta1.IQueryAllEvidenceResponse=} [properties] Properties to set + * @returns {cosmos.evidence.v1beta1.QueryAllEvidenceResponse} QueryAllEvidenceResponse instance + */ + QueryAllEvidenceResponse.create = function create(properties) { + return new QueryAllEvidenceResponse(properties); + }; + + /** + * Encodes the specified QueryAllEvidenceResponse message. Does not implicitly {@link cosmos.evidence.v1beta1.QueryAllEvidenceResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.evidence.v1beta1.QueryAllEvidenceResponse + * @static + * @param {cosmos.evidence.v1beta1.IQueryAllEvidenceResponse} message QueryAllEvidenceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAllEvidenceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evidence != null && message.evidence.length) + for (let i = 0; i < message.evidence.length; ++i) + $root.google.protobuf.Any.encode(message.evidence[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryAllEvidenceResponse message, length delimited. Does not implicitly {@link cosmos.evidence.v1beta1.QueryAllEvidenceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.evidence.v1beta1.QueryAllEvidenceResponse + * @static + * @param {cosmos.evidence.v1beta1.IQueryAllEvidenceResponse} message QueryAllEvidenceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAllEvidenceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryAllEvidenceResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.evidence.v1beta1.QueryAllEvidenceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.evidence.v1beta1.QueryAllEvidenceResponse} QueryAllEvidenceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAllEvidenceResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.evidence.v1beta1.QueryAllEvidenceResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.evidence && message.evidence.length)) + message.evidence = []; + message.evidence.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryAllEvidenceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.evidence.v1beta1.QueryAllEvidenceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.evidence.v1beta1.QueryAllEvidenceResponse} QueryAllEvidenceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAllEvidenceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryAllEvidenceResponse message. + * @function verify + * @memberof cosmos.evidence.v1beta1.QueryAllEvidenceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryAllEvidenceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evidence != null && message.hasOwnProperty("evidence")) { + if (!Array.isArray(message.evidence)) + return "evidence: array expected"; + for (let i = 0; i < message.evidence.length; ++i) { + let error = $root.google.protobuf.Any.verify(message.evidence[i]); + if (error) + return "evidence." + error; + } + } + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryAllEvidenceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.evidence.v1beta1.QueryAllEvidenceResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.evidence.v1beta1.QueryAllEvidenceResponse} QueryAllEvidenceResponse + */ + QueryAllEvidenceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.evidence.v1beta1.QueryAllEvidenceResponse) + return object; + let message = new $root.cosmos.evidence.v1beta1.QueryAllEvidenceResponse(); + if (object.evidence) { + if (!Array.isArray(object.evidence)) + throw TypeError(".cosmos.evidence.v1beta1.QueryAllEvidenceResponse.evidence: array expected"); + message.evidence = []; + for (let i = 0; i < object.evidence.length; ++i) { + if (typeof object.evidence[i] !== "object") + throw TypeError(".cosmos.evidence.v1beta1.QueryAllEvidenceResponse.evidence: object expected"); + message.evidence[i] = $root.google.protobuf.Any.fromObject(object.evidence[i]); + } + } + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.evidence.v1beta1.QueryAllEvidenceResponse.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryAllEvidenceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.evidence.v1beta1.QueryAllEvidenceResponse + * @static + * @param {cosmos.evidence.v1beta1.QueryAllEvidenceResponse} message QueryAllEvidenceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryAllEvidenceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.evidence = []; + if (options.defaults) + object.pagination = null; + if (message.evidence && message.evidence.length) { + object.evidence = []; + for (let j = 0; j < message.evidence.length; ++j) + object.evidence[j] = $root.google.protobuf.Any.toObject(message.evidence[j], options); + } + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryAllEvidenceResponse to JSON. + * @function toJSON + * @memberof cosmos.evidence.v1beta1.QueryAllEvidenceResponse + * @instance + * @returns {Object.} JSON object + */ + QueryAllEvidenceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryAllEvidenceResponse; + })(v1beta1.QueryAllEvidenceResponse || {}); + + v1beta1.Msg = (function(Msg) { + + /** + * Constructs a new Msg service. + * @memberof cosmos.evidence.v1beta1 + * @classdesc Represents a Msg + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Msg(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; + + /** + * Creates new Msg service using the specified rpc implementation. + * @function create + * @memberof cosmos.evidence.v1beta1.Msg + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Msg} RPC service. Useful where requests and/or responses are streamed. + */ + Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.evidence.v1beta1.Msg#submitEvidence}. + * @memberof cosmos.evidence.v1beta1.Msg + * @typedef SubmitEvidenceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidenceResponse} [response] MsgSubmitEvidenceResponse + */ + + /** + * Calls SubmitEvidence. + * @function submitEvidence + * @memberof cosmos.evidence.v1beta1.Msg + * @instance + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidence} request MsgSubmitEvidence message or plain object + * @param {cosmos.evidence.v1beta1.Msg.SubmitEvidenceCallback} callback Node-style callback called with the error, if any, and MsgSubmitEvidenceResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.submitEvidence = function submitEvidence(request, callback) { + return this.rpcCall(submitEvidence, $root.cosmos.evidence.v1beta1.MsgSubmitEvidence, $root.cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse, request, callback); + }, "name", { value: "SubmitEvidence" }); + + /** + * Calls SubmitEvidence. + * @function submitEvidence + * @memberof cosmos.evidence.v1beta1.Msg + * @instance + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidence} request MsgSubmitEvidence message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Msg; + })(v1beta1.Msg || {}); + + v1beta1.MsgSubmitEvidence = (function(MsgSubmitEvidence) { + + /** + * Properties of a MsgSubmitEvidence. + * @memberof cosmos.evidence.v1beta1 + * @interface IMsgSubmitEvidence + * @property {string|null} [submitter] MsgSubmitEvidence submitter + * @property {google.protobuf.IAny|null} [evidence] MsgSubmitEvidence evidence + */ + + /** + * Constructs a new MsgSubmitEvidence. + * @memberof cosmos.evidence.v1beta1 + * @classdesc Represents a MsgSubmitEvidence. + * @implements IMsgSubmitEvidence + * @constructor + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidence=} [properties] Properties to set + */ + function MsgSubmitEvidence(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgSubmitEvidence submitter. + * @member {string} submitter + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @instance + */ + MsgSubmitEvidence.prototype.submitter = ""; + + /** + * MsgSubmitEvidence evidence. + * @member {google.protobuf.IAny|null|undefined} evidence + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @instance + */ + MsgSubmitEvidence.prototype.evidence = null; + + /** + * Creates a new MsgSubmitEvidence instance using the specified properties. + * @function create + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @static + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidence=} [properties] Properties to set + * @returns {cosmos.evidence.v1beta1.MsgSubmitEvidence} MsgSubmitEvidence instance + */ + MsgSubmitEvidence.create = function create(properties) { + return new MsgSubmitEvidence(properties); + }; + + /** + * Encodes the specified MsgSubmitEvidence message. Does not implicitly {@link cosmos.evidence.v1beta1.MsgSubmitEvidence.verify|verify} messages. + * @function encode + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @static + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidence} message MsgSubmitEvidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitEvidence.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.submitter != null && Object.hasOwnProperty.call(message, "submitter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.submitter); + if (message.evidence != null && Object.hasOwnProperty.call(message, "evidence")) + $root.google.protobuf.Any.encode(message.evidence, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MsgSubmitEvidence message, length delimited. Does not implicitly {@link cosmos.evidence.v1beta1.MsgSubmitEvidence.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @static + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidence} message MsgSubmitEvidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitEvidence.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgSubmitEvidence message from the specified reader or buffer. + * @function decode + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.evidence.v1beta1.MsgSubmitEvidence} MsgSubmitEvidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitEvidence.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.evidence.v1beta1.MsgSubmitEvidence(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.submitter = reader.string(); + break; + case 2: + message.evidence = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgSubmitEvidence message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.evidence.v1beta1.MsgSubmitEvidence} MsgSubmitEvidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitEvidence.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgSubmitEvidence message. + * @function verify + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgSubmitEvidence.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.submitter != null && message.hasOwnProperty("submitter")) + if (!$util.isString(message.submitter)) + return "submitter: string expected"; + if (message.evidence != null && message.hasOwnProperty("evidence")) { + let error = $root.google.protobuf.Any.verify(message.evidence); + if (error) + return "evidence." + error; + } + return null; + }; + + /** + * Creates a MsgSubmitEvidence message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @static + * @param {Object.} object Plain object + * @returns {cosmos.evidence.v1beta1.MsgSubmitEvidence} MsgSubmitEvidence + */ + MsgSubmitEvidence.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.evidence.v1beta1.MsgSubmitEvidence) + return object; + let message = new $root.cosmos.evidence.v1beta1.MsgSubmitEvidence(); + if (object.submitter != null) + message.submitter = String(object.submitter); + if (object.evidence != null) { + if (typeof object.evidence !== "object") + throw TypeError(".cosmos.evidence.v1beta1.MsgSubmitEvidence.evidence: object expected"); + message.evidence = $root.google.protobuf.Any.fromObject(object.evidence); + } + return message; + }; + + /** + * Creates a plain object from a MsgSubmitEvidence message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @static + * @param {cosmos.evidence.v1beta1.MsgSubmitEvidence} message MsgSubmitEvidence + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSubmitEvidence.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.submitter = ""; + object.evidence = null; + } + if (message.submitter != null && message.hasOwnProperty("submitter")) + object.submitter = message.submitter; + if (message.evidence != null && message.hasOwnProperty("evidence")) + object.evidence = $root.google.protobuf.Any.toObject(message.evidence, options); + return object; + }; + + /** + * Converts this MsgSubmitEvidence to JSON. + * @function toJSON + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence + * @instance + * @returns {Object.} JSON object + */ + MsgSubmitEvidence.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgSubmitEvidence; + })(v1beta1.MsgSubmitEvidence || {}); + + v1beta1.MsgSubmitEvidenceResponse = (function(MsgSubmitEvidenceResponse) { + + /** + * Properties of a MsgSubmitEvidenceResponse. + * @memberof cosmos.evidence.v1beta1 + * @interface IMsgSubmitEvidenceResponse + * @property {Uint8Array|null} [hash] MsgSubmitEvidenceResponse hash + */ + + /** + * Constructs a new MsgSubmitEvidenceResponse. + * @memberof cosmos.evidence.v1beta1 + * @classdesc Represents a MsgSubmitEvidenceResponse. + * @implements IMsgSubmitEvidenceResponse + * @constructor + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidenceResponse=} [properties] Properties to set + */ + function MsgSubmitEvidenceResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgSubmitEvidenceResponse hash. + * @member {Uint8Array} hash + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse + * @instance + */ + MsgSubmitEvidenceResponse.prototype.hash = $util.newBuffer([]); + + /** + * Creates a new MsgSubmitEvidenceResponse instance using the specified properties. + * @function create + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse + * @static + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidenceResponse=} [properties] Properties to set + * @returns {cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse} MsgSubmitEvidenceResponse instance + */ + MsgSubmitEvidenceResponse.create = function create(properties) { + return new MsgSubmitEvidenceResponse(properties); + }; + + /** + * Encodes the specified MsgSubmitEvidenceResponse message. Does not implicitly {@link cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse + * @static + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidenceResponse} message MsgSubmitEvidenceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitEvidenceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.hash); + return writer; + }; + + /** + * Encodes the specified MsgSubmitEvidenceResponse message, length delimited. Does not implicitly {@link cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse + * @static + * @param {cosmos.evidence.v1beta1.IMsgSubmitEvidenceResponse} message MsgSubmitEvidenceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitEvidenceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgSubmitEvidenceResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse} MsgSubmitEvidenceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitEvidenceResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + message.hash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgSubmitEvidenceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse} MsgSubmitEvidenceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitEvidenceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgSubmitEvidenceResponse message. + * @function verify + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgSubmitEvidenceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash))) + return "hash: buffer expected"; + return null; + }; + + /** + * Creates a MsgSubmitEvidenceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse} MsgSubmitEvidenceResponse + */ + MsgSubmitEvidenceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse) + return object; + let message = new $root.cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse(); + if (object.hash != null) + if (typeof object.hash === "string") + $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0); + else if (object.hash.length) + message.hash = object.hash; + return message; + }; + + /** + * Creates a plain object from a MsgSubmitEvidenceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse + * @static + * @param {cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse} message MsgSubmitEvidenceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSubmitEvidenceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + if (options.bytes === String) + object.hash = ""; + else { + object.hash = []; + if (options.bytes !== Array) + object.hash = $util.newBuffer(object.hash); + } + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash; + return object; + }; + + /** + * Converts this MsgSubmitEvidenceResponse to JSON. + * @function toJSON + * @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse + * @instance + * @returns {Object.} JSON object + */ + MsgSubmitEvidenceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgSubmitEvidenceResponse; + })(v1beta1.MsgSubmitEvidenceResponse || {}); + + return v1beta1; + })(evidence.v1beta1 || {}); + + return evidence; + })(cosmos.evidence || {}); + + /** + * Namespace genutil. + * @memberof cosmos + * @namespace + */ + + cosmos.genutil = (function(genutil) { + + /** + * Namespace v1beta1. + * @memberof cosmos.genutil + * @namespace + */ + + genutil.v1beta1 = (function(v1beta1) { + + v1beta1.GenesisState = (function(GenesisState) { + + /** + * Properties of a GenesisState. + * @memberof cosmos.genutil.v1beta1 + * @interface IGenesisState + * @property {Array.|null} [genTxs] GenesisState genTxs + */ + + /** + * Constructs a new GenesisState. + * @memberof cosmos.genutil.v1beta1 + * @classdesc Represents a GenesisState. + * @implements IGenesisState + * @constructor + * @param {cosmos.genutil.v1beta1.IGenesisState=} [properties] Properties to set + */ + function GenesisState(properties) { + this.genTxs = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenesisState genTxs. + * @member {Array.} genTxs + * @memberof cosmos.genutil.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.genTxs = $util.emptyArray; + + /** + * Creates a new GenesisState instance using the specified properties. + * @function create + * @memberof cosmos.genutil.v1beta1.GenesisState + * @static + * @param {cosmos.genutil.v1beta1.IGenesisState=} [properties] Properties to set + * @returns {cosmos.genutil.v1beta1.GenesisState} GenesisState instance + */ + GenesisState.create = function create(properties) { + return new GenesisState(properties); + }; + + /** + * Encodes the specified GenesisState message. Does not implicitly {@link cosmos.genutil.v1beta1.GenesisState.verify|verify} messages. + * @function encode + * @memberof cosmos.genutil.v1beta1.GenesisState + * @static + * @param {cosmos.genutil.v1beta1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.genTxs != null && message.genTxs.length) + for (let i = 0; i < message.genTxs.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.genTxs[i]); + return writer; + }; + + /** + * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link cosmos.genutil.v1beta1.GenesisState.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.genutil.v1beta1.GenesisState + * @static + * @param {cosmos.genutil.v1beta1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer. + * @function decode + * @memberof cosmos.genutil.v1beta1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.genutil.v1beta1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.genutil.v1beta1.GenesisState(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.genTxs && message.genTxs.length)) + message.genTxs = []; + message.genTxs.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.genutil.v1beta1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.genutil.v1beta1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenesisState message. + * @function verify + * @memberof cosmos.genutil.v1beta1.GenesisState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenesisState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.genTxs != null && message.hasOwnProperty("genTxs")) { + if (!Array.isArray(message.genTxs)) + return "genTxs: array expected"; + for (let i = 0; i < message.genTxs.length; ++i) + if (!(message.genTxs[i] && typeof message.genTxs[i].length === "number" || $util.isString(message.genTxs[i]))) + return "genTxs: buffer[] expected"; + } + return null; + }; + + /** + * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.genutil.v1beta1.GenesisState + * @static + * @param {Object.} object Plain object + * @returns {cosmos.genutil.v1beta1.GenesisState} GenesisState + */ + GenesisState.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.genutil.v1beta1.GenesisState) + return object; + let message = new $root.cosmos.genutil.v1beta1.GenesisState(); + if (object.genTxs) { + if (!Array.isArray(object.genTxs)) + throw TypeError(".cosmos.genutil.v1beta1.GenesisState.genTxs: array expected"); + message.genTxs = []; + for (let i = 0; i < object.genTxs.length; ++i) + if (typeof object.genTxs[i] === "string") + $util.base64.decode(object.genTxs[i], message.genTxs[i] = $util.newBuffer($util.base64.length(object.genTxs[i])), 0); + else if (object.genTxs[i].length) + message.genTxs[i] = object.genTxs[i]; + } + return message; + }; + + /** + * Creates a plain object from a GenesisState message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.genutil.v1beta1.GenesisState + * @static + * @param {cosmos.genutil.v1beta1.GenesisState} message GenesisState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenesisState.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.genTxs = []; + if (message.genTxs && message.genTxs.length) { + object.genTxs = []; + for (let j = 0; j < message.genTxs.length; ++j) + object.genTxs[j] = options.bytes === String ? $util.base64.encode(message.genTxs[j], 0, message.genTxs[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.genTxs[j]) : message.genTxs[j]; + } + return object; + }; + + /** + * Converts this GenesisState to JSON. + * @function toJSON + * @memberof cosmos.genutil.v1beta1.GenesisState + * @instance + * @returns {Object.} JSON object + */ + GenesisState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GenesisState; + })(v1beta1.GenesisState || {}); + + return v1beta1; + })(genutil.v1beta1 || {}); + + return genutil; + })(cosmos.genutil || {}); + + /** + * Namespace gov. + * @memberof cosmos + * @namespace + */ + + cosmos.gov = (function(gov) { + + /** + * Namespace v1beta1. + * @memberof cosmos.gov + * @namespace + */ + + gov.v1beta1 = (function(v1beta1) { + + v1beta1.GenesisState = (function(GenesisState) { + + /** + * Properties of a GenesisState. + * @memberof cosmos.gov.v1beta1 + * @interface IGenesisState + * @property {number|Long|null} [startingProposalId] GenesisState startingProposalId + * @property {Array.|null} [deposits] GenesisState deposits + * @property {Array.|null} [votes] GenesisState votes + * @property {Array.|null} [proposals] GenesisState proposals + * @property {cosmos.gov.v1beta1.IDepositParams|null} [depositParams] GenesisState depositParams + * @property {cosmos.gov.v1beta1.IVotingParams|null} [votingParams] GenesisState votingParams + * @property {cosmos.gov.v1beta1.ITallyParams|null} [tallyParams] GenesisState tallyParams + */ + + /** + * Constructs a new GenesisState. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a GenesisState. + * @implements IGenesisState + * @constructor + * @param {cosmos.gov.v1beta1.IGenesisState=} [properties] Properties to set + */ + function GenesisState(properties) { + this.deposits = []; + this.votes = []; + this.proposals = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenesisState startingProposalId. + * @member {number|Long} startingProposalId + * @memberof cosmos.gov.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.startingProposalId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GenesisState deposits. + * @member {Array.} deposits + * @memberof cosmos.gov.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.deposits = $util.emptyArray; + + /** + * GenesisState votes. + * @member {Array.} votes + * @memberof cosmos.gov.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.votes = $util.emptyArray; + + /** + * GenesisState proposals. + * @member {Array.} proposals + * @memberof cosmos.gov.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.proposals = $util.emptyArray; + + /** + * GenesisState depositParams. + * @member {cosmos.gov.v1beta1.IDepositParams|null|undefined} depositParams + * @memberof cosmos.gov.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.depositParams = null; + + /** + * GenesisState votingParams. + * @member {cosmos.gov.v1beta1.IVotingParams|null|undefined} votingParams + * @memberof cosmos.gov.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.votingParams = null; + + /** + * GenesisState tallyParams. + * @member {cosmos.gov.v1beta1.ITallyParams|null|undefined} tallyParams + * @memberof cosmos.gov.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.tallyParams = null; + + /** + * Creates a new GenesisState instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.GenesisState + * @static + * @param {cosmos.gov.v1beta1.IGenesisState=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.GenesisState} GenesisState instance + */ + GenesisState.create = function create(properties) { + return new GenesisState(properties); + }; + + /** + * Encodes the specified GenesisState message. Does not implicitly {@link cosmos.gov.v1beta1.GenesisState.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.GenesisState + * @static + * @param {cosmos.gov.v1beta1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startingProposalId != null && Object.hasOwnProperty.call(message, "startingProposalId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.startingProposalId); + if (message.deposits != null && message.deposits.length) + for (let i = 0; i < message.deposits.length; ++i) + $root.cosmos.gov.v1beta1.Deposit.encode(message.deposits[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.votes != null && message.votes.length) + for (let i = 0; i < message.votes.length; ++i) + $root.cosmos.gov.v1beta1.Vote.encode(message.votes[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.proposals != null && message.proposals.length) + for (let i = 0; i < message.proposals.length; ++i) + $root.cosmos.gov.v1beta1.Proposal.encode(message.proposals[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.depositParams != null && Object.hasOwnProperty.call(message, "depositParams")) + $root.cosmos.gov.v1beta1.DepositParams.encode(message.depositParams, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.votingParams != null && Object.hasOwnProperty.call(message, "votingParams")) + $root.cosmos.gov.v1beta1.VotingParams.encode(message.votingParams, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.tallyParams != null && Object.hasOwnProperty.call(message, "tallyParams")) + $root.cosmos.gov.v1beta1.TallyParams.encode(message.tallyParams, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.GenesisState.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.GenesisState + * @static + * @param {cosmos.gov.v1beta1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.GenesisState(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startingProposalId = reader.uint64(); + break; + case 2: + if (!(message.deposits && message.deposits.length)) + message.deposits = []; + message.deposits.push($root.cosmos.gov.v1beta1.Deposit.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.votes && message.votes.length)) + message.votes = []; + message.votes.push($root.cosmos.gov.v1beta1.Vote.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.proposals && message.proposals.length)) + message.proposals = []; + message.proposals.push($root.cosmos.gov.v1beta1.Proposal.decode(reader, reader.uint32())); + break; + case 5: + message.depositParams = $root.cosmos.gov.v1beta1.DepositParams.decode(reader, reader.uint32()); + break; + case 6: + message.votingParams = $root.cosmos.gov.v1beta1.VotingParams.decode(reader, reader.uint32()); + break; + case 7: + message.tallyParams = $root.cosmos.gov.v1beta1.TallyParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenesisState message. + * @function verify + * @memberof cosmos.gov.v1beta1.GenesisState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenesisState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startingProposalId != null && message.hasOwnProperty("startingProposalId")) + if (!$util.isInteger(message.startingProposalId) && !(message.startingProposalId && $util.isInteger(message.startingProposalId.low) && $util.isInteger(message.startingProposalId.high))) + return "startingProposalId: integer|Long expected"; + if (message.deposits != null && message.hasOwnProperty("deposits")) { + if (!Array.isArray(message.deposits)) + return "deposits: array expected"; + for (let i = 0; i < message.deposits.length; ++i) { + let error = $root.cosmos.gov.v1beta1.Deposit.verify(message.deposits[i]); + if (error) + return "deposits." + error; + } + } + if (message.votes != null && message.hasOwnProperty("votes")) { + if (!Array.isArray(message.votes)) + return "votes: array expected"; + for (let i = 0; i < message.votes.length; ++i) { + let error = $root.cosmos.gov.v1beta1.Vote.verify(message.votes[i]); + if (error) + return "votes." + error; + } + } + if (message.proposals != null && message.hasOwnProperty("proposals")) { + if (!Array.isArray(message.proposals)) + return "proposals: array expected"; + for (let i = 0; i < message.proposals.length; ++i) { + let error = $root.cosmos.gov.v1beta1.Proposal.verify(message.proposals[i]); + if (error) + return "proposals." + error; + } + } + if (message.depositParams != null && message.hasOwnProperty("depositParams")) { + let error = $root.cosmos.gov.v1beta1.DepositParams.verify(message.depositParams); + if (error) + return "depositParams." + error; + } + if (message.votingParams != null && message.hasOwnProperty("votingParams")) { + let error = $root.cosmos.gov.v1beta1.VotingParams.verify(message.votingParams); + if (error) + return "votingParams." + error; + } + if (message.tallyParams != null && message.hasOwnProperty("tallyParams")) { + let error = $root.cosmos.gov.v1beta1.TallyParams.verify(message.tallyParams); + if (error) + return "tallyParams." + error; + } + return null; + }; + + /** + * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.GenesisState + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.GenesisState} GenesisState + */ + GenesisState.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.GenesisState) + return object; + let message = new $root.cosmos.gov.v1beta1.GenesisState(); + if (object.startingProposalId != null) + if ($util.Long) + (message.startingProposalId = $util.Long.fromValue(object.startingProposalId)).unsigned = true; + else if (typeof object.startingProposalId === "string") + message.startingProposalId = parseInt(object.startingProposalId, 10); + else if (typeof object.startingProposalId === "number") + message.startingProposalId = object.startingProposalId; + else if (typeof object.startingProposalId === "object") + message.startingProposalId = new $util.LongBits(object.startingProposalId.low >>> 0, object.startingProposalId.high >>> 0).toNumber(true); + if (object.deposits) { + if (!Array.isArray(object.deposits)) + throw TypeError(".cosmos.gov.v1beta1.GenesisState.deposits: array expected"); + message.deposits = []; + for (let i = 0; i < object.deposits.length; ++i) { + if (typeof object.deposits[i] !== "object") + throw TypeError(".cosmos.gov.v1beta1.GenesisState.deposits: object expected"); + message.deposits[i] = $root.cosmos.gov.v1beta1.Deposit.fromObject(object.deposits[i]); + } + } + if (object.votes) { + if (!Array.isArray(object.votes)) + throw TypeError(".cosmos.gov.v1beta1.GenesisState.votes: array expected"); + message.votes = []; + for (let i = 0; i < object.votes.length; ++i) { + if (typeof object.votes[i] !== "object") + throw TypeError(".cosmos.gov.v1beta1.GenesisState.votes: object expected"); + message.votes[i] = $root.cosmos.gov.v1beta1.Vote.fromObject(object.votes[i]); + } + } + if (object.proposals) { + if (!Array.isArray(object.proposals)) + throw TypeError(".cosmos.gov.v1beta1.GenesisState.proposals: array expected"); + message.proposals = []; + for (let i = 0; i < object.proposals.length; ++i) { + if (typeof object.proposals[i] !== "object") + throw TypeError(".cosmos.gov.v1beta1.GenesisState.proposals: object expected"); + message.proposals[i] = $root.cosmos.gov.v1beta1.Proposal.fromObject(object.proposals[i]); + } + } + if (object.depositParams != null) { + if (typeof object.depositParams !== "object") + throw TypeError(".cosmos.gov.v1beta1.GenesisState.depositParams: object expected"); + message.depositParams = $root.cosmos.gov.v1beta1.DepositParams.fromObject(object.depositParams); + } + if (object.votingParams != null) { + if (typeof object.votingParams !== "object") + throw TypeError(".cosmos.gov.v1beta1.GenesisState.votingParams: object expected"); + message.votingParams = $root.cosmos.gov.v1beta1.VotingParams.fromObject(object.votingParams); + } + if (object.tallyParams != null) { + if (typeof object.tallyParams !== "object") + throw TypeError(".cosmos.gov.v1beta1.GenesisState.tallyParams: object expected"); + message.tallyParams = $root.cosmos.gov.v1beta1.TallyParams.fromObject(object.tallyParams); + } + return message; + }; + + /** + * Creates a plain object from a GenesisState message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.GenesisState + * @static + * @param {cosmos.gov.v1beta1.GenesisState} message GenesisState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenesisState.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) { + object.deposits = []; + object.votes = []; + object.proposals = []; + } + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.startingProposalId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.startingProposalId = options.longs === String ? "0" : 0; + object.depositParams = null; + object.votingParams = null; + object.tallyParams = null; + } + if (message.startingProposalId != null && message.hasOwnProperty("startingProposalId")) + if (typeof message.startingProposalId === "number") + object.startingProposalId = options.longs === String ? String(message.startingProposalId) : message.startingProposalId; + else + object.startingProposalId = options.longs === String ? $util.Long.prototype.toString.call(message.startingProposalId) : options.longs === Number ? new $util.LongBits(message.startingProposalId.low >>> 0, message.startingProposalId.high >>> 0).toNumber(true) : message.startingProposalId; + if (message.deposits && message.deposits.length) { + object.deposits = []; + for (let j = 0; j < message.deposits.length; ++j) + object.deposits[j] = $root.cosmos.gov.v1beta1.Deposit.toObject(message.deposits[j], options); + } + if (message.votes && message.votes.length) { + object.votes = []; + for (let j = 0; j < message.votes.length; ++j) + object.votes[j] = $root.cosmos.gov.v1beta1.Vote.toObject(message.votes[j], options); + } + if (message.proposals && message.proposals.length) { + object.proposals = []; + for (let j = 0; j < message.proposals.length; ++j) + object.proposals[j] = $root.cosmos.gov.v1beta1.Proposal.toObject(message.proposals[j], options); + } + if (message.depositParams != null && message.hasOwnProperty("depositParams")) + object.depositParams = $root.cosmos.gov.v1beta1.DepositParams.toObject(message.depositParams, options); + if (message.votingParams != null && message.hasOwnProperty("votingParams")) + object.votingParams = $root.cosmos.gov.v1beta1.VotingParams.toObject(message.votingParams, options); + if (message.tallyParams != null && message.hasOwnProperty("tallyParams")) + object.tallyParams = $root.cosmos.gov.v1beta1.TallyParams.toObject(message.tallyParams, options); + return object; + }; + + /** + * Converts this GenesisState to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.GenesisState + * @instance + * @returns {Object.} JSON object + */ + GenesisState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GenesisState; + })(v1beta1.GenesisState || {}); + + /** + * VoteOption enum. + * @name cosmos.gov.v1beta1.VoteOption + * @enum {string} + * @property {number} VOTE_OPTION_UNSPECIFIED=0 VOTE_OPTION_UNSPECIFIED value + * @property {number} VOTE_OPTION_YES=1 VOTE_OPTION_YES value + * @property {number} VOTE_OPTION_ABSTAIN=2 VOTE_OPTION_ABSTAIN value + * @property {number} VOTE_OPTION_NO=3 VOTE_OPTION_NO value + * @property {number} VOTE_OPTION_NO_WITH_VETO=4 VOTE_OPTION_NO_WITH_VETO value + */ + v1beta1.VoteOption = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VOTE_OPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "VOTE_OPTION_YES"] = 1; + values[valuesById[2] = "VOTE_OPTION_ABSTAIN"] = 2; + values[valuesById[3] = "VOTE_OPTION_NO"] = 3; + values[valuesById[4] = "VOTE_OPTION_NO_WITH_VETO"] = 4; + return values; + })(); + + v1beta1.TextProposal = (function(TextProposal) { + + /** + * Properties of a TextProposal. + * @memberof cosmos.gov.v1beta1 + * @interface ITextProposal + * @property {string|null} [title] TextProposal title + * @property {string|null} [description] TextProposal description + */ + + /** + * Constructs a new TextProposal. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a TextProposal. + * @implements ITextProposal + * @constructor + * @param {cosmos.gov.v1beta1.ITextProposal=} [properties] Properties to set + */ + function TextProposal(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextProposal title. + * @member {string} title + * @memberof cosmos.gov.v1beta1.TextProposal + * @instance + */ + TextProposal.prototype.title = ""; + + /** + * TextProposal description. + * @member {string} description + * @memberof cosmos.gov.v1beta1.TextProposal + * @instance + */ + TextProposal.prototype.description = ""; + + /** + * Creates a new TextProposal instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.TextProposal + * @static + * @param {cosmos.gov.v1beta1.ITextProposal=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.TextProposal} TextProposal instance + */ + TextProposal.create = function create(properties) { + return new TextProposal(properties); + }; + + /** + * Encodes the specified TextProposal message. Does not implicitly {@link cosmos.gov.v1beta1.TextProposal.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.TextProposal + * @static + * @param {cosmos.gov.v1beta1.ITextProposal} message TextProposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextProposal.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + return writer; + }; + + /** + * Encodes the specified TextProposal message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.TextProposal.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.TextProposal + * @static + * @param {cosmos.gov.v1beta1.ITextProposal} message TextProposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextProposal.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextProposal message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.TextProposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.TextProposal} TextProposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextProposal.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.TextProposal(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextProposal message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.TextProposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.TextProposal} TextProposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextProposal.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextProposal message. + * @function verify + * @memberof cosmos.gov.v1beta1.TextProposal + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextProposal.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a TextProposal message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.TextProposal + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.TextProposal} TextProposal + */ + TextProposal.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.TextProposal) + return object; + let message = new $root.cosmos.gov.v1beta1.TextProposal(); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a TextProposal message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.TextProposal + * @static + * @param {cosmos.gov.v1beta1.TextProposal} message TextProposal + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextProposal.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.title = ""; + object.description = ""; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this TextProposal to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.TextProposal + * @instance + * @returns {Object.} JSON object + */ + TextProposal.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TextProposal; + })(v1beta1.TextProposal || {}); + + v1beta1.Deposit = (function(Deposit) { + + /** + * Properties of a Deposit. + * @memberof cosmos.gov.v1beta1 + * @interface IDeposit + * @property {number|Long|null} [proposalId] Deposit proposalId + * @property {string|null} [depositor] Deposit depositor + * @property {Array.|null} [amount] Deposit amount + */ + + /** + * Constructs a new Deposit. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a Deposit. + * @implements IDeposit + * @constructor + * @param {cosmos.gov.v1beta1.IDeposit=} [properties] Properties to set + */ + function Deposit(properties) { + this.amount = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Deposit proposalId. + * @member {number|Long} proposalId + * @memberof cosmos.gov.v1beta1.Deposit + * @instance + */ + Deposit.prototype.proposalId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Deposit depositor. + * @member {string} depositor + * @memberof cosmos.gov.v1beta1.Deposit + * @instance + */ + Deposit.prototype.depositor = ""; + + /** + * Deposit amount. + * @member {Array.} amount + * @memberof cosmos.gov.v1beta1.Deposit + * @instance + */ + Deposit.prototype.amount = $util.emptyArray; + + /** + * Creates a new Deposit instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.Deposit + * @static + * @param {cosmos.gov.v1beta1.IDeposit=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.Deposit} Deposit instance + */ + Deposit.create = function create(properties) { + return new Deposit(properties); + }; + + /** + * Encodes the specified Deposit message. Does not implicitly {@link cosmos.gov.v1beta1.Deposit.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.Deposit + * @static + * @param {cosmos.gov.v1beta1.IDeposit} message Deposit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deposit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proposalId != null && Object.hasOwnProperty.call(message, "proposalId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposalId); + if (message.depositor != null && Object.hasOwnProperty.call(message, "depositor")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.depositor); + if (message.amount != null && message.amount.length) + for (let i = 0; i < message.amount.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.amount[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Deposit message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.Deposit.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.Deposit + * @static + * @param {cosmos.gov.v1beta1.IDeposit} message Deposit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deposit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Deposit message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.Deposit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.Deposit} Deposit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deposit.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.Deposit(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.depositor = reader.string(); + break; + case 3: + if (!(message.amount && message.amount.length)) + message.amount = []; + message.amount.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Deposit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.Deposit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.Deposit} Deposit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deposit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Deposit message. + * @function verify + * @memberof cosmos.gov.v1beta1.Deposit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Deposit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (!$util.isInteger(message.proposalId) && !(message.proposalId && $util.isInteger(message.proposalId.low) && $util.isInteger(message.proposalId.high))) + return "proposalId: integer|Long expected"; + if (message.depositor != null && message.hasOwnProperty("depositor")) + if (!$util.isString(message.depositor)) + return "depositor: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + if (!Array.isArray(message.amount)) + return "amount: array expected"; + for (let i = 0; i < message.amount.length; ++i) { + let error = $root.cosmos.base.v1beta1.Coin.verify(message.amount[i]); + if (error) + return "amount." + error; + } + } + return null; + }; + + /** + * Creates a Deposit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.Deposit + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.Deposit} Deposit + */ + Deposit.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.Deposit) + return object; + let message = new $root.cosmos.gov.v1beta1.Deposit(); + if (object.proposalId != null) + if ($util.Long) + (message.proposalId = $util.Long.fromValue(object.proposalId)).unsigned = true; + else if (typeof object.proposalId === "string") + message.proposalId = parseInt(object.proposalId, 10); + else if (typeof object.proposalId === "number") + message.proposalId = object.proposalId; + else if (typeof object.proposalId === "object") + message.proposalId = new $util.LongBits(object.proposalId.low >>> 0, object.proposalId.high >>> 0).toNumber(true); + if (object.depositor != null) + message.depositor = String(object.depositor); + if (object.amount) { + if (!Array.isArray(object.amount)) + throw TypeError(".cosmos.gov.v1beta1.Deposit.amount: array expected"); + message.amount = []; + for (let i = 0; i < object.amount.length; ++i) { + if (typeof object.amount[i] !== "object") + throw TypeError(".cosmos.gov.v1beta1.Deposit.amount: object expected"); + message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Deposit message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.Deposit + * @static + * @param {cosmos.gov.v1beta1.Deposit} message Deposit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Deposit.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.amount = []; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.proposalId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.proposalId = options.longs === String ? "0" : 0; + object.depositor = ""; + } + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (typeof message.proposalId === "number") + object.proposalId = options.longs === String ? String(message.proposalId) : message.proposalId; + else + object.proposalId = options.longs === String ? $util.Long.prototype.toString.call(message.proposalId) : options.longs === Number ? new $util.LongBits(message.proposalId.low >>> 0, message.proposalId.high >>> 0).toNumber(true) : message.proposalId; + if (message.depositor != null && message.hasOwnProperty("depositor")) + object.depositor = message.depositor; + if (message.amount && message.amount.length) { + object.amount = []; + for (let j = 0; j < message.amount.length; ++j) + object.amount[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.amount[j], options); + } + return object; + }; + + /** + * Converts this Deposit to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.Deposit + * @instance + * @returns {Object.} JSON object + */ + Deposit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Deposit; + })(v1beta1.Deposit || {}); + + v1beta1.Proposal = (function(Proposal) { + + /** + * Properties of a Proposal. + * @memberof cosmos.gov.v1beta1 + * @interface IProposal + * @property {number|Long|null} [proposalId] Proposal proposalId + * @property {google.protobuf.IAny|null} [content] Proposal content + * @property {cosmos.gov.v1beta1.ProposalStatus|null} [status] Proposal status + * @property {cosmos.gov.v1beta1.ITallyResult|null} [finalTallyResult] Proposal finalTallyResult + * @property {google.protobuf.ITimestamp|null} [submitTime] Proposal submitTime + * @property {google.protobuf.ITimestamp|null} [depositEndTime] Proposal depositEndTime + * @property {Array.|null} [totalDeposit] Proposal totalDeposit + * @property {google.protobuf.ITimestamp|null} [votingStartTime] Proposal votingStartTime + * @property {google.protobuf.ITimestamp|null} [votingEndTime] Proposal votingEndTime + */ + + /** + * Constructs a new Proposal. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a Proposal. + * @implements IProposal + * @constructor + * @param {cosmos.gov.v1beta1.IProposal=} [properties] Properties to set + */ + function Proposal(properties) { + this.totalDeposit = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Proposal proposalId. + * @member {number|Long} proposalId + * @memberof cosmos.gov.v1beta1.Proposal + * @instance + */ + Proposal.prototype.proposalId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Proposal content. + * @member {google.protobuf.IAny|null|undefined} content + * @memberof cosmos.gov.v1beta1.Proposal + * @instance + */ + Proposal.prototype.content = null; + + /** + * Proposal status. + * @member {cosmos.gov.v1beta1.ProposalStatus} status + * @memberof cosmos.gov.v1beta1.Proposal + * @instance + */ + Proposal.prototype.status = 0; + + /** + * Proposal finalTallyResult. + * @member {cosmos.gov.v1beta1.ITallyResult|null|undefined} finalTallyResult + * @memberof cosmos.gov.v1beta1.Proposal + * @instance + */ + Proposal.prototype.finalTallyResult = null; + + /** + * Proposal submitTime. + * @member {google.protobuf.ITimestamp|null|undefined} submitTime + * @memberof cosmos.gov.v1beta1.Proposal + * @instance + */ + Proposal.prototype.submitTime = null; + + /** + * Proposal depositEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} depositEndTime + * @memberof cosmos.gov.v1beta1.Proposal + * @instance + */ + Proposal.prototype.depositEndTime = null; + + /** + * Proposal totalDeposit. + * @member {Array.} totalDeposit + * @memberof cosmos.gov.v1beta1.Proposal + * @instance + */ + Proposal.prototype.totalDeposit = $util.emptyArray; + + /** + * Proposal votingStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} votingStartTime + * @memberof cosmos.gov.v1beta1.Proposal + * @instance + */ + Proposal.prototype.votingStartTime = null; + + /** + * Proposal votingEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} votingEndTime + * @memberof cosmos.gov.v1beta1.Proposal + * @instance + */ + Proposal.prototype.votingEndTime = null; + + /** + * Creates a new Proposal instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.Proposal + * @static + * @param {cosmos.gov.v1beta1.IProposal=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.Proposal} Proposal instance + */ + Proposal.create = function create(properties) { + return new Proposal(properties); + }; + + /** + * Encodes the specified Proposal message. Does not implicitly {@link cosmos.gov.v1beta1.Proposal.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.Proposal + * @static + * @param {cosmos.gov.v1beta1.IProposal} message Proposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proposal.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proposalId != null && Object.hasOwnProperty.call(message, "proposalId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposalId); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + $root.google.protobuf.Any.encode(message.content, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.status); + if (message.finalTallyResult != null && Object.hasOwnProperty.call(message, "finalTallyResult")) + $root.cosmos.gov.v1beta1.TallyResult.encode(message.finalTallyResult, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.depositEndTime != null && Object.hasOwnProperty.call(message, "depositEndTime")) + $root.google.protobuf.Timestamp.encode(message.depositEndTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.totalDeposit != null && message.totalDeposit.length) + for (let i = 0; i < message.totalDeposit.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.totalDeposit[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.votingStartTime != null && Object.hasOwnProperty.call(message, "votingStartTime")) + $root.google.protobuf.Timestamp.encode(message.votingStartTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.votingEndTime != null && Object.hasOwnProperty.call(message, "votingEndTime")) + $root.google.protobuf.Timestamp.encode(message.votingEndTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Proposal message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.Proposal.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.Proposal + * @static + * @param {cosmos.gov.v1beta1.IProposal} message Proposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proposal.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Proposal message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.Proposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.Proposal} Proposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proposal.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.Proposal(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.content = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 3: + message.status = reader.int32(); + break; + case 4: + message.finalTallyResult = $root.cosmos.gov.v1beta1.TallyResult.decode(reader, reader.uint32()); + break; + case 5: + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.depositEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 7: + if (!(message.totalDeposit && message.totalDeposit.length)) + message.totalDeposit = []; + message.totalDeposit.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + case 8: + message.votingStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 9: + message.votingEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Proposal message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.Proposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.Proposal} Proposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proposal.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Proposal message. + * @function verify + * @memberof cosmos.gov.v1beta1.Proposal + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Proposal.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (!$util.isInteger(message.proposalId) && !(message.proposalId && $util.isInteger(message.proposalId.low) && $util.isInteger(message.proposalId.high))) + return "proposalId: integer|Long expected"; + if (message.content != null && message.hasOwnProperty("content")) { + let error = $root.google.protobuf.Any.verify(message.content); + if (error) + return "content." + error; + } + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.finalTallyResult != null && message.hasOwnProperty("finalTallyResult")) { + let error = $root.cosmos.gov.v1beta1.TallyResult.verify(message.finalTallyResult); + if (error) + return "finalTallyResult." + error; + } + if (message.submitTime != null && message.hasOwnProperty("submitTime")) { + let error = $root.google.protobuf.Timestamp.verify(message.submitTime); + if (error) + return "submitTime." + error; + } + if (message.depositEndTime != null && message.hasOwnProperty("depositEndTime")) { + let error = $root.google.protobuf.Timestamp.verify(message.depositEndTime); + if (error) + return "depositEndTime." + error; + } + if (message.totalDeposit != null && message.hasOwnProperty("totalDeposit")) { + if (!Array.isArray(message.totalDeposit)) + return "totalDeposit: array expected"; + for (let i = 0; i < message.totalDeposit.length; ++i) { + let error = $root.cosmos.base.v1beta1.Coin.verify(message.totalDeposit[i]); + if (error) + return "totalDeposit." + error; + } + } + if (message.votingStartTime != null && message.hasOwnProperty("votingStartTime")) { + let error = $root.google.protobuf.Timestamp.verify(message.votingStartTime); + if (error) + return "votingStartTime." + error; + } + if (message.votingEndTime != null && message.hasOwnProperty("votingEndTime")) { + let error = $root.google.protobuf.Timestamp.verify(message.votingEndTime); + if (error) + return "votingEndTime." + error; + } + return null; + }; + + /** + * Creates a Proposal message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.Proposal + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.Proposal} Proposal + */ + Proposal.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.Proposal) + return object; + let message = new $root.cosmos.gov.v1beta1.Proposal(); + if (object.proposalId != null) + if ($util.Long) + (message.proposalId = $util.Long.fromValue(object.proposalId)).unsigned = true; + else if (typeof object.proposalId === "string") + message.proposalId = parseInt(object.proposalId, 10); + else if (typeof object.proposalId === "number") + message.proposalId = object.proposalId; + else if (typeof object.proposalId === "object") + message.proposalId = new $util.LongBits(object.proposalId.low >>> 0, object.proposalId.high >>> 0).toNumber(true); + if (object.content != null) { + if (typeof object.content !== "object") + throw TypeError(".cosmos.gov.v1beta1.Proposal.content: object expected"); + message.content = $root.google.protobuf.Any.fromObject(object.content); + } + switch (object.status) { + case "PROPOSAL_STATUS_UNSPECIFIED": + case 0: + message.status = 0; + break; + case "PROPOSAL_STATUS_DEPOSIT_PERIOD": + case 1: + message.status = 1; + break; + case "PROPOSAL_STATUS_VOTING_PERIOD": + case 2: + message.status = 2; + break; + case "PROPOSAL_STATUS_PASSED": + case 3: + message.status = 3; + break; + case "PROPOSAL_STATUS_REJECTED": + case 4: + message.status = 4; + break; + case "PROPOSAL_STATUS_FAILED": + case 5: + message.status = 5; + break; + } + if (object.finalTallyResult != null) { + if (typeof object.finalTallyResult !== "object") + throw TypeError(".cosmos.gov.v1beta1.Proposal.finalTallyResult: object expected"); + message.finalTallyResult = $root.cosmos.gov.v1beta1.TallyResult.fromObject(object.finalTallyResult); + } + if (object.submitTime != null) { + if (typeof object.submitTime !== "object") + throw TypeError(".cosmos.gov.v1beta1.Proposal.submitTime: object expected"); + message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + } + if (object.depositEndTime != null) { + if (typeof object.depositEndTime !== "object") + throw TypeError(".cosmos.gov.v1beta1.Proposal.depositEndTime: object expected"); + message.depositEndTime = $root.google.protobuf.Timestamp.fromObject(object.depositEndTime); + } + if (object.totalDeposit) { + if (!Array.isArray(object.totalDeposit)) + throw TypeError(".cosmos.gov.v1beta1.Proposal.totalDeposit: array expected"); + message.totalDeposit = []; + for (let i = 0; i < object.totalDeposit.length; ++i) { + if (typeof object.totalDeposit[i] !== "object") + throw TypeError(".cosmos.gov.v1beta1.Proposal.totalDeposit: object expected"); + message.totalDeposit[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.totalDeposit[i]); + } + } + if (object.votingStartTime != null) { + if (typeof object.votingStartTime !== "object") + throw TypeError(".cosmos.gov.v1beta1.Proposal.votingStartTime: object expected"); + message.votingStartTime = $root.google.protobuf.Timestamp.fromObject(object.votingStartTime); + } + if (object.votingEndTime != null) { + if (typeof object.votingEndTime !== "object") + throw TypeError(".cosmos.gov.v1beta1.Proposal.votingEndTime: object expected"); + message.votingEndTime = $root.google.protobuf.Timestamp.fromObject(object.votingEndTime); + } + return message; + }; + + /** + * Creates a plain object from a Proposal message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.Proposal + * @static + * @param {cosmos.gov.v1beta1.Proposal} message Proposal + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Proposal.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.totalDeposit = []; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.proposalId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.proposalId = options.longs === String ? "0" : 0; + object.content = null; + object.status = options.enums === String ? "PROPOSAL_STATUS_UNSPECIFIED" : 0; + object.finalTallyResult = null; + object.submitTime = null; + object.depositEndTime = null; + object.votingStartTime = null; + object.votingEndTime = null; + } + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (typeof message.proposalId === "number") + object.proposalId = options.longs === String ? String(message.proposalId) : message.proposalId; + else + object.proposalId = options.longs === String ? $util.Long.prototype.toString.call(message.proposalId) : options.longs === Number ? new $util.LongBits(message.proposalId.low >>> 0, message.proposalId.high >>> 0).toNumber(true) : message.proposalId; + if (message.content != null && message.hasOwnProperty("content")) + object.content = $root.google.protobuf.Any.toObject(message.content, options); + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.cosmos.gov.v1beta1.ProposalStatus[message.status] : message.status; + if (message.finalTallyResult != null && message.hasOwnProperty("finalTallyResult")) + object.finalTallyResult = $root.cosmos.gov.v1beta1.TallyResult.toObject(message.finalTallyResult, options); + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); + if (message.depositEndTime != null && message.hasOwnProperty("depositEndTime")) + object.depositEndTime = $root.google.protobuf.Timestamp.toObject(message.depositEndTime, options); + if (message.totalDeposit && message.totalDeposit.length) { + object.totalDeposit = []; + for (let j = 0; j < message.totalDeposit.length; ++j) + object.totalDeposit[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.totalDeposit[j], options); + } + if (message.votingStartTime != null && message.hasOwnProperty("votingStartTime")) + object.votingStartTime = $root.google.protobuf.Timestamp.toObject(message.votingStartTime, options); + if (message.votingEndTime != null && message.hasOwnProperty("votingEndTime")) + object.votingEndTime = $root.google.protobuf.Timestamp.toObject(message.votingEndTime, options); + return object; + }; + + /** + * Converts this Proposal to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.Proposal + * @instance + * @returns {Object.} JSON object + */ + Proposal.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Proposal; + })(v1beta1.Proposal || {}); + + /** + * ProposalStatus enum. + * @name cosmos.gov.v1beta1.ProposalStatus + * @enum {string} + * @property {number} PROPOSAL_STATUS_UNSPECIFIED=0 PROPOSAL_STATUS_UNSPECIFIED value + * @property {number} PROPOSAL_STATUS_DEPOSIT_PERIOD=1 PROPOSAL_STATUS_DEPOSIT_PERIOD value + * @property {number} PROPOSAL_STATUS_VOTING_PERIOD=2 PROPOSAL_STATUS_VOTING_PERIOD value + * @property {number} PROPOSAL_STATUS_PASSED=3 PROPOSAL_STATUS_PASSED value + * @property {number} PROPOSAL_STATUS_REJECTED=4 PROPOSAL_STATUS_REJECTED value + * @property {number} PROPOSAL_STATUS_FAILED=5 PROPOSAL_STATUS_FAILED value + */ + v1beta1.ProposalStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROPOSAL_STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "PROPOSAL_STATUS_DEPOSIT_PERIOD"] = 1; + values[valuesById[2] = "PROPOSAL_STATUS_VOTING_PERIOD"] = 2; + values[valuesById[3] = "PROPOSAL_STATUS_PASSED"] = 3; + values[valuesById[4] = "PROPOSAL_STATUS_REJECTED"] = 4; + values[valuesById[5] = "PROPOSAL_STATUS_FAILED"] = 5; + return values; + })(); + + v1beta1.TallyResult = (function(TallyResult) { + + /** + * Properties of a TallyResult. + * @memberof cosmos.gov.v1beta1 + * @interface ITallyResult + * @property {string|null} [yes] TallyResult yes + * @property {string|null} [abstain] TallyResult abstain + * @property {string|null} [no] TallyResult no + * @property {string|null} [noWithVeto] TallyResult noWithVeto + */ + + /** + * Constructs a new TallyResult. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a TallyResult. + * @implements ITallyResult + * @constructor + * @param {cosmos.gov.v1beta1.ITallyResult=} [properties] Properties to set + */ + function TallyResult(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TallyResult yes. + * @member {string} yes + * @memberof cosmos.gov.v1beta1.TallyResult + * @instance + */ + TallyResult.prototype.yes = ""; + + /** + * TallyResult abstain. + * @member {string} abstain + * @memberof cosmos.gov.v1beta1.TallyResult + * @instance + */ + TallyResult.prototype.abstain = ""; + + /** + * TallyResult no. + * @member {string} no + * @memberof cosmos.gov.v1beta1.TallyResult + * @instance + */ + TallyResult.prototype.no = ""; + + /** + * TallyResult noWithVeto. + * @member {string} noWithVeto + * @memberof cosmos.gov.v1beta1.TallyResult + * @instance + */ + TallyResult.prototype.noWithVeto = ""; + + /** + * Creates a new TallyResult instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.TallyResult + * @static + * @param {cosmos.gov.v1beta1.ITallyResult=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.TallyResult} TallyResult instance + */ + TallyResult.create = function create(properties) { + return new TallyResult(properties); + }; + + /** + * Encodes the specified TallyResult message. Does not implicitly {@link cosmos.gov.v1beta1.TallyResult.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.TallyResult + * @static + * @param {cosmos.gov.v1beta1.ITallyResult} message TallyResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TallyResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.yes != null && Object.hasOwnProperty.call(message, "yes")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.yes); + if (message.abstain != null && Object.hasOwnProperty.call(message, "abstain")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.abstain); + if (message.no != null && Object.hasOwnProperty.call(message, "no")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.no); + if (message.noWithVeto != null && Object.hasOwnProperty.call(message, "noWithVeto")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.noWithVeto); + return writer; + }; + + /** + * Encodes the specified TallyResult message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.TallyResult.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.TallyResult + * @static + * @param {cosmos.gov.v1beta1.ITallyResult} message TallyResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TallyResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TallyResult message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.TallyResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.TallyResult} TallyResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TallyResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.TallyResult(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.yes = reader.string(); + break; + case 2: + message.abstain = reader.string(); + break; + case 3: + message.no = reader.string(); + break; + case 4: + message.noWithVeto = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TallyResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.TallyResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.TallyResult} TallyResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TallyResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TallyResult message. + * @function verify + * @memberof cosmos.gov.v1beta1.TallyResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TallyResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.yes != null && message.hasOwnProperty("yes")) + if (!$util.isString(message.yes)) + return "yes: string expected"; + if (message.abstain != null && message.hasOwnProperty("abstain")) + if (!$util.isString(message.abstain)) + return "abstain: string expected"; + if (message.no != null && message.hasOwnProperty("no")) + if (!$util.isString(message.no)) + return "no: string expected"; + if (message.noWithVeto != null && message.hasOwnProperty("noWithVeto")) + if (!$util.isString(message.noWithVeto)) + return "noWithVeto: string expected"; + return null; + }; + + /** + * Creates a TallyResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.TallyResult + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.TallyResult} TallyResult + */ + TallyResult.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.TallyResult) + return object; + let message = new $root.cosmos.gov.v1beta1.TallyResult(); + if (object.yes != null) + message.yes = String(object.yes); + if (object.abstain != null) + message.abstain = String(object.abstain); + if (object.no != null) + message.no = String(object.no); + if (object.noWithVeto != null) + message.noWithVeto = String(object.noWithVeto); + return message; + }; + + /** + * Creates a plain object from a TallyResult message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.TallyResult + * @static + * @param {cosmos.gov.v1beta1.TallyResult} message TallyResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TallyResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.yes = ""; + object.abstain = ""; + object.no = ""; + object.noWithVeto = ""; + } + if (message.yes != null && message.hasOwnProperty("yes")) + object.yes = message.yes; + if (message.abstain != null && message.hasOwnProperty("abstain")) + object.abstain = message.abstain; + if (message.no != null && message.hasOwnProperty("no")) + object.no = message.no; + if (message.noWithVeto != null && message.hasOwnProperty("noWithVeto")) + object.noWithVeto = message.noWithVeto; + return object; + }; + + /** + * Converts this TallyResult to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.TallyResult + * @instance + * @returns {Object.} JSON object + */ + TallyResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TallyResult; + })(v1beta1.TallyResult || {}); + + v1beta1.Vote = (function(Vote) { + + /** + * Properties of a Vote. + * @memberof cosmos.gov.v1beta1 + * @interface IVote + * @property {number|Long|null} [proposalId] Vote proposalId + * @property {string|null} [voter] Vote voter + * @property {cosmos.gov.v1beta1.VoteOption|null} [option] Vote option + */ + + /** + * Constructs a new Vote. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a Vote. + * @implements IVote + * @constructor + * @param {cosmos.gov.v1beta1.IVote=} [properties] Properties to set + */ + function Vote(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Vote proposalId. + * @member {number|Long} proposalId + * @memberof cosmos.gov.v1beta1.Vote + * @instance + */ + Vote.prototype.proposalId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Vote voter. + * @member {string} voter + * @memberof cosmos.gov.v1beta1.Vote + * @instance + */ + Vote.prototype.voter = ""; + + /** + * Vote option. + * @member {cosmos.gov.v1beta1.VoteOption} option + * @memberof cosmos.gov.v1beta1.Vote + * @instance + */ + Vote.prototype.option = 0; + + /** + * Creates a new Vote instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.Vote + * @static + * @param {cosmos.gov.v1beta1.IVote=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.Vote} Vote instance + */ + Vote.create = function create(properties) { + return new Vote(properties); + }; + + /** + * Encodes the specified Vote message. Does not implicitly {@link cosmos.gov.v1beta1.Vote.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.Vote + * @static + * @param {cosmos.gov.v1beta1.IVote} message Vote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vote.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proposalId != null && Object.hasOwnProperty.call(message, "proposalId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposalId); + if (message.voter != null && Object.hasOwnProperty.call(message, "voter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.voter); + if (message.option != null && Object.hasOwnProperty.call(message, "option")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.option); + return writer; + }; + + /** + * Encodes the specified Vote message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.Vote.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.Vote + * @static + * @param {cosmos.gov.v1beta1.IVote} message Vote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vote.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Vote message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.Vote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.Vote} Vote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vote.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.Vote(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.voter = reader.string(); + break; + case 3: + message.option = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Vote message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.Vote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.Vote} Vote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vote.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Vote message. + * @function verify + * @memberof cosmos.gov.v1beta1.Vote + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Vote.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (!$util.isInteger(message.proposalId) && !(message.proposalId && $util.isInteger(message.proposalId.low) && $util.isInteger(message.proposalId.high))) + return "proposalId: integer|Long expected"; + if (message.voter != null && message.hasOwnProperty("voter")) + if (!$util.isString(message.voter)) + return "voter: string expected"; + if (message.option != null && message.hasOwnProperty("option")) + switch (message.option) { + default: + return "option: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a Vote message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.Vote + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.Vote} Vote + */ + Vote.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.Vote) + return object; + let message = new $root.cosmos.gov.v1beta1.Vote(); + if (object.proposalId != null) + if ($util.Long) + (message.proposalId = $util.Long.fromValue(object.proposalId)).unsigned = true; + else if (typeof object.proposalId === "string") + message.proposalId = parseInt(object.proposalId, 10); + else if (typeof object.proposalId === "number") + message.proposalId = object.proposalId; + else if (typeof object.proposalId === "object") + message.proposalId = new $util.LongBits(object.proposalId.low >>> 0, object.proposalId.high >>> 0).toNumber(true); + if (object.voter != null) + message.voter = String(object.voter); + switch (object.option) { + case "VOTE_OPTION_UNSPECIFIED": + case 0: + message.option = 0; + break; + case "VOTE_OPTION_YES": + case 1: + message.option = 1; + break; + case "VOTE_OPTION_ABSTAIN": + case 2: + message.option = 2; + break; + case "VOTE_OPTION_NO": + case 3: + message.option = 3; + break; + case "VOTE_OPTION_NO_WITH_VETO": + case 4: + message.option = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a Vote message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.Vote + * @static + * @param {cosmos.gov.v1beta1.Vote} message Vote + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Vote.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.proposalId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.proposalId = options.longs === String ? "0" : 0; + object.voter = ""; + object.option = options.enums === String ? "VOTE_OPTION_UNSPECIFIED" : 0; + } + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (typeof message.proposalId === "number") + object.proposalId = options.longs === String ? String(message.proposalId) : message.proposalId; + else + object.proposalId = options.longs === String ? $util.Long.prototype.toString.call(message.proposalId) : options.longs === Number ? new $util.LongBits(message.proposalId.low >>> 0, message.proposalId.high >>> 0).toNumber(true) : message.proposalId; + if (message.voter != null && message.hasOwnProperty("voter")) + object.voter = message.voter; + if (message.option != null && message.hasOwnProperty("option")) + object.option = options.enums === String ? $root.cosmos.gov.v1beta1.VoteOption[message.option] : message.option; + return object; + }; + + /** + * Converts this Vote to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.Vote + * @instance + * @returns {Object.} JSON object + */ + Vote.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Vote; + })(v1beta1.Vote || {}); + + v1beta1.DepositParams = (function(DepositParams) { + + /** + * Properties of a DepositParams. + * @memberof cosmos.gov.v1beta1 + * @interface IDepositParams + * @property {Array.|null} [minDeposit] DepositParams minDeposit + * @property {google.protobuf.IDuration|null} [maxDepositPeriod] DepositParams maxDepositPeriod + */ + + /** + * Constructs a new DepositParams. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a DepositParams. + * @implements IDepositParams + * @constructor + * @param {cosmos.gov.v1beta1.IDepositParams=} [properties] Properties to set + */ + function DepositParams(properties) { + this.minDeposit = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DepositParams minDeposit. + * @member {Array.} minDeposit + * @memberof cosmos.gov.v1beta1.DepositParams + * @instance + */ + DepositParams.prototype.minDeposit = $util.emptyArray; + + /** + * DepositParams maxDepositPeriod. + * @member {google.protobuf.IDuration|null|undefined} maxDepositPeriod + * @memberof cosmos.gov.v1beta1.DepositParams + * @instance + */ + DepositParams.prototype.maxDepositPeriod = null; + + /** + * Creates a new DepositParams instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.DepositParams + * @static + * @param {cosmos.gov.v1beta1.IDepositParams=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.DepositParams} DepositParams instance + */ + DepositParams.create = function create(properties) { + return new DepositParams(properties); + }; + + /** + * Encodes the specified DepositParams message. Does not implicitly {@link cosmos.gov.v1beta1.DepositParams.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.DepositParams + * @static + * @param {cosmos.gov.v1beta1.IDepositParams} message DepositParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DepositParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minDeposit != null && message.minDeposit.length) + for (let i = 0; i < message.minDeposit.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.minDeposit[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.maxDepositPeriod != null && Object.hasOwnProperty.call(message, "maxDepositPeriod")) + $root.google.protobuf.Duration.encode(message.maxDepositPeriod, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DepositParams message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.DepositParams.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.DepositParams + * @static + * @param {cosmos.gov.v1beta1.IDepositParams} message DepositParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DepositParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DepositParams message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.DepositParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.DepositParams} DepositParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DepositParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.DepositParams(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.minDeposit && message.minDeposit.length)) + message.minDeposit = []; + message.minDeposit.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + case 2: + message.maxDepositPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DepositParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.DepositParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.DepositParams} DepositParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DepositParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DepositParams message. + * @function verify + * @memberof cosmos.gov.v1beta1.DepositParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DepositParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.minDeposit != null && message.hasOwnProperty("minDeposit")) { + if (!Array.isArray(message.minDeposit)) + return "minDeposit: array expected"; + for (let i = 0; i < message.minDeposit.length; ++i) { + let error = $root.cosmos.base.v1beta1.Coin.verify(message.minDeposit[i]); + if (error) + return "minDeposit." + error; + } + } + if (message.maxDepositPeriod != null && message.hasOwnProperty("maxDepositPeriod")) { + let error = $root.google.protobuf.Duration.verify(message.maxDepositPeriod); + if (error) + return "maxDepositPeriod." + error; + } + return null; + }; + + /** + * Creates a DepositParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.DepositParams + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.DepositParams} DepositParams + */ + DepositParams.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.DepositParams) + return object; + let message = new $root.cosmos.gov.v1beta1.DepositParams(); + if (object.minDeposit) { + if (!Array.isArray(object.minDeposit)) + throw TypeError(".cosmos.gov.v1beta1.DepositParams.minDeposit: array expected"); + message.minDeposit = []; + for (let i = 0; i < object.minDeposit.length; ++i) { + if (typeof object.minDeposit[i] !== "object") + throw TypeError(".cosmos.gov.v1beta1.DepositParams.minDeposit: object expected"); + message.minDeposit[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.minDeposit[i]); + } + } + if (object.maxDepositPeriod != null) { + if (typeof object.maxDepositPeriod !== "object") + throw TypeError(".cosmos.gov.v1beta1.DepositParams.maxDepositPeriod: object expected"); + message.maxDepositPeriod = $root.google.protobuf.Duration.fromObject(object.maxDepositPeriod); + } + return message; + }; + + /** + * Creates a plain object from a DepositParams message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.DepositParams + * @static + * @param {cosmos.gov.v1beta1.DepositParams} message DepositParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DepositParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.minDeposit = []; + if (options.defaults) + object.maxDepositPeriod = null; + if (message.minDeposit && message.minDeposit.length) { + object.minDeposit = []; + for (let j = 0; j < message.minDeposit.length; ++j) + object.minDeposit[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.minDeposit[j], options); + } + if (message.maxDepositPeriod != null && message.hasOwnProperty("maxDepositPeriod")) + object.maxDepositPeriod = $root.google.protobuf.Duration.toObject(message.maxDepositPeriod, options); + return object; + }; + + /** + * Converts this DepositParams to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.DepositParams + * @instance + * @returns {Object.} JSON object + */ + DepositParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DepositParams; + })(v1beta1.DepositParams || {}); + + v1beta1.VotingParams = (function(VotingParams) { + + /** + * Properties of a VotingParams. + * @memberof cosmos.gov.v1beta1 + * @interface IVotingParams + * @property {google.protobuf.IDuration|null} [votingPeriod] VotingParams votingPeriod + */ + + /** + * Constructs a new VotingParams. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a VotingParams. + * @implements IVotingParams + * @constructor + * @param {cosmos.gov.v1beta1.IVotingParams=} [properties] Properties to set + */ + function VotingParams(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VotingParams votingPeriod. + * @member {google.protobuf.IDuration|null|undefined} votingPeriod + * @memberof cosmos.gov.v1beta1.VotingParams + * @instance + */ + VotingParams.prototype.votingPeriod = null; + + /** + * Creates a new VotingParams instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.VotingParams + * @static + * @param {cosmos.gov.v1beta1.IVotingParams=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.VotingParams} VotingParams instance + */ + VotingParams.create = function create(properties) { + return new VotingParams(properties); + }; + + /** + * Encodes the specified VotingParams message. Does not implicitly {@link cosmos.gov.v1beta1.VotingParams.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.VotingParams + * @static + * @param {cosmos.gov.v1beta1.IVotingParams} message VotingParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VotingParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.votingPeriod != null && Object.hasOwnProperty.call(message, "votingPeriod")) + $root.google.protobuf.Duration.encode(message.votingPeriod, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VotingParams message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.VotingParams.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.VotingParams + * @static + * @param {cosmos.gov.v1beta1.IVotingParams} message VotingParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VotingParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VotingParams message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.VotingParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.VotingParams} VotingParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VotingParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.VotingParams(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votingPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VotingParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.VotingParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.VotingParams} VotingParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VotingParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VotingParams message. + * @function verify + * @memberof cosmos.gov.v1beta1.VotingParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VotingParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.votingPeriod != null && message.hasOwnProperty("votingPeriod")) { + let error = $root.google.protobuf.Duration.verify(message.votingPeriod); + if (error) + return "votingPeriod." + error; + } + return null; + }; + + /** + * Creates a VotingParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.VotingParams + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.VotingParams} VotingParams + */ + VotingParams.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.VotingParams) + return object; + let message = new $root.cosmos.gov.v1beta1.VotingParams(); + if (object.votingPeriod != null) { + if (typeof object.votingPeriod !== "object") + throw TypeError(".cosmos.gov.v1beta1.VotingParams.votingPeriod: object expected"); + message.votingPeriod = $root.google.protobuf.Duration.fromObject(object.votingPeriod); + } + return message; + }; + + /** + * Creates a plain object from a VotingParams message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.VotingParams + * @static + * @param {cosmos.gov.v1beta1.VotingParams} message VotingParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VotingParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.votingPeriod = null; + if (message.votingPeriod != null && message.hasOwnProperty("votingPeriod")) + object.votingPeriod = $root.google.protobuf.Duration.toObject(message.votingPeriod, options); + return object; + }; + + /** + * Converts this VotingParams to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.VotingParams + * @instance + * @returns {Object.} JSON object + */ + VotingParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VotingParams; + })(v1beta1.VotingParams || {}); + + v1beta1.TallyParams = (function(TallyParams) { + + /** + * Properties of a TallyParams. + * @memberof cosmos.gov.v1beta1 + * @interface ITallyParams + * @property {Uint8Array|null} [quorum] TallyParams quorum + * @property {Uint8Array|null} [threshold] TallyParams threshold + * @property {Uint8Array|null} [vetoThreshold] TallyParams vetoThreshold + */ + + /** + * Constructs a new TallyParams. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a TallyParams. + * @implements ITallyParams + * @constructor + * @param {cosmos.gov.v1beta1.ITallyParams=} [properties] Properties to set + */ + function TallyParams(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TallyParams quorum. + * @member {Uint8Array} quorum + * @memberof cosmos.gov.v1beta1.TallyParams + * @instance + */ + TallyParams.prototype.quorum = $util.newBuffer([]); + + /** + * TallyParams threshold. + * @member {Uint8Array} threshold + * @memberof cosmos.gov.v1beta1.TallyParams + * @instance + */ + TallyParams.prototype.threshold = $util.newBuffer([]); + + /** + * TallyParams vetoThreshold. + * @member {Uint8Array} vetoThreshold + * @memberof cosmos.gov.v1beta1.TallyParams + * @instance + */ + TallyParams.prototype.vetoThreshold = $util.newBuffer([]); + + /** + * Creates a new TallyParams instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.TallyParams + * @static + * @param {cosmos.gov.v1beta1.ITallyParams=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.TallyParams} TallyParams instance + */ + TallyParams.create = function create(properties) { + return new TallyParams(properties); + }; + + /** + * Encodes the specified TallyParams message. Does not implicitly {@link cosmos.gov.v1beta1.TallyParams.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.TallyParams + * @static + * @param {cosmos.gov.v1beta1.ITallyParams} message TallyParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TallyParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quorum != null && Object.hasOwnProperty.call(message, "quorum")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.quorum); + if (message.threshold != null && Object.hasOwnProperty.call(message, "threshold")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.threshold); + if (message.vetoThreshold != null && Object.hasOwnProperty.call(message, "vetoThreshold")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.vetoThreshold); + return writer; + }; + + /** + * Encodes the specified TallyParams message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.TallyParams.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.TallyParams + * @static + * @param {cosmos.gov.v1beta1.ITallyParams} message TallyParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TallyParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TallyParams message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.TallyParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.TallyParams} TallyParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TallyParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.TallyParams(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.quorum = reader.bytes(); + break; + case 2: + message.threshold = reader.bytes(); + break; + case 3: + message.vetoThreshold = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TallyParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.TallyParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.TallyParams} TallyParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TallyParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TallyParams message. + * @function verify + * @memberof cosmos.gov.v1beta1.TallyParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TallyParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quorum != null && message.hasOwnProperty("quorum")) + if (!(message.quorum && typeof message.quorum.length === "number" || $util.isString(message.quorum))) + return "quorum: buffer expected"; + if (message.threshold != null && message.hasOwnProperty("threshold")) + if (!(message.threshold && typeof message.threshold.length === "number" || $util.isString(message.threshold))) + return "threshold: buffer expected"; + if (message.vetoThreshold != null && message.hasOwnProperty("vetoThreshold")) + if (!(message.vetoThreshold && typeof message.vetoThreshold.length === "number" || $util.isString(message.vetoThreshold))) + return "vetoThreshold: buffer expected"; + return null; + }; + + /** + * Creates a TallyParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.TallyParams + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.TallyParams} TallyParams + */ + TallyParams.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.TallyParams) + return object; + let message = new $root.cosmos.gov.v1beta1.TallyParams(); + if (object.quorum != null) + if (typeof object.quorum === "string") + $util.base64.decode(object.quorum, message.quorum = $util.newBuffer($util.base64.length(object.quorum)), 0); + else if (object.quorum.length) + message.quorum = object.quorum; + if (object.threshold != null) + if (typeof object.threshold === "string") + $util.base64.decode(object.threshold, message.threshold = $util.newBuffer($util.base64.length(object.threshold)), 0); + else if (object.threshold.length) + message.threshold = object.threshold; + if (object.vetoThreshold != null) + if (typeof object.vetoThreshold === "string") + $util.base64.decode(object.vetoThreshold, message.vetoThreshold = $util.newBuffer($util.base64.length(object.vetoThreshold)), 0); + else if (object.vetoThreshold.length) + message.vetoThreshold = object.vetoThreshold; + return message; + }; + + /** + * Creates a plain object from a TallyParams message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.TallyParams + * @static + * @param {cosmos.gov.v1beta1.TallyParams} message TallyParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TallyParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if (options.bytes === String) + object.quorum = ""; + else { + object.quorum = []; + if (options.bytes !== Array) + object.quorum = $util.newBuffer(object.quorum); + } + if (options.bytes === String) + object.threshold = ""; + else { + object.threshold = []; + if (options.bytes !== Array) + object.threshold = $util.newBuffer(object.threshold); + } + if (options.bytes === String) + object.vetoThreshold = ""; + else { + object.vetoThreshold = []; + if (options.bytes !== Array) + object.vetoThreshold = $util.newBuffer(object.vetoThreshold); + } + } + if (message.quorum != null && message.hasOwnProperty("quorum")) + object.quorum = options.bytes === String ? $util.base64.encode(message.quorum, 0, message.quorum.length) : options.bytes === Array ? Array.prototype.slice.call(message.quorum) : message.quorum; + if (message.threshold != null && message.hasOwnProperty("threshold")) + object.threshold = options.bytes === String ? $util.base64.encode(message.threshold, 0, message.threshold.length) : options.bytes === Array ? Array.prototype.slice.call(message.threshold) : message.threshold; + if (message.vetoThreshold != null && message.hasOwnProperty("vetoThreshold")) + object.vetoThreshold = options.bytes === String ? $util.base64.encode(message.vetoThreshold, 0, message.vetoThreshold.length) : options.bytes === Array ? Array.prototype.slice.call(message.vetoThreshold) : message.vetoThreshold; + return object; + }; + + /** + * Converts this TallyParams to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.TallyParams + * @instance + * @returns {Object.} JSON object + */ + TallyParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TallyParams; + })(v1beta1.TallyParams || {}); + + v1beta1.Query = (function(Query) { + + /** + * Constructs a new Query service. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a Query + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Query(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; + + /** + * Creates new Query service using the specified rpc implementation. + * @function create + * @memberof cosmos.gov.v1beta1.Query + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Query} RPC service. Useful where requests and/or responses are streamed. + */ + Query.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.gov.v1beta1.Query#proposal}. + * @memberof cosmos.gov.v1beta1.Query + * @typedef ProposalCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.gov.v1beta1.IQueryProposalResponse} [response] QueryProposalResponse + */ + + /** + * Calls Proposal. + * @function proposal + * @memberof cosmos.gov.v1beta1.Query + * @instance + * @param {cosmos.gov.v1beta1.IQueryProposalRequest} request QueryProposalRequest message or plain object + * @param {cosmos.gov.v1beta1.Query.ProposalCallback} callback Node-style callback called with the error, if any, and QueryProposalResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.proposal = function proposal(request, callback) { + return this.rpcCall(proposal, $root.cosmos.gov.v1beta1.QueryProposalRequest, $root.cosmos.gov.v1beta1.QueryProposalResponse, request, callback); + }, "name", { value: "Proposal" }); + + /** + * Calls Proposal. + * @function proposal + * @memberof cosmos.gov.v1beta1.Query + * @instance + * @param {cosmos.gov.v1beta1.IQueryProposalRequest} request QueryProposalRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.gov.v1beta1.Query#proposals}. + * @memberof cosmos.gov.v1beta1.Query + * @typedef ProposalsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.gov.v1beta1.IQueryProposalsResponse} [response] QueryProposalsResponse + */ + + /** + * Calls Proposals. + * @function proposals + * @memberof cosmos.gov.v1beta1.Query + * @instance + * @param {cosmos.gov.v1beta1.IQueryProposalsRequest} request QueryProposalsRequest message or plain object + * @param {cosmos.gov.v1beta1.Query.ProposalsCallback} callback Node-style callback called with the error, if any, and QueryProposalsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.proposals = function proposals(request, callback) { + return this.rpcCall(proposals, $root.cosmos.gov.v1beta1.QueryProposalsRequest, $root.cosmos.gov.v1beta1.QueryProposalsResponse, request, callback); + }, "name", { value: "Proposals" }); + + /** + * Calls Proposals. + * @function proposals + * @memberof cosmos.gov.v1beta1.Query + * @instance + * @param {cosmos.gov.v1beta1.IQueryProposalsRequest} request QueryProposalsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.gov.v1beta1.Query#vote}. + * @memberof cosmos.gov.v1beta1.Query + * @typedef VoteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.gov.v1beta1.IQueryVoteResponse} [response] QueryVoteResponse + */ + + /** + * Calls Vote. + * @function vote + * @memberof cosmos.gov.v1beta1.Query + * @instance + * @param {cosmos.gov.v1beta1.IQueryVoteRequest} request QueryVoteRequest message or plain object + * @param {cosmos.gov.v1beta1.Query.VoteCallback} callback Node-style callback called with the error, if any, and QueryVoteResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.vote = function vote(request, callback) { + return this.rpcCall(vote, $root.cosmos.gov.v1beta1.QueryVoteRequest, $root.cosmos.gov.v1beta1.QueryVoteResponse, request, callback); + }, "name", { value: "Vote" }); + + /** + * Calls Vote. + * @function vote + * @memberof cosmos.gov.v1beta1.Query + * @instance + * @param {cosmos.gov.v1beta1.IQueryVoteRequest} request QueryVoteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.gov.v1beta1.Query#votes}. + * @memberof cosmos.gov.v1beta1.Query + * @typedef VotesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.gov.v1beta1.IQueryVotesResponse} [response] QueryVotesResponse + */ + + /** + * Calls Votes. + * @function votes + * @memberof cosmos.gov.v1beta1.Query + * @instance + * @param {cosmos.gov.v1beta1.IQueryVotesRequest} request QueryVotesRequest message or plain object + * @param {cosmos.gov.v1beta1.Query.VotesCallback} callback Node-style callback called with the error, if any, and QueryVotesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.votes = function votes(request, callback) { + return this.rpcCall(votes, $root.cosmos.gov.v1beta1.QueryVotesRequest, $root.cosmos.gov.v1beta1.QueryVotesResponse, request, callback); + }, "name", { value: "Votes" }); + + /** + * Calls Votes. + * @function votes + * @memberof cosmos.gov.v1beta1.Query + * @instance + * @param {cosmos.gov.v1beta1.IQueryVotesRequest} request QueryVotesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.gov.v1beta1.Query#params}. + * @memberof cosmos.gov.v1beta1.Query + * @typedef ParamsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.gov.v1beta1.IQueryParamsResponse} [response] QueryParamsResponse + */ + + /** + * Calls Params. + * @function params + * @memberof cosmos.gov.v1beta1.Query + * @instance + * @param {cosmos.gov.v1beta1.IQueryParamsRequest} request QueryParamsRequest message or plain object + * @param {cosmos.gov.v1beta1.Query.ParamsCallback} callback Node-style callback called with the error, if any, and QueryParamsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.params = function params(request, callback) { + return this.rpcCall(params, $root.cosmos.gov.v1beta1.QueryParamsRequest, $root.cosmos.gov.v1beta1.QueryParamsResponse, request, callback); + }, "name", { value: "Params" }); + + /** + * Calls Params. + * @function params + * @memberof cosmos.gov.v1beta1.Query + * @instance + * @param {cosmos.gov.v1beta1.IQueryParamsRequest} request QueryParamsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.gov.v1beta1.Query#deposit}. + * @memberof cosmos.gov.v1beta1.Query + * @typedef DepositCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.gov.v1beta1.IQueryDepositResponse} [response] QueryDepositResponse + */ + + /** + * Calls Deposit. + * @function deposit + * @memberof cosmos.gov.v1beta1.Query + * @instance + * @param {cosmos.gov.v1beta1.IQueryDepositRequest} request QueryDepositRequest message or plain object + * @param {cosmos.gov.v1beta1.Query.DepositCallback} callback Node-style callback called with the error, if any, and QueryDepositResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.deposit = function deposit(request, callback) { + return this.rpcCall(deposit, $root.cosmos.gov.v1beta1.QueryDepositRequest, $root.cosmos.gov.v1beta1.QueryDepositResponse, request, callback); + }, "name", { value: "Deposit" }); + + /** + * Calls Deposit. + * @function deposit + * @memberof cosmos.gov.v1beta1.Query + * @instance + * @param {cosmos.gov.v1beta1.IQueryDepositRequest} request QueryDepositRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.gov.v1beta1.Query#deposits}. + * @memberof cosmos.gov.v1beta1.Query + * @typedef DepositsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.gov.v1beta1.IQueryDepositsResponse} [response] QueryDepositsResponse + */ + + /** + * Calls Deposits. + * @function deposits + * @memberof cosmos.gov.v1beta1.Query + * @instance + * @param {cosmos.gov.v1beta1.IQueryDepositsRequest} request QueryDepositsRequest message or plain object + * @param {cosmos.gov.v1beta1.Query.DepositsCallback} callback Node-style callback called with the error, if any, and QueryDepositsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.deposits = function deposits(request, callback) { + return this.rpcCall(deposits, $root.cosmos.gov.v1beta1.QueryDepositsRequest, $root.cosmos.gov.v1beta1.QueryDepositsResponse, request, callback); + }, "name", { value: "Deposits" }); + + /** + * Calls Deposits. + * @function deposits + * @memberof cosmos.gov.v1beta1.Query + * @instance + * @param {cosmos.gov.v1beta1.IQueryDepositsRequest} request QueryDepositsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.gov.v1beta1.Query#tallyResult}. + * @memberof cosmos.gov.v1beta1.Query + * @typedef TallyResultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.gov.v1beta1.IQueryTallyResultResponse} [response] QueryTallyResultResponse + */ + + /** + * Calls TallyResult. + * @function tallyResult + * @memberof cosmos.gov.v1beta1.Query + * @instance + * @param {cosmos.gov.v1beta1.IQueryTallyResultRequest} request QueryTallyResultRequest message or plain object + * @param {cosmos.gov.v1beta1.Query.TallyResultCallback} callback Node-style callback called with the error, if any, and QueryTallyResultResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.tallyResult = function tallyResult(request, callback) { + return this.rpcCall(tallyResult, $root.cosmos.gov.v1beta1.QueryTallyResultRequest, $root.cosmos.gov.v1beta1.QueryTallyResultResponse, request, callback); + }, "name", { value: "TallyResult" }); + + /** + * Calls TallyResult. + * @function tallyResult + * @memberof cosmos.gov.v1beta1.Query + * @instance + * @param {cosmos.gov.v1beta1.IQueryTallyResultRequest} request QueryTallyResultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Query; + })(v1beta1.Query || {}); + + v1beta1.QueryProposalRequest = (function(QueryProposalRequest) { + + /** + * Properties of a QueryProposalRequest. + * @memberof cosmos.gov.v1beta1 + * @interface IQueryProposalRequest + * @property {number|Long|null} [proposalId] QueryProposalRequest proposalId + */ + + /** + * Constructs a new QueryProposalRequest. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a QueryProposalRequest. + * @implements IQueryProposalRequest + * @constructor + * @param {cosmos.gov.v1beta1.IQueryProposalRequest=} [properties] Properties to set + */ + function QueryProposalRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryProposalRequest proposalId. + * @member {number|Long} proposalId + * @memberof cosmos.gov.v1beta1.QueryProposalRequest + * @instance + */ + QueryProposalRequest.prototype.proposalId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new QueryProposalRequest instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.QueryProposalRequest + * @static + * @param {cosmos.gov.v1beta1.IQueryProposalRequest=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.QueryProposalRequest} QueryProposalRequest instance + */ + QueryProposalRequest.create = function create(properties) { + return new QueryProposalRequest(properties); + }; + + /** + * Encodes the specified QueryProposalRequest message. Does not implicitly {@link cosmos.gov.v1beta1.QueryProposalRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.QueryProposalRequest + * @static + * @param {cosmos.gov.v1beta1.IQueryProposalRequest} message QueryProposalRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryProposalRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proposalId != null && Object.hasOwnProperty.call(message, "proposalId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposalId); + return writer; + }; + + /** + * Encodes the specified QueryProposalRequest message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.QueryProposalRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.QueryProposalRequest + * @static + * @param {cosmos.gov.v1beta1.IQueryProposalRequest} message QueryProposalRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryProposalRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryProposalRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.QueryProposalRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.QueryProposalRequest} QueryProposalRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryProposalRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.QueryProposalRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryProposalRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.QueryProposalRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.QueryProposalRequest} QueryProposalRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryProposalRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryProposalRequest message. + * @function verify + * @memberof cosmos.gov.v1beta1.QueryProposalRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryProposalRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (!$util.isInteger(message.proposalId) && !(message.proposalId && $util.isInteger(message.proposalId.low) && $util.isInteger(message.proposalId.high))) + return "proposalId: integer|Long expected"; + return null; + }; + + /** + * Creates a QueryProposalRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.QueryProposalRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.QueryProposalRequest} QueryProposalRequest + */ + QueryProposalRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.QueryProposalRequest) + return object; + let message = new $root.cosmos.gov.v1beta1.QueryProposalRequest(); + if (object.proposalId != null) + if ($util.Long) + (message.proposalId = $util.Long.fromValue(object.proposalId)).unsigned = true; + else if (typeof object.proposalId === "string") + message.proposalId = parseInt(object.proposalId, 10); + else if (typeof object.proposalId === "number") + message.proposalId = object.proposalId; + else if (typeof object.proposalId === "object") + message.proposalId = new $util.LongBits(object.proposalId.low >>> 0, object.proposalId.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a QueryProposalRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.QueryProposalRequest + * @static + * @param {cosmos.gov.v1beta1.QueryProposalRequest} message QueryProposalRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryProposalRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.proposalId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.proposalId = options.longs === String ? "0" : 0; + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (typeof message.proposalId === "number") + object.proposalId = options.longs === String ? String(message.proposalId) : message.proposalId; + else + object.proposalId = options.longs === String ? $util.Long.prototype.toString.call(message.proposalId) : options.longs === Number ? new $util.LongBits(message.proposalId.low >>> 0, message.proposalId.high >>> 0).toNumber(true) : message.proposalId; + return object; + }; + + /** + * Converts this QueryProposalRequest to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.QueryProposalRequest + * @instance + * @returns {Object.} JSON object + */ + QueryProposalRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryProposalRequest; + })(v1beta1.QueryProposalRequest || {}); + + v1beta1.QueryProposalResponse = (function(QueryProposalResponse) { + + /** + * Properties of a QueryProposalResponse. + * @memberof cosmos.gov.v1beta1 + * @interface IQueryProposalResponse + * @property {cosmos.gov.v1beta1.IProposal|null} [proposal] QueryProposalResponse proposal + */ + + /** + * Constructs a new QueryProposalResponse. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a QueryProposalResponse. + * @implements IQueryProposalResponse + * @constructor + * @param {cosmos.gov.v1beta1.IQueryProposalResponse=} [properties] Properties to set + */ + function QueryProposalResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryProposalResponse proposal. + * @member {cosmos.gov.v1beta1.IProposal|null|undefined} proposal + * @memberof cosmos.gov.v1beta1.QueryProposalResponse + * @instance + */ + QueryProposalResponse.prototype.proposal = null; + + /** + * Creates a new QueryProposalResponse instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.QueryProposalResponse + * @static + * @param {cosmos.gov.v1beta1.IQueryProposalResponse=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.QueryProposalResponse} QueryProposalResponse instance + */ + QueryProposalResponse.create = function create(properties) { + return new QueryProposalResponse(properties); + }; + + /** + * Encodes the specified QueryProposalResponse message. Does not implicitly {@link cosmos.gov.v1beta1.QueryProposalResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.QueryProposalResponse + * @static + * @param {cosmos.gov.v1beta1.IQueryProposalResponse} message QueryProposalResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryProposalResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proposal != null && Object.hasOwnProperty.call(message, "proposal")) + $root.cosmos.gov.v1beta1.Proposal.encode(message.proposal, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryProposalResponse message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.QueryProposalResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.QueryProposalResponse + * @static + * @param {cosmos.gov.v1beta1.IQueryProposalResponse} message QueryProposalResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryProposalResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryProposalResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.QueryProposalResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.QueryProposalResponse} QueryProposalResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryProposalResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.QueryProposalResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposal = $root.cosmos.gov.v1beta1.Proposal.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryProposalResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.QueryProposalResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.QueryProposalResponse} QueryProposalResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryProposalResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryProposalResponse message. + * @function verify + * @memberof cosmos.gov.v1beta1.QueryProposalResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryProposalResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proposal != null && message.hasOwnProperty("proposal")) { + let error = $root.cosmos.gov.v1beta1.Proposal.verify(message.proposal); + if (error) + return "proposal." + error; + } + return null; + }; + + /** + * Creates a QueryProposalResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.QueryProposalResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.QueryProposalResponse} QueryProposalResponse + */ + QueryProposalResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.QueryProposalResponse) + return object; + let message = new $root.cosmos.gov.v1beta1.QueryProposalResponse(); + if (object.proposal != null) { + if (typeof object.proposal !== "object") + throw TypeError(".cosmos.gov.v1beta1.QueryProposalResponse.proposal: object expected"); + message.proposal = $root.cosmos.gov.v1beta1.Proposal.fromObject(object.proposal); + } + return message; + }; + + /** + * Creates a plain object from a QueryProposalResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.QueryProposalResponse + * @static + * @param {cosmos.gov.v1beta1.QueryProposalResponse} message QueryProposalResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryProposalResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.proposal = null; + if (message.proposal != null && message.hasOwnProperty("proposal")) + object.proposal = $root.cosmos.gov.v1beta1.Proposal.toObject(message.proposal, options); + return object; + }; + + /** + * Converts this QueryProposalResponse to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.QueryProposalResponse + * @instance + * @returns {Object.} JSON object + */ + QueryProposalResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryProposalResponse; + })(v1beta1.QueryProposalResponse || {}); + + v1beta1.QueryProposalsRequest = (function(QueryProposalsRequest) { + + /** + * Properties of a QueryProposalsRequest. + * @memberof cosmos.gov.v1beta1 + * @interface IQueryProposalsRequest + * @property {cosmos.gov.v1beta1.ProposalStatus|null} [proposalStatus] QueryProposalsRequest proposalStatus + * @property {string|null} [voter] QueryProposalsRequest voter + * @property {string|null} [depositor] QueryProposalsRequest depositor + * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryProposalsRequest pagination + */ + + /** + * Constructs a new QueryProposalsRequest. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a QueryProposalsRequest. + * @implements IQueryProposalsRequest + * @constructor + * @param {cosmos.gov.v1beta1.IQueryProposalsRequest=} [properties] Properties to set + */ + function QueryProposalsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryProposalsRequest proposalStatus. + * @member {cosmos.gov.v1beta1.ProposalStatus} proposalStatus + * @memberof cosmos.gov.v1beta1.QueryProposalsRequest + * @instance + */ + QueryProposalsRequest.prototype.proposalStatus = 0; + + /** + * QueryProposalsRequest voter. + * @member {string} voter + * @memberof cosmos.gov.v1beta1.QueryProposalsRequest + * @instance + */ + QueryProposalsRequest.prototype.voter = ""; + + /** + * QueryProposalsRequest depositor. + * @member {string} depositor + * @memberof cosmos.gov.v1beta1.QueryProposalsRequest + * @instance + */ + QueryProposalsRequest.prototype.depositor = ""; + + /** + * QueryProposalsRequest pagination. + * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination + * @memberof cosmos.gov.v1beta1.QueryProposalsRequest + * @instance + */ + QueryProposalsRequest.prototype.pagination = null; + + /** + * Creates a new QueryProposalsRequest instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.QueryProposalsRequest + * @static + * @param {cosmos.gov.v1beta1.IQueryProposalsRequest=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.QueryProposalsRequest} QueryProposalsRequest instance + */ + QueryProposalsRequest.create = function create(properties) { + return new QueryProposalsRequest(properties); + }; + + /** + * Encodes the specified QueryProposalsRequest message. Does not implicitly {@link cosmos.gov.v1beta1.QueryProposalsRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.QueryProposalsRequest + * @static + * @param {cosmos.gov.v1beta1.IQueryProposalsRequest} message QueryProposalsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryProposalsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proposalStatus != null && Object.hasOwnProperty.call(message, "proposalStatus")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.proposalStatus); + if (message.voter != null && Object.hasOwnProperty.call(message, "voter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.voter); + if (message.depositor != null && Object.hasOwnProperty.call(message, "depositor")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.depositor); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryProposalsRequest message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.QueryProposalsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.QueryProposalsRequest + * @static + * @param {cosmos.gov.v1beta1.IQueryProposalsRequest} message QueryProposalsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryProposalsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryProposalsRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.QueryProposalsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.QueryProposalsRequest} QueryProposalsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryProposalsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.QueryProposalsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalStatus = reader.int32(); + break; + case 2: + message.voter = reader.string(); + break; + case 3: + message.depositor = reader.string(); + break; + case 4: + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryProposalsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.QueryProposalsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.QueryProposalsRequest} QueryProposalsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryProposalsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryProposalsRequest message. + * @function verify + * @memberof cosmos.gov.v1beta1.QueryProposalsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryProposalsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proposalStatus != null && message.hasOwnProperty("proposalStatus")) + switch (message.proposalStatus) { + default: + return "proposalStatus: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.voter != null && message.hasOwnProperty("voter")) + if (!$util.isString(message.voter)) + return "voter: string expected"; + if (message.depositor != null && message.hasOwnProperty("depositor")) + if (!$util.isString(message.depositor)) + return "depositor: string expected"; + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryProposalsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.QueryProposalsRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.QueryProposalsRequest} QueryProposalsRequest + */ + QueryProposalsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.QueryProposalsRequest) + return object; + let message = new $root.cosmos.gov.v1beta1.QueryProposalsRequest(); + switch (object.proposalStatus) { + case "PROPOSAL_STATUS_UNSPECIFIED": + case 0: + message.proposalStatus = 0; + break; + case "PROPOSAL_STATUS_DEPOSIT_PERIOD": + case 1: + message.proposalStatus = 1; + break; + case "PROPOSAL_STATUS_VOTING_PERIOD": + case 2: + message.proposalStatus = 2; + break; + case "PROPOSAL_STATUS_PASSED": + case 3: + message.proposalStatus = 3; + break; + case "PROPOSAL_STATUS_REJECTED": + case 4: + message.proposalStatus = 4; + break; + case "PROPOSAL_STATUS_FAILED": + case 5: + message.proposalStatus = 5; + break; + } + if (object.voter != null) + message.voter = String(object.voter); + if (object.depositor != null) + message.depositor = String(object.depositor); + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.gov.v1beta1.QueryProposalsRequest.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryProposalsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.QueryProposalsRequest + * @static + * @param {cosmos.gov.v1beta1.QueryProposalsRequest} message QueryProposalsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryProposalsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.proposalStatus = options.enums === String ? "PROPOSAL_STATUS_UNSPECIFIED" : 0; + object.voter = ""; + object.depositor = ""; + object.pagination = null; + } + if (message.proposalStatus != null && message.hasOwnProperty("proposalStatus")) + object.proposalStatus = options.enums === String ? $root.cosmos.gov.v1beta1.ProposalStatus[message.proposalStatus] : message.proposalStatus; + if (message.voter != null && message.hasOwnProperty("voter")) + object.voter = message.voter; + if (message.depositor != null && message.hasOwnProperty("depositor")) + object.depositor = message.depositor; + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryProposalsRequest to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.QueryProposalsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryProposalsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryProposalsRequest; + })(v1beta1.QueryProposalsRequest || {}); + + v1beta1.QueryProposalsResponse = (function(QueryProposalsResponse) { + + /** + * Properties of a QueryProposalsResponse. + * @memberof cosmos.gov.v1beta1 + * @interface IQueryProposalsResponse + * @property {Array.|null} [proposals] QueryProposalsResponse proposals + * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryProposalsResponse pagination + */ + + /** + * Constructs a new QueryProposalsResponse. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a QueryProposalsResponse. + * @implements IQueryProposalsResponse + * @constructor + * @param {cosmos.gov.v1beta1.IQueryProposalsResponse=} [properties] Properties to set + */ + function QueryProposalsResponse(properties) { + this.proposals = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryProposalsResponse proposals. + * @member {Array.} proposals + * @memberof cosmos.gov.v1beta1.QueryProposalsResponse + * @instance + */ + QueryProposalsResponse.prototype.proposals = $util.emptyArray; + + /** + * QueryProposalsResponse pagination. + * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination + * @memberof cosmos.gov.v1beta1.QueryProposalsResponse + * @instance + */ + QueryProposalsResponse.prototype.pagination = null; + + /** + * Creates a new QueryProposalsResponse instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.QueryProposalsResponse + * @static + * @param {cosmos.gov.v1beta1.IQueryProposalsResponse=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.QueryProposalsResponse} QueryProposalsResponse instance + */ + QueryProposalsResponse.create = function create(properties) { + return new QueryProposalsResponse(properties); + }; + + /** + * Encodes the specified QueryProposalsResponse message. Does not implicitly {@link cosmos.gov.v1beta1.QueryProposalsResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.QueryProposalsResponse + * @static + * @param {cosmos.gov.v1beta1.IQueryProposalsResponse} message QueryProposalsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryProposalsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proposals != null && message.proposals.length) + for (let i = 0; i < message.proposals.length; ++i) + $root.cosmos.gov.v1beta1.Proposal.encode(message.proposals[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryProposalsResponse message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.QueryProposalsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.QueryProposalsResponse + * @static + * @param {cosmos.gov.v1beta1.IQueryProposalsResponse} message QueryProposalsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryProposalsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryProposalsResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.QueryProposalsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.QueryProposalsResponse} QueryProposalsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryProposalsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.QueryProposalsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.proposals && message.proposals.length)) + message.proposals = []; + message.proposals.push($root.cosmos.gov.v1beta1.Proposal.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryProposalsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.QueryProposalsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.QueryProposalsResponse} QueryProposalsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryProposalsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryProposalsResponse message. + * @function verify + * @memberof cosmos.gov.v1beta1.QueryProposalsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryProposalsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proposals != null && message.hasOwnProperty("proposals")) { + if (!Array.isArray(message.proposals)) + return "proposals: array expected"; + for (let i = 0; i < message.proposals.length; ++i) { + let error = $root.cosmos.gov.v1beta1.Proposal.verify(message.proposals[i]); + if (error) + return "proposals." + error; + } + } + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryProposalsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.QueryProposalsResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.QueryProposalsResponse} QueryProposalsResponse + */ + QueryProposalsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.QueryProposalsResponse) + return object; + let message = new $root.cosmos.gov.v1beta1.QueryProposalsResponse(); + if (object.proposals) { + if (!Array.isArray(object.proposals)) + throw TypeError(".cosmos.gov.v1beta1.QueryProposalsResponse.proposals: array expected"); + message.proposals = []; + for (let i = 0; i < object.proposals.length; ++i) { + if (typeof object.proposals[i] !== "object") + throw TypeError(".cosmos.gov.v1beta1.QueryProposalsResponse.proposals: object expected"); + message.proposals[i] = $root.cosmos.gov.v1beta1.Proposal.fromObject(object.proposals[i]); + } + } + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.gov.v1beta1.QueryProposalsResponse.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryProposalsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.QueryProposalsResponse + * @static + * @param {cosmos.gov.v1beta1.QueryProposalsResponse} message QueryProposalsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryProposalsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.proposals = []; + if (options.defaults) + object.pagination = null; + if (message.proposals && message.proposals.length) { + object.proposals = []; + for (let j = 0; j < message.proposals.length; ++j) + object.proposals[j] = $root.cosmos.gov.v1beta1.Proposal.toObject(message.proposals[j], options); + } + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryProposalsResponse to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.QueryProposalsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryProposalsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryProposalsResponse; + })(v1beta1.QueryProposalsResponse || {}); + + v1beta1.QueryVoteRequest = (function(QueryVoteRequest) { + + /** + * Properties of a QueryVoteRequest. + * @memberof cosmos.gov.v1beta1 + * @interface IQueryVoteRequest + * @property {number|Long|null} [proposalId] QueryVoteRequest proposalId + * @property {string|null} [voter] QueryVoteRequest voter + */ + + /** + * Constructs a new QueryVoteRequest. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a QueryVoteRequest. + * @implements IQueryVoteRequest + * @constructor + * @param {cosmos.gov.v1beta1.IQueryVoteRequest=} [properties] Properties to set + */ + function QueryVoteRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryVoteRequest proposalId. + * @member {number|Long} proposalId + * @memberof cosmos.gov.v1beta1.QueryVoteRequest + * @instance + */ + QueryVoteRequest.prototype.proposalId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * QueryVoteRequest voter. + * @member {string} voter + * @memberof cosmos.gov.v1beta1.QueryVoteRequest + * @instance + */ + QueryVoteRequest.prototype.voter = ""; + + /** + * Creates a new QueryVoteRequest instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.QueryVoteRequest + * @static + * @param {cosmos.gov.v1beta1.IQueryVoteRequest=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.QueryVoteRequest} QueryVoteRequest instance + */ + QueryVoteRequest.create = function create(properties) { + return new QueryVoteRequest(properties); + }; + + /** + * Encodes the specified QueryVoteRequest message. Does not implicitly {@link cosmos.gov.v1beta1.QueryVoteRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.QueryVoteRequest + * @static + * @param {cosmos.gov.v1beta1.IQueryVoteRequest} message QueryVoteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryVoteRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proposalId != null && Object.hasOwnProperty.call(message, "proposalId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposalId); + if (message.voter != null && Object.hasOwnProperty.call(message, "voter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.voter); + return writer; + }; + + /** + * Encodes the specified QueryVoteRequest message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.QueryVoteRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.QueryVoteRequest + * @static + * @param {cosmos.gov.v1beta1.IQueryVoteRequest} message QueryVoteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryVoteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryVoteRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.QueryVoteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.QueryVoteRequest} QueryVoteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryVoteRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.QueryVoteRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.voter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryVoteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.QueryVoteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.QueryVoteRequest} QueryVoteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryVoteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryVoteRequest message. + * @function verify + * @memberof cosmos.gov.v1beta1.QueryVoteRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryVoteRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (!$util.isInteger(message.proposalId) && !(message.proposalId && $util.isInteger(message.proposalId.low) && $util.isInteger(message.proposalId.high))) + return "proposalId: integer|Long expected"; + if (message.voter != null && message.hasOwnProperty("voter")) + if (!$util.isString(message.voter)) + return "voter: string expected"; + return null; + }; + + /** + * Creates a QueryVoteRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.QueryVoteRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.QueryVoteRequest} QueryVoteRequest + */ + QueryVoteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.QueryVoteRequest) + return object; + let message = new $root.cosmos.gov.v1beta1.QueryVoteRequest(); + if (object.proposalId != null) + if ($util.Long) + (message.proposalId = $util.Long.fromValue(object.proposalId)).unsigned = true; + else if (typeof object.proposalId === "string") + message.proposalId = parseInt(object.proposalId, 10); + else if (typeof object.proposalId === "number") + message.proposalId = object.proposalId; + else if (typeof object.proposalId === "object") + message.proposalId = new $util.LongBits(object.proposalId.low >>> 0, object.proposalId.high >>> 0).toNumber(true); + if (object.voter != null) + message.voter = String(object.voter); + return message; + }; + + /** + * Creates a plain object from a QueryVoteRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.QueryVoteRequest + * @static + * @param {cosmos.gov.v1beta1.QueryVoteRequest} message QueryVoteRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryVoteRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.proposalId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.proposalId = options.longs === String ? "0" : 0; + object.voter = ""; + } + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (typeof message.proposalId === "number") + object.proposalId = options.longs === String ? String(message.proposalId) : message.proposalId; + else + object.proposalId = options.longs === String ? $util.Long.prototype.toString.call(message.proposalId) : options.longs === Number ? new $util.LongBits(message.proposalId.low >>> 0, message.proposalId.high >>> 0).toNumber(true) : message.proposalId; + if (message.voter != null && message.hasOwnProperty("voter")) + object.voter = message.voter; + return object; + }; + + /** + * Converts this QueryVoteRequest to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.QueryVoteRequest + * @instance + * @returns {Object.} JSON object + */ + QueryVoteRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryVoteRequest; + })(v1beta1.QueryVoteRequest || {}); + + v1beta1.QueryVoteResponse = (function(QueryVoteResponse) { + + /** + * Properties of a QueryVoteResponse. + * @memberof cosmos.gov.v1beta1 + * @interface IQueryVoteResponse + * @property {cosmos.gov.v1beta1.IVote|null} [vote] QueryVoteResponse vote + */ + + /** + * Constructs a new QueryVoteResponse. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a QueryVoteResponse. + * @implements IQueryVoteResponse + * @constructor + * @param {cosmos.gov.v1beta1.IQueryVoteResponse=} [properties] Properties to set + */ + function QueryVoteResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryVoteResponse vote. + * @member {cosmos.gov.v1beta1.IVote|null|undefined} vote + * @memberof cosmos.gov.v1beta1.QueryVoteResponse + * @instance + */ + QueryVoteResponse.prototype.vote = null; + + /** + * Creates a new QueryVoteResponse instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.QueryVoteResponse + * @static + * @param {cosmos.gov.v1beta1.IQueryVoteResponse=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.QueryVoteResponse} QueryVoteResponse instance + */ + QueryVoteResponse.create = function create(properties) { + return new QueryVoteResponse(properties); + }; + + /** + * Encodes the specified QueryVoteResponse message. Does not implicitly {@link cosmos.gov.v1beta1.QueryVoteResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.QueryVoteResponse + * @static + * @param {cosmos.gov.v1beta1.IQueryVoteResponse} message QueryVoteResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryVoteResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.vote != null && Object.hasOwnProperty.call(message, "vote")) + $root.cosmos.gov.v1beta1.Vote.encode(message.vote, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryVoteResponse message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.QueryVoteResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.QueryVoteResponse + * @static + * @param {cosmos.gov.v1beta1.IQueryVoteResponse} message QueryVoteResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryVoteResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryVoteResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.QueryVoteResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.QueryVoteResponse} QueryVoteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryVoteResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.QueryVoteResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.vote = $root.cosmos.gov.v1beta1.Vote.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryVoteResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.QueryVoteResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.QueryVoteResponse} QueryVoteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryVoteResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryVoteResponse message. + * @function verify + * @memberof cosmos.gov.v1beta1.QueryVoteResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryVoteResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.vote != null && message.hasOwnProperty("vote")) { + let error = $root.cosmos.gov.v1beta1.Vote.verify(message.vote); + if (error) + return "vote." + error; + } + return null; + }; + + /** + * Creates a QueryVoteResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.QueryVoteResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.QueryVoteResponse} QueryVoteResponse + */ + QueryVoteResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.QueryVoteResponse) + return object; + let message = new $root.cosmos.gov.v1beta1.QueryVoteResponse(); + if (object.vote != null) { + if (typeof object.vote !== "object") + throw TypeError(".cosmos.gov.v1beta1.QueryVoteResponse.vote: object expected"); + message.vote = $root.cosmos.gov.v1beta1.Vote.fromObject(object.vote); + } + return message; + }; + + /** + * Creates a plain object from a QueryVoteResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.QueryVoteResponse + * @static + * @param {cosmos.gov.v1beta1.QueryVoteResponse} message QueryVoteResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryVoteResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.vote = null; + if (message.vote != null && message.hasOwnProperty("vote")) + object.vote = $root.cosmos.gov.v1beta1.Vote.toObject(message.vote, options); + return object; + }; + + /** + * Converts this QueryVoteResponse to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.QueryVoteResponse + * @instance + * @returns {Object.} JSON object + */ + QueryVoteResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryVoteResponse; + })(v1beta1.QueryVoteResponse || {}); + + v1beta1.QueryVotesRequest = (function(QueryVotesRequest) { + + /** + * Properties of a QueryVotesRequest. + * @memberof cosmos.gov.v1beta1 + * @interface IQueryVotesRequest + * @property {number|Long|null} [proposalId] QueryVotesRequest proposalId + * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryVotesRequest pagination + */ + + /** + * Constructs a new QueryVotesRequest. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a QueryVotesRequest. + * @implements IQueryVotesRequest + * @constructor + * @param {cosmos.gov.v1beta1.IQueryVotesRequest=} [properties] Properties to set + */ + function QueryVotesRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryVotesRequest proposalId. + * @member {number|Long} proposalId + * @memberof cosmos.gov.v1beta1.QueryVotesRequest + * @instance + */ + QueryVotesRequest.prototype.proposalId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * QueryVotesRequest pagination. + * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination + * @memberof cosmos.gov.v1beta1.QueryVotesRequest + * @instance + */ + QueryVotesRequest.prototype.pagination = null; + + /** + * Creates a new QueryVotesRequest instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.QueryVotesRequest + * @static + * @param {cosmos.gov.v1beta1.IQueryVotesRequest=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.QueryVotesRequest} QueryVotesRequest instance + */ + QueryVotesRequest.create = function create(properties) { + return new QueryVotesRequest(properties); + }; + + /** + * Encodes the specified QueryVotesRequest message. Does not implicitly {@link cosmos.gov.v1beta1.QueryVotesRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.QueryVotesRequest + * @static + * @param {cosmos.gov.v1beta1.IQueryVotesRequest} message QueryVotesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryVotesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proposalId != null && Object.hasOwnProperty.call(message, "proposalId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposalId); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryVotesRequest message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.QueryVotesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.QueryVotesRequest + * @static + * @param {cosmos.gov.v1beta1.IQueryVotesRequest} message QueryVotesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryVotesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryVotesRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.QueryVotesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.QueryVotesRequest} QueryVotesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryVotesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.QueryVotesRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryVotesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.QueryVotesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.QueryVotesRequest} QueryVotesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryVotesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryVotesRequest message. + * @function verify + * @memberof cosmos.gov.v1beta1.QueryVotesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryVotesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (!$util.isInteger(message.proposalId) && !(message.proposalId && $util.isInteger(message.proposalId.low) && $util.isInteger(message.proposalId.high))) + return "proposalId: integer|Long expected"; + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryVotesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.QueryVotesRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.QueryVotesRequest} QueryVotesRequest + */ + QueryVotesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.QueryVotesRequest) + return object; + let message = new $root.cosmos.gov.v1beta1.QueryVotesRequest(); + if (object.proposalId != null) + if ($util.Long) + (message.proposalId = $util.Long.fromValue(object.proposalId)).unsigned = true; + else if (typeof object.proposalId === "string") + message.proposalId = parseInt(object.proposalId, 10); + else if (typeof object.proposalId === "number") + message.proposalId = object.proposalId; + else if (typeof object.proposalId === "object") + message.proposalId = new $util.LongBits(object.proposalId.low >>> 0, object.proposalId.high >>> 0).toNumber(true); + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.gov.v1beta1.QueryVotesRequest.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryVotesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.QueryVotesRequest + * @static + * @param {cosmos.gov.v1beta1.QueryVotesRequest} message QueryVotesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryVotesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.proposalId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.proposalId = options.longs === String ? "0" : 0; + object.pagination = null; + } + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (typeof message.proposalId === "number") + object.proposalId = options.longs === String ? String(message.proposalId) : message.proposalId; + else + object.proposalId = options.longs === String ? $util.Long.prototype.toString.call(message.proposalId) : options.longs === Number ? new $util.LongBits(message.proposalId.low >>> 0, message.proposalId.high >>> 0).toNumber(true) : message.proposalId; + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryVotesRequest to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.QueryVotesRequest + * @instance + * @returns {Object.} JSON object + */ + QueryVotesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryVotesRequest; + })(v1beta1.QueryVotesRequest || {}); + + v1beta1.QueryVotesResponse = (function(QueryVotesResponse) { + + /** + * Properties of a QueryVotesResponse. + * @memberof cosmos.gov.v1beta1 + * @interface IQueryVotesResponse + * @property {Array.|null} [votes] QueryVotesResponse votes + * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryVotesResponse pagination + */ + + /** + * Constructs a new QueryVotesResponse. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a QueryVotesResponse. + * @implements IQueryVotesResponse + * @constructor + * @param {cosmos.gov.v1beta1.IQueryVotesResponse=} [properties] Properties to set + */ + function QueryVotesResponse(properties) { + this.votes = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryVotesResponse votes. + * @member {Array.} votes + * @memberof cosmos.gov.v1beta1.QueryVotesResponse + * @instance + */ + QueryVotesResponse.prototype.votes = $util.emptyArray; + + /** + * QueryVotesResponse pagination. + * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination + * @memberof cosmos.gov.v1beta1.QueryVotesResponse + * @instance + */ + QueryVotesResponse.prototype.pagination = null; + + /** + * Creates a new QueryVotesResponse instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.QueryVotesResponse + * @static + * @param {cosmos.gov.v1beta1.IQueryVotesResponse=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.QueryVotesResponse} QueryVotesResponse instance + */ + QueryVotesResponse.create = function create(properties) { + return new QueryVotesResponse(properties); + }; + + /** + * Encodes the specified QueryVotesResponse message. Does not implicitly {@link cosmos.gov.v1beta1.QueryVotesResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.QueryVotesResponse + * @static + * @param {cosmos.gov.v1beta1.IQueryVotesResponse} message QueryVotesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryVotesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.votes != null && message.votes.length) + for (let i = 0; i < message.votes.length; ++i) + $root.cosmos.gov.v1beta1.Vote.encode(message.votes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryVotesResponse message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.QueryVotesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.QueryVotesResponse + * @static + * @param {cosmos.gov.v1beta1.IQueryVotesResponse} message QueryVotesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryVotesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryVotesResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.QueryVotesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.QueryVotesResponse} QueryVotesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryVotesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.QueryVotesResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.votes && message.votes.length)) + message.votes = []; + message.votes.push($root.cosmos.gov.v1beta1.Vote.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryVotesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.QueryVotesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.QueryVotesResponse} QueryVotesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryVotesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryVotesResponse message. + * @function verify + * @memberof cosmos.gov.v1beta1.QueryVotesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryVotesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.votes != null && message.hasOwnProperty("votes")) { + if (!Array.isArray(message.votes)) + return "votes: array expected"; + for (let i = 0; i < message.votes.length; ++i) { + let error = $root.cosmos.gov.v1beta1.Vote.verify(message.votes[i]); + if (error) + return "votes." + error; + } + } + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryVotesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.QueryVotesResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.QueryVotesResponse} QueryVotesResponse + */ + QueryVotesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.QueryVotesResponse) + return object; + let message = new $root.cosmos.gov.v1beta1.QueryVotesResponse(); + if (object.votes) { + if (!Array.isArray(object.votes)) + throw TypeError(".cosmos.gov.v1beta1.QueryVotesResponse.votes: array expected"); + message.votes = []; + for (let i = 0; i < object.votes.length; ++i) { + if (typeof object.votes[i] !== "object") + throw TypeError(".cosmos.gov.v1beta1.QueryVotesResponse.votes: object expected"); + message.votes[i] = $root.cosmos.gov.v1beta1.Vote.fromObject(object.votes[i]); + } + } + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.gov.v1beta1.QueryVotesResponse.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryVotesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.QueryVotesResponse + * @static + * @param {cosmos.gov.v1beta1.QueryVotesResponse} message QueryVotesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryVotesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.votes = []; + if (options.defaults) + object.pagination = null; + if (message.votes && message.votes.length) { + object.votes = []; + for (let j = 0; j < message.votes.length; ++j) + object.votes[j] = $root.cosmos.gov.v1beta1.Vote.toObject(message.votes[j], options); + } + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryVotesResponse to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.QueryVotesResponse + * @instance + * @returns {Object.} JSON object + */ + QueryVotesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryVotesResponse; + })(v1beta1.QueryVotesResponse || {}); + + v1beta1.QueryParamsRequest = (function(QueryParamsRequest) { + + /** + * Properties of a QueryParamsRequest. + * @memberof cosmos.gov.v1beta1 + * @interface IQueryParamsRequest + * @property {string|null} [paramsType] QueryParamsRequest paramsType + */ + + /** + * Constructs a new QueryParamsRequest. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a QueryParamsRequest. + * @implements IQueryParamsRequest + * @constructor + * @param {cosmos.gov.v1beta1.IQueryParamsRequest=} [properties] Properties to set + */ + function QueryParamsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryParamsRequest paramsType. + * @member {string} paramsType + * @memberof cosmos.gov.v1beta1.QueryParamsRequest + * @instance + */ + QueryParamsRequest.prototype.paramsType = ""; + + /** + * Creates a new QueryParamsRequest instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.QueryParamsRequest + * @static + * @param {cosmos.gov.v1beta1.IQueryParamsRequest=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.QueryParamsRequest} QueryParamsRequest instance + */ + QueryParamsRequest.create = function create(properties) { + return new QueryParamsRequest(properties); + }; + + /** + * Encodes the specified QueryParamsRequest message. Does not implicitly {@link cosmos.gov.v1beta1.QueryParamsRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.QueryParamsRequest + * @static + * @param {cosmos.gov.v1beta1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paramsType != null && Object.hasOwnProperty.call(message, "paramsType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paramsType); + return writer; + }; + + /** + * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.QueryParamsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.QueryParamsRequest + * @static + * @param {cosmos.gov.v1beta1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryParamsRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.QueryParamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.QueryParamsRequest} QueryParamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.QueryParamsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.paramsType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.QueryParamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.QueryParamsRequest} QueryParamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryParamsRequest message. + * @function verify + * @memberof cosmos.gov.v1beta1.QueryParamsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryParamsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paramsType != null && message.hasOwnProperty("paramsType")) + if (!$util.isString(message.paramsType)) + return "paramsType: string expected"; + return null; + }; + + /** + * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.QueryParamsRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.QueryParamsRequest} QueryParamsRequest + */ + QueryParamsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.QueryParamsRequest) + return object; + let message = new $root.cosmos.gov.v1beta1.QueryParamsRequest(); + if (object.paramsType != null) + message.paramsType = String(object.paramsType); + return message; + }; + + /** + * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.QueryParamsRequest + * @static + * @param {cosmos.gov.v1beta1.QueryParamsRequest} message QueryParamsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryParamsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.paramsType = ""; + if (message.paramsType != null && message.hasOwnProperty("paramsType")) + object.paramsType = message.paramsType; + return object; + }; + + /** + * Converts this QueryParamsRequest to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.QueryParamsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryParamsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryParamsRequest; + })(v1beta1.QueryParamsRequest || {}); + + v1beta1.QueryParamsResponse = (function(QueryParamsResponse) { + + /** + * Properties of a QueryParamsResponse. + * @memberof cosmos.gov.v1beta1 + * @interface IQueryParamsResponse + * @property {cosmos.gov.v1beta1.IVotingParams|null} [votingParams] QueryParamsResponse votingParams + * @property {cosmos.gov.v1beta1.IDepositParams|null} [depositParams] QueryParamsResponse depositParams + * @property {cosmos.gov.v1beta1.ITallyParams|null} [tallyParams] QueryParamsResponse tallyParams + */ + + /** + * Constructs a new QueryParamsResponse. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a QueryParamsResponse. + * @implements IQueryParamsResponse + * @constructor + * @param {cosmos.gov.v1beta1.IQueryParamsResponse=} [properties] Properties to set + */ + function QueryParamsResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryParamsResponse votingParams. + * @member {cosmos.gov.v1beta1.IVotingParams|null|undefined} votingParams + * @memberof cosmos.gov.v1beta1.QueryParamsResponse + * @instance + */ + QueryParamsResponse.prototype.votingParams = null; + + /** + * QueryParamsResponse depositParams. + * @member {cosmos.gov.v1beta1.IDepositParams|null|undefined} depositParams + * @memberof cosmos.gov.v1beta1.QueryParamsResponse + * @instance + */ + QueryParamsResponse.prototype.depositParams = null; + + /** + * QueryParamsResponse tallyParams. + * @member {cosmos.gov.v1beta1.ITallyParams|null|undefined} tallyParams + * @memberof cosmos.gov.v1beta1.QueryParamsResponse + * @instance + */ + QueryParamsResponse.prototype.tallyParams = null; + + /** + * Creates a new QueryParamsResponse instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.QueryParamsResponse + * @static + * @param {cosmos.gov.v1beta1.IQueryParamsResponse=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.QueryParamsResponse} QueryParamsResponse instance + */ + QueryParamsResponse.create = function create(properties) { + return new QueryParamsResponse(properties); + }; + + /** + * Encodes the specified QueryParamsResponse message. Does not implicitly {@link cosmos.gov.v1beta1.QueryParamsResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.QueryParamsResponse + * @static + * @param {cosmos.gov.v1beta1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.votingParams != null && Object.hasOwnProperty.call(message, "votingParams")) + $root.cosmos.gov.v1beta1.VotingParams.encode(message.votingParams, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.depositParams != null && Object.hasOwnProperty.call(message, "depositParams")) + $root.cosmos.gov.v1beta1.DepositParams.encode(message.depositParams, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.tallyParams != null && Object.hasOwnProperty.call(message, "tallyParams")) + $root.cosmos.gov.v1beta1.TallyParams.encode(message.tallyParams, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.QueryParamsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.QueryParamsResponse + * @static + * @param {cosmos.gov.v1beta1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryParamsResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.QueryParamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.QueryParamsResponse} QueryParamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.QueryParamsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votingParams = $root.cosmos.gov.v1beta1.VotingParams.decode(reader, reader.uint32()); + break; + case 2: + message.depositParams = $root.cosmos.gov.v1beta1.DepositParams.decode(reader, reader.uint32()); + break; + case 3: + message.tallyParams = $root.cosmos.gov.v1beta1.TallyParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.QueryParamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.QueryParamsResponse} QueryParamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryParamsResponse message. + * @function verify + * @memberof cosmos.gov.v1beta1.QueryParamsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryParamsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.votingParams != null && message.hasOwnProperty("votingParams")) { + let error = $root.cosmos.gov.v1beta1.VotingParams.verify(message.votingParams); + if (error) + return "votingParams." + error; + } + if (message.depositParams != null && message.hasOwnProperty("depositParams")) { + let error = $root.cosmos.gov.v1beta1.DepositParams.verify(message.depositParams); + if (error) + return "depositParams." + error; + } + if (message.tallyParams != null && message.hasOwnProperty("tallyParams")) { + let error = $root.cosmos.gov.v1beta1.TallyParams.verify(message.tallyParams); + if (error) + return "tallyParams." + error; + } + return null; + }; + + /** + * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.QueryParamsResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.QueryParamsResponse} QueryParamsResponse + */ + QueryParamsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.QueryParamsResponse) + return object; + let message = new $root.cosmos.gov.v1beta1.QueryParamsResponse(); + if (object.votingParams != null) { + if (typeof object.votingParams !== "object") + throw TypeError(".cosmos.gov.v1beta1.QueryParamsResponse.votingParams: object expected"); + message.votingParams = $root.cosmos.gov.v1beta1.VotingParams.fromObject(object.votingParams); + } + if (object.depositParams != null) { + if (typeof object.depositParams !== "object") + throw TypeError(".cosmos.gov.v1beta1.QueryParamsResponse.depositParams: object expected"); + message.depositParams = $root.cosmos.gov.v1beta1.DepositParams.fromObject(object.depositParams); + } + if (object.tallyParams != null) { + if (typeof object.tallyParams !== "object") + throw TypeError(".cosmos.gov.v1beta1.QueryParamsResponse.tallyParams: object expected"); + message.tallyParams = $root.cosmos.gov.v1beta1.TallyParams.fromObject(object.tallyParams); + } + return message; + }; + + /** + * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.QueryParamsResponse + * @static + * @param {cosmos.gov.v1beta1.QueryParamsResponse} message QueryParamsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryParamsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.votingParams = null; + object.depositParams = null; + object.tallyParams = null; + } + if (message.votingParams != null && message.hasOwnProperty("votingParams")) + object.votingParams = $root.cosmos.gov.v1beta1.VotingParams.toObject(message.votingParams, options); + if (message.depositParams != null && message.hasOwnProperty("depositParams")) + object.depositParams = $root.cosmos.gov.v1beta1.DepositParams.toObject(message.depositParams, options); + if (message.tallyParams != null && message.hasOwnProperty("tallyParams")) + object.tallyParams = $root.cosmos.gov.v1beta1.TallyParams.toObject(message.tallyParams, options); + return object; + }; + + /** + * Converts this QueryParamsResponse to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.QueryParamsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryParamsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryParamsResponse; + })(v1beta1.QueryParamsResponse || {}); + + v1beta1.QueryDepositRequest = (function(QueryDepositRequest) { + + /** + * Properties of a QueryDepositRequest. + * @memberof cosmos.gov.v1beta1 + * @interface IQueryDepositRequest + * @property {number|Long|null} [proposalId] QueryDepositRequest proposalId + * @property {string|null} [depositor] QueryDepositRequest depositor + */ + + /** + * Constructs a new QueryDepositRequest. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a QueryDepositRequest. + * @implements IQueryDepositRequest + * @constructor + * @param {cosmos.gov.v1beta1.IQueryDepositRequest=} [properties] Properties to set + */ + function QueryDepositRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryDepositRequest proposalId. + * @member {number|Long} proposalId + * @memberof cosmos.gov.v1beta1.QueryDepositRequest + * @instance + */ + QueryDepositRequest.prototype.proposalId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * QueryDepositRequest depositor. + * @member {string} depositor + * @memberof cosmos.gov.v1beta1.QueryDepositRequest + * @instance + */ + QueryDepositRequest.prototype.depositor = ""; + + /** + * Creates a new QueryDepositRequest instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.QueryDepositRequest + * @static + * @param {cosmos.gov.v1beta1.IQueryDepositRequest=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.QueryDepositRequest} QueryDepositRequest instance + */ + QueryDepositRequest.create = function create(properties) { + return new QueryDepositRequest(properties); + }; + + /** + * Encodes the specified QueryDepositRequest message. Does not implicitly {@link cosmos.gov.v1beta1.QueryDepositRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.QueryDepositRequest + * @static + * @param {cosmos.gov.v1beta1.IQueryDepositRequest} message QueryDepositRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDepositRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proposalId != null && Object.hasOwnProperty.call(message, "proposalId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposalId); + if (message.depositor != null && Object.hasOwnProperty.call(message, "depositor")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.depositor); + return writer; + }; + + /** + * Encodes the specified QueryDepositRequest message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.QueryDepositRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.QueryDepositRequest + * @static + * @param {cosmos.gov.v1beta1.IQueryDepositRequest} message QueryDepositRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDepositRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDepositRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.QueryDepositRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.QueryDepositRequest} QueryDepositRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDepositRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.QueryDepositRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.depositor = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDepositRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.QueryDepositRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.QueryDepositRequest} QueryDepositRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDepositRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDepositRequest message. + * @function verify + * @memberof cosmos.gov.v1beta1.QueryDepositRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDepositRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (!$util.isInteger(message.proposalId) && !(message.proposalId && $util.isInteger(message.proposalId.low) && $util.isInteger(message.proposalId.high))) + return "proposalId: integer|Long expected"; + if (message.depositor != null && message.hasOwnProperty("depositor")) + if (!$util.isString(message.depositor)) + return "depositor: string expected"; + return null; + }; + + /** + * Creates a QueryDepositRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.QueryDepositRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.QueryDepositRequest} QueryDepositRequest + */ + QueryDepositRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.QueryDepositRequest) + return object; + let message = new $root.cosmos.gov.v1beta1.QueryDepositRequest(); + if (object.proposalId != null) + if ($util.Long) + (message.proposalId = $util.Long.fromValue(object.proposalId)).unsigned = true; + else if (typeof object.proposalId === "string") + message.proposalId = parseInt(object.proposalId, 10); + else if (typeof object.proposalId === "number") + message.proposalId = object.proposalId; + else if (typeof object.proposalId === "object") + message.proposalId = new $util.LongBits(object.proposalId.low >>> 0, object.proposalId.high >>> 0).toNumber(true); + if (object.depositor != null) + message.depositor = String(object.depositor); + return message; + }; + + /** + * Creates a plain object from a QueryDepositRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.QueryDepositRequest + * @static + * @param {cosmos.gov.v1beta1.QueryDepositRequest} message QueryDepositRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDepositRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.proposalId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.proposalId = options.longs === String ? "0" : 0; + object.depositor = ""; + } + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (typeof message.proposalId === "number") + object.proposalId = options.longs === String ? String(message.proposalId) : message.proposalId; + else + object.proposalId = options.longs === String ? $util.Long.prototype.toString.call(message.proposalId) : options.longs === Number ? new $util.LongBits(message.proposalId.low >>> 0, message.proposalId.high >>> 0).toNumber(true) : message.proposalId; + if (message.depositor != null && message.hasOwnProperty("depositor")) + object.depositor = message.depositor; + return object; + }; + + /** + * Converts this QueryDepositRequest to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.QueryDepositRequest + * @instance + * @returns {Object.} JSON object + */ + QueryDepositRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryDepositRequest; + })(v1beta1.QueryDepositRequest || {}); + + v1beta1.QueryDepositResponse = (function(QueryDepositResponse) { + + /** + * Properties of a QueryDepositResponse. + * @memberof cosmos.gov.v1beta1 + * @interface IQueryDepositResponse + * @property {cosmos.gov.v1beta1.IDeposit|null} [deposit] QueryDepositResponse deposit + */ + + /** + * Constructs a new QueryDepositResponse. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a QueryDepositResponse. + * @implements IQueryDepositResponse + * @constructor + * @param {cosmos.gov.v1beta1.IQueryDepositResponse=} [properties] Properties to set + */ + function QueryDepositResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryDepositResponse deposit. + * @member {cosmos.gov.v1beta1.IDeposit|null|undefined} deposit + * @memberof cosmos.gov.v1beta1.QueryDepositResponse + * @instance + */ + QueryDepositResponse.prototype.deposit = null; + + /** + * Creates a new QueryDepositResponse instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.QueryDepositResponse + * @static + * @param {cosmos.gov.v1beta1.IQueryDepositResponse=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.QueryDepositResponse} QueryDepositResponse instance + */ + QueryDepositResponse.create = function create(properties) { + return new QueryDepositResponse(properties); + }; + + /** + * Encodes the specified QueryDepositResponse message. Does not implicitly {@link cosmos.gov.v1beta1.QueryDepositResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.QueryDepositResponse + * @static + * @param {cosmos.gov.v1beta1.IQueryDepositResponse} message QueryDepositResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDepositResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deposit != null && Object.hasOwnProperty.call(message, "deposit")) + $root.cosmos.gov.v1beta1.Deposit.encode(message.deposit, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryDepositResponse message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.QueryDepositResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.QueryDepositResponse + * @static + * @param {cosmos.gov.v1beta1.IQueryDepositResponse} message QueryDepositResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDepositResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDepositResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.QueryDepositResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.QueryDepositResponse} QueryDepositResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDepositResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.QueryDepositResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deposit = $root.cosmos.gov.v1beta1.Deposit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDepositResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.QueryDepositResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.QueryDepositResponse} QueryDepositResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDepositResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDepositResponse message. + * @function verify + * @memberof cosmos.gov.v1beta1.QueryDepositResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDepositResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deposit != null && message.hasOwnProperty("deposit")) { + let error = $root.cosmos.gov.v1beta1.Deposit.verify(message.deposit); + if (error) + return "deposit." + error; + } + return null; + }; + + /** + * Creates a QueryDepositResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.QueryDepositResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.QueryDepositResponse} QueryDepositResponse + */ + QueryDepositResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.QueryDepositResponse) + return object; + let message = new $root.cosmos.gov.v1beta1.QueryDepositResponse(); + if (object.deposit != null) { + if (typeof object.deposit !== "object") + throw TypeError(".cosmos.gov.v1beta1.QueryDepositResponse.deposit: object expected"); + message.deposit = $root.cosmos.gov.v1beta1.Deposit.fromObject(object.deposit); + } + return message; + }; + + /** + * Creates a plain object from a QueryDepositResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.QueryDepositResponse + * @static + * @param {cosmos.gov.v1beta1.QueryDepositResponse} message QueryDepositResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDepositResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.deposit = null; + if (message.deposit != null && message.hasOwnProperty("deposit")) + object.deposit = $root.cosmos.gov.v1beta1.Deposit.toObject(message.deposit, options); + return object; + }; + + /** + * Converts this QueryDepositResponse to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.QueryDepositResponse + * @instance + * @returns {Object.} JSON object + */ + QueryDepositResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryDepositResponse; + })(v1beta1.QueryDepositResponse || {}); + + v1beta1.QueryDepositsRequest = (function(QueryDepositsRequest) { + + /** + * Properties of a QueryDepositsRequest. + * @memberof cosmos.gov.v1beta1 + * @interface IQueryDepositsRequest + * @property {number|Long|null} [proposalId] QueryDepositsRequest proposalId + * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryDepositsRequest pagination + */ + + /** + * Constructs a new QueryDepositsRequest. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a QueryDepositsRequest. + * @implements IQueryDepositsRequest + * @constructor + * @param {cosmos.gov.v1beta1.IQueryDepositsRequest=} [properties] Properties to set + */ + function QueryDepositsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryDepositsRequest proposalId. + * @member {number|Long} proposalId + * @memberof cosmos.gov.v1beta1.QueryDepositsRequest + * @instance + */ + QueryDepositsRequest.prototype.proposalId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * QueryDepositsRequest pagination. + * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination + * @memberof cosmos.gov.v1beta1.QueryDepositsRequest + * @instance + */ + QueryDepositsRequest.prototype.pagination = null; + + /** + * Creates a new QueryDepositsRequest instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.QueryDepositsRequest + * @static + * @param {cosmos.gov.v1beta1.IQueryDepositsRequest=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.QueryDepositsRequest} QueryDepositsRequest instance + */ + QueryDepositsRequest.create = function create(properties) { + return new QueryDepositsRequest(properties); + }; + + /** + * Encodes the specified QueryDepositsRequest message. Does not implicitly {@link cosmos.gov.v1beta1.QueryDepositsRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.QueryDepositsRequest + * @static + * @param {cosmos.gov.v1beta1.IQueryDepositsRequest} message QueryDepositsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDepositsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proposalId != null && Object.hasOwnProperty.call(message, "proposalId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposalId); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryDepositsRequest message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.QueryDepositsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.QueryDepositsRequest + * @static + * @param {cosmos.gov.v1beta1.IQueryDepositsRequest} message QueryDepositsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDepositsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDepositsRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.QueryDepositsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.QueryDepositsRequest} QueryDepositsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDepositsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.QueryDepositsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDepositsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.QueryDepositsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.QueryDepositsRequest} QueryDepositsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDepositsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDepositsRequest message. + * @function verify + * @memberof cosmos.gov.v1beta1.QueryDepositsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDepositsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (!$util.isInteger(message.proposalId) && !(message.proposalId && $util.isInteger(message.proposalId.low) && $util.isInteger(message.proposalId.high))) + return "proposalId: integer|Long expected"; + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryDepositsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.QueryDepositsRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.QueryDepositsRequest} QueryDepositsRequest + */ + QueryDepositsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.QueryDepositsRequest) + return object; + let message = new $root.cosmos.gov.v1beta1.QueryDepositsRequest(); + if (object.proposalId != null) + if ($util.Long) + (message.proposalId = $util.Long.fromValue(object.proposalId)).unsigned = true; + else if (typeof object.proposalId === "string") + message.proposalId = parseInt(object.proposalId, 10); + else if (typeof object.proposalId === "number") + message.proposalId = object.proposalId; + else if (typeof object.proposalId === "object") + message.proposalId = new $util.LongBits(object.proposalId.low >>> 0, object.proposalId.high >>> 0).toNumber(true); + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.gov.v1beta1.QueryDepositsRequest.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryDepositsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.QueryDepositsRequest + * @static + * @param {cosmos.gov.v1beta1.QueryDepositsRequest} message QueryDepositsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDepositsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.proposalId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.proposalId = options.longs === String ? "0" : 0; + object.pagination = null; + } + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (typeof message.proposalId === "number") + object.proposalId = options.longs === String ? String(message.proposalId) : message.proposalId; + else + object.proposalId = options.longs === String ? $util.Long.prototype.toString.call(message.proposalId) : options.longs === Number ? new $util.LongBits(message.proposalId.low >>> 0, message.proposalId.high >>> 0).toNumber(true) : message.proposalId; + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryDepositsRequest to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.QueryDepositsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryDepositsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryDepositsRequest; + })(v1beta1.QueryDepositsRequest || {}); + + v1beta1.QueryDepositsResponse = (function(QueryDepositsResponse) { + + /** + * Properties of a QueryDepositsResponse. + * @memberof cosmos.gov.v1beta1 + * @interface IQueryDepositsResponse + * @property {Array.|null} [deposits] QueryDepositsResponse deposits + * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryDepositsResponse pagination + */ + + /** + * Constructs a new QueryDepositsResponse. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a QueryDepositsResponse. + * @implements IQueryDepositsResponse + * @constructor + * @param {cosmos.gov.v1beta1.IQueryDepositsResponse=} [properties] Properties to set + */ + function QueryDepositsResponse(properties) { + this.deposits = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryDepositsResponse deposits. + * @member {Array.} deposits + * @memberof cosmos.gov.v1beta1.QueryDepositsResponse + * @instance + */ + QueryDepositsResponse.prototype.deposits = $util.emptyArray; + + /** + * QueryDepositsResponse pagination. + * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination + * @memberof cosmos.gov.v1beta1.QueryDepositsResponse + * @instance + */ + QueryDepositsResponse.prototype.pagination = null; + + /** + * Creates a new QueryDepositsResponse instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.QueryDepositsResponse + * @static + * @param {cosmos.gov.v1beta1.IQueryDepositsResponse=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.QueryDepositsResponse} QueryDepositsResponse instance + */ + QueryDepositsResponse.create = function create(properties) { + return new QueryDepositsResponse(properties); + }; + + /** + * Encodes the specified QueryDepositsResponse message. Does not implicitly {@link cosmos.gov.v1beta1.QueryDepositsResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.QueryDepositsResponse + * @static + * @param {cosmos.gov.v1beta1.IQueryDepositsResponse} message QueryDepositsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDepositsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deposits != null && message.deposits.length) + for (let i = 0; i < message.deposits.length; ++i) + $root.cosmos.gov.v1beta1.Deposit.encode(message.deposits[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryDepositsResponse message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.QueryDepositsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.QueryDepositsResponse + * @static + * @param {cosmos.gov.v1beta1.IQueryDepositsResponse} message QueryDepositsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDepositsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDepositsResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.QueryDepositsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.QueryDepositsResponse} QueryDepositsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDepositsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.QueryDepositsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.deposits && message.deposits.length)) + message.deposits = []; + message.deposits.push($root.cosmos.gov.v1beta1.Deposit.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDepositsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.QueryDepositsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.QueryDepositsResponse} QueryDepositsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDepositsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDepositsResponse message. + * @function verify + * @memberof cosmos.gov.v1beta1.QueryDepositsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDepositsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deposits != null && message.hasOwnProperty("deposits")) { + if (!Array.isArray(message.deposits)) + return "deposits: array expected"; + for (let i = 0; i < message.deposits.length; ++i) { + let error = $root.cosmos.gov.v1beta1.Deposit.verify(message.deposits[i]); + if (error) + return "deposits." + error; + } + } + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryDepositsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.QueryDepositsResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.QueryDepositsResponse} QueryDepositsResponse + */ + QueryDepositsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.QueryDepositsResponse) + return object; + let message = new $root.cosmos.gov.v1beta1.QueryDepositsResponse(); + if (object.deposits) { + if (!Array.isArray(object.deposits)) + throw TypeError(".cosmos.gov.v1beta1.QueryDepositsResponse.deposits: array expected"); + message.deposits = []; + for (let i = 0; i < object.deposits.length; ++i) { + if (typeof object.deposits[i] !== "object") + throw TypeError(".cosmos.gov.v1beta1.QueryDepositsResponse.deposits: object expected"); + message.deposits[i] = $root.cosmos.gov.v1beta1.Deposit.fromObject(object.deposits[i]); + } + } + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.gov.v1beta1.QueryDepositsResponse.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryDepositsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.QueryDepositsResponse + * @static + * @param {cosmos.gov.v1beta1.QueryDepositsResponse} message QueryDepositsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDepositsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.deposits = []; + if (options.defaults) + object.pagination = null; + if (message.deposits && message.deposits.length) { + object.deposits = []; + for (let j = 0; j < message.deposits.length; ++j) + object.deposits[j] = $root.cosmos.gov.v1beta1.Deposit.toObject(message.deposits[j], options); + } + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryDepositsResponse to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.QueryDepositsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryDepositsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryDepositsResponse; + })(v1beta1.QueryDepositsResponse || {}); + + v1beta1.QueryTallyResultRequest = (function(QueryTallyResultRequest) { + + /** + * Properties of a QueryTallyResultRequest. + * @memberof cosmos.gov.v1beta1 + * @interface IQueryTallyResultRequest + * @property {number|Long|null} [proposalId] QueryTallyResultRequest proposalId + */ + + /** + * Constructs a new QueryTallyResultRequest. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a QueryTallyResultRequest. + * @implements IQueryTallyResultRequest + * @constructor + * @param {cosmos.gov.v1beta1.IQueryTallyResultRequest=} [properties] Properties to set + */ + function QueryTallyResultRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryTallyResultRequest proposalId. + * @member {number|Long} proposalId + * @memberof cosmos.gov.v1beta1.QueryTallyResultRequest + * @instance + */ + QueryTallyResultRequest.prototype.proposalId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new QueryTallyResultRequest instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.QueryTallyResultRequest + * @static + * @param {cosmos.gov.v1beta1.IQueryTallyResultRequest=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.QueryTallyResultRequest} QueryTallyResultRequest instance + */ + QueryTallyResultRequest.create = function create(properties) { + return new QueryTallyResultRequest(properties); + }; + + /** + * Encodes the specified QueryTallyResultRequest message. Does not implicitly {@link cosmos.gov.v1beta1.QueryTallyResultRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.QueryTallyResultRequest + * @static + * @param {cosmos.gov.v1beta1.IQueryTallyResultRequest} message QueryTallyResultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryTallyResultRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proposalId != null && Object.hasOwnProperty.call(message, "proposalId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposalId); + return writer; + }; + + /** + * Encodes the specified QueryTallyResultRequest message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.QueryTallyResultRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.QueryTallyResultRequest + * @static + * @param {cosmos.gov.v1beta1.IQueryTallyResultRequest} message QueryTallyResultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryTallyResultRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryTallyResultRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.QueryTallyResultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.QueryTallyResultRequest} QueryTallyResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryTallyResultRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.QueryTallyResultRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryTallyResultRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.QueryTallyResultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.QueryTallyResultRequest} QueryTallyResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryTallyResultRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryTallyResultRequest message. + * @function verify + * @memberof cosmos.gov.v1beta1.QueryTallyResultRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryTallyResultRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (!$util.isInteger(message.proposalId) && !(message.proposalId && $util.isInteger(message.proposalId.low) && $util.isInteger(message.proposalId.high))) + return "proposalId: integer|Long expected"; + return null; + }; + + /** + * Creates a QueryTallyResultRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.QueryTallyResultRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.QueryTallyResultRequest} QueryTallyResultRequest + */ + QueryTallyResultRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.QueryTallyResultRequest) + return object; + let message = new $root.cosmos.gov.v1beta1.QueryTallyResultRequest(); + if (object.proposalId != null) + if ($util.Long) + (message.proposalId = $util.Long.fromValue(object.proposalId)).unsigned = true; + else if (typeof object.proposalId === "string") + message.proposalId = parseInt(object.proposalId, 10); + else if (typeof object.proposalId === "number") + message.proposalId = object.proposalId; + else if (typeof object.proposalId === "object") + message.proposalId = new $util.LongBits(object.proposalId.low >>> 0, object.proposalId.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a QueryTallyResultRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.QueryTallyResultRequest + * @static + * @param {cosmos.gov.v1beta1.QueryTallyResultRequest} message QueryTallyResultRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryTallyResultRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.proposalId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.proposalId = options.longs === String ? "0" : 0; + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (typeof message.proposalId === "number") + object.proposalId = options.longs === String ? String(message.proposalId) : message.proposalId; + else + object.proposalId = options.longs === String ? $util.Long.prototype.toString.call(message.proposalId) : options.longs === Number ? new $util.LongBits(message.proposalId.low >>> 0, message.proposalId.high >>> 0).toNumber(true) : message.proposalId; + return object; + }; + + /** + * Converts this QueryTallyResultRequest to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.QueryTallyResultRequest + * @instance + * @returns {Object.} JSON object + */ + QueryTallyResultRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryTallyResultRequest; + })(v1beta1.QueryTallyResultRequest || {}); + + v1beta1.QueryTallyResultResponse = (function(QueryTallyResultResponse) { + + /** + * Properties of a QueryTallyResultResponse. + * @memberof cosmos.gov.v1beta1 + * @interface IQueryTallyResultResponse + * @property {cosmos.gov.v1beta1.ITallyResult|null} [tally] QueryTallyResultResponse tally + */ + + /** + * Constructs a new QueryTallyResultResponse. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a QueryTallyResultResponse. + * @implements IQueryTallyResultResponse + * @constructor + * @param {cosmos.gov.v1beta1.IQueryTallyResultResponse=} [properties] Properties to set + */ + function QueryTallyResultResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryTallyResultResponse tally. + * @member {cosmos.gov.v1beta1.ITallyResult|null|undefined} tally + * @memberof cosmos.gov.v1beta1.QueryTallyResultResponse + * @instance + */ + QueryTallyResultResponse.prototype.tally = null; + + /** + * Creates a new QueryTallyResultResponse instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.QueryTallyResultResponse + * @static + * @param {cosmos.gov.v1beta1.IQueryTallyResultResponse=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.QueryTallyResultResponse} QueryTallyResultResponse instance + */ + QueryTallyResultResponse.create = function create(properties) { + return new QueryTallyResultResponse(properties); + }; + + /** + * Encodes the specified QueryTallyResultResponse message. Does not implicitly {@link cosmos.gov.v1beta1.QueryTallyResultResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.QueryTallyResultResponse + * @static + * @param {cosmos.gov.v1beta1.IQueryTallyResultResponse} message QueryTallyResultResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryTallyResultResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tally != null && Object.hasOwnProperty.call(message, "tally")) + $root.cosmos.gov.v1beta1.TallyResult.encode(message.tally, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryTallyResultResponse message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.QueryTallyResultResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.QueryTallyResultResponse + * @static + * @param {cosmos.gov.v1beta1.IQueryTallyResultResponse} message QueryTallyResultResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryTallyResultResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryTallyResultResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.QueryTallyResultResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.QueryTallyResultResponse} QueryTallyResultResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryTallyResultResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.QueryTallyResultResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tally = $root.cosmos.gov.v1beta1.TallyResult.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryTallyResultResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.QueryTallyResultResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.QueryTallyResultResponse} QueryTallyResultResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryTallyResultResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryTallyResultResponse message. + * @function verify + * @memberof cosmos.gov.v1beta1.QueryTallyResultResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryTallyResultResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tally != null && message.hasOwnProperty("tally")) { + let error = $root.cosmos.gov.v1beta1.TallyResult.verify(message.tally); + if (error) + return "tally." + error; + } + return null; + }; + + /** + * Creates a QueryTallyResultResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.QueryTallyResultResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.QueryTallyResultResponse} QueryTallyResultResponse + */ + QueryTallyResultResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.QueryTallyResultResponse) + return object; + let message = new $root.cosmos.gov.v1beta1.QueryTallyResultResponse(); + if (object.tally != null) { + if (typeof object.tally !== "object") + throw TypeError(".cosmos.gov.v1beta1.QueryTallyResultResponse.tally: object expected"); + message.tally = $root.cosmos.gov.v1beta1.TallyResult.fromObject(object.tally); + } + return message; + }; + + /** + * Creates a plain object from a QueryTallyResultResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.QueryTallyResultResponse + * @static + * @param {cosmos.gov.v1beta1.QueryTallyResultResponse} message QueryTallyResultResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryTallyResultResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.tally = null; + if (message.tally != null && message.hasOwnProperty("tally")) + object.tally = $root.cosmos.gov.v1beta1.TallyResult.toObject(message.tally, options); + return object; + }; + + /** + * Converts this QueryTallyResultResponse to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.QueryTallyResultResponse + * @instance + * @returns {Object.} JSON object + */ + QueryTallyResultResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryTallyResultResponse; + })(v1beta1.QueryTallyResultResponse || {}); + + v1beta1.Msg = (function(Msg) { + + /** + * Constructs a new Msg service. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a Msg + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Msg(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; + + /** + * Creates new Msg service using the specified rpc implementation. + * @function create + * @memberof cosmos.gov.v1beta1.Msg + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Msg} RPC service. Useful where requests and/or responses are streamed. + */ + Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.gov.v1beta1.Msg#submitProposal}. + * @memberof cosmos.gov.v1beta1.Msg + * @typedef SubmitProposalCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.gov.v1beta1.IMsgSubmitProposalResponse} [response] MsgSubmitProposalResponse + */ + + /** + * Calls SubmitProposal. + * @function submitProposal + * @memberof cosmos.gov.v1beta1.Msg + * @instance + * @param {cosmos.gov.v1beta1.IMsgSubmitProposal} request MsgSubmitProposal message or plain object + * @param {cosmos.gov.v1beta1.Msg.SubmitProposalCallback} callback Node-style callback called with the error, if any, and MsgSubmitProposalResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.submitProposal = function submitProposal(request, callback) { + return this.rpcCall(submitProposal, $root.cosmos.gov.v1beta1.MsgSubmitProposal, $root.cosmos.gov.v1beta1.MsgSubmitProposalResponse, request, callback); + }, "name", { value: "SubmitProposal" }); + + /** + * Calls SubmitProposal. + * @function submitProposal + * @memberof cosmos.gov.v1beta1.Msg + * @instance + * @param {cosmos.gov.v1beta1.IMsgSubmitProposal} request MsgSubmitProposal message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.gov.v1beta1.Msg#vote}. + * @memberof cosmos.gov.v1beta1.Msg + * @typedef VoteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.gov.v1beta1.IMsgVoteResponse} [response] MsgVoteResponse + */ + + /** + * Calls Vote. + * @function vote + * @memberof cosmos.gov.v1beta1.Msg + * @instance + * @param {cosmos.gov.v1beta1.IMsgVote} request MsgVote message or plain object + * @param {cosmos.gov.v1beta1.Msg.VoteCallback} callback Node-style callback called with the error, if any, and MsgVoteResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.vote = function vote(request, callback) { + return this.rpcCall(vote, $root.cosmos.gov.v1beta1.MsgVote, $root.cosmos.gov.v1beta1.MsgVoteResponse, request, callback); + }, "name", { value: "Vote" }); + + /** + * Calls Vote. + * @function vote + * @memberof cosmos.gov.v1beta1.Msg + * @instance + * @param {cosmos.gov.v1beta1.IMsgVote} request MsgVote message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.gov.v1beta1.Msg#deposit}. + * @memberof cosmos.gov.v1beta1.Msg + * @typedef DepositCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.gov.v1beta1.IMsgDepositResponse} [response] MsgDepositResponse + */ + + /** + * Calls Deposit. + * @function deposit + * @memberof cosmos.gov.v1beta1.Msg + * @instance + * @param {cosmos.gov.v1beta1.IMsgDeposit} request MsgDeposit message or plain object + * @param {cosmos.gov.v1beta1.Msg.DepositCallback} callback Node-style callback called with the error, if any, and MsgDepositResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.deposit = function deposit(request, callback) { + return this.rpcCall(deposit, $root.cosmos.gov.v1beta1.MsgDeposit, $root.cosmos.gov.v1beta1.MsgDepositResponse, request, callback); + }, "name", { value: "Deposit" }); + + /** + * Calls Deposit. + * @function deposit + * @memberof cosmos.gov.v1beta1.Msg + * @instance + * @param {cosmos.gov.v1beta1.IMsgDeposit} request MsgDeposit message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Msg; + })(v1beta1.Msg || {}); + + v1beta1.MsgSubmitProposal = (function(MsgSubmitProposal) { + + /** + * Properties of a MsgSubmitProposal. + * @memberof cosmos.gov.v1beta1 + * @interface IMsgSubmitProposal + * @property {google.protobuf.IAny|null} [content] MsgSubmitProposal content + * @property {Array.|null} [initialDeposit] MsgSubmitProposal initialDeposit + * @property {string|null} [proposer] MsgSubmitProposal proposer + */ + + /** + * Constructs a new MsgSubmitProposal. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a MsgSubmitProposal. + * @implements IMsgSubmitProposal + * @constructor + * @param {cosmos.gov.v1beta1.IMsgSubmitProposal=} [properties] Properties to set + */ + function MsgSubmitProposal(properties) { + this.initialDeposit = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgSubmitProposal content. + * @member {google.protobuf.IAny|null|undefined} content + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @instance + */ + MsgSubmitProposal.prototype.content = null; + + /** + * MsgSubmitProposal initialDeposit. + * @member {Array.} initialDeposit + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @instance + */ + MsgSubmitProposal.prototype.initialDeposit = $util.emptyArray; + + /** + * MsgSubmitProposal proposer. + * @member {string} proposer + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @instance + */ + MsgSubmitProposal.prototype.proposer = ""; + + /** + * Creates a new MsgSubmitProposal instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @static + * @param {cosmos.gov.v1beta1.IMsgSubmitProposal=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.MsgSubmitProposal} MsgSubmitProposal instance + */ + MsgSubmitProposal.create = function create(properties) { + return new MsgSubmitProposal(properties); + }; + + /** + * Encodes the specified MsgSubmitProposal message. Does not implicitly {@link cosmos.gov.v1beta1.MsgSubmitProposal.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @static + * @param {cosmos.gov.v1beta1.IMsgSubmitProposal} message MsgSubmitProposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitProposal.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + $root.google.protobuf.Any.encode(message.content, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.initialDeposit != null && message.initialDeposit.length) + for (let i = 0; i < message.initialDeposit.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.initialDeposit[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.proposer != null && Object.hasOwnProperty.call(message, "proposer")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.proposer); + return writer; + }; + + /** + * Encodes the specified MsgSubmitProposal message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.MsgSubmitProposal.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @static + * @param {cosmos.gov.v1beta1.IMsgSubmitProposal} message MsgSubmitProposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitProposal.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgSubmitProposal message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.MsgSubmitProposal} MsgSubmitProposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitProposal.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.MsgSubmitProposal(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.content = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.initialDeposit && message.initialDeposit.length)) + message.initialDeposit = []; + message.initialDeposit.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + case 3: + message.proposer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgSubmitProposal message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.MsgSubmitProposal} MsgSubmitProposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitProposal.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgSubmitProposal message. + * @function verify + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgSubmitProposal.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) { + let error = $root.google.protobuf.Any.verify(message.content); + if (error) + return "content." + error; + } + if (message.initialDeposit != null && message.hasOwnProperty("initialDeposit")) { + if (!Array.isArray(message.initialDeposit)) + return "initialDeposit: array expected"; + for (let i = 0; i < message.initialDeposit.length; ++i) { + let error = $root.cosmos.base.v1beta1.Coin.verify(message.initialDeposit[i]); + if (error) + return "initialDeposit." + error; + } + } + if (message.proposer != null && message.hasOwnProperty("proposer")) + if (!$util.isString(message.proposer)) + return "proposer: string expected"; + return null; + }; + + /** + * Creates a MsgSubmitProposal message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.MsgSubmitProposal} MsgSubmitProposal + */ + MsgSubmitProposal.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.MsgSubmitProposal) + return object; + let message = new $root.cosmos.gov.v1beta1.MsgSubmitProposal(); + if (object.content != null) { + if (typeof object.content !== "object") + throw TypeError(".cosmos.gov.v1beta1.MsgSubmitProposal.content: object expected"); + message.content = $root.google.protobuf.Any.fromObject(object.content); + } + if (object.initialDeposit) { + if (!Array.isArray(object.initialDeposit)) + throw TypeError(".cosmos.gov.v1beta1.MsgSubmitProposal.initialDeposit: array expected"); + message.initialDeposit = []; + for (let i = 0; i < object.initialDeposit.length; ++i) { + if (typeof object.initialDeposit[i] !== "object") + throw TypeError(".cosmos.gov.v1beta1.MsgSubmitProposal.initialDeposit: object expected"); + message.initialDeposit[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.initialDeposit[i]); + } + } + if (object.proposer != null) + message.proposer = String(object.proposer); + return message; + }; + + /** + * Creates a plain object from a MsgSubmitProposal message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @static + * @param {cosmos.gov.v1beta1.MsgSubmitProposal} message MsgSubmitProposal + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSubmitProposal.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.initialDeposit = []; + if (options.defaults) { + object.content = null; + object.proposer = ""; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = $root.google.protobuf.Any.toObject(message.content, options); + if (message.initialDeposit && message.initialDeposit.length) { + object.initialDeposit = []; + for (let j = 0; j < message.initialDeposit.length; ++j) + object.initialDeposit[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.initialDeposit[j], options); + } + if (message.proposer != null && message.hasOwnProperty("proposer")) + object.proposer = message.proposer; + return object; + }; + + /** + * Converts this MsgSubmitProposal to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.MsgSubmitProposal + * @instance + * @returns {Object.} JSON object + */ + MsgSubmitProposal.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgSubmitProposal; + })(v1beta1.MsgSubmitProposal || {}); + + v1beta1.MsgSubmitProposalResponse = (function(MsgSubmitProposalResponse) { + + /** + * Properties of a MsgSubmitProposalResponse. + * @memberof cosmos.gov.v1beta1 + * @interface IMsgSubmitProposalResponse + * @property {number|Long|null} [proposalId] MsgSubmitProposalResponse proposalId + */ + + /** + * Constructs a new MsgSubmitProposalResponse. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a MsgSubmitProposalResponse. + * @implements IMsgSubmitProposalResponse + * @constructor + * @param {cosmos.gov.v1beta1.IMsgSubmitProposalResponse=} [properties] Properties to set + */ + function MsgSubmitProposalResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgSubmitProposalResponse proposalId. + * @member {number|Long} proposalId + * @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse + * @instance + */ + MsgSubmitProposalResponse.prototype.proposalId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new MsgSubmitProposalResponse instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse + * @static + * @param {cosmos.gov.v1beta1.IMsgSubmitProposalResponse=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.MsgSubmitProposalResponse} MsgSubmitProposalResponse instance + */ + MsgSubmitProposalResponse.create = function create(properties) { + return new MsgSubmitProposalResponse(properties); + }; + + /** + * Encodes the specified MsgSubmitProposalResponse message. Does not implicitly {@link cosmos.gov.v1beta1.MsgSubmitProposalResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse + * @static + * @param {cosmos.gov.v1beta1.IMsgSubmitProposalResponse} message MsgSubmitProposalResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitProposalResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proposalId != null && Object.hasOwnProperty.call(message, "proposalId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposalId); + return writer; + }; + + /** + * Encodes the specified MsgSubmitProposalResponse message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.MsgSubmitProposalResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse + * @static + * @param {cosmos.gov.v1beta1.IMsgSubmitProposalResponse} message MsgSubmitProposalResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitProposalResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgSubmitProposalResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.MsgSubmitProposalResponse} MsgSubmitProposalResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitProposalResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.MsgSubmitProposalResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgSubmitProposalResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.MsgSubmitProposalResponse} MsgSubmitProposalResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitProposalResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgSubmitProposalResponse message. + * @function verify + * @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgSubmitProposalResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (!$util.isInteger(message.proposalId) && !(message.proposalId && $util.isInteger(message.proposalId.low) && $util.isInteger(message.proposalId.high))) + return "proposalId: integer|Long expected"; + return null; + }; + + /** + * Creates a MsgSubmitProposalResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.MsgSubmitProposalResponse} MsgSubmitProposalResponse + */ + MsgSubmitProposalResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.MsgSubmitProposalResponse) + return object; + let message = new $root.cosmos.gov.v1beta1.MsgSubmitProposalResponse(); + if (object.proposalId != null) + if ($util.Long) + (message.proposalId = $util.Long.fromValue(object.proposalId)).unsigned = true; + else if (typeof object.proposalId === "string") + message.proposalId = parseInt(object.proposalId, 10); + else if (typeof object.proposalId === "number") + message.proposalId = object.proposalId; + else if (typeof object.proposalId === "object") + message.proposalId = new $util.LongBits(object.proposalId.low >>> 0, object.proposalId.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a MsgSubmitProposalResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse + * @static + * @param {cosmos.gov.v1beta1.MsgSubmitProposalResponse} message MsgSubmitProposalResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSubmitProposalResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.proposalId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.proposalId = options.longs === String ? "0" : 0; + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (typeof message.proposalId === "number") + object.proposalId = options.longs === String ? String(message.proposalId) : message.proposalId; + else + object.proposalId = options.longs === String ? $util.Long.prototype.toString.call(message.proposalId) : options.longs === Number ? new $util.LongBits(message.proposalId.low >>> 0, message.proposalId.high >>> 0).toNumber(true) : message.proposalId; + return object; + }; + + /** + * Converts this MsgSubmitProposalResponse to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse + * @instance + * @returns {Object.} JSON object + */ + MsgSubmitProposalResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgSubmitProposalResponse; + })(v1beta1.MsgSubmitProposalResponse || {}); + + v1beta1.MsgVote = (function(MsgVote) { + + /** + * Properties of a MsgVote. + * @memberof cosmos.gov.v1beta1 + * @interface IMsgVote + * @property {number|Long|null} [proposalId] MsgVote proposalId + * @property {string|null} [voter] MsgVote voter + * @property {cosmos.gov.v1beta1.VoteOption|null} [option] MsgVote option + */ + + /** + * Constructs a new MsgVote. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a MsgVote. + * @implements IMsgVote + * @constructor + * @param {cosmos.gov.v1beta1.IMsgVote=} [properties] Properties to set + */ + function MsgVote(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgVote proposalId. + * @member {number|Long} proposalId + * @memberof cosmos.gov.v1beta1.MsgVote + * @instance + */ + MsgVote.prototype.proposalId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * MsgVote voter. + * @member {string} voter + * @memberof cosmos.gov.v1beta1.MsgVote + * @instance + */ + MsgVote.prototype.voter = ""; + + /** + * MsgVote option. + * @member {cosmos.gov.v1beta1.VoteOption} option + * @memberof cosmos.gov.v1beta1.MsgVote + * @instance + */ + MsgVote.prototype.option = 0; + + /** + * Creates a new MsgVote instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.MsgVote + * @static + * @param {cosmos.gov.v1beta1.IMsgVote=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.MsgVote} MsgVote instance + */ + MsgVote.create = function create(properties) { + return new MsgVote(properties); + }; + + /** + * Encodes the specified MsgVote message. Does not implicitly {@link cosmos.gov.v1beta1.MsgVote.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.MsgVote + * @static + * @param {cosmos.gov.v1beta1.IMsgVote} message MsgVote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgVote.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proposalId != null && Object.hasOwnProperty.call(message, "proposalId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposalId); + if (message.voter != null && Object.hasOwnProperty.call(message, "voter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.voter); + if (message.option != null && Object.hasOwnProperty.call(message, "option")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.option); + return writer; + }; + + /** + * Encodes the specified MsgVote message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.MsgVote.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.MsgVote + * @static + * @param {cosmos.gov.v1beta1.IMsgVote} message MsgVote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgVote.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgVote message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.MsgVote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.MsgVote} MsgVote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgVote.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.MsgVote(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.voter = reader.string(); + break; + case 3: + message.option = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgVote message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.MsgVote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.MsgVote} MsgVote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgVote.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgVote message. + * @function verify + * @memberof cosmos.gov.v1beta1.MsgVote + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgVote.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (!$util.isInteger(message.proposalId) && !(message.proposalId && $util.isInteger(message.proposalId.low) && $util.isInteger(message.proposalId.high))) + return "proposalId: integer|Long expected"; + if (message.voter != null && message.hasOwnProperty("voter")) + if (!$util.isString(message.voter)) + return "voter: string expected"; + if (message.option != null && message.hasOwnProperty("option")) + switch (message.option) { + default: + return "option: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a MsgVote message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.MsgVote + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.MsgVote} MsgVote + */ + MsgVote.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.MsgVote) + return object; + let message = new $root.cosmos.gov.v1beta1.MsgVote(); + if (object.proposalId != null) + if ($util.Long) + (message.proposalId = $util.Long.fromValue(object.proposalId)).unsigned = true; + else if (typeof object.proposalId === "string") + message.proposalId = parseInt(object.proposalId, 10); + else if (typeof object.proposalId === "number") + message.proposalId = object.proposalId; + else if (typeof object.proposalId === "object") + message.proposalId = new $util.LongBits(object.proposalId.low >>> 0, object.proposalId.high >>> 0).toNumber(true); + if (object.voter != null) + message.voter = String(object.voter); + switch (object.option) { + case "VOTE_OPTION_UNSPECIFIED": + case 0: + message.option = 0; + break; + case "VOTE_OPTION_YES": + case 1: + message.option = 1; + break; + case "VOTE_OPTION_ABSTAIN": + case 2: + message.option = 2; + break; + case "VOTE_OPTION_NO": + case 3: + message.option = 3; + break; + case "VOTE_OPTION_NO_WITH_VETO": + case 4: + message.option = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a MsgVote message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.MsgVote + * @static + * @param {cosmos.gov.v1beta1.MsgVote} message MsgVote + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgVote.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.proposalId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.proposalId = options.longs === String ? "0" : 0; + object.voter = ""; + object.option = options.enums === String ? "VOTE_OPTION_UNSPECIFIED" : 0; + } + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (typeof message.proposalId === "number") + object.proposalId = options.longs === String ? String(message.proposalId) : message.proposalId; + else + object.proposalId = options.longs === String ? $util.Long.prototype.toString.call(message.proposalId) : options.longs === Number ? new $util.LongBits(message.proposalId.low >>> 0, message.proposalId.high >>> 0).toNumber(true) : message.proposalId; + if (message.voter != null && message.hasOwnProperty("voter")) + object.voter = message.voter; + if (message.option != null && message.hasOwnProperty("option")) + object.option = options.enums === String ? $root.cosmos.gov.v1beta1.VoteOption[message.option] : message.option; + return object; + }; + + /** + * Converts this MsgVote to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.MsgVote + * @instance + * @returns {Object.} JSON object + */ + MsgVote.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgVote; + })(v1beta1.MsgVote || {}); + + v1beta1.MsgVoteResponse = (function(MsgVoteResponse) { + + /** + * Properties of a MsgVoteResponse. + * @memberof cosmos.gov.v1beta1 + * @interface IMsgVoteResponse + */ + + /** + * Constructs a new MsgVoteResponse. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a MsgVoteResponse. + * @implements IMsgVoteResponse + * @constructor + * @param {cosmos.gov.v1beta1.IMsgVoteResponse=} [properties] Properties to set + */ + function MsgVoteResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgVoteResponse instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.MsgVoteResponse + * @static + * @param {cosmos.gov.v1beta1.IMsgVoteResponse=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.MsgVoteResponse} MsgVoteResponse instance + */ + MsgVoteResponse.create = function create(properties) { + return new MsgVoteResponse(properties); + }; + + /** + * Encodes the specified MsgVoteResponse message. Does not implicitly {@link cosmos.gov.v1beta1.MsgVoteResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.MsgVoteResponse + * @static + * @param {cosmos.gov.v1beta1.IMsgVoteResponse} message MsgVoteResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgVoteResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgVoteResponse message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.MsgVoteResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.MsgVoteResponse + * @static + * @param {cosmos.gov.v1beta1.IMsgVoteResponse} message MsgVoteResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgVoteResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgVoteResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.MsgVoteResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.MsgVoteResponse} MsgVoteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgVoteResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.MsgVoteResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgVoteResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.MsgVoteResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.MsgVoteResponse} MsgVoteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgVoteResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgVoteResponse message. + * @function verify + * @memberof cosmos.gov.v1beta1.MsgVoteResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgVoteResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgVoteResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.MsgVoteResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.MsgVoteResponse} MsgVoteResponse + */ + MsgVoteResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.MsgVoteResponse) + return object; + return new $root.cosmos.gov.v1beta1.MsgVoteResponse(); + }; + + /** + * Creates a plain object from a MsgVoteResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.MsgVoteResponse + * @static + * @param {cosmos.gov.v1beta1.MsgVoteResponse} message MsgVoteResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgVoteResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgVoteResponse to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.MsgVoteResponse + * @instance + * @returns {Object.} JSON object + */ + MsgVoteResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgVoteResponse; + })(v1beta1.MsgVoteResponse || {}); + + v1beta1.MsgDeposit = (function(MsgDeposit) { + + /** + * Properties of a MsgDeposit. + * @memberof cosmos.gov.v1beta1 + * @interface IMsgDeposit + * @property {number|Long|null} [proposalId] MsgDeposit proposalId + * @property {string|null} [depositor] MsgDeposit depositor + * @property {Array.|null} [amount] MsgDeposit amount + */ + + /** + * Constructs a new MsgDeposit. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a MsgDeposit. + * @implements IMsgDeposit + * @constructor + * @param {cosmos.gov.v1beta1.IMsgDeposit=} [properties] Properties to set + */ + function MsgDeposit(properties) { + this.amount = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgDeposit proposalId. + * @member {number|Long} proposalId + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @instance + */ + MsgDeposit.prototype.proposalId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * MsgDeposit depositor. + * @member {string} depositor + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @instance + */ + MsgDeposit.prototype.depositor = ""; + + /** + * MsgDeposit amount. + * @member {Array.} amount + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @instance + */ + MsgDeposit.prototype.amount = $util.emptyArray; + + /** + * Creates a new MsgDeposit instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @static + * @param {cosmos.gov.v1beta1.IMsgDeposit=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.MsgDeposit} MsgDeposit instance + */ + MsgDeposit.create = function create(properties) { + return new MsgDeposit(properties); + }; + + /** + * Encodes the specified MsgDeposit message. Does not implicitly {@link cosmos.gov.v1beta1.MsgDeposit.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @static + * @param {cosmos.gov.v1beta1.IMsgDeposit} message MsgDeposit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgDeposit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proposalId != null && Object.hasOwnProperty.call(message, "proposalId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposalId); + if (message.depositor != null && Object.hasOwnProperty.call(message, "depositor")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.depositor); + if (message.amount != null && message.amount.length) + for (let i = 0; i < message.amount.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.amount[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MsgDeposit message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.MsgDeposit.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @static + * @param {cosmos.gov.v1beta1.IMsgDeposit} message MsgDeposit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgDeposit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgDeposit message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.MsgDeposit} MsgDeposit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgDeposit.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.MsgDeposit(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.depositor = reader.string(); + break; + case 3: + if (!(message.amount && message.amount.length)) + message.amount = []; + message.amount.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgDeposit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.MsgDeposit} MsgDeposit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgDeposit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgDeposit message. + * @function verify + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgDeposit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (!$util.isInteger(message.proposalId) && !(message.proposalId && $util.isInteger(message.proposalId.low) && $util.isInteger(message.proposalId.high))) + return "proposalId: integer|Long expected"; + if (message.depositor != null && message.hasOwnProperty("depositor")) + if (!$util.isString(message.depositor)) + return "depositor: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + if (!Array.isArray(message.amount)) + return "amount: array expected"; + for (let i = 0; i < message.amount.length; ++i) { + let error = $root.cosmos.base.v1beta1.Coin.verify(message.amount[i]); + if (error) + return "amount." + error; + } + } + return null; + }; + + /** + * Creates a MsgDeposit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.MsgDeposit} MsgDeposit + */ + MsgDeposit.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.MsgDeposit) + return object; + let message = new $root.cosmos.gov.v1beta1.MsgDeposit(); + if (object.proposalId != null) + if ($util.Long) + (message.proposalId = $util.Long.fromValue(object.proposalId)).unsigned = true; + else if (typeof object.proposalId === "string") + message.proposalId = parseInt(object.proposalId, 10); + else if (typeof object.proposalId === "number") + message.proposalId = object.proposalId; + else if (typeof object.proposalId === "object") + message.proposalId = new $util.LongBits(object.proposalId.low >>> 0, object.proposalId.high >>> 0).toNumber(true); + if (object.depositor != null) + message.depositor = String(object.depositor); + if (object.amount) { + if (!Array.isArray(object.amount)) + throw TypeError(".cosmos.gov.v1beta1.MsgDeposit.amount: array expected"); + message.amount = []; + for (let i = 0; i < object.amount.length; ++i) { + if (typeof object.amount[i] !== "object") + throw TypeError(".cosmos.gov.v1beta1.MsgDeposit.amount: object expected"); + message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MsgDeposit message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @static + * @param {cosmos.gov.v1beta1.MsgDeposit} message MsgDeposit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgDeposit.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.amount = []; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.proposalId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.proposalId = options.longs === String ? "0" : 0; + object.depositor = ""; + } + if (message.proposalId != null && message.hasOwnProperty("proposalId")) + if (typeof message.proposalId === "number") + object.proposalId = options.longs === String ? String(message.proposalId) : message.proposalId; + else + object.proposalId = options.longs === String ? $util.Long.prototype.toString.call(message.proposalId) : options.longs === Number ? new $util.LongBits(message.proposalId.low >>> 0, message.proposalId.high >>> 0).toNumber(true) : message.proposalId; + if (message.depositor != null && message.hasOwnProperty("depositor")) + object.depositor = message.depositor; + if (message.amount && message.amount.length) { + object.amount = []; + for (let j = 0; j < message.amount.length; ++j) + object.amount[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.amount[j], options); + } + return object; + }; + + /** + * Converts this MsgDeposit to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.MsgDeposit + * @instance + * @returns {Object.} JSON object + */ + MsgDeposit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgDeposit; + })(v1beta1.MsgDeposit || {}); + + v1beta1.MsgDepositResponse = (function(MsgDepositResponse) { + + /** + * Properties of a MsgDepositResponse. + * @memberof cosmos.gov.v1beta1 + * @interface IMsgDepositResponse + */ + + /** + * Constructs a new MsgDepositResponse. + * @memberof cosmos.gov.v1beta1 + * @classdesc Represents a MsgDepositResponse. + * @implements IMsgDepositResponse + * @constructor + * @param {cosmos.gov.v1beta1.IMsgDepositResponse=} [properties] Properties to set + */ + function MsgDepositResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgDepositResponse instance using the specified properties. + * @function create + * @memberof cosmos.gov.v1beta1.MsgDepositResponse + * @static + * @param {cosmos.gov.v1beta1.IMsgDepositResponse=} [properties] Properties to set + * @returns {cosmos.gov.v1beta1.MsgDepositResponse} MsgDepositResponse instance + */ + MsgDepositResponse.create = function create(properties) { + return new MsgDepositResponse(properties); + }; + + /** + * Encodes the specified MsgDepositResponse message. Does not implicitly {@link cosmos.gov.v1beta1.MsgDepositResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.gov.v1beta1.MsgDepositResponse + * @static + * @param {cosmos.gov.v1beta1.IMsgDepositResponse} message MsgDepositResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgDepositResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgDepositResponse message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.MsgDepositResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.gov.v1beta1.MsgDepositResponse + * @static + * @param {cosmos.gov.v1beta1.IMsgDepositResponse} message MsgDepositResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgDepositResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgDepositResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.gov.v1beta1.MsgDepositResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.gov.v1beta1.MsgDepositResponse} MsgDepositResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgDepositResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.MsgDepositResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgDepositResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.gov.v1beta1.MsgDepositResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.gov.v1beta1.MsgDepositResponse} MsgDepositResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgDepositResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgDepositResponse message. + * @function verify + * @memberof cosmos.gov.v1beta1.MsgDepositResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgDepositResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgDepositResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.gov.v1beta1.MsgDepositResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.gov.v1beta1.MsgDepositResponse} MsgDepositResponse + */ + MsgDepositResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.gov.v1beta1.MsgDepositResponse) + return object; + return new $root.cosmos.gov.v1beta1.MsgDepositResponse(); + }; + + /** + * Creates a plain object from a MsgDepositResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.gov.v1beta1.MsgDepositResponse + * @static + * @param {cosmos.gov.v1beta1.MsgDepositResponse} message MsgDepositResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgDepositResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgDepositResponse to JSON. + * @function toJSON + * @memberof cosmos.gov.v1beta1.MsgDepositResponse + * @instance + * @returns {Object.} JSON object + */ + MsgDepositResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgDepositResponse; + })(v1beta1.MsgDepositResponse || {}); + + return v1beta1; + })(gov.v1beta1 || {}); + + return gov; + })(cosmos.gov || {}); + + /** + * Namespace mint. + * @memberof cosmos + * @namespace + */ + + cosmos.mint = (function(mint) { + + /** + * Namespace v1beta1. + * @memberof cosmos.mint + * @namespace + */ + + mint.v1beta1 = (function(v1beta1) { + + v1beta1.GenesisState = (function(GenesisState) { + + /** + * Properties of a GenesisState. + * @memberof cosmos.mint.v1beta1 + * @interface IGenesisState + * @property {cosmos.mint.v1beta1.IMinter|null} [minter] GenesisState minter + * @property {cosmos.mint.v1beta1.IParams|null} [params] GenesisState params + */ + + /** + * Constructs a new GenesisState. + * @memberof cosmos.mint.v1beta1 + * @classdesc Represents a GenesisState. + * @implements IGenesisState + * @constructor + * @param {cosmos.mint.v1beta1.IGenesisState=} [properties] Properties to set + */ + function GenesisState(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenesisState minter. + * @member {cosmos.mint.v1beta1.IMinter|null|undefined} minter + * @memberof cosmos.mint.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.minter = null; + + /** + * GenesisState params. + * @member {cosmos.mint.v1beta1.IParams|null|undefined} params + * @memberof cosmos.mint.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.params = null; + + /** + * Creates a new GenesisState instance using the specified properties. + * @function create + * @memberof cosmos.mint.v1beta1.GenesisState + * @static + * @param {cosmos.mint.v1beta1.IGenesisState=} [properties] Properties to set + * @returns {cosmos.mint.v1beta1.GenesisState} GenesisState instance + */ + GenesisState.create = function create(properties) { + return new GenesisState(properties); + }; + + /** + * Encodes the specified GenesisState message. Does not implicitly {@link cosmos.mint.v1beta1.GenesisState.verify|verify} messages. + * @function encode + * @memberof cosmos.mint.v1beta1.GenesisState + * @static + * @param {cosmos.mint.v1beta1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minter != null && Object.hasOwnProperty.call(message, "minter")) + $root.cosmos.mint.v1beta1.Minter.encode(message.minter, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.cosmos.mint.v1beta1.Params.encode(message.params, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link cosmos.mint.v1beta1.GenesisState.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.mint.v1beta1.GenesisState + * @static + * @param {cosmos.mint.v1beta1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer. + * @function decode + * @memberof cosmos.mint.v1beta1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.mint.v1beta1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.mint.v1beta1.GenesisState(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.minter = $root.cosmos.mint.v1beta1.Minter.decode(reader, reader.uint32()); + break; + case 2: + message.params = $root.cosmos.mint.v1beta1.Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.mint.v1beta1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.mint.v1beta1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenesisState message. + * @function verify + * @memberof cosmos.mint.v1beta1.GenesisState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenesisState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.minter != null && message.hasOwnProperty("minter")) { + let error = $root.cosmos.mint.v1beta1.Minter.verify(message.minter); + if (error) + return "minter." + error; + } + if (message.params != null && message.hasOwnProperty("params")) { + let error = $root.cosmos.mint.v1beta1.Params.verify(message.params); + if (error) + return "params." + error; + } + return null; + }; + + /** + * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.mint.v1beta1.GenesisState + * @static + * @param {Object.} object Plain object + * @returns {cosmos.mint.v1beta1.GenesisState} GenesisState + */ + GenesisState.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.mint.v1beta1.GenesisState) + return object; + let message = new $root.cosmos.mint.v1beta1.GenesisState(); + if (object.minter != null) { + if (typeof object.minter !== "object") + throw TypeError(".cosmos.mint.v1beta1.GenesisState.minter: object expected"); + message.minter = $root.cosmos.mint.v1beta1.Minter.fromObject(object.minter); + } + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".cosmos.mint.v1beta1.GenesisState.params: object expected"); + message.params = $root.cosmos.mint.v1beta1.Params.fromObject(object.params); + } + return message; + }; + + /** + * Creates a plain object from a GenesisState message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.mint.v1beta1.GenesisState + * @static + * @param {cosmos.mint.v1beta1.GenesisState} message GenesisState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenesisState.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.minter = null; + object.params = null; + } + if (message.minter != null && message.hasOwnProperty("minter")) + object.minter = $root.cosmos.mint.v1beta1.Minter.toObject(message.minter, options); + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.cosmos.mint.v1beta1.Params.toObject(message.params, options); + return object; + }; + + /** + * Converts this GenesisState to JSON. + * @function toJSON + * @memberof cosmos.mint.v1beta1.GenesisState + * @instance + * @returns {Object.} JSON object + */ + GenesisState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GenesisState; + })(v1beta1.GenesisState || {}); + + v1beta1.Minter = (function(Minter) { + + /** + * Properties of a Minter. + * @memberof cosmos.mint.v1beta1 + * @interface IMinter + * @property {string|null} [inflation] Minter inflation + * @property {string|null} [annualProvisions] Minter annualProvisions + */ + + /** + * Constructs a new Minter. + * @memberof cosmos.mint.v1beta1 + * @classdesc Represents a Minter. + * @implements IMinter + * @constructor + * @param {cosmos.mint.v1beta1.IMinter=} [properties] Properties to set + */ + function Minter(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Minter inflation. + * @member {string} inflation + * @memberof cosmos.mint.v1beta1.Minter + * @instance + */ + Minter.prototype.inflation = ""; + + /** + * Minter annualProvisions. + * @member {string} annualProvisions + * @memberof cosmos.mint.v1beta1.Minter + * @instance + */ + Minter.prototype.annualProvisions = ""; + + /** + * Creates a new Minter instance using the specified properties. + * @function create + * @memberof cosmos.mint.v1beta1.Minter + * @static + * @param {cosmos.mint.v1beta1.IMinter=} [properties] Properties to set + * @returns {cosmos.mint.v1beta1.Minter} Minter instance + */ + Minter.create = function create(properties) { + return new Minter(properties); + }; + + /** + * Encodes the specified Minter message. Does not implicitly {@link cosmos.mint.v1beta1.Minter.verify|verify} messages. + * @function encode + * @memberof cosmos.mint.v1beta1.Minter + * @static + * @param {cosmos.mint.v1beta1.IMinter} message Minter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Minter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inflation != null && Object.hasOwnProperty.call(message, "inflation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inflation); + if (message.annualProvisions != null && Object.hasOwnProperty.call(message, "annualProvisions")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.annualProvisions); + return writer; + }; + + /** + * Encodes the specified Minter message, length delimited. Does not implicitly {@link cosmos.mint.v1beta1.Minter.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.mint.v1beta1.Minter + * @static + * @param {cosmos.mint.v1beta1.IMinter} message Minter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Minter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Minter message from the specified reader or buffer. + * @function decode + * @memberof cosmos.mint.v1beta1.Minter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.mint.v1beta1.Minter} Minter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Minter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.mint.v1beta1.Minter(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inflation = reader.string(); + break; + case 2: + message.annualProvisions = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Minter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.mint.v1beta1.Minter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.mint.v1beta1.Minter} Minter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Minter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Minter message. + * @function verify + * @memberof cosmos.mint.v1beta1.Minter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Minter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inflation != null && message.hasOwnProperty("inflation")) + if (!$util.isString(message.inflation)) + return "inflation: string expected"; + if (message.annualProvisions != null && message.hasOwnProperty("annualProvisions")) + if (!$util.isString(message.annualProvisions)) + return "annualProvisions: string expected"; + return null; + }; + + /** + * Creates a Minter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.mint.v1beta1.Minter + * @static + * @param {Object.} object Plain object + * @returns {cosmos.mint.v1beta1.Minter} Minter + */ + Minter.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.mint.v1beta1.Minter) + return object; + let message = new $root.cosmos.mint.v1beta1.Minter(); + if (object.inflation != null) + message.inflation = String(object.inflation); + if (object.annualProvisions != null) + message.annualProvisions = String(object.annualProvisions); + return message; + }; + + /** + * Creates a plain object from a Minter message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.mint.v1beta1.Minter + * @static + * @param {cosmos.mint.v1beta1.Minter} message Minter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Minter.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.inflation = ""; + object.annualProvisions = ""; + } + if (message.inflation != null && message.hasOwnProperty("inflation")) + object.inflation = message.inflation; + if (message.annualProvisions != null && message.hasOwnProperty("annualProvisions")) + object.annualProvisions = message.annualProvisions; + return object; + }; + + /** + * Converts this Minter to JSON. + * @function toJSON + * @memberof cosmos.mint.v1beta1.Minter + * @instance + * @returns {Object.} JSON object + */ + Minter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Minter; + })(v1beta1.Minter || {}); + + v1beta1.Params = (function(Params) { + + /** + * Properties of a Params. + * @memberof cosmos.mint.v1beta1 + * @interface IParams + * @property {string|null} [mintDenom] Params mintDenom + * @property {string|null} [inflationRateChange] Params inflationRateChange + * @property {string|null} [inflationMax] Params inflationMax + * @property {string|null} [inflationMin] Params inflationMin + * @property {string|null} [goalBonded] Params goalBonded + * @property {number|Long|null} [blocksPerYear] Params blocksPerYear + */ + + /** + * Constructs a new Params. + * @memberof cosmos.mint.v1beta1 + * @classdesc Represents a Params. + * @implements IParams + * @constructor + * @param {cosmos.mint.v1beta1.IParams=} [properties] Properties to set + */ + function Params(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Params mintDenom. + * @member {string} mintDenom + * @memberof cosmos.mint.v1beta1.Params + * @instance + */ + Params.prototype.mintDenom = ""; + + /** + * Params inflationRateChange. + * @member {string} inflationRateChange + * @memberof cosmos.mint.v1beta1.Params + * @instance + */ + Params.prototype.inflationRateChange = ""; + + /** + * Params inflationMax. + * @member {string} inflationMax + * @memberof cosmos.mint.v1beta1.Params + * @instance + */ + Params.prototype.inflationMax = ""; + + /** + * Params inflationMin. + * @member {string} inflationMin + * @memberof cosmos.mint.v1beta1.Params + * @instance + */ + Params.prototype.inflationMin = ""; + + /** + * Params goalBonded. + * @member {string} goalBonded + * @memberof cosmos.mint.v1beta1.Params + * @instance + */ + Params.prototype.goalBonded = ""; + + /** + * Params blocksPerYear. + * @member {number|Long} blocksPerYear + * @memberof cosmos.mint.v1beta1.Params + * @instance + */ + Params.prototype.blocksPerYear = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new Params instance using the specified properties. + * @function create + * @memberof cosmos.mint.v1beta1.Params + * @static + * @param {cosmos.mint.v1beta1.IParams=} [properties] Properties to set + * @returns {cosmos.mint.v1beta1.Params} Params instance + */ + Params.create = function create(properties) { + return new Params(properties); + }; + + /** + * Encodes the specified Params message. Does not implicitly {@link cosmos.mint.v1beta1.Params.verify|verify} messages. + * @function encode + * @memberof cosmos.mint.v1beta1.Params + * @static + * @param {cosmos.mint.v1beta1.IParams} message Params message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Params.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mintDenom != null && Object.hasOwnProperty.call(message, "mintDenom")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mintDenom); + if (message.inflationRateChange != null && Object.hasOwnProperty.call(message, "inflationRateChange")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inflationRateChange); + if (message.inflationMax != null && Object.hasOwnProperty.call(message, "inflationMax")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.inflationMax); + if (message.inflationMin != null && Object.hasOwnProperty.call(message, "inflationMin")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.inflationMin); + if (message.goalBonded != null && Object.hasOwnProperty.call(message, "goalBonded")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.goalBonded); + if (message.blocksPerYear != null && Object.hasOwnProperty.call(message, "blocksPerYear")) + writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.blocksPerYear); + return writer; + }; + + /** + * Encodes the specified Params message, length delimited. Does not implicitly {@link cosmos.mint.v1beta1.Params.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.mint.v1beta1.Params + * @static + * @param {cosmos.mint.v1beta1.IParams} message Params message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Params.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Params message from the specified reader or buffer. + * @function decode + * @memberof cosmos.mint.v1beta1.Params + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.mint.v1beta1.Params} Params + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Params.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.mint.v1beta1.Params(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mintDenom = reader.string(); + break; + case 2: + message.inflationRateChange = reader.string(); + break; + case 3: + message.inflationMax = reader.string(); + break; + case 4: + message.inflationMin = reader.string(); + break; + case 5: + message.goalBonded = reader.string(); + break; + case 6: + message.blocksPerYear = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Params message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.mint.v1beta1.Params + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.mint.v1beta1.Params} Params + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Params.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Params message. + * @function verify + * @memberof cosmos.mint.v1beta1.Params + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Params.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mintDenom != null && message.hasOwnProperty("mintDenom")) + if (!$util.isString(message.mintDenom)) + return "mintDenom: string expected"; + if (message.inflationRateChange != null && message.hasOwnProperty("inflationRateChange")) + if (!$util.isString(message.inflationRateChange)) + return "inflationRateChange: string expected"; + if (message.inflationMax != null && message.hasOwnProperty("inflationMax")) + if (!$util.isString(message.inflationMax)) + return "inflationMax: string expected"; + if (message.inflationMin != null && message.hasOwnProperty("inflationMin")) + if (!$util.isString(message.inflationMin)) + return "inflationMin: string expected"; + if (message.goalBonded != null && message.hasOwnProperty("goalBonded")) + if (!$util.isString(message.goalBonded)) + return "goalBonded: string expected"; + if (message.blocksPerYear != null && message.hasOwnProperty("blocksPerYear")) + if (!$util.isInteger(message.blocksPerYear) && !(message.blocksPerYear && $util.isInteger(message.blocksPerYear.low) && $util.isInteger(message.blocksPerYear.high))) + return "blocksPerYear: integer|Long expected"; + return null; + }; + + /** + * Creates a Params message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.mint.v1beta1.Params + * @static + * @param {Object.} object Plain object + * @returns {cosmos.mint.v1beta1.Params} Params + */ + Params.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.mint.v1beta1.Params) + return object; + let message = new $root.cosmos.mint.v1beta1.Params(); + if (object.mintDenom != null) + message.mintDenom = String(object.mintDenom); + if (object.inflationRateChange != null) + message.inflationRateChange = String(object.inflationRateChange); + if (object.inflationMax != null) + message.inflationMax = String(object.inflationMax); + if (object.inflationMin != null) + message.inflationMin = String(object.inflationMin); + if (object.goalBonded != null) + message.goalBonded = String(object.goalBonded); + if (object.blocksPerYear != null) + if ($util.Long) + (message.blocksPerYear = $util.Long.fromValue(object.blocksPerYear)).unsigned = true; + else if (typeof object.blocksPerYear === "string") + message.blocksPerYear = parseInt(object.blocksPerYear, 10); + else if (typeof object.blocksPerYear === "number") + message.blocksPerYear = object.blocksPerYear; + else if (typeof object.blocksPerYear === "object") + message.blocksPerYear = new $util.LongBits(object.blocksPerYear.low >>> 0, object.blocksPerYear.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a Params message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.mint.v1beta1.Params + * @static + * @param {cosmos.mint.v1beta1.Params} message Params + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Params.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.mintDenom = ""; + object.inflationRateChange = ""; + object.inflationMax = ""; + object.inflationMin = ""; + object.goalBonded = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.blocksPerYear = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.blocksPerYear = options.longs === String ? "0" : 0; + } + if (message.mintDenom != null && message.hasOwnProperty("mintDenom")) + object.mintDenom = message.mintDenom; + if (message.inflationRateChange != null && message.hasOwnProperty("inflationRateChange")) + object.inflationRateChange = message.inflationRateChange; + if (message.inflationMax != null && message.hasOwnProperty("inflationMax")) + object.inflationMax = message.inflationMax; + if (message.inflationMin != null && message.hasOwnProperty("inflationMin")) + object.inflationMin = message.inflationMin; + if (message.goalBonded != null && message.hasOwnProperty("goalBonded")) + object.goalBonded = message.goalBonded; + if (message.blocksPerYear != null && message.hasOwnProperty("blocksPerYear")) + if (typeof message.blocksPerYear === "number") + object.blocksPerYear = options.longs === String ? String(message.blocksPerYear) : message.blocksPerYear; + else + object.blocksPerYear = options.longs === String ? $util.Long.prototype.toString.call(message.blocksPerYear) : options.longs === Number ? new $util.LongBits(message.blocksPerYear.low >>> 0, message.blocksPerYear.high >>> 0).toNumber(true) : message.blocksPerYear; + return object; + }; + + /** + * Converts this Params to JSON. + * @function toJSON + * @memberof cosmos.mint.v1beta1.Params + * @instance + * @returns {Object.} JSON object + */ + Params.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Params; + })(v1beta1.Params || {}); + + v1beta1.Query = (function(Query) { + + /** + * Constructs a new Query service. + * @memberof cosmos.mint.v1beta1 + * @classdesc Represents a Query + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Query(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; + + /** + * Creates new Query service using the specified rpc implementation. + * @function create + * @memberof cosmos.mint.v1beta1.Query + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Query} RPC service. Useful where requests and/or responses are streamed. + */ + Query.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.mint.v1beta1.Query#params}. + * @memberof cosmos.mint.v1beta1.Query + * @typedef ParamsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.mint.v1beta1.IQueryParamsResponse} [response] QueryParamsResponse + */ + + /** + * Calls Params. + * @function params + * @memberof cosmos.mint.v1beta1.Query + * @instance + * @param {cosmos.mint.v1beta1.IQueryParamsRequest} request QueryParamsRequest message or plain object + * @param {cosmos.mint.v1beta1.Query.ParamsCallback} callback Node-style callback called with the error, if any, and QueryParamsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.params = function params(request, callback) { + return this.rpcCall(params, $root.cosmos.mint.v1beta1.QueryParamsRequest, $root.cosmos.mint.v1beta1.QueryParamsResponse, request, callback); + }, "name", { value: "Params" }); + + /** + * Calls Params. + * @function params + * @memberof cosmos.mint.v1beta1.Query + * @instance + * @param {cosmos.mint.v1beta1.IQueryParamsRequest} request QueryParamsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.mint.v1beta1.Query#inflation}. + * @memberof cosmos.mint.v1beta1.Query + * @typedef InflationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.mint.v1beta1.IQueryInflationResponse} [response] QueryInflationResponse + */ + + /** + * Calls Inflation. + * @function inflation + * @memberof cosmos.mint.v1beta1.Query + * @instance + * @param {cosmos.mint.v1beta1.IQueryInflationRequest} request QueryInflationRequest message or plain object + * @param {cosmos.mint.v1beta1.Query.InflationCallback} callback Node-style callback called with the error, if any, and QueryInflationResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.inflation = function inflation(request, callback) { + return this.rpcCall(inflation, $root.cosmos.mint.v1beta1.QueryInflationRequest, $root.cosmos.mint.v1beta1.QueryInflationResponse, request, callback); + }, "name", { value: "Inflation" }); + + /** + * Calls Inflation. + * @function inflation + * @memberof cosmos.mint.v1beta1.Query + * @instance + * @param {cosmos.mint.v1beta1.IQueryInflationRequest} request QueryInflationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.mint.v1beta1.Query#annualProvisions}. + * @memberof cosmos.mint.v1beta1.Query + * @typedef AnnualProvisionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.mint.v1beta1.IQueryAnnualProvisionsResponse} [response] QueryAnnualProvisionsResponse + */ + + /** + * Calls AnnualProvisions. + * @function annualProvisions + * @memberof cosmos.mint.v1beta1.Query + * @instance + * @param {cosmos.mint.v1beta1.IQueryAnnualProvisionsRequest} request QueryAnnualProvisionsRequest message or plain object + * @param {cosmos.mint.v1beta1.Query.AnnualProvisionsCallback} callback Node-style callback called with the error, if any, and QueryAnnualProvisionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.annualProvisions = function annualProvisions(request, callback) { + return this.rpcCall(annualProvisions, $root.cosmos.mint.v1beta1.QueryAnnualProvisionsRequest, $root.cosmos.mint.v1beta1.QueryAnnualProvisionsResponse, request, callback); + }, "name", { value: "AnnualProvisions" }); + + /** + * Calls AnnualProvisions. + * @function annualProvisions + * @memberof cosmos.mint.v1beta1.Query + * @instance + * @param {cosmos.mint.v1beta1.IQueryAnnualProvisionsRequest} request QueryAnnualProvisionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Query; + })(v1beta1.Query || {}); + + v1beta1.QueryParamsRequest = (function(QueryParamsRequest) { + + /** + * Properties of a QueryParamsRequest. + * @memberof cosmos.mint.v1beta1 + * @interface IQueryParamsRequest + */ + + /** + * Constructs a new QueryParamsRequest. + * @memberof cosmos.mint.v1beta1 + * @classdesc Represents a QueryParamsRequest. + * @implements IQueryParamsRequest + * @constructor + * @param {cosmos.mint.v1beta1.IQueryParamsRequest=} [properties] Properties to set + */ + function QueryParamsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new QueryParamsRequest instance using the specified properties. + * @function create + * @memberof cosmos.mint.v1beta1.QueryParamsRequest + * @static + * @param {cosmos.mint.v1beta1.IQueryParamsRequest=} [properties] Properties to set + * @returns {cosmos.mint.v1beta1.QueryParamsRequest} QueryParamsRequest instance + */ + QueryParamsRequest.create = function create(properties) { + return new QueryParamsRequest(properties); + }; + + /** + * Encodes the specified QueryParamsRequest message. Does not implicitly {@link cosmos.mint.v1beta1.QueryParamsRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.mint.v1beta1.QueryParamsRequest + * @static + * @param {cosmos.mint.v1beta1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link cosmos.mint.v1beta1.QueryParamsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.mint.v1beta1.QueryParamsRequest + * @static + * @param {cosmos.mint.v1beta1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryParamsRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.mint.v1beta1.QueryParamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.mint.v1beta1.QueryParamsRequest} QueryParamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.mint.v1beta1.QueryParamsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.mint.v1beta1.QueryParamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.mint.v1beta1.QueryParamsRequest} QueryParamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryParamsRequest message. + * @function verify + * @memberof cosmos.mint.v1beta1.QueryParamsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryParamsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.mint.v1beta1.QueryParamsRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.mint.v1beta1.QueryParamsRequest} QueryParamsRequest + */ + QueryParamsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.mint.v1beta1.QueryParamsRequest) + return object; + return new $root.cosmos.mint.v1beta1.QueryParamsRequest(); + }; + + /** + * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.mint.v1beta1.QueryParamsRequest + * @static + * @param {cosmos.mint.v1beta1.QueryParamsRequest} message QueryParamsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryParamsRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this QueryParamsRequest to JSON. + * @function toJSON + * @memberof cosmos.mint.v1beta1.QueryParamsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryParamsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryParamsRequest; + })(v1beta1.QueryParamsRequest || {}); + + v1beta1.QueryParamsResponse = (function(QueryParamsResponse) { + + /** + * Properties of a QueryParamsResponse. + * @memberof cosmos.mint.v1beta1 + * @interface IQueryParamsResponse + * @property {cosmos.mint.v1beta1.IParams|null} [params] QueryParamsResponse params + */ + + /** + * Constructs a new QueryParamsResponse. + * @memberof cosmos.mint.v1beta1 + * @classdesc Represents a QueryParamsResponse. + * @implements IQueryParamsResponse + * @constructor + * @param {cosmos.mint.v1beta1.IQueryParamsResponse=} [properties] Properties to set + */ + function QueryParamsResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryParamsResponse params. + * @member {cosmos.mint.v1beta1.IParams|null|undefined} params + * @memberof cosmos.mint.v1beta1.QueryParamsResponse + * @instance + */ + QueryParamsResponse.prototype.params = null; + + /** + * Creates a new QueryParamsResponse instance using the specified properties. + * @function create + * @memberof cosmos.mint.v1beta1.QueryParamsResponse + * @static + * @param {cosmos.mint.v1beta1.IQueryParamsResponse=} [properties] Properties to set + * @returns {cosmos.mint.v1beta1.QueryParamsResponse} QueryParamsResponse instance + */ + QueryParamsResponse.create = function create(properties) { + return new QueryParamsResponse(properties); + }; + + /** + * Encodes the specified QueryParamsResponse message. Does not implicitly {@link cosmos.mint.v1beta1.QueryParamsResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.mint.v1beta1.QueryParamsResponse + * @static + * @param {cosmos.mint.v1beta1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.cosmos.mint.v1beta1.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link cosmos.mint.v1beta1.QueryParamsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.mint.v1beta1.QueryParamsResponse + * @static + * @param {cosmos.mint.v1beta1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryParamsResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.mint.v1beta1.QueryParamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.mint.v1beta1.QueryParamsResponse} QueryParamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.mint.v1beta1.QueryParamsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = $root.cosmos.mint.v1beta1.Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.mint.v1beta1.QueryParamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.mint.v1beta1.QueryParamsResponse} QueryParamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryParamsResponse message. + * @function verify + * @memberof cosmos.mint.v1beta1.QueryParamsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryParamsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.params != null && message.hasOwnProperty("params")) { + let error = $root.cosmos.mint.v1beta1.Params.verify(message.params); + if (error) + return "params." + error; + } + return null; + }; + + /** + * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.mint.v1beta1.QueryParamsResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.mint.v1beta1.QueryParamsResponse} QueryParamsResponse + */ + QueryParamsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.mint.v1beta1.QueryParamsResponse) + return object; + let message = new $root.cosmos.mint.v1beta1.QueryParamsResponse(); + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".cosmos.mint.v1beta1.QueryParamsResponse.params: object expected"); + message.params = $root.cosmos.mint.v1beta1.Params.fromObject(object.params); + } + return message; + }; + + /** + * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.mint.v1beta1.QueryParamsResponse + * @static + * @param {cosmos.mint.v1beta1.QueryParamsResponse} message QueryParamsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryParamsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.params = null; + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.cosmos.mint.v1beta1.Params.toObject(message.params, options); + return object; + }; + + /** + * Converts this QueryParamsResponse to JSON. + * @function toJSON + * @memberof cosmos.mint.v1beta1.QueryParamsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryParamsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryParamsResponse; + })(v1beta1.QueryParamsResponse || {}); + + v1beta1.QueryInflationRequest = (function(QueryInflationRequest) { + + /** + * Properties of a QueryInflationRequest. + * @memberof cosmos.mint.v1beta1 + * @interface IQueryInflationRequest + */ + + /** + * Constructs a new QueryInflationRequest. + * @memberof cosmos.mint.v1beta1 + * @classdesc Represents a QueryInflationRequest. + * @implements IQueryInflationRequest + * @constructor + * @param {cosmos.mint.v1beta1.IQueryInflationRequest=} [properties] Properties to set + */ + function QueryInflationRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new QueryInflationRequest instance using the specified properties. + * @function create + * @memberof cosmos.mint.v1beta1.QueryInflationRequest + * @static + * @param {cosmos.mint.v1beta1.IQueryInflationRequest=} [properties] Properties to set + * @returns {cosmos.mint.v1beta1.QueryInflationRequest} QueryInflationRequest instance + */ + QueryInflationRequest.create = function create(properties) { + return new QueryInflationRequest(properties); + }; + + /** + * Encodes the specified QueryInflationRequest message. Does not implicitly {@link cosmos.mint.v1beta1.QueryInflationRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.mint.v1beta1.QueryInflationRequest + * @static + * @param {cosmos.mint.v1beta1.IQueryInflationRequest} message QueryInflationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryInflationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified QueryInflationRequest message, length delimited. Does not implicitly {@link cosmos.mint.v1beta1.QueryInflationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.mint.v1beta1.QueryInflationRequest + * @static + * @param {cosmos.mint.v1beta1.IQueryInflationRequest} message QueryInflationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryInflationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryInflationRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.mint.v1beta1.QueryInflationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.mint.v1beta1.QueryInflationRequest} QueryInflationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryInflationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.mint.v1beta1.QueryInflationRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryInflationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.mint.v1beta1.QueryInflationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.mint.v1beta1.QueryInflationRequest} QueryInflationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryInflationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryInflationRequest message. + * @function verify + * @memberof cosmos.mint.v1beta1.QueryInflationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryInflationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a QueryInflationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.mint.v1beta1.QueryInflationRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.mint.v1beta1.QueryInflationRequest} QueryInflationRequest + */ + QueryInflationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.mint.v1beta1.QueryInflationRequest) + return object; + return new $root.cosmos.mint.v1beta1.QueryInflationRequest(); + }; + + /** + * Creates a plain object from a QueryInflationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.mint.v1beta1.QueryInflationRequest + * @static + * @param {cosmos.mint.v1beta1.QueryInflationRequest} message QueryInflationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryInflationRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this QueryInflationRequest to JSON. + * @function toJSON + * @memberof cosmos.mint.v1beta1.QueryInflationRequest + * @instance + * @returns {Object.} JSON object + */ + QueryInflationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryInflationRequest; + })(v1beta1.QueryInflationRequest || {}); + + v1beta1.QueryInflationResponse = (function(QueryInflationResponse) { + + /** + * Properties of a QueryInflationResponse. + * @memberof cosmos.mint.v1beta1 + * @interface IQueryInflationResponse + * @property {Uint8Array|null} [inflation] QueryInflationResponse inflation + */ + + /** + * Constructs a new QueryInflationResponse. + * @memberof cosmos.mint.v1beta1 + * @classdesc Represents a QueryInflationResponse. + * @implements IQueryInflationResponse + * @constructor + * @param {cosmos.mint.v1beta1.IQueryInflationResponse=} [properties] Properties to set + */ + function QueryInflationResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryInflationResponse inflation. + * @member {Uint8Array} inflation + * @memberof cosmos.mint.v1beta1.QueryInflationResponse + * @instance + */ + QueryInflationResponse.prototype.inflation = $util.newBuffer([]); + + /** + * Creates a new QueryInflationResponse instance using the specified properties. + * @function create + * @memberof cosmos.mint.v1beta1.QueryInflationResponse + * @static + * @param {cosmos.mint.v1beta1.IQueryInflationResponse=} [properties] Properties to set + * @returns {cosmos.mint.v1beta1.QueryInflationResponse} QueryInflationResponse instance + */ + QueryInflationResponse.create = function create(properties) { + return new QueryInflationResponse(properties); + }; + + /** + * Encodes the specified QueryInflationResponse message. Does not implicitly {@link cosmos.mint.v1beta1.QueryInflationResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.mint.v1beta1.QueryInflationResponse + * @static + * @param {cosmos.mint.v1beta1.IQueryInflationResponse} message QueryInflationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryInflationResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inflation != null && Object.hasOwnProperty.call(message, "inflation")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.inflation); + return writer; + }; + + /** + * Encodes the specified QueryInflationResponse message, length delimited. Does not implicitly {@link cosmos.mint.v1beta1.QueryInflationResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.mint.v1beta1.QueryInflationResponse + * @static + * @param {cosmos.mint.v1beta1.IQueryInflationResponse} message QueryInflationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryInflationResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryInflationResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.mint.v1beta1.QueryInflationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.mint.v1beta1.QueryInflationResponse} QueryInflationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryInflationResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.mint.v1beta1.QueryInflationResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inflation = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryInflationResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.mint.v1beta1.QueryInflationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.mint.v1beta1.QueryInflationResponse} QueryInflationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryInflationResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryInflationResponse message. + * @function verify + * @memberof cosmos.mint.v1beta1.QueryInflationResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryInflationResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inflation != null && message.hasOwnProperty("inflation")) + if (!(message.inflation && typeof message.inflation.length === "number" || $util.isString(message.inflation))) + return "inflation: buffer expected"; + return null; + }; + + /** + * Creates a QueryInflationResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.mint.v1beta1.QueryInflationResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.mint.v1beta1.QueryInflationResponse} QueryInflationResponse + */ + QueryInflationResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.mint.v1beta1.QueryInflationResponse) + return object; + let message = new $root.cosmos.mint.v1beta1.QueryInflationResponse(); + if (object.inflation != null) + if (typeof object.inflation === "string") + $util.base64.decode(object.inflation, message.inflation = $util.newBuffer($util.base64.length(object.inflation)), 0); + else if (object.inflation.length) + message.inflation = object.inflation; + return message; + }; + + /** + * Creates a plain object from a QueryInflationResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.mint.v1beta1.QueryInflationResponse + * @static + * @param {cosmos.mint.v1beta1.QueryInflationResponse} message QueryInflationResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryInflationResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + if (options.bytes === String) + object.inflation = ""; + else { + object.inflation = []; + if (options.bytes !== Array) + object.inflation = $util.newBuffer(object.inflation); + } + if (message.inflation != null && message.hasOwnProperty("inflation")) + object.inflation = options.bytes === String ? $util.base64.encode(message.inflation, 0, message.inflation.length) : options.bytes === Array ? Array.prototype.slice.call(message.inflation) : message.inflation; + return object; + }; + + /** + * Converts this QueryInflationResponse to JSON. + * @function toJSON + * @memberof cosmos.mint.v1beta1.QueryInflationResponse + * @instance + * @returns {Object.} JSON object + */ + QueryInflationResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryInflationResponse; + })(v1beta1.QueryInflationResponse || {}); + + v1beta1.QueryAnnualProvisionsRequest = (function(QueryAnnualProvisionsRequest) { + + /** + * Properties of a QueryAnnualProvisionsRequest. + * @memberof cosmos.mint.v1beta1 + * @interface IQueryAnnualProvisionsRequest + */ + + /** + * Constructs a new QueryAnnualProvisionsRequest. + * @memberof cosmos.mint.v1beta1 + * @classdesc Represents a QueryAnnualProvisionsRequest. + * @implements IQueryAnnualProvisionsRequest + * @constructor + * @param {cosmos.mint.v1beta1.IQueryAnnualProvisionsRequest=} [properties] Properties to set + */ + function QueryAnnualProvisionsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new QueryAnnualProvisionsRequest instance using the specified properties. + * @function create + * @memberof cosmos.mint.v1beta1.QueryAnnualProvisionsRequest + * @static + * @param {cosmos.mint.v1beta1.IQueryAnnualProvisionsRequest=} [properties] Properties to set + * @returns {cosmos.mint.v1beta1.QueryAnnualProvisionsRequest} QueryAnnualProvisionsRequest instance + */ + QueryAnnualProvisionsRequest.create = function create(properties) { + return new QueryAnnualProvisionsRequest(properties); + }; + + /** + * Encodes the specified QueryAnnualProvisionsRequest message. Does not implicitly {@link cosmos.mint.v1beta1.QueryAnnualProvisionsRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.mint.v1beta1.QueryAnnualProvisionsRequest + * @static + * @param {cosmos.mint.v1beta1.IQueryAnnualProvisionsRequest} message QueryAnnualProvisionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAnnualProvisionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified QueryAnnualProvisionsRequest message, length delimited. Does not implicitly {@link cosmos.mint.v1beta1.QueryAnnualProvisionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.mint.v1beta1.QueryAnnualProvisionsRequest + * @static + * @param {cosmos.mint.v1beta1.IQueryAnnualProvisionsRequest} message QueryAnnualProvisionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAnnualProvisionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryAnnualProvisionsRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.mint.v1beta1.QueryAnnualProvisionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.mint.v1beta1.QueryAnnualProvisionsRequest} QueryAnnualProvisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAnnualProvisionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.mint.v1beta1.QueryAnnualProvisionsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryAnnualProvisionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.mint.v1beta1.QueryAnnualProvisionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.mint.v1beta1.QueryAnnualProvisionsRequest} QueryAnnualProvisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAnnualProvisionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryAnnualProvisionsRequest message. + * @function verify + * @memberof cosmos.mint.v1beta1.QueryAnnualProvisionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryAnnualProvisionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a QueryAnnualProvisionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.mint.v1beta1.QueryAnnualProvisionsRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.mint.v1beta1.QueryAnnualProvisionsRequest} QueryAnnualProvisionsRequest + */ + QueryAnnualProvisionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.mint.v1beta1.QueryAnnualProvisionsRequest) + return object; + return new $root.cosmos.mint.v1beta1.QueryAnnualProvisionsRequest(); + }; + + /** + * Creates a plain object from a QueryAnnualProvisionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.mint.v1beta1.QueryAnnualProvisionsRequest + * @static + * @param {cosmos.mint.v1beta1.QueryAnnualProvisionsRequest} message QueryAnnualProvisionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryAnnualProvisionsRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this QueryAnnualProvisionsRequest to JSON. + * @function toJSON + * @memberof cosmos.mint.v1beta1.QueryAnnualProvisionsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryAnnualProvisionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryAnnualProvisionsRequest; + })(v1beta1.QueryAnnualProvisionsRequest || {}); + + v1beta1.QueryAnnualProvisionsResponse = (function(QueryAnnualProvisionsResponse) { + + /** + * Properties of a QueryAnnualProvisionsResponse. + * @memberof cosmos.mint.v1beta1 + * @interface IQueryAnnualProvisionsResponse + * @property {Uint8Array|null} [annualProvisions] QueryAnnualProvisionsResponse annualProvisions + */ + + /** + * Constructs a new QueryAnnualProvisionsResponse. + * @memberof cosmos.mint.v1beta1 + * @classdesc Represents a QueryAnnualProvisionsResponse. + * @implements IQueryAnnualProvisionsResponse + * @constructor + * @param {cosmos.mint.v1beta1.IQueryAnnualProvisionsResponse=} [properties] Properties to set + */ + function QueryAnnualProvisionsResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryAnnualProvisionsResponse annualProvisions. + * @member {Uint8Array} annualProvisions + * @memberof cosmos.mint.v1beta1.QueryAnnualProvisionsResponse + * @instance + */ + QueryAnnualProvisionsResponse.prototype.annualProvisions = $util.newBuffer([]); + + /** + * Creates a new QueryAnnualProvisionsResponse instance using the specified properties. + * @function create + * @memberof cosmos.mint.v1beta1.QueryAnnualProvisionsResponse + * @static + * @param {cosmos.mint.v1beta1.IQueryAnnualProvisionsResponse=} [properties] Properties to set + * @returns {cosmos.mint.v1beta1.QueryAnnualProvisionsResponse} QueryAnnualProvisionsResponse instance + */ + QueryAnnualProvisionsResponse.create = function create(properties) { + return new QueryAnnualProvisionsResponse(properties); + }; + + /** + * Encodes the specified QueryAnnualProvisionsResponse message. Does not implicitly {@link cosmos.mint.v1beta1.QueryAnnualProvisionsResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.mint.v1beta1.QueryAnnualProvisionsResponse + * @static + * @param {cosmos.mint.v1beta1.IQueryAnnualProvisionsResponse} message QueryAnnualProvisionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAnnualProvisionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annualProvisions != null && Object.hasOwnProperty.call(message, "annualProvisions")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.annualProvisions); + return writer; + }; + + /** + * Encodes the specified QueryAnnualProvisionsResponse message, length delimited. Does not implicitly {@link cosmos.mint.v1beta1.QueryAnnualProvisionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.mint.v1beta1.QueryAnnualProvisionsResponse + * @static + * @param {cosmos.mint.v1beta1.IQueryAnnualProvisionsResponse} message QueryAnnualProvisionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAnnualProvisionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryAnnualProvisionsResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.mint.v1beta1.QueryAnnualProvisionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.mint.v1beta1.QueryAnnualProvisionsResponse} QueryAnnualProvisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAnnualProvisionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.mint.v1beta1.QueryAnnualProvisionsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.annualProvisions = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryAnnualProvisionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.mint.v1beta1.QueryAnnualProvisionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.mint.v1beta1.QueryAnnualProvisionsResponse} QueryAnnualProvisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAnnualProvisionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryAnnualProvisionsResponse message. + * @function verify + * @memberof cosmos.mint.v1beta1.QueryAnnualProvisionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryAnnualProvisionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annualProvisions != null && message.hasOwnProperty("annualProvisions")) + if (!(message.annualProvisions && typeof message.annualProvisions.length === "number" || $util.isString(message.annualProvisions))) + return "annualProvisions: buffer expected"; + return null; + }; + + /** + * Creates a QueryAnnualProvisionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.mint.v1beta1.QueryAnnualProvisionsResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.mint.v1beta1.QueryAnnualProvisionsResponse} QueryAnnualProvisionsResponse + */ + QueryAnnualProvisionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.mint.v1beta1.QueryAnnualProvisionsResponse) + return object; + let message = new $root.cosmos.mint.v1beta1.QueryAnnualProvisionsResponse(); + if (object.annualProvisions != null) + if (typeof object.annualProvisions === "string") + $util.base64.decode(object.annualProvisions, message.annualProvisions = $util.newBuffer($util.base64.length(object.annualProvisions)), 0); + else if (object.annualProvisions.length) + message.annualProvisions = object.annualProvisions; + return message; + }; + + /** + * Creates a plain object from a QueryAnnualProvisionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.mint.v1beta1.QueryAnnualProvisionsResponse + * @static + * @param {cosmos.mint.v1beta1.QueryAnnualProvisionsResponse} message QueryAnnualProvisionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryAnnualProvisionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + if (options.bytes === String) + object.annualProvisions = ""; + else { + object.annualProvisions = []; + if (options.bytes !== Array) + object.annualProvisions = $util.newBuffer(object.annualProvisions); + } + if (message.annualProvisions != null && message.hasOwnProperty("annualProvisions")) + object.annualProvisions = options.bytes === String ? $util.base64.encode(message.annualProvisions, 0, message.annualProvisions.length) : options.bytes === Array ? Array.prototype.slice.call(message.annualProvisions) : message.annualProvisions; + return object; + }; + + /** + * Converts this QueryAnnualProvisionsResponse to JSON. + * @function toJSON + * @memberof cosmos.mint.v1beta1.QueryAnnualProvisionsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryAnnualProvisionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryAnnualProvisionsResponse; + })(v1beta1.QueryAnnualProvisionsResponse || {}); + + return v1beta1; + })(mint.v1beta1 || {}); + + return mint; + })(cosmos.mint || {}); + + /** + * Namespace params. + * @memberof cosmos + * @namespace + */ + + cosmos.params = (function(params) { + + /** + * Namespace v1beta1. + * @memberof cosmos.params + * @namespace + */ + + params.v1beta1 = (function(v1beta1) { + + v1beta1.ParameterChangeProposal = (function(ParameterChangeProposal) { + + /** + * Properties of a ParameterChangeProposal. + * @memberof cosmos.params.v1beta1 + * @interface IParameterChangeProposal + * @property {string|null} [title] ParameterChangeProposal title + * @property {string|null} [description] ParameterChangeProposal description + * @property {Array.|null} [changes] ParameterChangeProposal changes + */ + + /** + * Constructs a new ParameterChangeProposal. + * @memberof cosmos.params.v1beta1 + * @classdesc Represents a ParameterChangeProposal. + * @implements IParameterChangeProposal + * @constructor + * @param {cosmos.params.v1beta1.IParameterChangeProposal=} [properties] Properties to set + */ + function ParameterChangeProposal(properties) { + this.changes = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ParameterChangeProposal title. + * @member {string} title + * @memberof cosmos.params.v1beta1.ParameterChangeProposal + * @instance + */ + ParameterChangeProposal.prototype.title = ""; + + /** + * ParameterChangeProposal description. + * @member {string} description + * @memberof cosmos.params.v1beta1.ParameterChangeProposal + * @instance + */ + ParameterChangeProposal.prototype.description = ""; + + /** + * ParameterChangeProposal changes. + * @member {Array.} changes + * @memberof cosmos.params.v1beta1.ParameterChangeProposal + * @instance + */ + ParameterChangeProposal.prototype.changes = $util.emptyArray; + + /** + * Creates a new ParameterChangeProposal instance using the specified properties. + * @function create + * @memberof cosmos.params.v1beta1.ParameterChangeProposal + * @static + * @param {cosmos.params.v1beta1.IParameterChangeProposal=} [properties] Properties to set + * @returns {cosmos.params.v1beta1.ParameterChangeProposal} ParameterChangeProposal instance + */ + ParameterChangeProposal.create = function create(properties) { + return new ParameterChangeProposal(properties); + }; + + /** + * Encodes the specified ParameterChangeProposal message. Does not implicitly {@link cosmos.params.v1beta1.ParameterChangeProposal.verify|verify} messages. + * @function encode + * @memberof cosmos.params.v1beta1.ParameterChangeProposal + * @static + * @param {cosmos.params.v1beta1.IParameterChangeProposal} message ParameterChangeProposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ParameterChangeProposal.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.changes != null && message.changes.length) + for (let i = 0; i < message.changes.length; ++i) + $root.cosmos.params.v1beta1.ParamChange.encode(message.changes[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ParameterChangeProposal message, length delimited. Does not implicitly {@link cosmos.params.v1beta1.ParameterChangeProposal.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.params.v1beta1.ParameterChangeProposal + * @static + * @param {cosmos.params.v1beta1.IParameterChangeProposal} message ParameterChangeProposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ParameterChangeProposal.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ParameterChangeProposal message from the specified reader or buffer. + * @function decode + * @memberof cosmos.params.v1beta1.ParameterChangeProposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.params.v1beta1.ParameterChangeProposal} ParameterChangeProposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ParameterChangeProposal.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.params.v1beta1.ParameterChangeProposal(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if (!(message.changes && message.changes.length)) + message.changes = []; + message.changes.push($root.cosmos.params.v1beta1.ParamChange.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ParameterChangeProposal message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.params.v1beta1.ParameterChangeProposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.params.v1beta1.ParameterChangeProposal} ParameterChangeProposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ParameterChangeProposal.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ParameterChangeProposal message. + * @function verify + * @memberof cosmos.params.v1beta1.ParameterChangeProposal + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ParameterChangeProposal.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.changes != null && message.hasOwnProperty("changes")) { + if (!Array.isArray(message.changes)) + return "changes: array expected"; + for (let i = 0; i < message.changes.length; ++i) { + let error = $root.cosmos.params.v1beta1.ParamChange.verify(message.changes[i]); + if (error) + return "changes." + error; + } + } + return null; + }; + + /** + * Creates a ParameterChangeProposal message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.params.v1beta1.ParameterChangeProposal + * @static + * @param {Object.} object Plain object + * @returns {cosmos.params.v1beta1.ParameterChangeProposal} ParameterChangeProposal + */ + ParameterChangeProposal.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.params.v1beta1.ParameterChangeProposal) + return object; + let message = new $root.cosmos.params.v1beta1.ParameterChangeProposal(); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.changes) { + if (!Array.isArray(object.changes)) + throw TypeError(".cosmos.params.v1beta1.ParameterChangeProposal.changes: array expected"); + message.changes = []; + for (let i = 0; i < object.changes.length; ++i) { + if (typeof object.changes[i] !== "object") + throw TypeError(".cosmos.params.v1beta1.ParameterChangeProposal.changes: object expected"); + message.changes[i] = $root.cosmos.params.v1beta1.ParamChange.fromObject(object.changes[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ParameterChangeProposal message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.params.v1beta1.ParameterChangeProposal + * @static + * @param {cosmos.params.v1beta1.ParameterChangeProposal} message ParameterChangeProposal + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ParameterChangeProposal.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.changes = []; + if (options.defaults) { + object.title = ""; + object.description = ""; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.changes && message.changes.length) { + object.changes = []; + for (let j = 0; j < message.changes.length; ++j) + object.changes[j] = $root.cosmos.params.v1beta1.ParamChange.toObject(message.changes[j], options); + } + return object; + }; + + /** + * Converts this ParameterChangeProposal to JSON. + * @function toJSON + * @memberof cosmos.params.v1beta1.ParameterChangeProposal + * @instance + * @returns {Object.} JSON object + */ + ParameterChangeProposal.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ParameterChangeProposal; + })(v1beta1.ParameterChangeProposal || {}); + + v1beta1.ParamChange = (function(ParamChange) { + + /** + * Properties of a ParamChange. + * @memberof cosmos.params.v1beta1 + * @interface IParamChange + * @property {string|null} [subspace] ParamChange subspace + * @property {string|null} [key] ParamChange key + * @property {string|null} [value] ParamChange value + */ + + /** + * Constructs a new ParamChange. + * @memberof cosmos.params.v1beta1 + * @classdesc Represents a ParamChange. + * @implements IParamChange + * @constructor + * @param {cosmos.params.v1beta1.IParamChange=} [properties] Properties to set + */ + function ParamChange(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ParamChange subspace. + * @member {string} subspace + * @memberof cosmos.params.v1beta1.ParamChange + * @instance + */ + ParamChange.prototype.subspace = ""; + + /** + * ParamChange key. + * @member {string} key + * @memberof cosmos.params.v1beta1.ParamChange + * @instance + */ + ParamChange.prototype.key = ""; + + /** + * ParamChange value. + * @member {string} value + * @memberof cosmos.params.v1beta1.ParamChange + * @instance + */ + ParamChange.prototype.value = ""; + + /** + * Creates a new ParamChange instance using the specified properties. + * @function create + * @memberof cosmos.params.v1beta1.ParamChange + * @static + * @param {cosmos.params.v1beta1.IParamChange=} [properties] Properties to set + * @returns {cosmos.params.v1beta1.ParamChange} ParamChange instance + */ + ParamChange.create = function create(properties) { + return new ParamChange(properties); + }; + + /** + * Encodes the specified ParamChange message. Does not implicitly {@link cosmos.params.v1beta1.ParamChange.verify|verify} messages. + * @function encode + * @memberof cosmos.params.v1beta1.ParamChange + * @static + * @param {cosmos.params.v1beta1.IParamChange} message ParamChange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ParamChange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subspace != null && Object.hasOwnProperty.call(message, "subspace")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subspace); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.value); + return writer; + }; + + /** + * Encodes the specified ParamChange message, length delimited. Does not implicitly {@link cosmos.params.v1beta1.ParamChange.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.params.v1beta1.ParamChange + * @static + * @param {cosmos.params.v1beta1.IParamChange} message ParamChange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ParamChange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ParamChange message from the specified reader or buffer. + * @function decode + * @memberof cosmos.params.v1beta1.ParamChange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.params.v1beta1.ParamChange} ParamChange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ParamChange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.params.v1beta1.ParamChange(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subspace = reader.string(); + break; + case 2: + message.key = reader.string(); + break; + case 3: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ParamChange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.params.v1beta1.ParamChange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.params.v1beta1.ParamChange} ParamChange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ParamChange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ParamChange message. + * @function verify + * @memberof cosmos.params.v1beta1.ParamChange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ParamChange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subspace != null && message.hasOwnProperty("subspace")) + if (!$util.isString(message.subspace)) + return "subspace: string expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a ParamChange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.params.v1beta1.ParamChange + * @static + * @param {Object.} object Plain object + * @returns {cosmos.params.v1beta1.ParamChange} ParamChange + */ + ParamChange.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.params.v1beta1.ParamChange) + return object; + let message = new $root.cosmos.params.v1beta1.ParamChange(); + if (object.subspace != null) + message.subspace = String(object.subspace); + if (object.key != null) + message.key = String(object.key); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a ParamChange message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.params.v1beta1.ParamChange + * @static + * @param {cosmos.params.v1beta1.ParamChange} message ParamChange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ParamChange.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.subspace = ""; + object.key = ""; + object.value = ""; + } + if (message.subspace != null && message.hasOwnProperty("subspace")) + object.subspace = message.subspace; + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this ParamChange to JSON. + * @function toJSON + * @memberof cosmos.params.v1beta1.ParamChange + * @instance + * @returns {Object.} JSON object + */ + ParamChange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ParamChange; + })(v1beta1.ParamChange || {}); + + v1beta1.Query = (function(Query) { + + /** + * Constructs a new Query service. + * @memberof cosmos.params.v1beta1 + * @classdesc Represents a Query + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Query(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; + + /** + * Creates new Query service using the specified rpc implementation. + * @function create + * @memberof cosmos.params.v1beta1.Query + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Query} RPC service. Useful where requests and/or responses are streamed. + */ + Query.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.params.v1beta1.Query#params}. + * @memberof cosmos.params.v1beta1.Query + * @typedef ParamsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.params.v1beta1.IQueryParamsResponse} [response] QueryParamsResponse + */ + + /** + * Calls Params. + * @function params + * @memberof cosmos.params.v1beta1.Query + * @instance + * @param {cosmos.params.v1beta1.IQueryParamsRequest} request QueryParamsRequest message or plain object + * @param {cosmos.params.v1beta1.Query.ParamsCallback} callback Node-style callback called with the error, if any, and QueryParamsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.params = function params(request, callback) { + return this.rpcCall(params, $root.cosmos.params.v1beta1.QueryParamsRequest, $root.cosmos.params.v1beta1.QueryParamsResponse, request, callback); + }, "name", { value: "Params" }); + + /** + * Calls Params. + * @function params + * @memberof cosmos.params.v1beta1.Query + * @instance + * @param {cosmos.params.v1beta1.IQueryParamsRequest} request QueryParamsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Query; + })(v1beta1.Query || {}); + + v1beta1.QueryParamsRequest = (function(QueryParamsRequest) { + + /** + * Properties of a QueryParamsRequest. + * @memberof cosmos.params.v1beta1 + * @interface IQueryParamsRequest + * @property {string|null} [subspace] QueryParamsRequest subspace + * @property {string|null} [key] QueryParamsRequest key + */ + + /** + * Constructs a new QueryParamsRequest. + * @memberof cosmos.params.v1beta1 + * @classdesc Represents a QueryParamsRequest. + * @implements IQueryParamsRequest + * @constructor + * @param {cosmos.params.v1beta1.IQueryParamsRequest=} [properties] Properties to set + */ + function QueryParamsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryParamsRequest subspace. + * @member {string} subspace + * @memberof cosmos.params.v1beta1.QueryParamsRequest + * @instance + */ + QueryParamsRequest.prototype.subspace = ""; + + /** + * QueryParamsRequest key. + * @member {string} key + * @memberof cosmos.params.v1beta1.QueryParamsRequest + * @instance + */ + QueryParamsRequest.prototype.key = ""; + + /** + * Creates a new QueryParamsRequest instance using the specified properties. + * @function create + * @memberof cosmos.params.v1beta1.QueryParamsRequest + * @static + * @param {cosmos.params.v1beta1.IQueryParamsRequest=} [properties] Properties to set + * @returns {cosmos.params.v1beta1.QueryParamsRequest} QueryParamsRequest instance + */ + QueryParamsRequest.create = function create(properties) { + return new QueryParamsRequest(properties); + }; + + /** + * Encodes the specified QueryParamsRequest message. Does not implicitly {@link cosmos.params.v1beta1.QueryParamsRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.params.v1beta1.QueryParamsRequest + * @static + * @param {cosmos.params.v1beta1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subspace != null && Object.hasOwnProperty.call(message, "subspace")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subspace); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.key); + return writer; + }; + + /** + * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link cosmos.params.v1beta1.QueryParamsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.params.v1beta1.QueryParamsRequest + * @static + * @param {cosmos.params.v1beta1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryParamsRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.params.v1beta1.QueryParamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.params.v1beta1.QueryParamsRequest} QueryParamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.params.v1beta1.QueryParamsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subspace = reader.string(); + break; + case 2: + message.key = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.params.v1beta1.QueryParamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.params.v1beta1.QueryParamsRequest} QueryParamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryParamsRequest message. + * @function verify + * @memberof cosmos.params.v1beta1.QueryParamsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryParamsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subspace != null && message.hasOwnProperty("subspace")) + if (!$util.isString(message.subspace)) + return "subspace: string expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + return null; + }; + + /** + * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.params.v1beta1.QueryParamsRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.params.v1beta1.QueryParamsRequest} QueryParamsRequest + */ + QueryParamsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.params.v1beta1.QueryParamsRequest) + return object; + let message = new $root.cosmos.params.v1beta1.QueryParamsRequest(); + if (object.subspace != null) + message.subspace = String(object.subspace); + if (object.key != null) + message.key = String(object.key); + return message; + }; + + /** + * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.params.v1beta1.QueryParamsRequest + * @static + * @param {cosmos.params.v1beta1.QueryParamsRequest} message QueryParamsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryParamsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.subspace = ""; + object.key = ""; + } + if (message.subspace != null && message.hasOwnProperty("subspace")) + object.subspace = message.subspace; + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + return object; + }; + + /** + * Converts this QueryParamsRequest to JSON. + * @function toJSON + * @memberof cosmos.params.v1beta1.QueryParamsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryParamsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryParamsRequest; + })(v1beta1.QueryParamsRequest || {}); + + v1beta1.QueryParamsResponse = (function(QueryParamsResponse) { + + /** + * Properties of a QueryParamsResponse. + * @memberof cosmos.params.v1beta1 + * @interface IQueryParamsResponse + * @property {cosmos.params.v1beta1.IParamChange|null} [param] QueryParamsResponse param + */ + + /** + * Constructs a new QueryParamsResponse. + * @memberof cosmos.params.v1beta1 + * @classdesc Represents a QueryParamsResponse. + * @implements IQueryParamsResponse + * @constructor + * @param {cosmos.params.v1beta1.IQueryParamsResponse=} [properties] Properties to set + */ + function QueryParamsResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryParamsResponse param. + * @member {cosmos.params.v1beta1.IParamChange|null|undefined} param + * @memberof cosmos.params.v1beta1.QueryParamsResponse + * @instance + */ + QueryParamsResponse.prototype.param = null; + + /** + * Creates a new QueryParamsResponse instance using the specified properties. + * @function create + * @memberof cosmos.params.v1beta1.QueryParamsResponse + * @static + * @param {cosmos.params.v1beta1.IQueryParamsResponse=} [properties] Properties to set + * @returns {cosmos.params.v1beta1.QueryParamsResponse} QueryParamsResponse instance + */ + QueryParamsResponse.create = function create(properties) { + return new QueryParamsResponse(properties); + }; + + /** + * Encodes the specified QueryParamsResponse message. Does not implicitly {@link cosmos.params.v1beta1.QueryParamsResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.params.v1beta1.QueryParamsResponse + * @static + * @param {cosmos.params.v1beta1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.param != null && Object.hasOwnProperty.call(message, "param")) + $root.cosmos.params.v1beta1.ParamChange.encode(message.param, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link cosmos.params.v1beta1.QueryParamsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.params.v1beta1.QueryParamsResponse + * @static + * @param {cosmos.params.v1beta1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryParamsResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.params.v1beta1.QueryParamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.params.v1beta1.QueryParamsResponse} QueryParamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.params.v1beta1.QueryParamsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.param = $root.cosmos.params.v1beta1.ParamChange.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.params.v1beta1.QueryParamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.params.v1beta1.QueryParamsResponse} QueryParamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryParamsResponse message. + * @function verify + * @memberof cosmos.params.v1beta1.QueryParamsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryParamsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.param != null && message.hasOwnProperty("param")) { + let error = $root.cosmos.params.v1beta1.ParamChange.verify(message.param); + if (error) + return "param." + error; + } + return null; + }; + + /** + * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.params.v1beta1.QueryParamsResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.params.v1beta1.QueryParamsResponse} QueryParamsResponse + */ + QueryParamsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.params.v1beta1.QueryParamsResponse) + return object; + let message = new $root.cosmos.params.v1beta1.QueryParamsResponse(); + if (object.param != null) { + if (typeof object.param !== "object") + throw TypeError(".cosmos.params.v1beta1.QueryParamsResponse.param: object expected"); + message.param = $root.cosmos.params.v1beta1.ParamChange.fromObject(object.param); + } + return message; + }; + + /** + * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.params.v1beta1.QueryParamsResponse + * @static + * @param {cosmos.params.v1beta1.QueryParamsResponse} message QueryParamsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryParamsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.param = null; + if (message.param != null && message.hasOwnProperty("param")) + object.param = $root.cosmos.params.v1beta1.ParamChange.toObject(message.param, options); + return object; + }; + + /** + * Converts this QueryParamsResponse to JSON. + * @function toJSON + * @memberof cosmos.params.v1beta1.QueryParamsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryParamsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryParamsResponse; + })(v1beta1.QueryParamsResponse || {}); + + return v1beta1; + })(params.v1beta1 || {}); + + return params; + })(cosmos.params || {}); + + /** + * Namespace slashing. + * @memberof cosmos + * @namespace + */ + + cosmos.slashing = (function(slashing) { + + /** + * Namespace v1beta1. + * @memberof cosmos.slashing + * @namespace + */ + + slashing.v1beta1 = (function(v1beta1) { + + v1beta1.GenesisState = (function(GenesisState) { + + /** + * Properties of a GenesisState. + * @memberof cosmos.slashing.v1beta1 + * @interface IGenesisState + * @property {cosmos.slashing.v1beta1.IParams|null} [params] GenesisState params + * @property {Array.|null} [signingInfos] GenesisState signingInfos + * @property {Array.|null} [missedBlocks] GenesisState missedBlocks + */ + + /** + * Constructs a new GenesisState. + * @memberof cosmos.slashing.v1beta1 + * @classdesc Represents a GenesisState. + * @implements IGenesisState + * @constructor + * @param {cosmos.slashing.v1beta1.IGenesisState=} [properties] Properties to set + */ + function GenesisState(properties) { + this.signingInfos = []; + this.missedBlocks = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenesisState params. + * @member {cosmos.slashing.v1beta1.IParams|null|undefined} params + * @memberof cosmos.slashing.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.params = null; + + /** + * GenesisState signingInfos. + * @member {Array.} signingInfos + * @memberof cosmos.slashing.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.signingInfos = $util.emptyArray; + + /** + * GenesisState missedBlocks. + * @member {Array.} missedBlocks + * @memberof cosmos.slashing.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.missedBlocks = $util.emptyArray; + + /** + * Creates a new GenesisState instance using the specified properties. + * @function create + * @memberof cosmos.slashing.v1beta1.GenesisState + * @static + * @param {cosmos.slashing.v1beta1.IGenesisState=} [properties] Properties to set + * @returns {cosmos.slashing.v1beta1.GenesisState} GenesisState instance + */ + GenesisState.create = function create(properties) { + return new GenesisState(properties); + }; + + /** + * Encodes the specified GenesisState message. Does not implicitly {@link cosmos.slashing.v1beta1.GenesisState.verify|verify} messages. + * @function encode + * @memberof cosmos.slashing.v1beta1.GenesisState + * @static + * @param {cosmos.slashing.v1beta1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.cosmos.slashing.v1beta1.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.signingInfos != null && message.signingInfos.length) + for (let i = 0; i < message.signingInfos.length; ++i) + $root.cosmos.slashing.v1beta1.SigningInfo.encode(message.signingInfos[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.missedBlocks != null && message.missedBlocks.length) + for (let i = 0; i < message.missedBlocks.length; ++i) + $root.cosmos.slashing.v1beta1.ValidatorMissedBlocks.encode(message.missedBlocks[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link cosmos.slashing.v1beta1.GenesisState.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.slashing.v1beta1.GenesisState + * @static + * @param {cosmos.slashing.v1beta1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer. + * @function decode + * @memberof cosmos.slashing.v1beta1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.slashing.v1beta1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.slashing.v1beta1.GenesisState(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = $root.cosmos.slashing.v1beta1.Params.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.signingInfos && message.signingInfos.length)) + message.signingInfos = []; + message.signingInfos.push($root.cosmos.slashing.v1beta1.SigningInfo.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.missedBlocks && message.missedBlocks.length)) + message.missedBlocks = []; + message.missedBlocks.push($root.cosmos.slashing.v1beta1.ValidatorMissedBlocks.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.slashing.v1beta1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.slashing.v1beta1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenesisState message. + * @function verify + * @memberof cosmos.slashing.v1beta1.GenesisState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenesisState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.params != null && message.hasOwnProperty("params")) { + let error = $root.cosmos.slashing.v1beta1.Params.verify(message.params); + if (error) + return "params." + error; + } + if (message.signingInfos != null && message.hasOwnProperty("signingInfos")) { + if (!Array.isArray(message.signingInfos)) + return "signingInfos: array expected"; + for (let i = 0; i < message.signingInfos.length; ++i) { + let error = $root.cosmos.slashing.v1beta1.SigningInfo.verify(message.signingInfos[i]); + if (error) + return "signingInfos." + error; + } + } + if (message.missedBlocks != null && message.hasOwnProperty("missedBlocks")) { + if (!Array.isArray(message.missedBlocks)) + return "missedBlocks: array expected"; + for (let i = 0; i < message.missedBlocks.length; ++i) { + let error = $root.cosmos.slashing.v1beta1.ValidatorMissedBlocks.verify(message.missedBlocks[i]); + if (error) + return "missedBlocks." + error; + } + } + return null; + }; + + /** + * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.slashing.v1beta1.GenesisState + * @static + * @param {Object.} object Plain object + * @returns {cosmos.slashing.v1beta1.GenesisState} GenesisState + */ + GenesisState.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.slashing.v1beta1.GenesisState) + return object; + let message = new $root.cosmos.slashing.v1beta1.GenesisState(); + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".cosmos.slashing.v1beta1.GenesisState.params: object expected"); + message.params = $root.cosmos.slashing.v1beta1.Params.fromObject(object.params); + } + if (object.signingInfos) { + if (!Array.isArray(object.signingInfos)) + throw TypeError(".cosmos.slashing.v1beta1.GenesisState.signingInfos: array expected"); + message.signingInfos = []; + for (let i = 0; i < object.signingInfos.length; ++i) { + if (typeof object.signingInfos[i] !== "object") + throw TypeError(".cosmos.slashing.v1beta1.GenesisState.signingInfos: object expected"); + message.signingInfos[i] = $root.cosmos.slashing.v1beta1.SigningInfo.fromObject(object.signingInfos[i]); + } + } + if (object.missedBlocks) { + if (!Array.isArray(object.missedBlocks)) + throw TypeError(".cosmos.slashing.v1beta1.GenesisState.missedBlocks: array expected"); + message.missedBlocks = []; + for (let i = 0; i < object.missedBlocks.length; ++i) { + if (typeof object.missedBlocks[i] !== "object") + throw TypeError(".cosmos.slashing.v1beta1.GenesisState.missedBlocks: object expected"); + message.missedBlocks[i] = $root.cosmos.slashing.v1beta1.ValidatorMissedBlocks.fromObject(object.missedBlocks[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GenesisState message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.slashing.v1beta1.GenesisState + * @static + * @param {cosmos.slashing.v1beta1.GenesisState} message GenesisState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenesisState.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) { + object.signingInfos = []; + object.missedBlocks = []; + } + if (options.defaults) + object.params = null; + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.cosmos.slashing.v1beta1.Params.toObject(message.params, options); + if (message.signingInfos && message.signingInfos.length) { + object.signingInfos = []; + for (let j = 0; j < message.signingInfos.length; ++j) + object.signingInfos[j] = $root.cosmos.slashing.v1beta1.SigningInfo.toObject(message.signingInfos[j], options); + } + if (message.missedBlocks && message.missedBlocks.length) { + object.missedBlocks = []; + for (let j = 0; j < message.missedBlocks.length; ++j) + object.missedBlocks[j] = $root.cosmos.slashing.v1beta1.ValidatorMissedBlocks.toObject(message.missedBlocks[j], options); + } + return object; + }; + + /** + * Converts this GenesisState to JSON. + * @function toJSON + * @memberof cosmos.slashing.v1beta1.GenesisState + * @instance + * @returns {Object.} JSON object + */ + GenesisState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GenesisState; + })(v1beta1.GenesisState || {}); + + v1beta1.SigningInfo = (function(SigningInfo) { + + /** + * Properties of a SigningInfo. + * @memberof cosmos.slashing.v1beta1 + * @interface ISigningInfo + * @property {string|null} [address] SigningInfo address + * @property {cosmos.slashing.v1beta1.IValidatorSigningInfo|null} [validatorSigningInfo] SigningInfo validatorSigningInfo + */ + + /** + * Constructs a new SigningInfo. + * @memberof cosmos.slashing.v1beta1 + * @classdesc Represents a SigningInfo. + * @implements ISigningInfo + * @constructor + * @param {cosmos.slashing.v1beta1.ISigningInfo=} [properties] Properties to set + */ + function SigningInfo(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SigningInfo address. + * @member {string} address + * @memberof cosmos.slashing.v1beta1.SigningInfo + * @instance + */ + SigningInfo.prototype.address = ""; + + /** + * SigningInfo validatorSigningInfo. + * @member {cosmos.slashing.v1beta1.IValidatorSigningInfo|null|undefined} validatorSigningInfo + * @memberof cosmos.slashing.v1beta1.SigningInfo + * @instance + */ + SigningInfo.prototype.validatorSigningInfo = null; + + /** + * Creates a new SigningInfo instance using the specified properties. + * @function create + * @memberof cosmos.slashing.v1beta1.SigningInfo + * @static + * @param {cosmos.slashing.v1beta1.ISigningInfo=} [properties] Properties to set + * @returns {cosmos.slashing.v1beta1.SigningInfo} SigningInfo instance + */ + SigningInfo.create = function create(properties) { + return new SigningInfo(properties); + }; + + /** + * Encodes the specified SigningInfo message. Does not implicitly {@link cosmos.slashing.v1beta1.SigningInfo.verify|verify} messages. + * @function encode + * @memberof cosmos.slashing.v1beta1.SigningInfo + * @static + * @param {cosmos.slashing.v1beta1.ISigningInfo} message SigningInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SigningInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.address); + if (message.validatorSigningInfo != null && Object.hasOwnProperty.call(message, "validatorSigningInfo")) + $root.cosmos.slashing.v1beta1.ValidatorSigningInfo.encode(message.validatorSigningInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SigningInfo message, length delimited. Does not implicitly {@link cosmos.slashing.v1beta1.SigningInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.slashing.v1beta1.SigningInfo + * @static + * @param {cosmos.slashing.v1beta1.ISigningInfo} message SigningInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SigningInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SigningInfo message from the specified reader or buffer. + * @function decode + * @memberof cosmos.slashing.v1beta1.SigningInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.slashing.v1beta1.SigningInfo} SigningInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SigningInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.slashing.v1beta1.SigningInfo(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.validatorSigningInfo = $root.cosmos.slashing.v1beta1.ValidatorSigningInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SigningInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.slashing.v1beta1.SigningInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.slashing.v1beta1.SigningInfo} SigningInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SigningInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SigningInfo message. + * @function verify + * @memberof cosmos.slashing.v1beta1.SigningInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SigningInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.validatorSigningInfo != null && message.hasOwnProperty("validatorSigningInfo")) { + let error = $root.cosmos.slashing.v1beta1.ValidatorSigningInfo.verify(message.validatorSigningInfo); + if (error) + return "validatorSigningInfo." + error; + } + return null; + }; + + /** + * Creates a SigningInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.slashing.v1beta1.SigningInfo + * @static + * @param {Object.} object Plain object + * @returns {cosmos.slashing.v1beta1.SigningInfo} SigningInfo + */ + SigningInfo.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.slashing.v1beta1.SigningInfo) + return object; + let message = new $root.cosmos.slashing.v1beta1.SigningInfo(); + if (object.address != null) + message.address = String(object.address); + if (object.validatorSigningInfo != null) { + if (typeof object.validatorSigningInfo !== "object") + throw TypeError(".cosmos.slashing.v1beta1.SigningInfo.validatorSigningInfo: object expected"); + message.validatorSigningInfo = $root.cosmos.slashing.v1beta1.ValidatorSigningInfo.fromObject(object.validatorSigningInfo); + } + return message; + }; + + /** + * Creates a plain object from a SigningInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.slashing.v1beta1.SigningInfo + * @static + * @param {cosmos.slashing.v1beta1.SigningInfo} message SigningInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SigningInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.address = ""; + object.validatorSigningInfo = null; + } + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + if (message.validatorSigningInfo != null && message.hasOwnProperty("validatorSigningInfo")) + object.validatorSigningInfo = $root.cosmos.slashing.v1beta1.ValidatorSigningInfo.toObject(message.validatorSigningInfo, options); + return object; + }; + + /** + * Converts this SigningInfo to JSON. + * @function toJSON + * @memberof cosmos.slashing.v1beta1.SigningInfo + * @instance + * @returns {Object.} JSON object + */ + SigningInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SigningInfo; + })(v1beta1.SigningInfo || {}); + + v1beta1.ValidatorMissedBlocks = (function(ValidatorMissedBlocks) { + + /** + * Properties of a ValidatorMissedBlocks. + * @memberof cosmos.slashing.v1beta1 + * @interface IValidatorMissedBlocks + * @property {string|null} [address] ValidatorMissedBlocks address + * @property {Array.|null} [missedBlocks] ValidatorMissedBlocks missedBlocks + */ + + /** + * Constructs a new ValidatorMissedBlocks. + * @memberof cosmos.slashing.v1beta1 + * @classdesc Represents a ValidatorMissedBlocks. + * @implements IValidatorMissedBlocks + * @constructor + * @param {cosmos.slashing.v1beta1.IValidatorMissedBlocks=} [properties] Properties to set + */ + function ValidatorMissedBlocks(properties) { + this.missedBlocks = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidatorMissedBlocks address. + * @member {string} address + * @memberof cosmos.slashing.v1beta1.ValidatorMissedBlocks + * @instance + */ + ValidatorMissedBlocks.prototype.address = ""; + + /** + * ValidatorMissedBlocks missedBlocks. + * @member {Array.} missedBlocks + * @memberof cosmos.slashing.v1beta1.ValidatorMissedBlocks + * @instance + */ + ValidatorMissedBlocks.prototype.missedBlocks = $util.emptyArray; + + /** + * Creates a new ValidatorMissedBlocks instance using the specified properties. + * @function create + * @memberof cosmos.slashing.v1beta1.ValidatorMissedBlocks + * @static + * @param {cosmos.slashing.v1beta1.IValidatorMissedBlocks=} [properties] Properties to set + * @returns {cosmos.slashing.v1beta1.ValidatorMissedBlocks} ValidatorMissedBlocks instance + */ + ValidatorMissedBlocks.create = function create(properties) { + return new ValidatorMissedBlocks(properties); + }; + + /** + * Encodes the specified ValidatorMissedBlocks message. Does not implicitly {@link cosmos.slashing.v1beta1.ValidatorMissedBlocks.verify|verify} messages. + * @function encode + * @memberof cosmos.slashing.v1beta1.ValidatorMissedBlocks + * @static + * @param {cosmos.slashing.v1beta1.IValidatorMissedBlocks} message ValidatorMissedBlocks message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorMissedBlocks.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.address); + if (message.missedBlocks != null && message.missedBlocks.length) + for (let i = 0; i < message.missedBlocks.length; ++i) + $root.cosmos.slashing.v1beta1.MissedBlock.encode(message.missedBlocks[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ValidatorMissedBlocks message, length delimited. Does not implicitly {@link cosmos.slashing.v1beta1.ValidatorMissedBlocks.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.slashing.v1beta1.ValidatorMissedBlocks + * @static + * @param {cosmos.slashing.v1beta1.IValidatorMissedBlocks} message ValidatorMissedBlocks message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorMissedBlocks.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidatorMissedBlocks message from the specified reader or buffer. + * @function decode + * @memberof cosmos.slashing.v1beta1.ValidatorMissedBlocks + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.slashing.v1beta1.ValidatorMissedBlocks} ValidatorMissedBlocks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorMissedBlocks.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.slashing.v1beta1.ValidatorMissedBlocks(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + if (!(message.missedBlocks && message.missedBlocks.length)) + message.missedBlocks = []; + message.missedBlocks.push($root.cosmos.slashing.v1beta1.MissedBlock.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidatorMissedBlocks message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.slashing.v1beta1.ValidatorMissedBlocks + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.slashing.v1beta1.ValidatorMissedBlocks} ValidatorMissedBlocks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorMissedBlocks.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidatorMissedBlocks message. + * @function verify + * @memberof cosmos.slashing.v1beta1.ValidatorMissedBlocks + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidatorMissedBlocks.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.missedBlocks != null && message.hasOwnProperty("missedBlocks")) { + if (!Array.isArray(message.missedBlocks)) + return "missedBlocks: array expected"; + for (let i = 0; i < message.missedBlocks.length; ++i) { + let error = $root.cosmos.slashing.v1beta1.MissedBlock.verify(message.missedBlocks[i]); + if (error) + return "missedBlocks." + error; + } + } + return null; + }; + + /** + * Creates a ValidatorMissedBlocks message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.slashing.v1beta1.ValidatorMissedBlocks + * @static + * @param {Object.} object Plain object + * @returns {cosmos.slashing.v1beta1.ValidatorMissedBlocks} ValidatorMissedBlocks + */ + ValidatorMissedBlocks.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.slashing.v1beta1.ValidatorMissedBlocks) + return object; + let message = new $root.cosmos.slashing.v1beta1.ValidatorMissedBlocks(); + if (object.address != null) + message.address = String(object.address); + if (object.missedBlocks) { + if (!Array.isArray(object.missedBlocks)) + throw TypeError(".cosmos.slashing.v1beta1.ValidatorMissedBlocks.missedBlocks: array expected"); + message.missedBlocks = []; + for (let i = 0; i < object.missedBlocks.length; ++i) { + if (typeof object.missedBlocks[i] !== "object") + throw TypeError(".cosmos.slashing.v1beta1.ValidatorMissedBlocks.missedBlocks: object expected"); + message.missedBlocks[i] = $root.cosmos.slashing.v1beta1.MissedBlock.fromObject(object.missedBlocks[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ValidatorMissedBlocks message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.slashing.v1beta1.ValidatorMissedBlocks + * @static + * @param {cosmos.slashing.v1beta1.ValidatorMissedBlocks} message ValidatorMissedBlocks + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidatorMissedBlocks.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.missedBlocks = []; + if (options.defaults) + object.address = ""; + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + if (message.missedBlocks && message.missedBlocks.length) { + object.missedBlocks = []; + for (let j = 0; j < message.missedBlocks.length; ++j) + object.missedBlocks[j] = $root.cosmos.slashing.v1beta1.MissedBlock.toObject(message.missedBlocks[j], options); + } + return object; + }; + + /** + * Converts this ValidatorMissedBlocks to JSON. + * @function toJSON + * @memberof cosmos.slashing.v1beta1.ValidatorMissedBlocks + * @instance + * @returns {Object.} JSON object + */ + ValidatorMissedBlocks.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidatorMissedBlocks; + })(v1beta1.ValidatorMissedBlocks || {}); + + v1beta1.MissedBlock = (function(MissedBlock) { + + /** + * Properties of a MissedBlock. + * @memberof cosmos.slashing.v1beta1 + * @interface IMissedBlock + * @property {number|Long|null} [index] MissedBlock index + * @property {boolean|null} [missed] MissedBlock missed + */ + + /** + * Constructs a new MissedBlock. + * @memberof cosmos.slashing.v1beta1 + * @classdesc Represents a MissedBlock. + * @implements IMissedBlock + * @constructor + * @param {cosmos.slashing.v1beta1.IMissedBlock=} [properties] Properties to set + */ + function MissedBlock(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MissedBlock index. + * @member {number|Long} index + * @memberof cosmos.slashing.v1beta1.MissedBlock + * @instance + */ + MissedBlock.prototype.index = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * MissedBlock missed. + * @member {boolean} missed + * @memberof cosmos.slashing.v1beta1.MissedBlock + * @instance + */ + MissedBlock.prototype.missed = false; + + /** + * Creates a new MissedBlock instance using the specified properties. + * @function create + * @memberof cosmos.slashing.v1beta1.MissedBlock + * @static + * @param {cosmos.slashing.v1beta1.IMissedBlock=} [properties] Properties to set + * @returns {cosmos.slashing.v1beta1.MissedBlock} MissedBlock instance + */ + MissedBlock.create = function create(properties) { + return new MissedBlock(properties); + }; + + /** + * Encodes the specified MissedBlock message. Does not implicitly {@link cosmos.slashing.v1beta1.MissedBlock.verify|verify} messages. + * @function encode + * @memberof cosmos.slashing.v1beta1.MissedBlock + * @static + * @param {cosmos.slashing.v1beta1.IMissedBlock} message MissedBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MissedBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.index); + if (message.missed != null && Object.hasOwnProperty.call(message, "missed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.missed); + return writer; + }; + + /** + * Encodes the specified MissedBlock message, length delimited. Does not implicitly {@link cosmos.slashing.v1beta1.MissedBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.slashing.v1beta1.MissedBlock + * @static + * @param {cosmos.slashing.v1beta1.IMissedBlock} message MissedBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MissedBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MissedBlock message from the specified reader or buffer. + * @function decode + * @memberof cosmos.slashing.v1beta1.MissedBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.slashing.v1beta1.MissedBlock} MissedBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MissedBlock.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.slashing.v1beta1.MissedBlock(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.int64(); + break; + case 2: + message.missed = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MissedBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.slashing.v1beta1.MissedBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.slashing.v1beta1.MissedBlock} MissedBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MissedBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MissedBlock message. + * @function verify + * @memberof cosmos.slashing.v1beta1.MissedBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MissedBlock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index) && !(message.index && $util.isInteger(message.index.low) && $util.isInteger(message.index.high))) + return "index: integer|Long expected"; + if (message.missed != null && message.hasOwnProperty("missed")) + if (typeof message.missed !== "boolean") + return "missed: boolean expected"; + return null; + }; + + /** + * Creates a MissedBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.slashing.v1beta1.MissedBlock + * @static + * @param {Object.} object Plain object + * @returns {cosmos.slashing.v1beta1.MissedBlock} MissedBlock + */ + MissedBlock.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.slashing.v1beta1.MissedBlock) + return object; + let message = new $root.cosmos.slashing.v1beta1.MissedBlock(); + if (object.index != null) + if ($util.Long) + (message.index = $util.Long.fromValue(object.index)).unsigned = false; + else if (typeof object.index === "string") + message.index = parseInt(object.index, 10); + else if (typeof object.index === "number") + message.index = object.index; + else if (typeof object.index === "object") + message.index = new $util.LongBits(object.index.low >>> 0, object.index.high >>> 0).toNumber(); + if (object.missed != null) + message.missed = Boolean(object.missed); + return message; + }; + + /** + * Creates a plain object from a MissedBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.slashing.v1beta1.MissedBlock + * @static + * @param {cosmos.slashing.v1beta1.MissedBlock} message MissedBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MissedBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.index = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.index = options.longs === String ? "0" : 0; + object.missed = false; + } + if (message.index != null && message.hasOwnProperty("index")) + if (typeof message.index === "number") + object.index = options.longs === String ? String(message.index) : message.index; + else + object.index = options.longs === String ? $util.Long.prototype.toString.call(message.index) : options.longs === Number ? new $util.LongBits(message.index.low >>> 0, message.index.high >>> 0).toNumber() : message.index; + if (message.missed != null && message.hasOwnProperty("missed")) + object.missed = message.missed; + return object; + }; + + /** + * Converts this MissedBlock to JSON. + * @function toJSON + * @memberof cosmos.slashing.v1beta1.MissedBlock + * @instance + * @returns {Object.} JSON object + */ + MissedBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MissedBlock; + })(v1beta1.MissedBlock || {}); + + v1beta1.Query = (function(Query) { + + /** + * Constructs a new Query service. + * @memberof cosmos.slashing.v1beta1 + * @classdesc Represents a Query + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Query(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; + + /** + * Creates new Query service using the specified rpc implementation. + * @function create + * @memberof cosmos.slashing.v1beta1.Query + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Query} RPC service. Useful where requests and/or responses are streamed. + */ + Query.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.slashing.v1beta1.Query#params}. + * @memberof cosmos.slashing.v1beta1.Query + * @typedef ParamsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.slashing.v1beta1.IQueryParamsResponse} [response] QueryParamsResponse + */ + + /** + * Calls Params. + * @function params + * @memberof cosmos.slashing.v1beta1.Query + * @instance + * @param {cosmos.slashing.v1beta1.IQueryParamsRequest} request QueryParamsRequest message or plain object + * @param {cosmos.slashing.v1beta1.Query.ParamsCallback} callback Node-style callback called with the error, if any, and QueryParamsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.params = function params(request, callback) { + return this.rpcCall(params, $root.cosmos.slashing.v1beta1.QueryParamsRequest, $root.cosmos.slashing.v1beta1.QueryParamsResponse, request, callback); + }, "name", { value: "Params" }); + + /** + * Calls Params. + * @function params + * @memberof cosmos.slashing.v1beta1.Query + * @instance + * @param {cosmos.slashing.v1beta1.IQueryParamsRequest} request QueryParamsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.slashing.v1beta1.Query#signingInfo}. + * @memberof cosmos.slashing.v1beta1.Query + * @typedef SigningInfoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.slashing.v1beta1.IQuerySigningInfoResponse} [response] QuerySigningInfoResponse + */ + + /** + * Calls SigningInfo. + * @function signingInfo + * @memberof cosmos.slashing.v1beta1.Query + * @instance + * @param {cosmos.slashing.v1beta1.IQuerySigningInfoRequest} request QuerySigningInfoRequest message or plain object + * @param {cosmos.slashing.v1beta1.Query.SigningInfoCallback} callback Node-style callback called with the error, if any, and QuerySigningInfoResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.signingInfo = function signingInfo(request, callback) { + return this.rpcCall(signingInfo, $root.cosmos.slashing.v1beta1.QuerySigningInfoRequest, $root.cosmos.slashing.v1beta1.QuerySigningInfoResponse, request, callback); + }, "name", { value: "SigningInfo" }); + + /** + * Calls SigningInfo. + * @function signingInfo + * @memberof cosmos.slashing.v1beta1.Query + * @instance + * @param {cosmos.slashing.v1beta1.IQuerySigningInfoRequest} request QuerySigningInfoRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.slashing.v1beta1.Query#signingInfos}. + * @memberof cosmos.slashing.v1beta1.Query + * @typedef SigningInfosCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.slashing.v1beta1.IQuerySigningInfosResponse} [response] QuerySigningInfosResponse + */ + + /** + * Calls SigningInfos. + * @function signingInfos + * @memberof cosmos.slashing.v1beta1.Query + * @instance + * @param {cosmos.slashing.v1beta1.IQuerySigningInfosRequest} request QuerySigningInfosRequest message or plain object + * @param {cosmos.slashing.v1beta1.Query.SigningInfosCallback} callback Node-style callback called with the error, if any, and QuerySigningInfosResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.signingInfos = function signingInfos(request, callback) { + return this.rpcCall(signingInfos, $root.cosmos.slashing.v1beta1.QuerySigningInfosRequest, $root.cosmos.slashing.v1beta1.QuerySigningInfosResponse, request, callback); + }, "name", { value: "SigningInfos" }); + + /** + * Calls SigningInfos. + * @function signingInfos + * @memberof cosmos.slashing.v1beta1.Query + * @instance + * @param {cosmos.slashing.v1beta1.IQuerySigningInfosRequest} request QuerySigningInfosRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Query; + })(v1beta1.Query || {}); + + v1beta1.QueryParamsRequest = (function(QueryParamsRequest) { + + /** + * Properties of a QueryParamsRequest. + * @memberof cosmos.slashing.v1beta1 + * @interface IQueryParamsRequest + */ + + /** + * Constructs a new QueryParamsRequest. + * @memberof cosmos.slashing.v1beta1 + * @classdesc Represents a QueryParamsRequest. + * @implements IQueryParamsRequest + * @constructor + * @param {cosmos.slashing.v1beta1.IQueryParamsRequest=} [properties] Properties to set + */ + function QueryParamsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new QueryParamsRequest instance using the specified properties. + * @function create + * @memberof cosmos.slashing.v1beta1.QueryParamsRequest + * @static + * @param {cosmos.slashing.v1beta1.IQueryParamsRequest=} [properties] Properties to set + * @returns {cosmos.slashing.v1beta1.QueryParamsRequest} QueryParamsRequest instance + */ + QueryParamsRequest.create = function create(properties) { + return new QueryParamsRequest(properties); + }; + + /** + * Encodes the specified QueryParamsRequest message. Does not implicitly {@link cosmos.slashing.v1beta1.QueryParamsRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.slashing.v1beta1.QueryParamsRequest + * @static + * @param {cosmos.slashing.v1beta1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link cosmos.slashing.v1beta1.QueryParamsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.slashing.v1beta1.QueryParamsRequest + * @static + * @param {cosmos.slashing.v1beta1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryParamsRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.slashing.v1beta1.QueryParamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.slashing.v1beta1.QueryParamsRequest} QueryParamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.slashing.v1beta1.QueryParamsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.slashing.v1beta1.QueryParamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.slashing.v1beta1.QueryParamsRequest} QueryParamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryParamsRequest message. + * @function verify + * @memberof cosmos.slashing.v1beta1.QueryParamsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryParamsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.slashing.v1beta1.QueryParamsRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.slashing.v1beta1.QueryParamsRequest} QueryParamsRequest + */ + QueryParamsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.slashing.v1beta1.QueryParamsRequest) + return object; + return new $root.cosmos.slashing.v1beta1.QueryParamsRequest(); + }; + + /** + * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.slashing.v1beta1.QueryParamsRequest + * @static + * @param {cosmos.slashing.v1beta1.QueryParamsRequest} message QueryParamsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryParamsRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this QueryParamsRequest to JSON. + * @function toJSON + * @memberof cosmos.slashing.v1beta1.QueryParamsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryParamsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryParamsRequest; + })(v1beta1.QueryParamsRequest || {}); + + v1beta1.QueryParamsResponse = (function(QueryParamsResponse) { + + /** + * Properties of a QueryParamsResponse. + * @memberof cosmos.slashing.v1beta1 + * @interface IQueryParamsResponse + * @property {cosmos.slashing.v1beta1.IParams|null} [params] QueryParamsResponse params + */ + + /** + * Constructs a new QueryParamsResponse. + * @memberof cosmos.slashing.v1beta1 + * @classdesc Represents a QueryParamsResponse. + * @implements IQueryParamsResponse + * @constructor + * @param {cosmos.slashing.v1beta1.IQueryParamsResponse=} [properties] Properties to set + */ + function QueryParamsResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryParamsResponse params. + * @member {cosmos.slashing.v1beta1.IParams|null|undefined} params + * @memberof cosmos.slashing.v1beta1.QueryParamsResponse + * @instance + */ + QueryParamsResponse.prototype.params = null; + + /** + * Creates a new QueryParamsResponse instance using the specified properties. + * @function create + * @memberof cosmos.slashing.v1beta1.QueryParamsResponse + * @static + * @param {cosmos.slashing.v1beta1.IQueryParamsResponse=} [properties] Properties to set + * @returns {cosmos.slashing.v1beta1.QueryParamsResponse} QueryParamsResponse instance + */ + QueryParamsResponse.create = function create(properties) { + return new QueryParamsResponse(properties); + }; + + /** + * Encodes the specified QueryParamsResponse message. Does not implicitly {@link cosmos.slashing.v1beta1.QueryParamsResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.slashing.v1beta1.QueryParamsResponse + * @static + * @param {cosmos.slashing.v1beta1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.cosmos.slashing.v1beta1.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link cosmos.slashing.v1beta1.QueryParamsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.slashing.v1beta1.QueryParamsResponse + * @static + * @param {cosmos.slashing.v1beta1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryParamsResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.slashing.v1beta1.QueryParamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.slashing.v1beta1.QueryParamsResponse} QueryParamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.slashing.v1beta1.QueryParamsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = $root.cosmos.slashing.v1beta1.Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.slashing.v1beta1.QueryParamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.slashing.v1beta1.QueryParamsResponse} QueryParamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryParamsResponse message. + * @function verify + * @memberof cosmos.slashing.v1beta1.QueryParamsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryParamsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.params != null && message.hasOwnProperty("params")) { + let error = $root.cosmos.slashing.v1beta1.Params.verify(message.params); + if (error) + return "params." + error; + } + return null; + }; + + /** + * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.slashing.v1beta1.QueryParamsResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.slashing.v1beta1.QueryParamsResponse} QueryParamsResponse + */ + QueryParamsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.slashing.v1beta1.QueryParamsResponse) + return object; + let message = new $root.cosmos.slashing.v1beta1.QueryParamsResponse(); + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".cosmos.slashing.v1beta1.QueryParamsResponse.params: object expected"); + message.params = $root.cosmos.slashing.v1beta1.Params.fromObject(object.params); + } + return message; + }; + + /** + * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.slashing.v1beta1.QueryParamsResponse + * @static + * @param {cosmos.slashing.v1beta1.QueryParamsResponse} message QueryParamsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryParamsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.params = null; + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.cosmos.slashing.v1beta1.Params.toObject(message.params, options); + return object; + }; + + /** + * Converts this QueryParamsResponse to JSON. + * @function toJSON + * @memberof cosmos.slashing.v1beta1.QueryParamsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryParamsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryParamsResponse; + })(v1beta1.QueryParamsResponse || {}); + + v1beta1.QuerySigningInfoRequest = (function(QuerySigningInfoRequest) { + + /** + * Properties of a QuerySigningInfoRequest. + * @memberof cosmos.slashing.v1beta1 + * @interface IQuerySigningInfoRequest + * @property {string|null} [consAddress] QuerySigningInfoRequest consAddress + */ + + /** + * Constructs a new QuerySigningInfoRequest. + * @memberof cosmos.slashing.v1beta1 + * @classdesc Represents a QuerySigningInfoRequest. + * @implements IQuerySigningInfoRequest + * @constructor + * @param {cosmos.slashing.v1beta1.IQuerySigningInfoRequest=} [properties] Properties to set + */ + function QuerySigningInfoRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuerySigningInfoRequest consAddress. + * @member {string} consAddress + * @memberof cosmos.slashing.v1beta1.QuerySigningInfoRequest + * @instance + */ + QuerySigningInfoRequest.prototype.consAddress = ""; + + /** + * Creates a new QuerySigningInfoRequest instance using the specified properties. + * @function create + * @memberof cosmos.slashing.v1beta1.QuerySigningInfoRequest + * @static + * @param {cosmos.slashing.v1beta1.IQuerySigningInfoRequest=} [properties] Properties to set + * @returns {cosmos.slashing.v1beta1.QuerySigningInfoRequest} QuerySigningInfoRequest instance + */ + QuerySigningInfoRequest.create = function create(properties) { + return new QuerySigningInfoRequest(properties); + }; + + /** + * Encodes the specified QuerySigningInfoRequest message. Does not implicitly {@link cosmos.slashing.v1beta1.QuerySigningInfoRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.slashing.v1beta1.QuerySigningInfoRequest + * @static + * @param {cosmos.slashing.v1beta1.IQuerySigningInfoRequest} message QuerySigningInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuerySigningInfoRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.consAddress != null && Object.hasOwnProperty.call(message, "consAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.consAddress); + return writer; + }; + + /** + * Encodes the specified QuerySigningInfoRequest message, length delimited. Does not implicitly {@link cosmos.slashing.v1beta1.QuerySigningInfoRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.slashing.v1beta1.QuerySigningInfoRequest + * @static + * @param {cosmos.slashing.v1beta1.IQuerySigningInfoRequest} message QuerySigningInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuerySigningInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuerySigningInfoRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.slashing.v1beta1.QuerySigningInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.slashing.v1beta1.QuerySigningInfoRequest} QuerySigningInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuerySigningInfoRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.slashing.v1beta1.QuerySigningInfoRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuerySigningInfoRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.slashing.v1beta1.QuerySigningInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.slashing.v1beta1.QuerySigningInfoRequest} QuerySigningInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuerySigningInfoRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuerySigningInfoRequest message. + * @function verify + * @memberof cosmos.slashing.v1beta1.QuerySigningInfoRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuerySigningInfoRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.consAddress != null && message.hasOwnProperty("consAddress")) + if (!$util.isString(message.consAddress)) + return "consAddress: string expected"; + return null; + }; + + /** + * Creates a QuerySigningInfoRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.slashing.v1beta1.QuerySigningInfoRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.slashing.v1beta1.QuerySigningInfoRequest} QuerySigningInfoRequest + */ + QuerySigningInfoRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.slashing.v1beta1.QuerySigningInfoRequest) + return object; + let message = new $root.cosmos.slashing.v1beta1.QuerySigningInfoRequest(); + if (object.consAddress != null) + message.consAddress = String(object.consAddress); + return message; + }; + + /** + * Creates a plain object from a QuerySigningInfoRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.slashing.v1beta1.QuerySigningInfoRequest + * @static + * @param {cosmos.slashing.v1beta1.QuerySigningInfoRequest} message QuerySigningInfoRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuerySigningInfoRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.consAddress = ""; + if (message.consAddress != null && message.hasOwnProperty("consAddress")) + object.consAddress = message.consAddress; + return object; + }; + + /** + * Converts this QuerySigningInfoRequest to JSON. + * @function toJSON + * @memberof cosmos.slashing.v1beta1.QuerySigningInfoRequest + * @instance + * @returns {Object.} JSON object + */ + QuerySigningInfoRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QuerySigningInfoRequest; + })(v1beta1.QuerySigningInfoRequest || {}); + + v1beta1.QuerySigningInfoResponse = (function(QuerySigningInfoResponse) { + + /** + * Properties of a QuerySigningInfoResponse. + * @memberof cosmos.slashing.v1beta1 + * @interface IQuerySigningInfoResponse + * @property {cosmos.slashing.v1beta1.IValidatorSigningInfo|null} [valSigningInfo] QuerySigningInfoResponse valSigningInfo + */ + + /** + * Constructs a new QuerySigningInfoResponse. + * @memberof cosmos.slashing.v1beta1 + * @classdesc Represents a QuerySigningInfoResponse. + * @implements IQuerySigningInfoResponse + * @constructor + * @param {cosmos.slashing.v1beta1.IQuerySigningInfoResponse=} [properties] Properties to set + */ + function QuerySigningInfoResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuerySigningInfoResponse valSigningInfo. + * @member {cosmos.slashing.v1beta1.IValidatorSigningInfo|null|undefined} valSigningInfo + * @memberof cosmos.slashing.v1beta1.QuerySigningInfoResponse + * @instance + */ + QuerySigningInfoResponse.prototype.valSigningInfo = null; + + /** + * Creates a new QuerySigningInfoResponse instance using the specified properties. + * @function create + * @memberof cosmos.slashing.v1beta1.QuerySigningInfoResponse + * @static + * @param {cosmos.slashing.v1beta1.IQuerySigningInfoResponse=} [properties] Properties to set + * @returns {cosmos.slashing.v1beta1.QuerySigningInfoResponse} QuerySigningInfoResponse instance + */ + QuerySigningInfoResponse.create = function create(properties) { + return new QuerySigningInfoResponse(properties); + }; + + /** + * Encodes the specified QuerySigningInfoResponse message. Does not implicitly {@link cosmos.slashing.v1beta1.QuerySigningInfoResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.slashing.v1beta1.QuerySigningInfoResponse + * @static + * @param {cosmos.slashing.v1beta1.IQuerySigningInfoResponse} message QuerySigningInfoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuerySigningInfoResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.valSigningInfo != null && Object.hasOwnProperty.call(message, "valSigningInfo")) + $root.cosmos.slashing.v1beta1.ValidatorSigningInfo.encode(message.valSigningInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QuerySigningInfoResponse message, length delimited. Does not implicitly {@link cosmos.slashing.v1beta1.QuerySigningInfoResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.slashing.v1beta1.QuerySigningInfoResponse + * @static + * @param {cosmos.slashing.v1beta1.IQuerySigningInfoResponse} message QuerySigningInfoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuerySigningInfoResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuerySigningInfoResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.slashing.v1beta1.QuerySigningInfoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.slashing.v1beta1.QuerySigningInfoResponse} QuerySigningInfoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuerySigningInfoResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.slashing.v1beta1.QuerySigningInfoResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.valSigningInfo = $root.cosmos.slashing.v1beta1.ValidatorSigningInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuerySigningInfoResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.slashing.v1beta1.QuerySigningInfoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.slashing.v1beta1.QuerySigningInfoResponse} QuerySigningInfoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuerySigningInfoResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuerySigningInfoResponse message. + * @function verify + * @memberof cosmos.slashing.v1beta1.QuerySigningInfoResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuerySigningInfoResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.valSigningInfo != null && message.hasOwnProperty("valSigningInfo")) { + let error = $root.cosmos.slashing.v1beta1.ValidatorSigningInfo.verify(message.valSigningInfo); + if (error) + return "valSigningInfo." + error; + } + return null; + }; + + /** + * Creates a QuerySigningInfoResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.slashing.v1beta1.QuerySigningInfoResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.slashing.v1beta1.QuerySigningInfoResponse} QuerySigningInfoResponse + */ + QuerySigningInfoResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.slashing.v1beta1.QuerySigningInfoResponse) + return object; + let message = new $root.cosmos.slashing.v1beta1.QuerySigningInfoResponse(); + if (object.valSigningInfo != null) { + if (typeof object.valSigningInfo !== "object") + throw TypeError(".cosmos.slashing.v1beta1.QuerySigningInfoResponse.valSigningInfo: object expected"); + message.valSigningInfo = $root.cosmos.slashing.v1beta1.ValidatorSigningInfo.fromObject(object.valSigningInfo); + } + return message; + }; + + /** + * Creates a plain object from a QuerySigningInfoResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.slashing.v1beta1.QuerySigningInfoResponse + * @static + * @param {cosmos.slashing.v1beta1.QuerySigningInfoResponse} message QuerySigningInfoResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuerySigningInfoResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.valSigningInfo = null; + if (message.valSigningInfo != null && message.hasOwnProperty("valSigningInfo")) + object.valSigningInfo = $root.cosmos.slashing.v1beta1.ValidatorSigningInfo.toObject(message.valSigningInfo, options); + return object; + }; + + /** + * Converts this QuerySigningInfoResponse to JSON. + * @function toJSON + * @memberof cosmos.slashing.v1beta1.QuerySigningInfoResponse + * @instance + * @returns {Object.} JSON object + */ + QuerySigningInfoResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QuerySigningInfoResponse; + })(v1beta1.QuerySigningInfoResponse || {}); + + v1beta1.QuerySigningInfosRequest = (function(QuerySigningInfosRequest) { + + /** + * Properties of a QuerySigningInfosRequest. + * @memberof cosmos.slashing.v1beta1 + * @interface IQuerySigningInfosRequest + * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QuerySigningInfosRequest pagination + */ + + /** + * Constructs a new QuerySigningInfosRequest. + * @memberof cosmos.slashing.v1beta1 + * @classdesc Represents a QuerySigningInfosRequest. + * @implements IQuerySigningInfosRequest + * @constructor + * @param {cosmos.slashing.v1beta1.IQuerySigningInfosRequest=} [properties] Properties to set + */ + function QuerySigningInfosRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuerySigningInfosRequest pagination. + * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination + * @memberof cosmos.slashing.v1beta1.QuerySigningInfosRequest + * @instance + */ + QuerySigningInfosRequest.prototype.pagination = null; + + /** + * Creates a new QuerySigningInfosRequest instance using the specified properties. + * @function create + * @memberof cosmos.slashing.v1beta1.QuerySigningInfosRequest + * @static + * @param {cosmos.slashing.v1beta1.IQuerySigningInfosRequest=} [properties] Properties to set + * @returns {cosmos.slashing.v1beta1.QuerySigningInfosRequest} QuerySigningInfosRequest instance + */ + QuerySigningInfosRequest.create = function create(properties) { + return new QuerySigningInfosRequest(properties); + }; + + /** + * Encodes the specified QuerySigningInfosRequest message. Does not implicitly {@link cosmos.slashing.v1beta1.QuerySigningInfosRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.slashing.v1beta1.QuerySigningInfosRequest + * @static + * @param {cosmos.slashing.v1beta1.IQuerySigningInfosRequest} message QuerySigningInfosRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuerySigningInfosRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QuerySigningInfosRequest message, length delimited. Does not implicitly {@link cosmos.slashing.v1beta1.QuerySigningInfosRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.slashing.v1beta1.QuerySigningInfosRequest + * @static + * @param {cosmos.slashing.v1beta1.IQuerySigningInfosRequest} message QuerySigningInfosRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuerySigningInfosRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuerySigningInfosRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.slashing.v1beta1.QuerySigningInfosRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.slashing.v1beta1.QuerySigningInfosRequest} QuerySigningInfosRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuerySigningInfosRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.slashing.v1beta1.QuerySigningInfosRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuerySigningInfosRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.slashing.v1beta1.QuerySigningInfosRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.slashing.v1beta1.QuerySigningInfosRequest} QuerySigningInfosRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuerySigningInfosRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuerySigningInfosRequest message. + * @function verify + * @memberof cosmos.slashing.v1beta1.QuerySigningInfosRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuerySigningInfosRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QuerySigningInfosRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.slashing.v1beta1.QuerySigningInfosRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.slashing.v1beta1.QuerySigningInfosRequest} QuerySigningInfosRequest + */ + QuerySigningInfosRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.slashing.v1beta1.QuerySigningInfosRequest) + return object; + let message = new $root.cosmos.slashing.v1beta1.QuerySigningInfosRequest(); + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.slashing.v1beta1.QuerySigningInfosRequest.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QuerySigningInfosRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.slashing.v1beta1.QuerySigningInfosRequest + * @static + * @param {cosmos.slashing.v1beta1.QuerySigningInfosRequest} message QuerySigningInfosRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuerySigningInfosRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.pagination = null; + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QuerySigningInfosRequest to JSON. + * @function toJSON + * @memberof cosmos.slashing.v1beta1.QuerySigningInfosRequest + * @instance + * @returns {Object.} JSON object + */ + QuerySigningInfosRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QuerySigningInfosRequest; + })(v1beta1.QuerySigningInfosRequest || {}); + + v1beta1.QuerySigningInfosResponse = (function(QuerySigningInfosResponse) { + + /** + * Properties of a QuerySigningInfosResponse. + * @memberof cosmos.slashing.v1beta1 + * @interface IQuerySigningInfosResponse + * @property {Array.|null} [info] QuerySigningInfosResponse info + * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QuerySigningInfosResponse pagination + */ + + /** + * Constructs a new QuerySigningInfosResponse. + * @memberof cosmos.slashing.v1beta1 + * @classdesc Represents a QuerySigningInfosResponse. + * @implements IQuerySigningInfosResponse + * @constructor + * @param {cosmos.slashing.v1beta1.IQuerySigningInfosResponse=} [properties] Properties to set + */ + function QuerySigningInfosResponse(properties) { + this.info = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuerySigningInfosResponse info. + * @member {Array.} info + * @memberof cosmos.slashing.v1beta1.QuerySigningInfosResponse + * @instance + */ + QuerySigningInfosResponse.prototype.info = $util.emptyArray; + + /** + * QuerySigningInfosResponse pagination. + * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination + * @memberof cosmos.slashing.v1beta1.QuerySigningInfosResponse + * @instance + */ + QuerySigningInfosResponse.prototype.pagination = null; + + /** + * Creates a new QuerySigningInfosResponse instance using the specified properties. + * @function create + * @memberof cosmos.slashing.v1beta1.QuerySigningInfosResponse + * @static + * @param {cosmos.slashing.v1beta1.IQuerySigningInfosResponse=} [properties] Properties to set + * @returns {cosmos.slashing.v1beta1.QuerySigningInfosResponse} QuerySigningInfosResponse instance + */ + QuerySigningInfosResponse.create = function create(properties) { + return new QuerySigningInfosResponse(properties); + }; + + /** + * Encodes the specified QuerySigningInfosResponse message. Does not implicitly {@link cosmos.slashing.v1beta1.QuerySigningInfosResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.slashing.v1beta1.QuerySigningInfosResponse + * @static + * @param {cosmos.slashing.v1beta1.IQuerySigningInfosResponse} message QuerySigningInfosResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuerySigningInfosResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.info != null && message.info.length) + for (let i = 0; i < message.info.length; ++i) + $root.cosmos.slashing.v1beta1.ValidatorSigningInfo.encode(message.info[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QuerySigningInfosResponse message, length delimited. Does not implicitly {@link cosmos.slashing.v1beta1.QuerySigningInfosResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.slashing.v1beta1.QuerySigningInfosResponse + * @static + * @param {cosmos.slashing.v1beta1.IQuerySigningInfosResponse} message QuerySigningInfosResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuerySigningInfosResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuerySigningInfosResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.slashing.v1beta1.QuerySigningInfosResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.slashing.v1beta1.QuerySigningInfosResponse} QuerySigningInfosResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuerySigningInfosResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.slashing.v1beta1.QuerySigningInfosResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.info && message.info.length)) + message.info = []; + message.info.push($root.cosmos.slashing.v1beta1.ValidatorSigningInfo.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuerySigningInfosResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.slashing.v1beta1.QuerySigningInfosResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.slashing.v1beta1.QuerySigningInfosResponse} QuerySigningInfosResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuerySigningInfosResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuerySigningInfosResponse message. + * @function verify + * @memberof cosmos.slashing.v1beta1.QuerySigningInfosResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuerySigningInfosResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.info != null && message.hasOwnProperty("info")) { + if (!Array.isArray(message.info)) + return "info: array expected"; + for (let i = 0; i < message.info.length; ++i) { + let error = $root.cosmos.slashing.v1beta1.ValidatorSigningInfo.verify(message.info[i]); + if (error) + return "info." + error; + } + } + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QuerySigningInfosResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.slashing.v1beta1.QuerySigningInfosResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.slashing.v1beta1.QuerySigningInfosResponse} QuerySigningInfosResponse + */ + QuerySigningInfosResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.slashing.v1beta1.QuerySigningInfosResponse) + return object; + let message = new $root.cosmos.slashing.v1beta1.QuerySigningInfosResponse(); + if (object.info) { + if (!Array.isArray(object.info)) + throw TypeError(".cosmos.slashing.v1beta1.QuerySigningInfosResponse.info: array expected"); + message.info = []; + for (let i = 0; i < object.info.length; ++i) { + if (typeof object.info[i] !== "object") + throw TypeError(".cosmos.slashing.v1beta1.QuerySigningInfosResponse.info: object expected"); + message.info[i] = $root.cosmos.slashing.v1beta1.ValidatorSigningInfo.fromObject(object.info[i]); + } + } + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.slashing.v1beta1.QuerySigningInfosResponse.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QuerySigningInfosResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.slashing.v1beta1.QuerySigningInfosResponse + * @static + * @param {cosmos.slashing.v1beta1.QuerySigningInfosResponse} message QuerySigningInfosResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuerySigningInfosResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.info = []; + if (options.defaults) + object.pagination = null; + if (message.info && message.info.length) { + object.info = []; + for (let j = 0; j < message.info.length; ++j) + object.info[j] = $root.cosmos.slashing.v1beta1.ValidatorSigningInfo.toObject(message.info[j], options); + } + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QuerySigningInfosResponse to JSON. + * @function toJSON + * @memberof cosmos.slashing.v1beta1.QuerySigningInfosResponse + * @instance + * @returns {Object.} JSON object + */ + QuerySigningInfosResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QuerySigningInfosResponse; + })(v1beta1.QuerySigningInfosResponse || {}); + + v1beta1.ValidatorSigningInfo = (function(ValidatorSigningInfo) { + + /** + * Properties of a ValidatorSigningInfo. + * @memberof cosmos.slashing.v1beta1 + * @interface IValidatorSigningInfo + * @property {string|null} [address] ValidatorSigningInfo address + * @property {number|Long|null} [startHeight] ValidatorSigningInfo startHeight + * @property {number|Long|null} [indexOffset] ValidatorSigningInfo indexOffset + * @property {google.protobuf.ITimestamp|null} [jailedUntil] ValidatorSigningInfo jailedUntil + * @property {boolean|null} [tombstoned] ValidatorSigningInfo tombstoned + * @property {number|Long|null} [missedBlocksCounter] ValidatorSigningInfo missedBlocksCounter + */ + + /** + * Constructs a new ValidatorSigningInfo. + * @memberof cosmos.slashing.v1beta1 + * @classdesc Represents a ValidatorSigningInfo. + * @implements IValidatorSigningInfo + * @constructor + * @param {cosmos.slashing.v1beta1.IValidatorSigningInfo=} [properties] Properties to set + */ + function ValidatorSigningInfo(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidatorSigningInfo address. + * @member {string} address + * @memberof cosmos.slashing.v1beta1.ValidatorSigningInfo + * @instance + */ + ValidatorSigningInfo.prototype.address = ""; + + /** + * ValidatorSigningInfo startHeight. + * @member {number|Long} startHeight + * @memberof cosmos.slashing.v1beta1.ValidatorSigningInfo + * @instance + */ + ValidatorSigningInfo.prototype.startHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ValidatorSigningInfo indexOffset. + * @member {number|Long} indexOffset + * @memberof cosmos.slashing.v1beta1.ValidatorSigningInfo + * @instance + */ + ValidatorSigningInfo.prototype.indexOffset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ValidatorSigningInfo jailedUntil. + * @member {google.protobuf.ITimestamp|null|undefined} jailedUntil + * @memberof cosmos.slashing.v1beta1.ValidatorSigningInfo + * @instance + */ + ValidatorSigningInfo.prototype.jailedUntil = null; + + /** + * ValidatorSigningInfo tombstoned. + * @member {boolean} tombstoned + * @memberof cosmos.slashing.v1beta1.ValidatorSigningInfo + * @instance + */ + ValidatorSigningInfo.prototype.tombstoned = false; + + /** + * ValidatorSigningInfo missedBlocksCounter. + * @member {number|Long} missedBlocksCounter + * @memberof cosmos.slashing.v1beta1.ValidatorSigningInfo + * @instance + */ + ValidatorSigningInfo.prototype.missedBlocksCounter = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ValidatorSigningInfo instance using the specified properties. + * @function create + * @memberof cosmos.slashing.v1beta1.ValidatorSigningInfo + * @static + * @param {cosmos.slashing.v1beta1.IValidatorSigningInfo=} [properties] Properties to set + * @returns {cosmos.slashing.v1beta1.ValidatorSigningInfo} ValidatorSigningInfo instance + */ + ValidatorSigningInfo.create = function create(properties) { + return new ValidatorSigningInfo(properties); + }; + + /** + * Encodes the specified ValidatorSigningInfo message. Does not implicitly {@link cosmos.slashing.v1beta1.ValidatorSigningInfo.verify|verify} messages. + * @function encode + * @memberof cosmos.slashing.v1beta1.ValidatorSigningInfo + * @static + * @param {cosmos.slashing.v1beta1.IValidatorSigningInfo} message ValidatorSigningInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorSigningInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.address); + if (message.startHeight != null && Object.hasOwnProperty.call(message, "startHeight")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.startHeight); + if (message.indexOffset != null && Object.hasOwnProperty.call(message, "indexOffset")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.indexOffset); + if (message.jailedUntil != null && Object.hasOwnProperty.call(message, "jailedUntil")) + $root.google.protobuf.Timestamp.encode(message.jailedUntil, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.tombstoned != null && Object.hasOwnProperty.call(message, "tombstoned")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.tombstoned); + if (message.missedBlocksCounter != null && Object.hasOwnProperty.call(message, "missedBlocksCounter")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.missedBlocksCounter); + return writer; + }; + + /** + * Encodes the specified ValidatorSigningInfo message, length delimited. Does not implicitly {@link cosmos.slashing.v1beta1.ValidatorSigningInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.slashing.v1beta1.ValidatorSigningInfo + * @static + * @param {cosmos.slashing.v1beta1.IValidatorSigningInfo} message ValidatorSigningInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorSigningInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidatorSigningInfo message from the specified reader or buffer. + * @function decode + * @memberof cosmos.slashing.v1beta1.ValidatorSigningInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.slashing.v1beta1.ValidatorSigningInfo} ValidatorSigningInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorSigningInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.slashing.v1beta1.ValidatorSigningInfo(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.startHeight = reader.int64(); + break; + case 3: + message.indexOffset = reader.int64(); + break; + case 4: + message.jailedUntil = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.tombstoned = reader.bool(); + break; + case 6: + message.missedBlocksCounter = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidatorSigningInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.slashing.v1beta1.ValidatorSigningInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.slashing.v1beta1.ValidatorSigningInfo} ValidatorSigningInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorSigningInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidatorSigningInfo message. + * @function verify + * @memberof cosmos.slashing.v1beta1.ValidatorSigningInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidatorSigningInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.startHeight != null && message.hasOwnProperty("startHeight")) + if (!$util.isInteger(message.startHeight) && !(message.startHeight && $util.isInteger(message.startHeight.low) && $util.isInteger(message.startHeight.high))) + return "startHeight: integer|Long expected"; + if (message.indexOffset != null && message.hasOwnProperty("indexOffset")) + if (!$util.isInteger(message.indexOffset) && !(message.indexOffset && $util.isInteger(message.indexOffset.low) && $util.isInteger(message.indexOffset.high))) + return "indexOffset: integer|Long expected"; + if (message.jailedUntil != null && message.hasOwnProperty("jailedUntil")) { + let error = $root.google.protobuf.Timestamp.verify(message.jailedUntil); + if (error) + return "jailedUntil." + error; + } + if (message.tombstoned != null && message.hasOwnProperty("tombstoned")) + if (typeof message.tombstoned !== "boolean") + return "tombstoned: boolean expected"; + if (message.missedBlocksCounter != null && message.hasOwnProperty("missedBlocksCounter")) + if (!$util.isInteger(message.missedBlocksCounter) && !(message.missedBlocksCounter && $util.isInteger(message.missedBlocksCounter.low) && $util.isInteger(message.missedBlocksCounter.high))) + return "missedBlocksCounter: integer|Long expected"; + return null; + }; + + /** + * Creates a ValidatorSigningInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.slashing.v1beta1.ValidatorSigningInfo + * @static + * @param {Object.} object Plain object + * @returns {cosmos.slashing.v1beta1.ValidatorSigningInfo} ValidatorSigningInfo + */ + ValidatorSigningInfo.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.slashing.v1beta1.ValidatorSigningInfo) + return object; + let message = new $root.cosmos.slashing.v1beta1.ValidatorSigningInfo(); + if (object.address != null) + message.address = String(object.address); + if (object.startHeight != null) + if ($util.Long) + (message.startHeight = $util.Long.fromValue(object.startHeight)).unsigned = false; + else if (typeof object.startHeight === "string") + message.startHeight = parseInt(object.startHeight, 10); + else if (typeof object.startHeight === "number") + message.startHeight = object.startHeight; + else if (typeof object.startHeight === "object") + message.startHeight = new $util.LongBits(object.startHeight.low >>> 0, object.startHeight.high >>> 0).toNumber(); + if (object.indexOffset != null) + if ($util.Long) + (message.indexOffset = $util.Long.fromValue(object.indexOffset)).unsigned = false; + else if (typeof object.indexOffset === "string") + message.indexOffset = parseInt(object.indexOffset, 10); + else if (typeof object.indexOffset === "number") + message.indexOffset = object.indexOffset; + else if (typeof object.indexOffset === "object") + message.indexOffset = new $util.LongBits(object.indexOffset.low >>> 0, object.indexOffset.high >>> 0).toNumber(); + if (object.jailedUntil != null) { + if (typeof object.jailedUntil !== "object") + throw TypeError(".cosmos.slashing.v1beta1.ValidatorSigningInfo.jailedUntil: object expected"); + message.jailedUntil = $root.google.protobuf.Timestamp.fromObject(object.jailedUntil); + } + if (object.tombstoned != null) + message.tombstoned = Boolean(object.tombstoned); + if (object.missedBlocksCounter != null) + if ($util.Long) + (message.missedBlocksCounter = $util.Long.fromValue(object.missedBlocksCounter)).unsigned = false; + else if (typeof object.missedBlocksCounter === "string") + message.missedBlocksCounter = parseInt(object.missedBlocksCounter, 10); + else if (typeof object.missedBlocksCounter === "number") + message.missedBlocksCounter = object.missedBlocksCounter; + else if (typeof object.missedBlocksCounter === "object") + message.missedBlocksCounter = new $util.LongBits(object.missedBlocksCounter.low >>> 0, object.missedBlocksCounter.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ValidatorSigningInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.slashing.v1beta1.ValidatorSigningInfo + * @static + * @param {cosmos.slashing.v1beta1.ValidatorSigningInfo} message ValidatorSigningInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidatorSigningInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.address = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.startHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.startHeight = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.indexOffset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.indexOffset = options.longs === String ? "0" : 0; + object.jailedUntil = null; + object.tombstoned = false; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.missedBlocksCounter = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.missedBlocksCounter = options.longs === String ? "0" : 0; + } + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + if (message.startHeight != null && message.hasOwnProperty("startHeight")) + if (typeof message.startHeight === "number") + object.startHeight = options.longs === String ? String(message.startHeight) : message.startHeight; + else + object.startHeight = options.longs === String ? $util.Long.prototype.toString.call(message.startHeight) : options.longs === Number ? new $util.LongBits(message.startHeight.low >>> 0, message.startHeight.high >>> 0).toNumber() : message.startHeight; + if (message.indexOffset != null && message.hasOwnProperty("indexOffset")) + if (typeof message.indexOffset === "number") + object.indexOffset = options.longs === String ? String(message.indexOffset) : message.indexOffset; + else + object.indexOffset = options.longs === String ? $util.Long.prototype.toString.call(message.indexOffset) : options.longs === Number ? new $util.LongBits(message.indexOffset.low >>> 0, message.indexOffset.high >>> 0).toNumber() : message.indexOffset; + if (message.jailedUntil != null && message.hasOwnProperty("jailedUntil")) + object.jailedUntil = $root.google.protobuf.Timestamp.toObject(message.jailedUntil, options); + if (message.tombstoned != null && message.hasOwnProperty("tombstoned")) + object.tombstoned = message.tombstoned; + if (message.missedBlocksCounter != null && message.hasOwnProperty("missedBlocksCounter")) + if (typeof message.missedBlocksCounter === "number") + object.missedBlocksCounter = options.longs === String ? String(message.missedBlocksCounter) : message.missedBlocksCounter; + else + object.missedBlocksCounter = options.longs === String ? $util.Long.prototype.toString.call(message.missedBlocksCounter) : options.longs === Number ? new $util.LongBits(message.missedBlocksCounter.low >>> 0, message.missedBlocksCounter.high >>> 0).toNumber() : message.missedBlocksCounter; + return object; + }; + + /** + * Converts this ValidatorSigningInfo to JSON. + * @function toJSON + * @memberof cosmos.slashing.v1beta1.ValidatorSigningInfo + * @instance + * @returns {Object.} JSON object + */ + ValidatorSigningInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidatorSigningInfo; + })(v1beta1.ValidatorSigningInfo || {}); + + v1beta1.Params = (function(Params) { + + /** + * Properties of a Params. + * @memberof cosmos.slashing.v1beta1 + * @interface IParams + * @property {number|Long|null} [signedBlocksWindow] Params signedBlocksWindow + * @property {Uint8Array|null} [minSignedPerWindow] Params minSignedPerWindow + * @property {google.protobuf.IDuration|null} [downtimeJailDuration] Params downtimeJailDuration + * @property {Uint8Array|null} [slashFractionDoubleSign] Params slashFractionDoubleSign + * @property {Uint8Array|null} [slashFractionDowntime] Params slashFractionDowntime + */ + + /** + * Constructs a new Params. + * @memberof cosmos.slashing.v1beta1 + * @classdesc Represents a Params. + * @implements IParams + * @constructor + * @param {cosmos.slashing.v1beta1.IParams=} [properties] Properties to set + */ + function Params(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Params signedBlocksWindow. + * @member {number|Long} signedBlocksWindow + * @memberof cosmos.slashing.v1beta1.Params + * @instance + */ + Params.prototype.signedBlocksWindow = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Params minSignedPerWindow. + * @member {Uint8Array} minSignedPerWindow + * @memberof cosmos.slashing.v1beta1.Params + * @instance + */ + Params.prototype.minSignedPerWindow = $util.newBuffer([]); + + /** + * Params downtimeJailDuration. + * @member {google.protobuf.IDuration|null|undefined} downtimeJailDuration + * @memberof cosmos.slashing.v1beta1.Params + * @instance + */ + Params.prototype.downtimeJailDuration = null; + + /** + * Params slashFractionDoubleSign. + * @member {Uint8Array} slashFractionDoubleSign + * @memberof cosmos.slashing.v1beta1.Params + * @instance + */ + Params.prototype.slashFractionDoubleSign = $util.newBuffer([]); + + /** + * Params slashFractionDowntime. + * @member {Uint8Array} slashFractionDowntime + * @memberof cosmos.slashing.v1beta1.Params + * @instance + */ + Params.prototype.slashFractionDowntime = $util.newBuffer([]); + + /** + * Creates a new Params instance using the specified properties. + * @function create + * @memberof cosmos.slashing.v1beta1.Params + * @static + * @param {cosmos.slashing.v1beta1.IParams=} [properties] Properties to set + * @returns {cosmos.slashing.v1beta1.Params} Params instance + */ + Params.create = function create(properties) { + return new Params(properties); + }; + + /** + * Encodes the specified Params message. Does not implicitly {@link cosmos.slashing.v1beta1.Params.verify|verify} messages. + * @function encode + * @memberof cosmos.slashing.v1beta1.Params + * @static + * @param {cosmos.slashing.v1beta1.IParams} message Params message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Params.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.signedBlocksWindow != null && Object.hasOwnProperty.call(message, "signedBlocksWindow")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.signedBlocksWindow); + if (message.minSignedPerWindow != null && Object.hasOwnProperty.call(message, "minSignedPerWindow")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.minSignedPerWindow); + if (message.downtimeJailDuration != null && Object.hasOwnProperty.call(message, "downtimeJailDuration")) + $root.google.protobuf.Duration.encode(message.downtimeJailDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.slashFractionDoubleSign != null && Object.hasOwnProperty.call(message, "slashFractionDoubleSign")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.slashFractionDoubleSign); + if (message.slashFractionDowntime != null && Object.hasOwnProperty.call(message, "slashFractionDowntime")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.slashFractionDowntime); + return writer; + }; + + /** + * Encodes the specified Params message, length delimited. Does not implicitly {@link cosmos.slashing.v1beta1.Params.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.slashing.v1beta1.Params + * @static + * @param {cosmos.slashing.v1beta1.IParams} message Params message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Params.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Params message from the specified reader or buffer. + * @function decode + * @memberof cosmos.slashing.v1beta1.Params + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.slashing.v1beta1.Params} Params + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Params.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.slashing.v1beta1.Params(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signedBlocksWindow = reader.int64(); + break; + case 2: + message.minSignedPerWindow = reader.bytes(); + break; + case 3: + message.downtimeJailDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 4: + message.slashFractionDoubleSign = reader.bytes(); + break; + case 5: + message.slashFractionDowntime = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Params message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.slashing.v1beta1.Params + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.slashing.v1beta1.Params} Params + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Params.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Params message. + * @function verify + * @memberof cosmos.slashing.v1beta1.Params + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Params.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.signedBlocksWindow != null && message.hasOwnProperty("signedBlocksWindow")) + if (!$util.isInteger(message.signedBlocksWindow) && !(message.signedBlocksWindow && $util.isInteger(message.signedBlocksWindow.low) && $util.isInteger(message.signedBlocksWindow.high))) + return "signedBlocksWindow: integer|Long expected"; + if (message.minSignedPerWindow != null && message.hasOwnProperty("minSignedPerWindow")) + if (!(message.minSignedPerWindow && typeof message.minSignedPerWindow.length === "number" || $util.isString(message.minSignedPerWindow))) + return "minSignedPerWindow: buffer expected"; + if (message.downtimeJailDuration != null && message.hasOwnProperty("downtimeJailDuration")) { + let error = $root.google.protobuf.Duration.verify(message.downtimeJailDuration); + if (error) + return "downtimeJailDuration." + error; + } + if (message.slashFractionDoubleSign != null && message.hasOwnProperty("slashFractionDoubleSign")) + if (!(message.slashFractionDoubleSign && typeof message.slashFractionDoubleSign.length === "number" || $util.isString(message.slashFractionDoubleSign))) + return "slashFractionDoubleSign: buffer expected"; + if (message.slashFractionDowntime != null && message.hasOwnProperty("slashFractionDowntime")) + if (!(message.slashFractionDowntime && typeof message.slashFractionDowntime.length === "number" || $util.isString(message.slashFractionDowntime))) + return "slashFractionDowntime: buffer expected"; + return null; + }; + + /** + * Creates a Params message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.slashing.v1beta1.Params + * @static + * @param {Object.} object Plain object + * @returns {cosmos.slashing.v1beta1.Params} Params + */ + Params.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.slashing.v1beta1.Params) + return object; + let message = new $root.cosmos.slashing.v1beta1.Params(); + if (object.signedBlocksWindow != null) + if ($util.Long) + (message.signedBlocksWindow = $util.Long.fromValue(object.signedBlocksWindow)).unsigned = false; + else if (typeof object.signedBlocksWindow === "string") + message.signedBlocksWindow = parseInt(object.signedBlocksWindow, 10); + else if (typeof object.signedBlocksWindow === "number") + message.signedBlocksWindow = object.signedBlocksWindow; + else if (typeof object.signedBlocksWindow === "object") + message.signedBlocksWindow = new $util.LongBits(object.signedBlocksWindow.low >>> 0, object.signedBlocksWindow.high >>> 0).toNumber(); + if (object.minSignedPerWindow != null) + if (typeof object.minSignedPerWindow === "string") + $util.base64.decode(object.minSignedPerWindow, message.minSignedPerWindow = $util.newBuffer($util.base64.length(object.minSignedPerWindow)), 0); + else if (object.minSignedPerWindow.length) + message.minSignedPerWindow = object.minSignedPerWindow; + if (object.downtimeJailDuration != null) { + if (typeof object.downtimeJailDuration !== "object") + throw TypeError(".cosmos.slashing.v1beta1.Params.downtimeJailDuration: object expected"); + message.downtimeJailDuration = $root.google.protobuf.Duration.fromObject(object.downtimeJailDuration); + } + if (object.slashFractionDoubleSign != null) + if (typeof object.slashFractionDoubleSign === "string") + $util.base64.decode(object.slashFractionDoubleSign, message.slashFractionDoubleSign = $util.newBuffer($util.base64.length(object.slashFractionDoubleSign)), 0); + else if (object.slashFractionDoubleSign.length) + message.slashFractionDoubleSign = object.slashFractionDoubleSign; + if (object.slashFractionDowntime != null) + if (typeof object.slashFractionDowntime === "string") + $util.base64.decode(object.slashFractionDowntime, message.slashFractionDowntime = $util.newBuffer($util.base64.length(object.slashFractionDowntime)), 0); + else if (object.slashFractionDowntime.length) + message.slashFractionDowntime = object.slashFractionDowntime; + return message; + }; + + /** + * Creates a plain object from a Params message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.slashing.v1beta1.Params + * @static + * @param {cosmos.slashing.v1beta1.Params} message Params + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Params.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.signedBlocksWindow = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.signedBlocksWindow = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.minSignedPerWindow = ""; + else { + object.minSignedPerWindow = []; + if (options.bytes !== Array) + object.minSignedPerWindow = $util.newBuffer(object.minSignedPerWindow); + } + object.downtimeJailDuration = null; + if (options.bytes === String) + object.slashFractionDoubleSign = ""; + else { + object.slashFractionDoubleSign = []; + if (options.bytes !== Array) + object.slashFractionDoubleSign = $util.newBuffer(object.slashFractionDoubleSign); + } + if (options.bytes === String) + object.slashFractionDowntime = ""; + else { + object.slashFractionDowntime = []; + if (options.bytes !== Array) + object.slashFractionDowntime = $util.newBuffer(object.slashFractionDowntime); + } + } + if (message.signedBlocksWindow != null && message.hasOwnProperty("signedBlocksWindow")) + if (typeof message.signedBlocksWindow === "number") + object.signedBlocksWindow = options.longs === String ? String(message.signedBlocksWindow) : message.signedBlocksWindow; + else + object.signedBlocksWindow = options.longs === String ? $util.Long.prototype.toString.call(message.signedBlocksWindow) : options.longs === Number ? new $util.LongBits(message.signedBlocksWindow.low >>> 0, message.signedBlocksWindow.high >>> 0).toNumber() : message.signedBlocksWindow; + if (message.minSignedPerWindow != null && message.hasOwnProperty("minSignedPerWindow")) + object.minSignedPerWindow = options.bytes === String ? $util.base64.encode(message.minSignedPerWindow, 0, message.minSignedPerWindow.length) : options.bytes === Array ? Array.prototype.slice.call(message.minSignedPerWindow) : message.minSignedPerWindow; + if (message.downtimeJailDuration != null && message.hasOwnProperty("downtimeJailDuration")) + object.downtimeJailDuration = $root.google.protobuf.Duration.toObject(message.downtimeJailDuration, options); + if (message.slashFractionDoubleSign != null && message.hasOwnProperty("slashFractionDoubleSign")) + object.slashFractionDoubleSign = options.bytes === String ? $util.base64.encode(message.slashFractionDoubleSign, 0, message.slashFractionDoubleSign.length) : options.bytes === Array ? Array.prototype.slice.call(message.slashFractionDoubleSign) : message.slashFractionDoubleSign; + if (message.slashFractionDowntime != null && message.hasOwnProperty("slashFractionDowntime")) + object.slashFractionDowntime = options.bytes === String ? $util.base64.encode(message.slashFractionDowntime, 0, message.slashFractionDowntime.length) : options.bytes === Array ? Array.prototype.slice.call(message.slashFractionDowntime) : message.slashFractionDowntime; + return object; + }; + + /** + * Converts this Params to JSON. + * @function toJSON + * @memberof cosmos.slashing.v1beta1.Params + * @instance + * @returns {Object.} JSON object + */ + Params.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Params; + })(v1beta1.Params || {}); + + v1beta1.Msg = (function(Msg) { + + /** + * Constructs a new Msg service. + * @memberof cosmos.slashing.v1beta1 + * @classdesc Represents a Msg + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Msg(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; + + /** + * Creates new Msg service using the specified rpc implementation. + * @function create + * @memberof cosmos.slashing.v1beta1.Msg + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Msg} RPC service. Useful where requests and/or responses are streamed. + */ + Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.slashing.v1beta1.Msg#unjail}. + * @memberof cosmos.slashing.v1beta1.Msg + * @typedef UnjailCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.slashing.v1beta1.IMsgUnjailResponse} [response] MsgUnjailResponse + */ + + /** + * Calls Unjail. + * @function unjail + * @memberof cosmos.slashing.v1beta1.Msg + * @instance + * @param {cosmos.slashing.v1beta1.IMsgUnjail} request MsgUnjail message or plain object + * @param {cosmos.slashing.v1beta1.Msg.UnjailCallback} callback Node-style callback called with the error, if any, and MsgUnjailResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.unjail = function unjail(request, callback) { + return this.rpcCall(unjail, $root.cosmos.slashing.v1beta1.MsgUnjail, $root.cosmos.slashing.v1beta1.MsgUnjailResponse, request, callback); + }, "name", { value: "Unjail" }); + + /** + * Calls Unjail. + * @function unjail + * @memberof cosmos.slashing.v1beta1.Msg + * @instance + * @param {cosmos.slashing.v1beta1.IMsgUnjail} request MsgUnjail message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Msg; + })(v1beta1.Msg || {}); + + v1beta1.MsgUnjail = (function(MsgUnjail) { + + /** + * Properties of a MsgUnjail. + * @memberof cosmos.slashing.v1beta1 + * @interface IMsgUnjail + * @property {string|null} [validatorAddr] MsgUnjail validatorAddr + */ + + /** + * Constructs a new MsgUnjail. + * @memberof cosmos.slashing.v1beta1 + * @classdesc Represents a MsgUnjail. + * @implements IMsgUnjail + * @constructor + * @param {cosmos.slashing.v1beta1.IMsgUnjail=} [properties] Properties to set + */ + function MsgUnjail(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgUnjail validatorAddr. + * @member {string} validatorAddr + * @memberof cosmos.slashing.v1beta1.MsgUnjail + * @instance + */ + MsgUnjail.prototype.validatorAddr = ""; + + /** + * Creates a new MsgUnjail instance using the specified properties. + * @function create + * @memberof cosmos.slashing.v1beta1.MsgUnjail + * @static + * @param {cosmos.slashing.v1beta1.IMsgUnjail=} [properties] Properties to set + * @returns {cosmos.slashing.v1beta1.MsgUnjail} MsgUnjail instance + */ + MsgUnjail.create = function create(properties) { + return new MsgUnjail(properties); + }; + + /** + * Encodes the specified MsgUnjail message. Does not implicitly {@link cosmos.slashing.v1beta1.MsgUnjail.verify|verify} messages. + * @function encode + * @memberof cosmos.slashing.v1beta1.MsgUnjail + * @static + * @param {cosmos.slashing.v1beta1.IMsgUnjail} message MsgUnjail message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUnjail.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validatorAddr != null && Object.hasOwnProperty.call(message, "validatorAddr")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.validatorAddr); + return writer; + }; + + /** + * Encodes the specified MsgUnjail message, length delimited. Does not implicitly {@link cosmos.slashing.v1beta1.MsgUnjail.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.slashing.v1beta1.MsgUnjail + * @static + * @param {cosmos.slashing.v1beta1.IMsgUnjail} message MsgUnjail message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUnjail.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgUnjail message from the specified reader or buffer. + * @function decode + * @memberof cosmos.slashing.v1beta1.MsgUnjail + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.slashing.v1beta1.MsgUnjail} MsgUnjail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUnjail.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.slashing.v1beta1.MsgUnjail(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgUnjail message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.slashing.v1beta1.MsgUnjail + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.slashing.v1beta1.MsgUnjail} MsgUnjail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUnjail.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgUnjail message. + * @function verify + * @memberof cosmos.slashing.v1beta1.MsgUnjail + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgUnjail.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validatorAddr != null && message.hasOwnProperty("validatorAddr")) + if (!$util.isString(message.validatorAddr)) + return "validatorAddr: string expected"; + return null; + }; + + /** + * Creates a MsgUnjail message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.slashing.v1beta1.MsgUnjail + * @static + * @param {Object.} object Plain object + * @returns {cosmos.slashing.v1beta1.MsgUnjail} MsgUnjail + */ + MsgUnjail.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.slashing.v1beta1.MsgUnjail) + return object; + let message = new $root.cosmos.slashing.v1beta1.MsgUnjail(); + if (object.validatorAddr != null) + message.validatorAddr = String(object.validatorAddr); + return message; + }; + + /** + * Creates a plain object from a MsgUnjail message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.slashing.v1beta1.MsgUnjail + * @static + * @param {cosmos.slashing.v1beta1.MsgUnjail} message MsgUnjail + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgUnjail.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.validatorAddr = ""; + if (message.validatorAddr != null && message.hasOwnProperty("validatorAddr")) + object.validatorAddr = message.validatorAddr; + return object; + }; + + /** + * Converts this MsgUnjail to JSON. + * @function toJSON + * @memberof cosmos.slashing.v1beta1.MsgUnjail + * @instance + * @returns {Object.} JSON object + */ + MsgUnjail.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgUnjail; + })(v1beta1.MsgUnjail || {}); + + v1beta1.MsgUnjailResponse = (function(MsgUnjailResponse) { + + /** + * Properties of a MsgUnjailResponse. + * @memberof cosmos.slashing.v1beta1 + * @interface IMsgUnjailResponse + */ + + /** + * Constructs a new MsgUnjailResponse. + * @memberof cosmos.slashing.v1beta1 + * @classdesc Represents a MsgUnjailResponse. + * @implements IMsgUnjailResponse + * @constructor + * @param {cosmos.slashing.v1beta1.IMsgUnjailResponse=} [properties] Properties to set + */ + function MsgUnjailResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgUnjailResponse instance using the specified properties. + * @function create + * @memberof cosmos.slashing.v1beta1.MsgUnjailResponse + * @static + * @param {cosmos.slashing.v1beta1.IMsgUnjailResponse=} [properties] Properties to set + * @returns {cosmos.slashing.v1beta1.MsgUnjailResponse} MsgUnjailResponse instance + */ + MsgUnjailResponse.create = function create(properties) { + return new MsgUnjailResponse(properties); + }; + + /** + * Encodes the specified MsgUnjailResponse message. Does not implicitly {@link cosmos.slashing.v1beta1.MsgUnjailResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.slashing.v1beta1.MsgUnjailResponse + * @static + * @param {cosmos.slashing.v1beta1.IMsgUnjailResponse} message MsgUnjailResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUnjailResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgUnjailResponse message, length delimited. Does not implicitly {@link cosmos.slashing.v1beta1.MsgUnjailResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.slashing.v1beta1.MsgUnjailResponse + * @static + * @param {cosmos.slashing.v1beta1.IMsgUnjailResponse} message MsgUnjailResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUnjailResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgUnjailResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.slashing.v1beta1.MsgUnjailResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.slashing.v1beta1.MsgUnjailResponse} MsgUnjailResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUnjailResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.slashing.v1beta1.MsgUnjailResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgUnjailResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.slashing.v1beta1.MsgUnjailResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.slashing.v1beta1.MsgUnjailResponse} MsgUnjailResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUnjailResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgUnjailResponse message. + * @function verify + * @memberof cosmos.slashing.v1beta1.MsgUnjailResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgUnjailResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgUnjailResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.slashing.v1beta1.MsgUnjailResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.slashing.v1beta1.MsgUnjailResponse} MsgUnjailResponse + */ + MsgUnjailResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.slashing.v1beta1.MsgUnjailResponse) + return object; + return new $root.cosmos.slashing.v1beta1.MsgUnjailResponse(); + }; + + /** + * Creates a plain object from a MsgUnjailResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.slashing.v1beta1.MsgUnjailResponse + * @static + * @param {cosmos.slashing.v1beta1.MsgUnjailResponse} message MsgUnjailResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgUnjailResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgUnjailResponse to JSON. + * @function toJSON + * @memberof cosmos.slashing.v1beta1.MsgUnjailResponse + * @instance + * @returns {Object.} JSON object + */ + MsgUnjailResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgUnjailResponse; + })(v1beta1.MsgUnjailResponse || {}); + + return v1beta1; + })(slashing.v1beta1 || {}); + + return slashing; + })(cosmos.slashing || {}); + + /** + * Namespace staking. + * @memberof cosmos + * @namespace + */ + + cosmos.staking = (function(staking) { + + /** + * Namespace v1beta1. + * @memberof cosmos.staking + * @namespace + */ + + staking.v1beta1 = (function(v1beta1) { + + v1beta1.GenesisState = (function(GenesisState) { + + /** + * Properties of a GenesisState. + * @memberof cosmos.staking.v1beta1 + * @interface IGenesisState + * @property {cosmos.staking.v1beta1.IParams|null} [params] GenesisState params + * @property {Uint8Array|null} [lastTotalPower] GenesisState lastTotalPower + * @property {Array.|null} [lastValidatorPowers] GenesisState lastValidatorPowers + * @property {Array.|null} [validators] GenesisState validators + * @property {Array.|null} [delegations] GenesisState delegations + * @property {Array.|null} [unbondingDelegations] GenesisState unbondingDelegations + * @property {Array.|null} [redelegations] GenesisState redelegations + * @property {boolean|null} [exported] GenesisState exported + */ + + /** + * Constructs a new GenesisState. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a GenesisState. + * @implements IGenesisState + * @constructor + * @param {cosmos.staking.v1beta1.IGenesisState=} [properties] Properties to set + */ + function GenesisState(properties) { + this.lastValidatorPowers = []; + this.validators = []; + this.delegations = []; + this.unbondingDelegations = []; + this.redelegations = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenesisState params. + * @member {cosmos.staking.v1beta1.IParams|null|undefined} params + * @memberof cosmos.staking.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.params = null; + + /** + * GenesisState lastTotalPower. + * @member {Uint8Array} lastTotalPower + * @memberof cosmos.staking.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.lastTotalPower = $util.newBuffer([]); + + /** + * GenesisState lastValidatorPowers. + * @member {Array.} lastValidatorPowers + * @memberof cosmos.staking.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.lastValidatorPowers = $util.emptyArray; + + /** + * GenesisState validators. + * @member {Array.} validators + * @memberof cosmos.staking.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.validators = $util.emptyArray; + + /** + * GenesisState delegations. + * @member {Array.} delegations + * @memberof cosmos.staking.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.delegations = $util.emptyArray; + + /** + * GenesisState unbondingDelegations. + * @member {Array.} unbondingDelegations + * @memberof cosmos.staking.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.unbondingDelegations = $util.emptyArray; + + /** + * GenesisState redelegations. + * @member {Array.} redelegations + * @memberof cosmos.staking.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.redelegations = $util.emptyArray; + + /** + * GenesisState exported. + * @member {boolean} exported + * @memberof cosmos.staking.v1beta1.GenesisState + * @instance + */ + GenesisState.prototype.exported = false; + + /** + * Creates a new GenesisState instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.GenesisState + * @static + * @param {cosmos.staking.v1beta1.IGenesisState=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.GenesisState} GenesisState instance + */ + GenesisState.create = function create(properties) { + return new GenesisState(properties); + }; + + /** + * Encodes the specified GenesisState message. Does not implicitly {@link cosmos.staking.v1beta1.GenesisState.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.GenesisState + * @static + * @param {cosmos.staking.v1beta1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.cosmos.staking.v1beta1.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.lastTotalPower != null && Object.hasOwnProperty.call(message, "lastTotalPower")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.lastTotalPower); + if (message.lastValidatorPowers != null && message.lastValidatorPowers.length) + for (let i = 0; i < message.lastValidatorPowers.length; ++i) + $root.cosmos.staking.v1beta1.LastValidatorPower.encode(message.lastValidatorPowers[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.validators != null && message.validators.length) + for (let i = 0; i < message.validators.length; ++i) + $root.cosmos.staking.v1beta1.Validator.encode(message.validators[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.delegations != null && message.delegations.length) + for (let i = 0; i < message.delegations.length; ++i) + $root.cosmos.staking.v1beta1.Delegation.encode(message.delegations[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.unbondingDelegations != null && message.unbondingDelegations.length) + for (let i = 0; i < message.unbondingDelegations.length; ++i) + $root.cosmos.staking.v1beta1.UnbondingDelegation.encode(message.unbondingDelegations[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.redelegations != null && message.redelegations.length) + for (let i = 0; i < message.redelegations.length; ++i) + $root.cosmos.staking.v1beta1.Redelegation.encode(message.redelegations[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.exported != null && Object.hasOwnProperty.call(message, "exported")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.exported); + return writer; + }; + + /** + * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.GenesisState.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.GenesisState + * @static + * @param {cosmos.staking.v1beta1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.GenesisState(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = $root.cosmos.staking.v1beta1.Params.decode(reader, reader.uint32()); + break; + case 2: + message.lastTotalPower = reader.bytes(); + break; + case 3: + if (!(message.lastValidatorPowers && message.lastValidatorPowers.length)) + message.lastValidatorPowers = []; + message.lastValidatorPowers.push($root.cosmos.staking.v1beta1.LastValidatorPower.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.validators && message.validators.length)) + message.validators = []; + message.validators.push($root.cosmos.staking.v1beta1.Validator.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.delegations && message.delegations.length)) + message.delegations = []; + message.delegations.push($root.cosmos.staking.v1beta1.Delegation.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.unbondingDelegations && message.unbondingDelegations.length)) + message.unbondingDelegations = []; + message.unbondingDelegations.push($root.cosmos.staking.v1beta1.UnbondingDelegation.decode(reader, reader.uint32())); + break; + case 7: + if (!(message.redelegations && message.redelegations.length)) + message.redelegations = []; + message.redelegations.push($root.cosmos.staking.v1beta1.Redelegation.decode(reader, reader.uint32())); + break; + case 8: + message.exported = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenesisState message. + * @function verify + * @memberof cosmos.staking.v1beta1.GenesisState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenesisState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.params != null && message.hasOwnProperty("params")) { + let error = $root.cosmos.staking.v1beta1.Params.verify(message.params); + if (error) + return "params." + error; + } + if (message.lastTotalPower != null && message.hasOwnProperty("lastTotalPower")) + if (!(message.lastTotalPower && typeof message.lastTotalPower.length === "number" || $util.isString(message.lastTotalPower))) + return "lastTotalPower: buffer expected"; + if (message.lastValidatorPowers != null && message.hasOwnProperty("lastValidatorPowers")) { + if (!Array.isArray(message.lastValidatorPowers)) + return "lastValidatorPowers: array expected"; + for (let i = 0; i < message.lastValidatorPowers.length; ++i) { + let error = $root.cosmos.staking.v1beta1.LastValidatorPower.verify(message.lastValidatorPowers[i]); + if (error) + return "lastValidatorPowers." + error; + } + } + if (message.validators != null && message.hasOwnProperty("validators")) { + if (!Array.isArray(message.validators)) + return "validators: array expected"; + for (let i = 0; i < message.validators.length; ++i) { + let error = $root.cosmos.staking.v1beta1.Validator.verify(message.validators[i]); + if (error) + return "validators." + error; + } + } + if (message.delegations != null && message.hasOwnProperty("delegations")) { + if (!Array.isArray(message.delegations)) + return "delegations: array expected"; + for (let i = 0; i < message.delegations.length; ++i) { + let error = $root.cosmos.staking.v1beta1.Delegation.verify(message.delegations[i]); + if (error) + return "delegations." + error; + } + } + if (message.unbondingDelegations != null && message.hasOwnProperty("unbondingDelegations")) { + if (!Array.isArray(message.unbondingDelegations)) + return "unbondingDelegations: array expected"; + for (let i = 0; i < message.unbondingDelegations.length; ++i) { + let error = $root.cosmos.staking.v1beta1.UnbondingDelegation.verify(message.unbondingDelegations[i]); + if (error) + return "unbondingDelegations." + error; + } + } + if (message.redelegations != null && message.hasOwnProperty("redelegations")) { + if (!Array.isArray(message.redelegations)) + return "redelegations: array expected"; + for (let i = 0; i < message.redelegations.length; ++i) { + let error = $root.cosmos.staking.v1beta1.Redelegation.verify(message.redelegations[i]); + if (error) + return "redelegations." + error; + } + } + if (message.exported != null && message.hasOwnProperty("exported")) + if (typeof message.exported !== "boolean") + return "exported: boolean expected"; + return null; + }; + + /** + * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.GenesisState + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.GenesisState} GenesisState + */ + GenesisState.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.GenesisState) + return object; + let message = new $root.cosmos.staking.v1beta1.GenesisState(); + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".cosmos.staking.v1beta1.GenesisState.params: object expected"); + message.params = $root.cosmos.staking.v1beta1.Params.fromObject(object.params); + } + if (object.lastTotalPower != null) + if (typeof object.lastTotalPower === "string") + $util.base64.decode(object.lastTotalPower, message.lastTotalPower = $util.newBuffer($util.base64.length(object.lastTotalPower)), 0); + else if (object.lastTotalPower.length) + message.lastTotalPower = object.lastTotalPower; + if (object.lastValidatorPowers) { + if (!Array.isArray(object.lastValidatorPowers)) + throw TypeError(".cosmos.staking.v1beta1.GenesisState.lastValidatorPowers: array expected"); + message.lastValidatorPowers = []; + for (let i = 0; i < object.lastValidatorPowers.length; ++i) { + if (typeof object.lastValidatorPowers[i] !== "object") + throw TypeError(".cosmos.staking.v1beta1.GenesisState.lastValidatorPowers: object expected"); + message.lastValidatorPowers[i] = $root.cosmos.staking.v1beta1.LastValidatorPower.fromObject(object.lastValidatorPowers[i]); + } + } + if (object.validators) { + if (!Array.isArray(object.validators)) + throw TypeError(".cosmos.staking.v1beta1.GenesisState.validators: array expected"); + message.validators = []; + for (let i = 0; i < object.validators.length; ++i) { + if (typeof object.validators[i] !== "object") + throw TypeError(".cosmos.staking.v1beta1.GenesisState.validators: object expected"); + message.validators[i] = $root.cosmos.staking.v1beta1.Validator.fromObject(object.validators[i]); + } + } + if (object.delegations) { + if (!Array.isArray(object.delegations)) + throw TypeError(".cosmos.staking.v1beta1.GenesisState.delegations: array expected"); + message.delegations = []; + for (let i = 0; i < object.delegations.length; ++i) { + if (typeof object.delegations[i] !== "object") + throw TypeError(".cosmos.staking.v1beta1.GenesisState.delegations: object expected"); + message.delegations[i] = $root.cosmos.staking.v1beta1.Delegation.fromObject(object.delegations[i]); + } + } + if (object.unbondingDelegations) { + if (!Array.isArray(object.unbondingDelegations)) + throw TypeError(".cosmos.staking.v1beta1.GenesisState.unbondingDelegations: array expected"); + message.unbondingDelegations = []; + for (let i = 0; i < object.unbondingDelegations.length; ++i) { + if (typeof object.unbondingDelegations[i] !== "object") + throw TypeError(".cosmos.staking.v1beta1.GenesisState.unbondingDelegations: object expected"); + message.unbondingDelegations[i] = $root.cosmos.staking.v1beta1.UnbondingDelegation.fromObject(object.unbondingDelegations[i]); + } + } + if (object.redelegations) { + if (!Array.isArray(object.redelegations)) + throw TypeError(".cosmos.staking.v1beta1.GenesisState.redelegations: array expected"); + message.redelegations = []; + for (let i = 0; i < object.redelegations.length; ++i) { + if (typeof object.redelegations[i] !== "object") + throw TypeError(".cosmos.staking.v1beta1.GenesisState.redelegations: object expected"); + message.redelegations[i] = $root.cosmos.staking.v1beta1.Redelegation.fromObject(object.redelegations[i]); + } + } + if (object.exported != null) + message.exported = Boolean(object.exported); + return message; + }; + + /** + * Creates a plain object from a GenesisState message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.GenesisState + * @static + * @param {cosmos.staking.v1beta1.GenesisState} message GenesisState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenesisState.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) { + object.lastValidatorPowers = []; + object.validators = []; + object.delegations = []; + object.unbondingDelegations = []; + object.redelegations = []; + } + if (options.defaults) { + object.params = null; + if (options.bytes === String) + object.lastTotalPower = ""; + else { + object.lastTotalPower = []; + if (options.bytes !== Array) + object.lastTotalPower = $util.newBuffer(object.lastTotalPower); + } + object.exported = false; + } + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.cosmos.staking.v1beta1.Params.toObject(message.params, options); + if (message.lastTotalPower != null && message.hasOwnProperty("lastTotalPower")) + object.lastTotalPower = options.bytes === String ? $util.base64.encode(message.lastTotalPower, 0, message.lastTotalPower.length) : options.bytes === Array ? Array.prototype.slice.call(message.lastTotalPower) : message.lastTotalPower; + if (message.lastValidatorPowers && message.lastValidatorPowers.length) { + object.lastValidatorPowers = []; + for (let j = 0; j < message.lastValidatorPowers.length; ++j) + object.lastValidatorPowers[j] = $root.cosmos.staking.v1beta1.LastValidatorPower.toObject(message.lastValidatorPowers[j], options); + } + if (message.validators && message.validators.length) { + object.validators = []; + for (let j = 0; j < message.validators.length; ++j) + object.validators[j] = $root.cosmos.staking.v1beta1.Validator.toObject(message.validators[j], options); + } + if (message.delegations && message.delegations.length) { + object.delegations = []; + for (let j = 0; j < message.delegations.length; ++j) + object.delegations[j] = $root.cosmos.staking.v1beta1.Delegation.toObject(message.delegations[j], options); + } + if (message.unbondingDelegations && message.unbondingDelegations.length) { + object.unbondingDelegations = []; + for (let j = 0; j < message.unbondingDelegations.length; ++j) + object.unbondingDelegations[j] = $root.cosmos.staking.v1beta1.UnbondingDelegation.toObject(message.unbondingDelegations[j], options); + } + if (message.redelegations && message.redelegations.length) { + object.redelegations = []; + for (let j = 0; j < message.redelegations.length; ++j) + object.redelegations[j] = $root.cosmos.staking.v1beta1.Redelegation.toObject(message.redelegations[j], options); + } + if (message.exported != null && message.hasOwnProperty("exported")) + object.exported = message.exported; + return object; + }; + + /** + * Converts this GenesisState to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.GenesisState + * @instance + * @returns {Object.} JSON object + */ + GenesisState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GenesisState; + })(v1beta1.GenesisState || {}); + + v1beta1.LastValidatorPower = (function(LastValidatorPower) { + + /** + * Properties of a LastValidatorPower. + * @memberof cosmos.staking.v1beta1 + * @interface ILastValidatorPower + * @property {string|null} [address] LastValidatorPower address + * @property {number|Long|null} [power] LastValidatorPower power + */ + + /** + * Constructs a new LastValidatorPower. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a LastValidatorPower. + * @implements ILastValidatorPower + * @constructor + * @param {cosmos.staking.v1beta1.ILastValidatorPower=} [properties] Properties to set + */ + function LastValidatorPower(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LastValidatorPower address. + * @member {string} address + * @memberof cosmos.staking.v1beta1.LastValidatorPower + * @instance + */ + LastValidatorPower.prototype.address = ""; + + /** + * LastValidatorPower power. + * @member {number|Long} power + * @memberof cosmos.staking.v1beta1.LastValidatorPower + * @instance + */ + LastValidatorPower.prototype.power = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new LastValidatorPower instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.LastValidatorPower + * @static + * @param {cosmos.staking.v1beta1.ILastValidatorPower=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.LastValidatorPower} LastValidatorPower instance + */ + LastValidatorPower.create = function create(properties) { + return new LastValidatorPower(properties); + }; + + /** + * Encodes the specified LastValidatorPower message. Does not implicitly {@link cosmos.staking.v1beta1.LastValidatorPower.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.LastValidatorPower + * @static + * @param {cosmos.staking.v1beta1.ILastValidatorPower} message LastValidatorPower message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LastValidatorPower.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.address); + if (message.power != null && Object.hasOwnProperty.call(message, "power")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.power); + return writer; + }; + + /** + * Encodes the specified LastValidatorPower message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.LastValidatorPower.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.LastValidatorPower + * @static + * @param {cosmos.staking.v1beta1.ILastValidatorPower} message LastValidatorPower message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LastValidatorPower.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LastValidatorPower message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.LastValidatorPower + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.LastValidatorPower} LastValidatorPower + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LastValidatorPower.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.LastValidatorPower(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.power = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LastValidatorPower message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.LastValidatorPower + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.LastValidatorPower} LastValidatorPower + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LastValidatorPower.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LastValidatorPower message. + * @function verify + * @memberof cosmos.staking.v1beta1.LastValidatorPower + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LastValidatorPower.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.power != null && message.hasOwnProperty("power")) + if (!$util.isInteger(message.power) && !(message.power && $util.isInteger(message.power.low) && $util.isInteger(message.power.high))) + return "power: integer|Long expected"; + return null; + }; + + /** + * Creates a LastValidatorPower message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.LastValidatorPower + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.LastValidatorPower} LastValidatorPower + */ + LastValidatorPower.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.LastValidatorPower) + return object; + let message = new $root.cosmos.staking.v1beta1.LastValidatorPower(); + if (object.address != null) + message.address = String(object.address); + if (object.power != null) + if ($util.Long) + (message.power = $util.Long.fromValue(object.power)).unsigned = false; + else if (typeof object.power === "string") + message.power = parseInt(object.power, 10); + else if (typeof object.power === "number") + message.power = object.power; + else if (typeof object.power === "object") + message.power = new $util.LongBits(object.power.low >>> 0, object.power.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a LastValidatorPower message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.LastValidatorPower + * @static + * @param {cosmos.staking.v1beta1.LastValidatorPower} message LastValidatorPower + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LastValidatorPower.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.address = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.power = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.power = options.longs === String ? "0" : 0; + } + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + if (message.power != null && message.hasOwnProperty("power")) + if (typeof message.power === "number") + object.power = options.longs === String ? String(message.power) : message.power; + else + object.power = options.longs === String ? $util.Long.prototype.toString.call(message.power) : options.longs === Number ? new $util.LongBits(message.power.low >>> 0, message.power.high >>> 0).toNumber() : message.power; + return object; + }; + + /** + * Converts this LastValidatorPower to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.LastValidatorPower + * @instance + * @returns {Object.} JSON object + */ + LastValidatorPower.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LastValidatorPower; + })(v1beta1.LastValidatorPower || {}); + + v1beta1.Query = (function(Query) { + + /** + * Constructs a new Query service. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a Query + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Query(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; + + /** + * Creates new Query service using the specified rpc implementation. + * @function create + * @memberof cosmos.staking.v1beta1.Query + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Query} RPC service. Useful where requests and/or responses are streamed. + */ + Query.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.staking.v1beta1.Query#validators}. + * @memberof cosmos.staking.v1beta1.Query + * @typedef ValidatorsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.staking.v1beta1.IQueryValidatorsResponse} [response] QueryValidatorsResponse + */ + + /** + * Calls Validators. + * @function validators + * @memberof cosmos.staking.v1beta1.Query + * @instance + * @param {cosmos.staking.v1beta1.IQueryValidatorsRequest} request QueryValidatorsRequest message or plain object + * @param {cosmos.staking.v1beta1.Query.ValidatorsCallback} callback Node-style callback called with the error, if any, and QueryValidatorsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.validators = function validators(request, callback) { + return this.rpcCall(validators, $root.cosmos.staking.v1beta1.QueryValidatorsRequest, $root.cosmos.staking.v1beta1.QueryValidatorsResponse, request, callback); + }, "name", { value: "Validators" }); + + /** + * Calls Validators. + * @function validators + * @memberof cosmos.staking.v1beta1.Query + * @instance + * @param {cosmos.staking.v1beta1.IQueryValidatorsRequest} request QueryValidatorsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.staking.v1beta1.Query#validator}. + * @memberof cosmos.staking.v1beta1.Query + * @typedef ValidatorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.staking.v1beta1.IQueryValidatorResponse} [response] QueryValidatorResponse + */ + + /** + * Calls Validator. + * @function validator + * @memberof cosmos.staking.v1beta1.Query + * @instance + * @param {cosmos.staking.v1beta1.IQueryValidatorRequest} request QueryValidatorRequest message or plain object + * @param {cosmos.staking.v1beta1.Query.ValidatorCallback} callback Node-style callback called with the error, if any, and QueryValidatorResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.validator = function validator(request, callback) { + return this.rpcCall(validator, $root.cosmos.staking.v1beta1.QueryValidatorRequest, $root.cosmos.staking.v1beta1.QueryValidatorResponse, request, callback); + }, "name", { value: "Validator" }); + + /** + * Calls Validator. + * @function validator + * @memberof cosmos.staking.v1beta1.Query + * @instance + * @param {cosmos.staking.v1beta1.IQueryValidatorRequest} request QueryValidatorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.staking.v1beta1.Query#validatorDelegations}. + * @memberof cosmos.staking.v1beta1.Query + * @typedef ValidatorDelegationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.staking.v1beta1.IQueryValidatorDelegationsResponse} [response] QueryValidatorDelegationsResponse + */ + + /** + * Calls ValidatorDelegations. + * @function validatorDelegations + * @memberof cosmos.staking.v1beta1.Query + * @instance + * @param {cosmos.staking.v1beta1.IQueryValidatorDelegationsRequest} request QueryValidatorDelegationsRequest message or plain object + * @param {cosmos.staking.v1beta1.Query.ValidatorDelegationsCallback} callback Node-style callback called with the error, if any, and QueryValidatorDelegationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.validatorDelegations = function validatorDelegations(request, callback) { + return this.rpcCall(validatorDelegations, $root.cosmos.staking.v1beta1.QueryValidatorDelegationsRequest, $root.cosmos.staking.v1beta1.QueryValidatorDelegationsResponse, request, callback); + }, "name", { value: "ValidatorDelegations" }); + + /** + * Calls ValidatorDelegations. + * @function validatorDelegations + * @memberof cosmos.staking.v1beta1.Query + * @instance + * @param {cosmos.staking.v1beta1.IQueryValidatorDelegationsRequest} request QueryValidatorDelegationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.staking.v1beta1.Query#validatorUnbondingDelegations}. + * @memberof cosmos.staking.v1beta1.Query + * @typedef ValidatorUnbondingDelegationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.staking.v1beta1.IQueryValidatorUnbondingDelegationsResponse} [response] QueryValidatorUnbondingDelegationsResponse + */ + + /** + * Calls ValidatorUnbondingDelegations. + * @function validatorUnbondingDelegations + * @memberof cosmos.staking.v1beta1.Query + * @instance + * @param {cosmos.staking.v1beta1.IQueryValidatorUnbondingDelegationsRequest} request QueryValidatorUnbondingDelegationsRequest message or plain object + * @param {cosmos.staking.v1beta1.Query.ValidatorUnbondingDelegationsCallback} callback Node-style callback called with the error, if any, and QueryValidatorUnbondingDelegationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.validatorUnbondingDelegations = function validatorUnbondingDelegations(request, callback) { + return this.rpcCall(validatorUnbondingDelegations, $root.cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest, $root.cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse, request, callback); + }, "name", { value: "ValidatorUnbondingDelegations" }); + + /** + * Calls ValidatorUnbondingDelegations. + * @function validatorUnbondingDelegations + * @memberof cosmos.staking.v1beta1.Query + * @instance + * @param {cosmos.staking.v1beta1.IQueryValidatorUnbondingDelegationsRequest} request QueryValidatorUnbondingDelegationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.staking.v1beta1.Query#delegation}. + * @memberof cosmos.staking.v1beta1.Query + * @typedef DelegationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.staking.v1beta1.IQueryDelegationResponse} [response] QueryDelegationResponse + */ + + /** + * Calls Delegation. + * @function delegation + * @memberof cosmos.staking.v1beta1.Query + * @instance + * @param {cosmos.staking.v1beta1.IQueryDelegationRequest} request QueryDelegationRequest message or plain object + * @param {cosmos.staking.v1beta1.Query.DelegationCallback} callback Node-style callback called with the error, if any, and QueryDelegationResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.delegation = function delegation(request, callback) { + return this.rpcCall(delegation, $root.cosmos.staking.v1beta1.QueryDelegationRequest, $root.cosmos.staking.v1beta1.QueryDelegationResponse, request, callback); + }, "name", { value: "Delegation" }); + + /** + * Calls Delegation. + * @function delegation + * @memberof cosmos.staking.v1beta1.Query + * @instance + * @param {cosmos.staking.v1beta1.IQueryDelegationRequest} request QueryDelegationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.staking.v1beta1.Query#unbondingDelegation}. + * @memberof cosmos.staking.v1beta1.Query + * @typedef UnbondingDelegationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.staking.v1beta1.IQueryUnbondingDelegationResponse} [response] QueryUnbondingDelegationResponse + */ + + /** + * Calls UnbondingDelegation. + * @function unbondingDelegation + * @memberof cosmos.staking.v1beta1.Query + * @instance + * @param {cosmos.staking.v1beta1.IQueryUnbondingDelegationRequest} request QueryUnbondingDelegationRequest message or plain object + * @param {cosmos.staking.v1beta1.Query.UnbondingDelegationCallback} callback Node-style callback called with the error, if any, and QueryUnbondingDelegationResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.unbondingDelegation = function unbondingDelegation(request, callback) { + return this.rpcCall(unbondingDelegation, $root.cosmos.staking.v1beta1.QueryUnbondingDelegationRequest, $root.cosmos.staking.v1beta1.QueryUnbondingDelegationResponse, request, callback); + }, "name", { value: "UnbondingDelegation" }); + + /** + * Calls UnbondingDelegation. + * @function unbondingDelegation + * @memberof cosmos.staking.v1beta1.Query + * @instance + * @param {cosmos.staking.v1beta1.IQueryUnbondingDelegationRequest} request QueryUnbondingDelegationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.staking.v1beta1.Query#delegatorDelegations}. + * @memberof cosmos.staking.v1beta1.Query + * @typedef DelegatorDelegationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.staking.v1beta1.IQueryDelegatorDelegationsResponse} [response] QueryDelegatorDelegationsResponse + */ + + /** + * Calls DelegatorDelegations. + * @function delegatorDelegations + * @memberof cosmos.staking.v1beta1.Query + * @instance + * @param {cosmos.staking.v1beta1.IQueryDelegatorDelegationsRequest} request QueryDelegatorDelegationsRequest message or plain object + * @param {cosmos.staking.v1beta1.Query.DelegatorDelegationsCallback} callback Node-style callback called with the error, if any, and QueryDelegatorDelegationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.delegatorDelegations = function delegatorDelegations(request, callback) { + return this.rpcCall(delegatorDelegations, $root.cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest, $root.cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse, request, callback); + }, "name", { value: "DelegatorDelegations" }); + + /** + * Calls DelegatorDelegations. + * @function delegatorDelegations + * @memberof cosmos.staking.v1beta1.Query + * @instance + * @param {cosmos.staking.v1beta1.IQueryDelegatorDelegationsRequest} request QueryDelegatorDelegationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.staking.v1beta1.Query#delegatorUnbondingDelegations}. + * @memberof cosmos.staking.v1beta1.Query + * @typedef DelegatorUnbondingDelegationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.staking.v1beta1.IQueryDelegatorUnbondingDelegationsResponse} [response] QueryDelegatorUnbondingDelegationsResponse + */ + + /** + * Calls DelegatorUnbondingDelegations. + * @function delegatorUnbondingDelegations + * @memberof cosmos.staking.v1beta1.Query + * @instance + * @param {cosmos.staking.v1beta1.IQueryDelegatorUnbondingDelegationsRequest} request QueryDelegatorUnbondingDelegationsRequest message or plain object + * @param {cosmos.staking.v1beta1.Query.DelegatorUnbondingDelegationsCallback} callback Node-style callback called with the error, if any, and QueryDelegatorUnbondingDelegationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.delegatorUnbondingDelegations = function delegatorUnbondingDelegations(request, callback) { + return this.rpcCall(delegatorUnbondingDelegations, $root.cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest, $root.cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse, request, callback); + }, "name", { value: "DelegatorUnbondingDelegations" }); + + /** + * Calls DelegatorUnbondingDelegations. + * @function delegatorUnbondingDelegations + * @memberof cosmos.staking.v1beta1.Query + * @instance + * @param {cosmos.staking.v1beta1.IQueryDelegatorUnbondingDelegationsRequest} request QueryDelegatorUnbondingDelegationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.staking.v1beta1.Query#redelegations}. + * @memberof cosmos.staking.v1beta1.Query + * @typedef RedelegationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.staking.v1beta1.IQueryRedelegationsResponse} [response] QueryRedelegationsResponse + */ + + /** + * Calls Redelegations. + * @function redelegations + * @memberof cosmos.staking.v1beta1.Query + * @instance + * @param {cosmos.staking.v1beta1.IQueryRedelegationsRequest} request QueryRedelegationsRequest message or plain object + * @param {cosmos.staking.v1beta1.Query.RedelegationsCallback} callback Node-style callback called with the error, if any, and QueryRedelegationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.redelegations = function redelegations(request, callback) { + return this.rpcCall(redelegations, $root.cosmos.staking.v1beta1.QueryRedelegationsRequest, $root.cosmos.staking.v1beta1.QueryRedelegationsResponse, request, callback); + }, "name", { value: "Redelegations" }); + + /** + * Calls Redelegations. + * @function redelegations + * @memberof cosmos.staking.v1beta1.Query + * @instance + * @param {cosmos.staking.v1beta1.IQueryRedelegationsRequest} request QueryRedelegationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.staking.v1beta1.Query#delegatorValidators}. + * @memberof cosmos.staking.v1beta1.Query + * @typedef DelegatorValidatorsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.staking.v1beta1.IQueryDelegatorValidatorsResponse} [response] QueryDelegatorValidatorsResponse + */ + + /** + * Calls DelegatorValidators. + * @function delegatorValidators + * @memberof cosmos.staking.v1beta1.Query + * @instance + * @param {cosmos.staking.v1beta1.IQueryDelegatorValidatorsRequest} request QueryDelegatorValidatorsRequest message or plain object + * @param {cosmos.staking.v1beta1.Query.DelegatorValidatorsCallback} callback Node-style callback called with the error, if any, and QueryDelegatorValidatorsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.delegatorValidators = function delegatorValidators(request, callback) { + return this.rpcCall(delegatorValidators, $root.cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest, $root.cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse, request, callback); + }, "name", { value: "DelegatorValidators" }); + + /** + * Calls DelegatorValidators. + * @function delegatorValidators + * @memberof cosmos.staking.v1beta1.Query + * @instance + * @param {cosmos.staking.v1beta1.IQueryDelegatorValidatorsRequest} request QueryDelegatorValidatorsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.staking.v1beta1.Query#delegatorValidator}. + * @memberof cosmos.staking.v1beta1.Query + * @typedef DelegatorValidatorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.staking.v1beta1.IQueryDelegatorValidatorResponse} [response] QueryDelegatorValidatorResponse + */ + + /** + * Calls DelegatorValidator. + * @function delegatorValidator + * @memberof cosmos.staking.v1beta1.Query + * @instance + * @param {cosmos.staking.v1beta1.IQueryDelegatorValidatorRequest} request QueryDelegatorValidatorRequest message or plain object + * @param {cosmos.staking.v1beta1.Query.DelegatorValidatorCallback} callback Node-style callback called with the error, if any, and QueryDelegatorValidatorResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.delegatorValidator = function delegatorValidator(request, callback) { + return this.rpcCall(delegatorValidator, $root.cosmos.staking.v1beta1.QueryDelegatorValidatorRequest, $root.cosmos.staking.v1beta1.QueryDelegatorValidatorResponse, request, callback); + }, "name", { value: "DelegatorValidator" }); + + /** + * Calls DelegatorValidator. + * @function delegatorValidator + * @memberof cosmos.staking.v1beta1.Query + * @instance + * @param {cosmos.staking.v1beta1.IQueryDelegatorValidatorRequest} request QueryDelegatorValidatorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.staking.v1beta1.Query#historicalInfo}. + * @memberof cosmos.staking.v1beta1.Query + * @typedef HistoricalInfoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.staking.v1beta1.IQueryHistoricalInfoResponse} [response] QueryHistoricalInfoResponse + */ + + /** + * Calls HistoricalInfo. + * @function historicalInfo + * @memberof cosmos.staking.v1beta1.Query + * @instance + * @param {cosmos.staking.v1beta1.IQueryHistoricalInfoRequest} request QueryHistoricalInfoRequest message or plain object + * @param {cosmos.staking.v1beta1.Query.HistoricalInfoCallback} callback Node-style callback called with the error, if any, and QueryHistoricalInfoResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.historicalInfo = function historicalInfo(request, callback) { + return this.rpcCall(historicalInfo, $root.cosmos.staking.v1beta1.QueryHistoricalInfoRequest, $root.cosmos.staking.v1beta1.QueryHistoricalInfoResponse, request, callback); + }, "name", { value: "HistoricalInfo" }); + + /** + * Calls HistoricalInfo. + * @function historicalInfo + * @memberof cosmos.staking.v1beta1.Query + * @instance + * @param {cosmos.staking.v1beta1.IQueryHistoricalInfoRequest} request QueryHistoricalInfoRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.staking.v1beta1.Query#pool}. + * @memberof cosmos.staking.v1beta1.Query + * @typedef PoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.staking.v1beta1.IQueryPoolResponse} [response] QueryPoolResponse + */ + + /** + * Calls Pool. + * @function pool + * @memberof cosmos.staking.v1beta1.Query + * @instance + * @param {cosmos.staking.v1beta1.IQueryPoolRequest} request QueryPoolRequest message or plain object + * @param {cosmos.staking.v1beta1.Query.PoolCallback} callback Node-style callback called with the error, if any, and QueryPoolResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.pool = function pool(request, callback) { + return this.rpcCall(pool, $root.cosmos.staking.v1beta1.QueryPoolRequest, $root.cosmos.staking.v1beta1.QueryPoolResponse, request, callback); + }, "name", { value: "Pool" }); + + /** + * Calls Pool. + * @function pool + * @memberof cosmos.staking.v1beta1.Query + * @instance + * @param {cosmos.staking.v1beta1.IQueryPoolRequest} request QueryPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.staking.v1beta1.Query#params}. + * @memberof cosmos.staking.v1beta1.Query + * @typedef ParamsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.staking.v1beta1.IQueryParamsResponse} [response] QueryParamsResponse + */ + + /** + * Calls Params. + * @function params + * @memberof cosmos.staking.v1beta1.Query + * @instance + * @param {cosmos.staking.v1beta1.IQueryParamsRequest} request QueryParamsRequest message or plain object + * @param {cosmos.staking.v1beta1.Query.ParamsCallback} callback Node-style callback called with the error, if any, and QueryParamsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.params = function params(request, callback) { + return this.rpcCall(params, $root.cosmos.staking.v1beta1.QueryParamsRequest, $root.cosmos.staking.v1beta1.QueryParamsResponse, request, callback); + }, "name", { value: "Params" }); + + /** + * Calls Params. + * @function params + * @memberof cosmos.staking.v1beta1.Query + * @instance + * @param {cosmos.staking.v1beta1.IQueryParamsRequest} request QueryParamsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Query; + })(v1beta1.Query || {}); + + v1beta1.QueryValidatorsRequest = (function(QueryValidatorsRequest) { + + /** + * Properties of a QueryValidatorsRequest. + * @memberof cosmos.staking.v1beta1 + * @interface IQueryValidatorsRequest + * @property {string|null} [status] QueryValidatorsRequest status + * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryValidatorsRequest pagination + */ + + /** + * Constructs a new QueryValidatorsRequest. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a QueryValidatorsRequest. + * @implements IQueryValidatorsRequest + * @constructor + * @param {cosmos.staking.v1beta1.IQueryValidatorsRequest=} [properties] Properties to set + */ + function QueryValidatorsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryValidatorsRequest status. + * @member {string} status + * @memberof cosmos.staking.v1beta1.QueryValidatorsRequest + * @instance + */ + QueryValidatorsRequest.prototype.status = ""; + + /** + * QueryValidatorsRequest pagination. + * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination + * @memberof cosmos.staking.v1beta1.QueryValidatorsRequest + * @instance + */ + QueryValidatorsRequest.prototype.pagination = null; + + /** + * Creates a new QueryValidatorsRequest instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.QueryValidatorsRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryValidatorsRequest=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.QueryValidatorsRequest} QueryValidatorsRequest instance + */ + QueryValidatorsRequest.create = function create(properties) { + return new QueryValidatorsRequest(properties); + }; + + /** + * Encodes the specified QueryValidatorsRequest message. Does not implicitly {@link cosmos.staking.v1beta1.QueryValidatorsRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.QueryValidatorsRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryValidatorsRequest} message QueryValidatorsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryValidatorsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.status); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryValidatorsRequest message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.QueryValidatorsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.QueryValidatorsRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryValidatorsRequest} message QueryValidatorsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryValidatorsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryValidatorsRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.QueryValidatorsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.QueryValidatorsRequest} QueryValidatorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryValidatorsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.QueryValidatorsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.status = reader.string(); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryValidatorsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.QueryValidatorsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.QueryValidatorsRequest} QueryValidatorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryValidatorsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryValidatorsRequest message. + * @function verify + * @memberof cosmos.staking.v1beta1.QueryValidatorsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryValidatorsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.status != null && message.hasOwnProperty("status")) + if (!$util.isString(message.status)) + return "status: string expected"; + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryValidatorsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.QueryValidatorsRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.QueryValidatorsRequest} QueryValidatorsRequest + */ + QueryValidatorsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.QueryValidatorsRequest) + return object; + let message = new $root.cosmos.staking.v1beta1.QueryValidatorsRequest(); + if (object.status != null) + message.status = String(object.status); + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.staking.v1beta1.QueryValidatorsRequest.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryValidatorsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.QueryValidatorsRequest + * @static + * @param {cosmos.staking.v1beta1.QueryValidatorsRequest} message QueryValidatorsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryValidatorsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.status = ""; + object.pagination = null; + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = message.status; + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryValidatorsRequest to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.QueryValidatorsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryValidatorsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryValidatorsRequest; + })(v1beta1.QueryValidatorsRequest || {}); + + v1beta1.QueryValidatorsResponse = (function(QueryValidatorsResponse) { + + /** + * Properties of a QueryValidatorsResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IQueryValidatorsResponse + * @property {Array.|null} [validators] QueryValidatorsResponse validators + * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryValidatorsResponse pagination + */ + + /** + * Constructs a new QueryValidatorsResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a QueryValidatorsResponse. + * @implements IQueryValidatorsResponse + * @constructor + * @param {cosmos.staking.v1beta1.IQueryValidatorsResponse=} [properties] Properties to set + */ + function QueryValidatorsResponse(properties) { + this.validators = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryValidatorsResponse validators. + * @member {Array.} validators + * @memberof cosmos.staking.v1beta1.QueryValidatorsResponse + * @instance + */ + QueryValidatorsResponse.prototype.validators = $util.emptyArray; + + /** + * QueryValidatorsResponse pagination. + * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination + * @memberof cosmos.staking.v1beta1.QueryValidatorsResponse + * @instance + */ + QueryValidatorsResponse.prototype.pagination = null; + + /** + * Creates a new QueryValidatorsResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.QueryValidatorsResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryValidatorsResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.QueryValidatorsResponse} QueryValidatorsResponse instance + */ + QueryValidatorsResponse.create = function create(properties) { + return new QueryValidatorsResponse(properties); + }; + + /** + * Encodes the specified QueryValidatorsResponse message. Does not implicitly {@link cosmos.staking.v1beta1.QueryValidatorsResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.QueryValidatorsResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryValidatorsResponse} message QueryValidatorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryValidatorsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validators != null && message.validators.length) + for (let i = 0; i < message.validators.length; ++i) + $root.cosmos.staking.v1beta1.Validator.encode(message.validators[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryValidatorsResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.QueryValidatorsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.QueryValidatorsResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryValidatorsResponse} message QueryValidatorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryValidatorsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryValidatorsResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.QueryValidatorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.QueryValidatorsResponse} QueryValidatorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryValidatorsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.QueryValidatorsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.validators && message.validators.length)) + message.validators = []; + message.validators.push($root.cosmos.staking.v1beta1.Validator.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryValidatorsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.QueryValidatorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.QueryValidatorsResponse} QueryValidatorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryValidatorsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryValidatorsResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.QueryValidatorsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryValidatorsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validators != null && message.hasOwnProperty("validators")) { + if (!Array.isArray(message.validators)) + return "validators: array expected"; + for (let i = 0; i < message.validators.length; ++i) { + let error = $root.cosmos.staking.v1beta1.Validator.verify(message.validators[i]); + if (error) + return "validators." + error; + } + } + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryValidatorsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.QueryValidatorsResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.QueryValidatorsResponse} QueryValidatorsResponse + */ + QueryValidatorsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.QueryValidatorsResponse) + return object; + let message = new $root.cosmos.staking.v1beta1.QueryValidatorsResponse(); + if (object.validators) { + if (!Array.isArray(object.validators)) + throw TypeError(".cosmos.staking.v1beta1.QueryValidatorsResponse.validators: array expected"); + message.validators = []; + for (let i = 0; i < object.validators.length; ++i) { + if (typeof object.validators[i] !== "object") + throw TypeError(".cosmos.staking.v1beta1.QueryValidatorsResponse.validators: object expected"); + message.validators[i] = $root.cosmos.staking.v1beta1.Validator.fromObject(object.validators[i]); + } + } + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.staking.v1beta1.QueryValidatorsResponse.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryValidatorsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.QueryValidatorsResponse + * @static + * @param {cosmos.staking.v1beta1.QueryValidatorsResponse} message QueryValidatorsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryValidatorsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.validators = []; + if (options.defaults) + object.pagination = null; + if (message.validators && message.validators.length) { + object.validators = []; + for (let j = 0; j < message.validators.length; ++j) + object.validators[j] = $root.cosmos.staking.v1beta1.Validator.toObject(message.validators[j], options); + } + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryValidatorsResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.QueryValidatorsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryValidatorsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryValidatorsResponse; + })(v1beta1.QueryValidatorsResponse || {}); + + v1beta1.QueryValidatorRequest = (function(QueryValidatorRequest) { + + /** + * Properties of a QueryValidatorRequest. + * @memberof cosmos.staking.v1beta1 + * @interface IQueryValidatorRequest + * @property {string|null} [validatorAddr] QueryValidatorRequest validatorAddr + */ + + /** + * Constructs a new QueryValidatorRequest. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a QueryValidatorRequest. + * @implements IQueryValidatorRequest + * @constructor + * @param {cosmos.staking.v1beta1.IQueryValidatorRequest=} [properties] Properties to set + */ + function QueryValidatorRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryValidatorRequest validatorAddr. + * @member {string} validatorAddr + * @memberof cosmos.staking.v1beta1.QueryValidatorRequest + * @instance + */ + QueryValidatorRequest.prototype.validatorAddr = ""; + + /** + * Creates a new QueryValidatorRequest instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.QueryValidatorRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryValidatorRequest=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.QueryValidatorRequest} QueryValidatorRequest instance + */ + QueryValidatorRequest.create = function create(properties) { + return new QueryValidatorRequest(properties); + }; + + /** + * Encodes the specified QueryValidatorRequest message. Does not implicitly {@link cosmos.staking.v1beta1.QueryValidatorRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.QueryValidatorRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryValidatorRequest} message QueryValidatorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryValidatorRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validatorAddr != null && Object.hasOwnProperty.call(message, "validatorAddr")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.validatorAddr); + return writer; + }; + + /** + * Encodes the specified QueryValidatorRequest message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.QueryValidatorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.QueryValidatorRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryValidatorRequest} message QueryValidatorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryValidatorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryValidatorRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.QueryValidatorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.QueryValidatorRequest} QueryValidatorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryValidatorRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.QueryValidatorRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryValidatorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.QueryValidatorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.QueryValidatorRequest} QueryValidatorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryValidatorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryValidatorRequest message. + * @function verify + * @memberof cosmos.staking.v1beta1.QueryValidatorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryValidatorRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validatorAddr != null && message.hasOwnProperty("validatorAddr")) + if (!$util.isString(message.validatorAddr)) + return "validatorAddr: string expected"; + return null; + }; + + /** + * Creates a QueryValidatorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.QueryValidatorRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.QueryValidatorRequest} QueryValidatorRequest + */ + QueryValidatorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.QueryValidatorRequest) + return object; + let message = new $root.cosmos.staking.v1beta1.QueryValidatorRequest(); + if (object.validatorAddr != null) + message.validatorAddr = String(object.validatorAddr); + return message; + }; + + /** + * Creates a plain object from a QueryValidatorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.QueryValidatorRequest + * @static + * @param {cosmos.staking.v1beta1.QueryValidatorRequest} message QueryValidatorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryValidatorRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.validatorAddr = ""; + if (message.validatorAddr != null && message.hasOwnProperty("validatorAddr")) + object.validatorAddr = message.validatorAddr; + return object; + }; + + /** + * Converts this QueryValidatorRequest to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.QueryValidatorRequest + * @instance + * @returns {Object.} JSON object + */ + QueryValidatorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryValidatorRequest; + })(v1beta1.QueryValidatorRequest || {}); + + v1beta1.QueryValidatorResponse = (function(QueryValidatorResponse) { + + /** + * Properties of a QueryValidatorResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IQueryValidatorResponse + * @property {cosmos.staking.v1beta1.IValidator|null} [validator] QueryValidatorResponse validator + */ + + /** + * Constructs a new QueryValidatorResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a QueryValidatorResponse. + * @implements IQueryValidatorResponse + * @constructor + * @param {cosmos.staking.v1beta1.IQueryValidatorResponse=} [properties] Properties to set + */ + function QueryValidatorResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryValidatorResponse validator. + * @member {cosmos.staking.v1beta1.IValidator|null|undefined} validator + * @memberof cosmos.staking.v1beta1.QueryValidatorResponse + * @instance + */ + QueryValidatorResponse.prototype.validator = null; + + /** + * Creates a new QueryValidatorResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.QueryValidatorResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryValidatorResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.QueryValidatorResponse} QueryValidatorResponse instance + */ + QueryValidatorResponse.create = function create(properties) { + return new QueryValidatorResponse(properties); + }; + + /** + * Encodes the specified QueryValidatorResponse message. Does not implicitly {@link cosmos.staking.v1beta1.QueryValidatorResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.QueryValidatorResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryValidatorResponse} message QueryValidatorResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryValidatorResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validator != null && Object.hasOwnProperty.call(message, "validator")) + $root.cosmos.staking.v1beta1.Validator.encode(message.validator, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryValidatorResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.QueryValidatorResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.QueryValidatorResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryValidatorResponse} message QueryValidatorResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryValidatorResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryValidatorResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.QueryValidatorResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.QueryValidatorResponse} QueryValidatorResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryValidatorResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.QueryValidatorResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validator = $root.cosmos.staking.v1beta1.Validator.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryValidatorResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.QueryValidatorResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.QueryValidatorResponse} QueryValidatorResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryValidatorResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryValidatorResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.QueryValidatorResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryValidatorResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validator != null && message.hasOwnProperty("validator")) { + let error = $root.cosmos.staking.v1beta1.Validator.verify(message.validator); + if (error) + return "validator." + error; + } + return null; + }; + + /** + * Creates a QueryValidatorResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.QueryValidatorResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.QueryValidatorResponse} QueryValidatorResponse + */ + QueryValidatorResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.QueryValidatorResponse) + return object; + let message = new $root.cosmos.staking.v1beta1.QueryValidatorResponse(); + if (object.validator != null) { + if (typeof object.validator !== "object") + throw TypeError(".cosmos.staking.v1beta1.QueryValidatorResponse.validator: object expected"); + message.validator = $root.cosmos.staking.v1beta1.Validator.fromObject(object.validator); + } + return message; + }; + + /** + * Creates a plain object from a QueryValidatorResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.QueryValidatorResponse + * @static + * @param {cosmos.staking.v1beta1.QueryValidatorResponse} message QueryValidatorResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryValidatorResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.validator = null; + if (message.validator != null && message.hasOwnProperty("validator")) + object.validator = $root.cosmos.staking.v1beta1.Validator.toObject(message.validator, options); + return object; + }; + + /** + * Converts this QueryValidatorResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.QueryValidatorResponse + * @instance + * @returns {Object.} JSON object + */ + QueryValidatorResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryValidatorResponse; + })(v1beta1.QueryValidatorResponse || {}); + + v1beta1.QueryValidatorDelegationsRequest = (function(QueryValidatorDelegationsRequest) { + + /** + * Properties of a QueryValidatorDelegationsRequest. + * @memberof cosmos.staking.v1beta1 + * @interface IQueryValidatorDelegationsRequest + * @property {string|null} [validatorAddr] QueryValidatorDelegationsRequest validatorAddr + * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryValidatorDelegationsRequest pagination + */ + + /** + * Constructs a new QueryValidatorDelegationsRequest. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a QueryValidatorDelegationsRequest. + * @implements IQueryValidatorDelegationsRequest + * @constructor + * @param {cosmos.staking.v1beta1.IQueryValidatorDelegationsRequest=} [properties] Properties to set + */ + function QueryValidatorDelegationsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryValidatorDelegationsRequest validatorAddr. + * @member {string} validatorAddr + * @memberof cosmos.staking.v1beta1.QueryValidatorDelegationsRequest + * @instance + */ + QueryValidatorDelegationsRequest.prototype.validatorAddr = ""; + + /** + * QueryValidatorDelegationsRequest pagination. + * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination + * @memberof cosmos.staking.v1beta1.QueryValidatorDelegationsRequest + * @instance + */ + QueryValidatorDelegationsRequest.prototype.pagination = null; + + /** + * Creates a new QueryValidatorDelegationsRequest instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.QueryValidatorDelegationsRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryValidatorDelegationsRequest=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.QueryValidatorDelegationsRequest} QueryValidatorDelegationsRequest instance + */ + QueryValidatorDelegationsRequest.create = function create(properties) { + return new QueryValidatorDelegationsRequest(properties); + }; + + /** + * Encodes the specified QueryValidatorDelegationsRequest message. Does not implicitly {@link cosmos.staking.v1beta1.QueryValidatorDelegationsRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.QueryValidatorDelegationsRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryValidatorDelegationsRequest} message QueryValidatorDelegationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryValidatorDelegationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validatorAddr != null && Object.hasOwnProperty.call(message, "validatorAddr")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.validatorAddr); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryValidatorDelegationsRequest message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.QueryValidatorDelegationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.QueryValidatorDelegationsRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryValidatorDelegationsRequest} message QueryValidatorDelegationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryValidatorDelegationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryValidatorDelegationsRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.QueryValidatorDelegationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.QueryValidatorDelegationsRequest} QueryValidatorDelegationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryValidatorDelegationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.QueryValidatorDelegationsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddr = reader.string(); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryValidatorDelegationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.QueryValidatorDelegationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.QueryValidatorDelegationsRequest} QueryValidatorDelegationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryValidatorDelegationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryValidatorDelegationsRequest message. + * @function verify + * @memberof cosmos.staking.v1beta1.QueryValidatorDelegationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryValidatorDelegationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validatorAddr != null && message.hasOwnProperty("validatorAddr")) + if (!$util.isString(message.validatorAddr)) + return "validatorAddr: string expected"; + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryValidatorDelegationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.QueryValidatorDelegationsRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.QueryValidatorDelegationsRequest} QueryValidatorDelegationsRequest + */ + QueryValidatorDelegationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.QueryValidatorDelegationsRequest) + return object; + let message = new $root.cosmos.staking.v1beta1.QueryValidatorDelegationsRequest(); + if (object.validatorAddr != null) + message.validatorAddr = String(object.validatorAddr); + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.staking.v1beta1.QueryValidatorDelegationsRequest.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryValidatorDelegationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.QueryValidatorDelegationsRequest + * @static + * @param {cosmos.staking.v1beta1.QueryValidatorDelegationsRequest} message QueryValidatorDelegationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryValidatorDelegationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.validatorAddr = ""; + object.pagination = null; + } + if (message.validatorAddr != null && message.hasOwnProperty("validatorAddr")) + object.validatorAddr = message.validatorAddr; + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryValidatorDelegationsRequest to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.QueryValidatorDelegationsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryValidatorDelegationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryValidatorDelegationsRequest; + })(v1beta1.QueryValidatorDelegationsRequest || {}); + + v1beta1.QueryValidatorDelegationsResponse = (function(QueryValidatorDelegationsResponse) { + + /** + * Properties of a QueryValidatorDelegationsResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IQueryValidatorDelegationsResponse + * @property {Array.|null} [delegationResponses] QueryValidatorDelegationsResponse delegationResponses + * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryValidatorDelegationsResponse pagination + */ + + /** + * Constructs a new QueryValidatorDelegationsResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a QueryValidatorDelegationsResponse. + * @implements IQueryValidatorDelegationsResponse + * @constructor + * @param {cosmos.staking.v1beta1.IQueryValidatorDelegationsResponse=} [properties] Properties to set + */ + function QueryValidatorDelegationsResponse(properties) { + this.delegationResponses = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryValidatorDelegationsResponse delegationResponses. + * @member {Array.} delegationResponses + * @memberof cosmos.staking.v1beta1.QueryValidatorDelegationsResponse + * @instance + */ + QueryValidatorDelegationsResponse.prototype.delegationResponses = $util.emptyArray; + + /** + * QueryValidatorDelegationsResponse pagination. + * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination + * @memberof cosmos.staking.v1beta1.QueryValidatorDelegationsResponse + * @instance + */ + QueryValidatorDelegationsResponse.prototype.pagination = null; + + /** + * Creates a new QueryValidatorDelegationsResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.QueryValidatorDelegationsResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryValidatorDelegationsResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.QueryValidatorDelegationsResponse} QueryValidatorDelegationsResponse instance + */ + QueryValidatorDelegationsResponse.create = function create(properties) { + return new QueryValidatorDelegationsResponse(properties); + }; + + /** + * Encodes the specified QueryValidatorDelegationsResponse message. Does not implicitly {@link cosmos.staking.v1beta1.QueryValidatorDelegationsResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.QueryValidatorDelegationsResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryValidatorDelegationsResponse} message QueryValidatorDelegationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryValidatorDelegationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegationResponses != null && message.delegationResponses.length) + for (let i = 0; i < message.delegationResponses.length; ++i) + $root.cosmos.staking.v1beta1.DelegationResponse.encode(message.delegationResponses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryValidatorDelegationsResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.QueryValidatorDelegationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.QueryValidatorDelegationsResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryValidatorDelegationsResponse} message QueryValidatorDelegationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryValidatorDelegationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryValidatorDelegationsResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.QueryValidatorDelegationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.QueryValidatorDelegationsResponse} QueryValidatorDelegationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryValidatorDelegationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.QueryValidatorDelegationsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.delegationResponses && message.delegationResponses.length)) + message.delegationResponses = []; + message.delegationResponses.push($root.cosmos.staking.v1beta1.DelegationResponse.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryValidatorDelegationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.QueryValidatorDelegationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.QueryValidatorDelegationsResponse} QueryValidatorDelegationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryValidatorDelegationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryValidatorDelegationsResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.QueryValidatorDelegationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryValidatorDelegationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegationResponses != null && message.hasOwnProperty("delegationResponses")) { + if (!Array.isArray(message.delegationResponses)) + return "delegationResponses: array expected"; + for (let i = 0; i < message.delegationResponses.length; ++i) { + let error = $root.cosmos.staking.v1beta1.DelegationResponse.verify(message.delegationResponses[i]); + if (error) + return "delegationResponses." + error; + } + } + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryValidatorDelegationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.QueryValidatorDelegationsResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.QueryValidatorDelegationsResponse} QueryValidatorDelegationsResponse + */ + QueryValidatorDelegationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.QueryValidatorDelegationsResponse) + return object; + let message = new $root.cosmos.staking.v1beta1.QueryValidatorDelegationsResponse(); + if (object.delegationResponses) { + if (!Array.isArray(object.delegationResponses)) + throw TypeError(".cosmos.staking.v1beta1.QueryValidatorDelegationsResponse.delegationResponses: array expected"); + message.delegationResponses = []; + for (let i = 0; i < object.delegationResponses.length; ++i) { + if (typeof object.delegationResponses[i] !== "object") + throw TypeError(".cosmos.staking.v1beta1.QueryValidatorDelegationsResponse.delegationResponses: object expected"); + message.delegationResponses[i] = $root.cosmos.staking.v1beta1.DelegationResponse.fromObject(object.delegationResponses[i]); + } + } + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.staking.v1beta1.QueryValidatorDelegationsResponse.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryValidatorDelegationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.QueryValidatorDelegationsResponse + * @static + * @param {cosmos.staking.v1beta1.QueryValidatorDelegationsResponse} message QueryValidatorDelegationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryValidatorDelegationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.delegationResponses = []; + if (options.defaults) + object.pagination = null; + if (message.delegationResponses && message.delegationResponses.length) { + object.delegationResponses = []; + for (let j = 0; j < message.delegationResponses.length; ++j) + object.delegationResponses[j] = $root.cosmos.staking.v1beta1.DelegationResponse.toObject(message.delegationResponses[j], options); + } + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryValidatorDelegationsResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.QueryValidatorDelegationsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryValidatorDelegationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryValidatorDelegationsResponse; + })(v1beta1.QueryValidatorDelegationsResponse || {}); + + v1beta1.QueryValidatorUnbondingDelegationsRequest = (function(QueryValidatorUnbondingDelegationsRequest) { + + /** + * Properties of a QueryValidatorUnbondingDelegationsRequest. + * @memberof cosmos.staking.v1beta1 + * @interface IQueryValidatorUnbondingDelegationsRequest + * @property {string|null} [validatorAddr] QueryValidatorUnbondingDelegationsRequest validatorAddr + * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryValidatorUnbondingDelegationsRequest pagination + */ + + /** + * Constructs a new QueryValidatorUnbondingDelegationsRequest. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a QueryValidatorUnbondingDelegationsRequest. + * @implements IQueryValidatorUnbondingDelegationsRequest + * @constructor + * @param {cosmos.staking.v1beta1.IQueryValidatorUnbondingDelegationsRequest=} [properties] Properties to set + */ + function QueryValidatorUnbondingDelegationsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryValidatorUnbondingDelegationsRequest validatorAddr. + * @member {string} validatorAddr + * @memberof cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest + * @instance + */ + QueryValidatorUnbondingDelegationsRequest.prototype.validatorAddr = ""; + + /** + * QueryValidatorUnbondingDelegationsRequest pagination. + * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination + * @memberof cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest + * @instance + */ + QueryValidatorUnbondingDelegationsRequest.prototype.pagination = null; + + /** + * Creates a new QueryValidatorUnbondingDelegationsRequest instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryValidatorUnbondingDelegationsRequest=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest} QueryValidatorUnbondingDelegationsRequest instance + */ + QueryValidatorUnbondingDelegationsRequest.create = function create(properties) { + return new QueryValidatorUnbondingDelegationsRequest(properties); + }; + + /** + * Encodes the specified QueryValidatorUnbondingDelegationsRequest message. Does not implicitly {@link cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryValidatorUnbondingDelegationsRequest} message QueryValidatorUnbondingDelegationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryValidatorUnbondingDelegationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validatorAddr != null && Object.hasOwnProperty.call(message, "validatorAddr")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.validatorAddr); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryValidatorUnbondingDelegationsRequest message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryValidatorUnbondingDelegationsRequest} message QueryValidatorUnbondingDelegationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryValidatorUnbondingDelegationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryValidatorUnbondingDelegationsRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest} QueryValidatorUnbondingDelegationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryValidatorUnbondingDelegationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddr = reader.string(); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryValidatorUnbondingDelegationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest} QueryValidatorUnbondingDelegationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryValidatorUnbondingDelegationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryValidatorUnbondingDelegationsRequest message. + * @function verify + * @memberof cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryValidatorUnbondingDelegationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validatorAddr != null && message.hasOwnProperty("validatorAddr")) + if (!$util.isString(message.validatorAddr)) + return "validatorAddr: string expected"; + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryValidatorUnbondingDelegationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest} QueryValidatorUnbondingDelegationsRequest + */ + QueryValidatorUnbondingDelegationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest) + return object; + let message = new $root.cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest(); + if (object.validatorAddr != null) + message.validatorAddr = String(object.validatorAddr); + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryValidatorUnbondingDelegationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest + * @static + * @param {cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest} message QueryValidatorUnbondingDelegationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryValidatorUnbondingDelegationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.validatorAddr = ""; + object.pagination = null; + } + if (message.validatorAddr != null && message.hasOwnProperty("validatorAddr")) + object.validatorAddr = message.validatorAddr; + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryValidatorUnbondingDelegationsRequest to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryValidatorUnbondingDelegationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryValidatorUnbondingDelegationsRequest; + })(v1beta1.QueryValidatorUnbondingDelegationsRequest || {}); + + v1beta1.QueryValidatorUnbondingDelegationsResponse = (function(QueryValidatorUnbondingDelegationsResponse) { + + /** + * Properties of a QueryValidatorUnbondingDelegationsResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IQueryValidatorUnbondingDelegationsResponse + * @property {Array.|null} [unbondingResponses] QueryValidatorUnbondingDelegationsResponse unbondingResponses + * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryValidatorUnbondingDelegationsResponse pagination + */ + + /** + * Constructs a new QueryValidatorUnbondingDelegationsResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a QueryValidatorUnbondingDelegationsResponse. + * @implements IQueryValidatorUnbondingDelegationsResponse + * @constructor + * @param {cosmos.staking.v1beta1.IQueryValidatorUnbondingDelegationsResponse=} [properties] Properties to set + */ + function QueryValidatorUnbondingDelegationsResponse(properties) { + this.unbondingResponses = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryValidatorUnbondingDelegationsResponse unbondingResponses. + * @member {Array.} unbondingResponses + * @memberof cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse + * @instance + */ + QueryValidatorUnbondingDelegationsResponse.prototype.unbondingResponses = $util.emptyArray; + + /** + * QueryValidatorUnbondingDelegationsResponse pagination. + * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination + * @memberof cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse + * @instance + */ + QueryValidatorUnbondingDelegationsResponse.prototype.pagination = null; + + /** + * Creates a new QueryValidatorUnbondingDelegationsResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryValidatorUnbondingDelegationsResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse} QueryValidatorUnbondingDelegationsResponse instance + */ + QueryValidatorUnbondingDelegationsResponse.create = function create(properties) { + return new QueryValidatorUnbondingDelegationsResponse(properties); + }; + + /** + * Encodes the specified QueryValidatorUnbondingDelegationsResponse message. Does not implicitly {@link cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryValidatorUnbondingDelegationsResponse} message QueryValidatorUnbondingDelegationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryValidatorUnbondingDelegationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.unbondingResponses != null && message.unbondingResponses.length) + for (let i = 0; i < message.unbondingResponses.length; ++i) + $root.cosmos.staking.v1beta1.UnbondingDelegation.encode(message.unbondingResponses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryValidatorUnbondingDelegationsResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryValidatorUnbondingDelegationsResponse} message QueryValidatorUnbondingDelegationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryValidatorUnbondingDelegationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryValidatorUnbondingDelegationsResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse} QueryValidatorUnbondingDelegationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryValidatorUnbondingDelegationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.unbondingResponses && message.unbondingResponses.length)) + message.unbondingResponses = []; + message.unbondingResponses.push($root.cosmos.staking.v1beta1.UnbondingDelegation.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryValidatorUnbondingDelegationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse} QueryValidatorUnbondingDelegationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryValidatorUnbondingDelegationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryValidatorUnbondingDelegationsResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryValidatorUnbondingDelegationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.unbondingResponses != null && message.hasOwnProperty("unbondingResponses")) { + if (!Array.isArray(message.unbondingResponses)) + return "unbondingResponses: array expected"; + for (let i = 0; i < message.unbondingResponses.length; ++i) { + let error = $root.cosmos.staking.v1beta1.UnbondingDelegation.verify(message.unbondingResponses[i]); + if (error) + return "unbondingResponses." + error; + } + } + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryValidatorUnbondingDelegationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse} QueryValidatorUnbondingDelegationsResponse + */ + QueryValidatorUnbondingDelegationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse) + return object; + let message = new $root.cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse(); + if (object.unbondingResponses) { + if (!Array.isArray(object.unbondingResponses)) + throw TypeError(".cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse.unbondingResponses: array expected"); + message.unbondingResponses = []; + for (let i = 0; i < object.unbondingResponses.length; ++i) { + if (typeof object.unbondingResponses[i] !== "object") + throw TypeError(".cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse.unbondingResponses: object expected"); + message.unbondingResponses[i] = $root.cosmos.staking.v1beta1.UnbondingDelegation.fromObject(object.unbondingResponses[i]); + } + } + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryValidatorUnbondingDelegationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse + * @static + * @param {cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse} message QueryValidatorUnbondingDelegationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryValidatorUnbondingDelegationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.unbondingResponses = []; + if (options.defaults) + object.pagination = null; + if (message.unbondingResponses && message.unbondingResponses.length) { + object.unbondingResponses = []; + for (let j = 0; j < message.unbondingResponses.length; ++j) + object.unbondingResponses[j] = $root.cosmos.staking.v1beta1.UnbondingDelegation.toObject(message.unbondingResponses[j], options); + } + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryValidatorUnbondingDelegationsResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryValidatorUnbondingDelegationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryValidatorUnbondingDelegationsResponse; + })(v1beta1.QueryValidatorUnbondingDelegationsResponse || {}); + + v1beta1.QueryDelegationRequest = (function(QueryDelegationRequest) { + + /** + * Properties of a QueryDelegationRequest. + * @memberof cosmos.staking.v1beta1 + * @interface IQueryDelegationRequest + * @property {string|null} [delegatorAddr] QueryDelegationRequest delegatorAddr + * @property {string|null} [validatorAddr] QueryDelegationRequest validatorAddr + */ + + /** + * Constructs a new QueryDelegationRequest. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a QueryDelegationRequest. + * @implements IQueryDelegationRequest + * @constructor + * @param {cosmos.staking.v1beta1.IQueryDelegationRequest=} [properties] Properties to set + */ + function QueryDelegationRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryDelegationRequest delegatorAddr. + * @member {string} delegatorAddr + * @memberof cosmos.staking.v1beta1.QueryDelegationRequest + * @instance + */ + QueryDelegationRequest.prototype.delegatorAddr = ""; + + /** + * QueryDelegationRequest validatorAddr. + * @member {string} validatorAddr + * @memberof cosmos.staking.v1beta1.QueryDelegationRequest + * @instance + */ + QueryDelegationRequest.prototype.validatorAddr = ""; + + /** + * Creates a new QueryDelegationRequest instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.QueryDelegationRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryDelegationRequest=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.QueryDelegationRequest} QueryDelegationRequest instance + */ + QueryDelegationRequest.create = function create(properties) { + return new QueryDelegationRequest(properties); + }; + + /** + * Encodes the specified QueryDelegationRequest message. Does not implicitly {@link cosmos.staking.v1beta1.QueryDelegationRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.QueryDelegationRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryDelegationRequest} message QueryDelegationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddr != null && Object.hasOwnProperty.call(message, "delegatorAddr")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddr); + if (message.validatorAddr != null && Object.hasOwnProperty.call(message, "validatorAddr")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddr); + return writer; + }; + + /** + * Encodes the specified QueryDelegationRequest message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.QueryDelegationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.QueryDelegationRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryDelegationRequest} message QueryDelegationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDelegationRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.QueryDelegationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.QueryDelegationRequest} QueryDelegationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.QueryDelegationRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.validatorAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDelegationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.QueryDelegationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.QueryDelegationRequest} QueryDelegationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDelegationRequest message. + * @function verify + * @memberof cosmos.staking.v1beta1.QueryDelegationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDelegationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddr != null && message.hasOwnProperty("delegatorAddr")) + if (!$util.isString(message.delegatorAddr)) + return "delegatorAddr: string expected"; + if (message.validatorAddr != null && message.hasOwnProperty("validatorAddr")) + if (!$util.isString(message.validatorAddr)) + return "validatorAddr: string expected"; + return null; + }; + + /** + * Creates a QueryDelegationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.QueryDelegationRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.QueryDelegationRequest} QueryDelegationRequest + */ + QueryDelegationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.QueryDelegationRequest) + return object; + let message = new $root.cosmos.staking.v1beta1.QueryDelegationRequest(); + if (object.delegatorAddr != null) + message.delegatorAddr = String(object.delegatorAddr); + if (object.validatorAddr != null) + message.validatorAddr = String(object.validatorAddr); + return message; + }; + + /** + * Creates a plain object from a QueryDelegationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.QueryDelegationRequest + * @static + * @param {cosmos.staking.v1beta1.QueryDelegationRequest} message QueryDelegationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDelegationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.delegatorAddr = ""; + object.validatorAddr = ""; + } + if (message.delegatorAddr != null && message.hasOwnProperty("delegatorAddr")) + object.delegatorAddr = message.delegatorAddr; + if (message.validatorAddr != null && message.hasOwnProperty("validatorAddr")) + object.validatorAddr = message.validatorAddr; + return object; + }; + + /** + * Converts this QueryDelegationRequest to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.QueryDelegationRequest + * @instance + * @returns {Object.} JSON object + */ + QueryDelegationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryDelegationRequest; + })(v1beta1.QueryDelegationRequest || {}); + + v1beta1.QueryDelegationResponse = (function(QueryDelegationResponse) { + + /** + * Properties of a QueryDelegationResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IQueryDelegationResponse + * @property {cosmos.staking.v1beta1.IDelegationResponse|null} [delegationResponse] QueryDelegationResponse delegationResponse + */ + + /** + * Constructs a new QueryDelegationResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a QueryDelegationResponse. + * @implements IQueryDelegationResponse + * @constructor + * @param {cosmos.staking.v1beta1.IQueryDelegationResponse=} [properties] Properties to set + */ + function QueryDelegationResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryDelegationResponse delegationResponse. + * @member {cosmos.staking.v1beta1.IDelegationResponse|null|undefined} delegationResponse + * @memberof cosmos.staking.v1beta1.QueryDelegationResponse + * @instance + */ + QueryDelegationResponse.prototype.delegationResponse = null; + + /** + * Creates a new QueryDelegationResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.QueryDelegationResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryDelegationResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.QueryDelegationResponse} QueryDelegationResponse instance + */ + QueryDelegationResponse.create = function create(properties) { + return new QueryDelegationResponse(properties); + }; + + /** + * Encodes the specified QueryDelegationResponse message. Does not implicitly {@link cosmos.staking.v1beta1.QueryDelegationResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.QueryDelegationResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryDelegationResponse} message QueryDelegationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegationResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegationResponse != null && Object.hasOwnProperty.call(message, "delegationResponse")) + $root.cosmos.staking.v1beta1.DelegationResponse.encode(message.delegationResponse, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryDelegationResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.QueryDelegationResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.QueryDelegationResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryDelegationResponse} message QueryDelegationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegationResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDelegationResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.QueryDelegationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.QueryDelegationResponse} QueryDelegationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegationResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.QueryDelegationResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegationResponse = $root.cosmos.staking.v1beta1.DelegationResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDelegationResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.QueryDelegationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.QueryDelegationResponse} QueryDelegationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegationResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDelegationResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.QueryDelegationResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDelegationResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegationResponse != null && message.hasOwnProperty("delegationResponse")) { + let error = $root.cosmos.staking.v1beta1.DelegationResponse.verify(message.delegationResponse); + if (error) + return "delegationResponse." + error; + } + return null; + }; + + /** + * Creates a QueryDelegationResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.QueryDelegationResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.QueryDelegationResponse} QueryDelegationResponse + */ + QueryDelegationResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.QueryDelegationResponse) + return object; + let message = new $root.cosmos.staking.v1beta1.QueryDelegationResponse(); + if (object.delegationResponse != null) { + if (typeof object.delegationResponse !== "object") + throw TypeError(".cosmos.staking.v1beta1.QueryDelegationResponse.delegationResponse: object expected"); + message.delegationResponse = $root.cosmos.staking.v1beta1.DelegationResponse.fromObject(object.delegationResponse); + } + return message; + }; + + /** + * Creates a plain object from a QueryDelegationResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.QueryDelegationResponse + * @static + * @param {cosmos.staking.v1beta1.QueryDelegationResponse} message QueryDelegationResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDelegationResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.delegationResponse = null; + if (message.delegationResponse != null && message.hasOwnProperty("delegationResponse")) + object.delegationResponse = $root.cosmos.staking.v1beta1.DelegationResponse.toObject(message.delegationResponse, options); + return object; + }; + + /** + * Converts this QueryDelegationResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.QueryDelegationResponse + * @instance + * @returns {Object.} JSON object + */ + QueryDelegationResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryDelegationResponse; + })(v1beta1.QueryDelegationResponse || {}); + + v1beta1.QueryUnbondingDelegationRequest = (function(QueryUnbondingDelegationRequest) { + + /** + * Properties of a QueryUnbondingDelegationRequest. + * @memberof cosmos.staking.v1beta1 + * @interface IQueryUnbondingDelegationRequest + * @property {string|null} [delegatorAddr] QueryUnbondingDelegationRequest delegatorAddr + * @property {string|null} [validatorAddr] QueryUnbondingDelegationRequest validatorAddr + */ + + /** + * Constructs a new QueryUnbondingDelegationRequest. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a QueryUnbondingDelegationRequest. + * @implements IQueryUnbondingDelegationRequest + * @constructor + * @param {cosmos.staking.v1beta1.IQueryUnbondingDelegationRequest=} [properties] Properties to set + */ + function QueryUnbondingDelegationRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryUnbondingDelegationRequest delegatorAddr. + * @member {string} delegatorAddr + * @memberof cosmos.staking.v1beta1.QueryUnbondingDelegationRequest + * @instance + */ + QueryUnbondingDelegationRequest.prototype.delegatorAddr = ""; + + /** + * QueryUnbondingDelegationRequest validatorAddr. + * @member {string} validatorAddr + * @memberof cosmos.staking.v1beta1.QueryUnbondingDelegationRequest + * @instance + */ + QueryUnbondingDelegationRequest.prototype.validatorAddr = ""; + + /** + * Creates a new QueryUnbondingDelegationRequest instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.QueryUnbondingDelegationRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryUnbondingDelegationRequest=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.QueryUnbondingDelegationRequest} QueryUnbondingDelegationRequest instance + */ + QueryUnbondingDelegationRequest.create = function create(properties) { + return new QueryUnbondingDelegationRequest(properties); + }; + + /** + * Encodes the specified QueryUnbondingDelegationRequest message. Does not implicitly {@link cosmos.staking.v1beta1.QueryUnbondingDelegationRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.QueryUnbondingDelegationRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryUnbondingDelegationRequest} message QueryUnbondingDelegationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryUnbondingDelegationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddr != null && Object.hasOwnProperty.call(message, "delegatorAddr")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddr); + if (message.validatorAddr != null && Object.hasOwnProperty.call(message, "validatorAddr")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddr); + return writer; + }; + + /** + * Encodes the specified QueryUnbondingDelegationRequest message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.QueryUnbondingDelegationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.QueryUnbondingDelegationRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryUnbondingDelegationRequest} message QueryUnbondingDelegationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryUnbondingDelegationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryUnbondingDelegationRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.QueryUnbondingDelegationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.QueryUnbondingDelegationRequest} QueryUnbondingDelegationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryUnbondingDelegationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.QueryUnbondingDelegationRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.validatorAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryUnbondingDelegationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.QueryUnbondingDelegationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.QueryUnbondingDelegationRequest} QueryUnbondingDelegationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryUnbondingDelegationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryUnbondingDelegationRequest message. + * @function verify + * @memberof cosmos.staking.v1beta1.QueryUnbondingDelegationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryUnbondingDelegationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddr != null && message.hasOwnProperty("delegatorAddr")) + if (!$util.isString(message.delegatorAddr)) + return "delegatorAddr: string expected"; + if (message.validatorAddr != null && message.hasOwnProperty("validatorAddr")) + if (!$util.isString(message.validatorAddr)) + return "validatorAddr: string expected"; + return null; + }; + + /** + * Creates a QueryUnbondingDelegationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.QueryUnbondingDelegationRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.QueryUnbondingDelegationRequest} QueryUnbondingDelegationRequest + */ + QueryUnbondingDelegationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.QueryUnbondingDelegationRequest) + return object; + let message = new $root.cosmos.staking.v1beta1.QueryUnbondingDelegationRequest(); + if (object.delegatorAddr != null) + message.delegatorAddr = String(object.delegatorAddr); + if (object.validatorAddr != null) + message.validatorAddr = String(object.validatorAddr); + return message; + }; + + /** + * Creates a plain object from a QueryUnbondingDelegationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.QueryUnbondingDelegationRequest + * @static + * @param {cosmos.staking.v1beta1.QueryUnbondingDelegationRequest} message QueryUnbondingDelegationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryUnbondingDelegationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.delegatorAddr = ""; + object.validatorAddr = ""; + } + if (message.delegatorAddr != null && message.hasOwnProperty("delegatorAddr")) + object.delegatorAddr = message.delegatorAddr; + if (message.validatorAddr != null && message.hasOwnProperty("validatorAddr")) + object.validatorAddr = message.validatorAddr; + return object; + }; + + /** + * Converts this QueryUnbondingDelegationRequest to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.QueryUnbondingDelegationRequest + * @instance + * @returns {Object.} JSON object + */ + QueryUnbondingDelegationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryUnbondingDelegationRequest; + })(v1beta1.QueryUnbondingDelegationRequest || {}); + + v1beta1.QueryUnbondingDelegationResponse = (function(QueryUnbondingDelegationResponse) { + + /** + * Properties of a QueryUnbondingDelegationResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IQueryUnbondingDelegationResponse + * @property {cosmos.staking.v1beta1.IUnbondingDelegation|null} [unbond] QueryUnbondingDelegationResponse unbond + */ + + /** + * Constructs a new QueryUnbondingDelegationResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a QueryUnbondingDelegationResponse. + * @implements IQueryUnbondingDelegationResponse + * @constructor + * @param {cosmos.staking.v1beta1.IQueryUnbondingDelegationResponse=} [properties] Properties to set + */ + function QueryUnbondingDelegationResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryUnbondingDelegationResponse unbond. + * @member {cosmos.staking.v1beta1.IUnbondingDelegation|null|undefined} unbond + * @memberof cosmos.staking.v1beta1.QueryUnbondingDelegationResponse + * @instance + */ + QueryUnbondingDelegationResponse.prototype.unbond = null; + + /** + * Creates a new QueryUnbondingDelegationResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.QueryUnbondingDelegationResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryUnbondingDelegationResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.QueryUnbondingDelegationResponse} QueryUnbondingDelegationResponse instance + */ + QueryUnbondingDelegationResponse.create = function create(properties) { + return new QueryUnbondingDelegationResponse(properties); + }; + + /** + * Encodes the specified QueryUnbondingDelegationResponse message. Does not implicitly {@link cosmos.staking.v1beta1.QueryUnbondingDelegationResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.QueryUnbondingDelegationResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryUnbondingDelegationResponse} message QueryUnbondingDelegationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryUnbondingDelegationResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.unbond != null && Object.hasOwnProperty.call(message, "unbond")) + $root.cosmos.staking.v1beta1.UnbondingDelegation.encode(message.unbond, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryUnbondingDelegationResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.QueryUnbondingDelegationResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.QueryUnbondingDelegationResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryUnbondingDelegationResponse} message QueryUnbondingDelegationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryUnbondingDelegationResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryUnbondingDelegationResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.QueryUnbondingDelegationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.QueryUnbondingDelegationResponse} QueryUnbondingDelegationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryUnbondingDelegationResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.QueryUnbondingDelegationResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.unbond = $root.cosmos.staking.v1beta1.UnbondingDelegation.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryUnbondingDelegationResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.QueryUnbondingDelegationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.QueryUnbondingDelegationResponse} QueryUnbondingDelegationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryUnbondingDelegationResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryUnbondingDelegationResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.QueryUnbondingDelegationResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryUnbondingDelegationResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.unbond != null && message.hasOwnProperty("unbond")) { + let error = $root.cosmos.staking.v1beta1.UnbondingDelegation.verify(message.unbond); + if (error) + return "unbond." + error; + } + return null; + }; + + /** + * Creates a QueryUnbondingDelegationResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.QueryUnbondingDelegationResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.QueryUnbondingDelegationResponse} QueryUnbondingDelegationResponse + */ + QueryUnbondingDelegationResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.QueryUnbondingDelegationResponse) + return object; + let message = new $root.cosmos.staking.v1beta1.QueryUnbondingDelegationResponse(); + if (object.unbond != null) { + if (typeof object.unbond !== "object") + throw TypeError(".cosmos.staking.v1beta1.QueryUnbondingDelegationResponse.unbond: object expected"); + message.unbond = $root.cosmos.staking.v1beta1.UnbondingDelegation.fromObject(object.unbond); + } + return message; + }; + + /** + * Creates a plain object from a QueryUnbondingDelegationResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.QueryUnbondingDelegationResponse + * @static + * @param {cosmos.staking.v1beta1.QueryUnbondingDelegationResponse} message QueryUnbondingDelegationResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryUnbondingDelegationResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.unbond = null; + if (message.unbond != null && message.hasOwnProperty("unbond")) + object.unbond = $root.cosmos.staking.v1beta1.UnbondingDelegation.toObject(message.unbond, options); + return object; + }; + + /** + * Converts this QueryUnbondingDelegationResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.QueryUnbondingDelegationResponse + * @instance + * @returns {Object.} JSON object + */ + QueryUnbondingDelegationResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryUnbondingDelegationResponse; + })(v1beta1.QueryUnbondingDelegationResponse || {}); + + v1beta1.QueryDelegatorDelegationsRequest = (function(QueryDelegatorDelegationsRequest) { + + /** + * Properties of a QueryDelegatorDelegationsRequest. + * @memberof cosmos.staking.v1beta1 + * @interface IQueryDelegatorDelegationsRequest + * @property {string|null} [delegatorAddr] QueryDelegatorDelegationsRequest delegatorAddr + * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryDelegatorDelegationsRequest pagination + */ + + /** + * Constructs a new QueryDelegatorDelegationsRequest. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a QueryDelegatorDelegationsRequest. + * @implements IQueryDelegatorDelegationsRequest + * @constructor + * @param {cosmos.staking.v1beta1.IQueryDelegatorDelegationsRequest=} [properties] Properties to set + */ + function QueryDelegatorDelegationsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryDelegatorDelegationsRequest delegatorAddr. + * @member {string} delegatorAddr + * @memberof cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest + * @instance + */ + QueryDelegatorDelegationsRequest.prototype.delegatorAddr = ""; + + /** + * QueryDelegatorDelegationsRequest pagination. + * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination + * @memberof cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest + * @instance + */ + QueryDelegatorDelegationsRequest.prototype.pagination = null; + + /** + * Creates a new QueryDelegatorDelegationsRequest instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryDelegatorDelegationsRequest=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest} QueryDelegatorDelegationsRequest instance + */ + QueryDelegatorDelegationsRequest.create = function create(properties) { + return new QueryDelegatorDelegationsRequest(properties); + }; + + /** + * Encodes the specified QueryDelegatorDelegationsRequest message. Does not implicitly {@link cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryDelegatorDelegationsRequest} message QueryDelegatorDelegationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegatorDelegationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddr != null && Object.hasOwnProperty.call(message, "delegatorAddr")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddr); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryDelegatorDelegationsRequest message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryDelegatorDelegationsRequest} message QueryDelegatorDelegationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegatorDelegationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDelegatorDelegationsRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest} QueryDelegatorDelegationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegatorDelegationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDelegatorDelegationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest} QueryDelegatorDelegationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegatorDelegationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDelegatorDelegationsRequest message. + * @function verify + * @memberof cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDelegatorDelegationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddr != null && message.hasOwnProperty("delegatorAddr")) + if (!$util.isString(message.delegatorAddr)) + return "delegatorAddr: string expected"; + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryDelegatorDelegationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest} QueryDelegatorDelegationsRequest + */ + QueryDelegatorDelegationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest) + return object; + let message = new $root.cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest(); + if (object.delegatorAddr != null) + message.delegatorAddr = String(object.delegatorAddr); + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryDelegatorDelegationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest + * @static + * @param {cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest} message QueryDelegatorDelegationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDelegatorDelegationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.delegatorAddr = ""; + object.pagination = null; + } + if (message.delegatorAddr != null && message.hasOwnProperty("delegatorAddr")) + object.delegatorAddr = message.delegatorAddr; + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryDelegatorDelegationsRequest to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryDelegatorDelegationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryDelegatorDelegationsRequest; + })(v1beta1.QueryDelegatorDelegationsRequest || {}); + + v1beta1.QueryDelegatorDelegationsResponse = (function(QueryDelegatorDelegationsResponse) { + + /** + * Properties of a QueryDelegatorDelegationsResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IQueryDelegatorDelegationsResponse + * @property {Array.|null} [delegationResponses] QueryDelegatorDelegationsResponse delegationResponses + * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryDelegatorDelegationsResponse pagination + */ + + /** + * Constructs a new QueryDelegatorDelegationsResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a QueryDelegatorDelegationsResponse. + * @implements IQueryDelegatorDelegationsResponse + * @constructor + * @param {cosmos.staking.v1beta1.IQueryDelegatorDelegationsResponse=} [properties] Properties to set + */ + function QueryDelegatorDelegationsResponse(properties) { + this.delegationResponses = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryDelegatorDelegationsResponse delegationResponses. + * @member {Array.} delegationResponses + * @memberof cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse + * @instance + */ + QueryDelegatorDelegationsResponse.prototype.delegationResponses = $util.emptyArray; + + /** + * QueryDelegatorDelegationsResponse pagination. + * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination + * @memberof cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse + * @instance + */ + QueryDelegatorDelegationsResponse.prototype.pagination = null; + + /** + * Creates a new QueryDelegatorDelegationsResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryDelegatorDelegationsResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse} QueryDelegatorDelegationsResponse instance + */ + QueryDelegatorDelegationsResponse.create = function create(properties) { + return new QueryDelegatorDelegationsResponse(properties); + }; + + /** + * Encodes the specified QueryDelegatorDelegationsResponse message. Does not implicitly {@link cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryDelegatorDelegationsResponse} message QueryDelegatorDelegationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegatorDelegationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegationResponses != null && message.delegationResponses.length) + for (let i = 0; i < message.delegationResponses.length; ++i) + $root.cosmos.staking.v1beta1.DelegationResponse.encode(message.delegationResponses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryDelegatorDelegationsResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryDelegatorDelegationsResponse} message QueryDelegatorDelegationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegatorDelegationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDelegatorDelegationsResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse} QueryDelegatorDelegationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegatorDelegationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.delegationResponses && message.delegationResponses.length)) + message.delegationResponses = []; + message.delegationResponses.push($root.cosmos.staking.v1beta1.DelegationResponse.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDelegatorDelegationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse} QueryDelegatorDelegationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegatorDelegationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDelegatorDelegationsResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDelegatorDelegationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegationResponses != null && message.hasOwnProperty("delegationResponses")) { + if (!Array.isArray(message.delegationResponses)) + return "delegationResponses: array expected"; + for (let i = 0; i < message.delegationResponses.length; ++i) { + let error = $root.cosmos.staking.v1beta1.DelegationResponse.verify(message.delegationResponses[i]); + if (error) + return "delegationResponses." + error; + } + } + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryDelegatorDelegationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse} QueryDelegatorDelegationsResponse + */ + QueryDelegatorDelegationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse) + return object; + let message = new $root.cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse(); + if (object.delegationResponses) { + if (!Array.isArray(object.delegationResponses)) + throw TypeError(".cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse.delegationResponses: array expected"); + message.delegationResponses = []; + for (let i = 0; i < object.delegationResponses.length; ++i) { + if (typeof object.delegationResponses[i] !== "object") + throw TypeError(".cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse.delegationResponses: object expected"); + message.delegationResponses[i] = $root.cosmos.staking.v1beta1.DelegationResponse.fromObject(object.delegationResponses[i]); + } + } + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryDelegatorDelegationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse + * @static + * @param {cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse} message QueryDelegatorDelegationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDelegatorDelegationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.delegationResponses = []; + if (options.defaults) + object.pagination = null; + if (message.delegationResponses && message.delegationResponses.length) { + object.delegationResponses = []; + for (let j = 0; j < message.delegationResponses.length; ++j) + object.delegationResponses[j] = $root.cosmos.staking.v1beta1.DelegationResponse.toObject(message.delegationResponses[j], options); + } + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryDelegatorDelegationsResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryDelegatorDelegationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryDelegatorDelegationsResponse; + })(v1beta1.QueryDelegatorDelegationsResponse || {}); + + v1beta1.QueryDelegatorUnbondingDelegationsRequest = (function(QueryDelegatorUnbondingDelegationsRequest) { + + /** + * Properties of a QueryDelegatorUnbondingDelegationsRequest. + * @memberof cosmos.staking.v1beta1 + * @interface IQueryDelegatorUnbondingDelegationsRequest + * @property {string|null} [delegatorAddr] QueryDelegatorUnbondingDelegationsRequest delegatorAddr + * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryDelegatorUnbondingDelegationsRequest pagination + */ + + /** + * Constructs a new QueryDelegatorUnbondingDelegationsRequest. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a QueryDelegatorUnbondingDelegationsRequest. + * @implements IQueryDelegatorUnbondingDelegationsRequest + * @constructor + * @param {cosmos.staking.v1beta1.IQueryDelegatorUnbondingDelegationsRequest=} [properties] Properties to set + */ + function QueryDelegatorUnbondingDelegationsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryDelegatorUnbondingDelegationsRequest delegatorAddr. + * @member {string} delegatorAddr + * @memberof cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest + * @instance + */ + QueryDelegatorUnbondingDelegationsRequest.prototype.delegatorAddr = ""; + + /** + * QueryDelegatorUnbondingDelegationsRequest pagination. + * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination + * @memberof cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest + * @instance + */ + QueryDelegatorUnbondingDelegationsRequest.prototype.pagination = null; + + /** + * Creates a new QueryDelegatorUnbondingDelegationsRequest instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryDelegatorUnbondingDelegationsRequest=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest} QueryDelegatorUnbondingDelegationsRequest instance + */ + QueryDelegatorUnbondingDelegationsRequest.create = function create(properties) { + return new QueryDelegatorUnbondingDelegationsRequest(properties); + }; + + /** + * Encodes the specified QueryDelegatorUnbondingDelegationsRequest message. Does not implicitly {@link cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryDelegatorUnbondingDelegationsRequest} message QueryDelegatorUnbondingDelegationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegatorUnbondingDelegationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddr != null && Object.hasOwnProperty.call(message, "delegatorAddr")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddr); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryDelegatorUnbondingDelegationsRequest message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryDelegatorUnbondingDelegationsRequest} message QueryDelegatorUnbondingDelegationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegatorUnbondingDelegationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDelegatorUnbondingDelegationsRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest} QueryDelegatorUnbondingDelegationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegatorUnbondingDelegationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDelegatorUnbondingDelegationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest} QueryDelegatorUnbondingDelegationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegatorUnbondingDelegationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDelegatorUnbondingDelegationsRequest message. + * @function verify + * @memberof cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDelegatorUnbondingDelegationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddr != null && message.hasOwnProperty("delegatorAddr")) + if (!$util.isString(message.delegatorAddr)) + return "delegatorAddr: string expected"; + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryDelegatorUnbondingDelegationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest} QueryDelegatorUnbondingDelegationsRequest + */ + QueryDelegatorUnbondingDelegationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest) + return object; + let message = new $root.cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest(); + if (object.delegatorAddr != null) + message.delegatorAddr = String(object.delegatorAddr); + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryDelegatorUnbondingDelegationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest + * @static + * @param {cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest} message QueryDelegatorUnbondingDelegationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDelegatorUnbondingDelegationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.delegatorAddr = ""; + object.pagination = null; + } + if (message.delegatorAddr != null && message.hasOwnProperty("delegatorAddr")) + object.delegatorAddr = message.delegatorAddr; + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryDelegatorUnbondingDelegationsRequest to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryDelegatorUnbondingDelegationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryDelegatorUnbondingDelegationsRequest; + })(v1beta1.QueryDelegatorUnbondingDelegationsRequest || {}); + + v1beta1.QueryDelegatorUnbondingDelegationsResponse = (function(QueryDelegatorUnbondingDelegationsResponse) { + + /** + * Properties of a QueryDelegatorUnbondingDelegationsResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IQueryDelegatorUnbondingDelegationsResponse + * @property {Array.|null} [unbondingResponses] QueryDelegatorUnbondingDelegationsResponse unbondingResponses + * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryDelegatorUnbondingDelegationsResponse pagination + */ + + /** + * Constructs a new QueryDelegatorUnbondingDelegationsResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a QueryDelegatorUnbondingDelegationsResponse. + * @implements IQueryDelegatorUnbondingDelegationsResponse + * @constructor + * @param {cosmos.staking.v1beta1.IQueryDelegatorUnbondingDelegationsResponse=} [properties] Properties to set + */ + function QueryDelegatorUnbondingDelegationsResponse(properties) { + this.unbondingResponses = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryDelegatorUnbondingDelegationsResponse unbondingResponses. + * @member {Array.} unbondingResponses + * @memberof cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse + * @instance + */ + QueryDelegatorUnbondingDelegationsResponse.prototype.unbondingResponses = $util.emptyArray; + + /** + * QueryDelegatorUnbondingDelegationsResponse pagination. + * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination + * @memberof cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse + * @instance + */ + QueryDelegatorUnbondingDelegationsResponse.prototype.pagination = null; + + /** + * Creates a new QueryDelegatorUnbondingDelegationsResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryDelegatorUnbondingDelegationsResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse} QueryDelegatorUnbondingDelegationsResponse instance + */ + QueryDelegatorUnbondingDelegationsResponse.create = function create(properties) { + return new QueryDelegatorUnbondingDelegationsResponse(properties); + }; + + /** + * Encodes the specified QueryDelegatorUnbondingDelegationsResponse message. Does not implicitly {@link cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryDelegatorUnbondingDelegationsResponse} message QueryDelegatorUnbondingDelegationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegatorUnbondingDelegationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.unbondingResponses != null && message.unbondingResponses.length) + for (let i = 0; i < message.unbondingResponses.length; ++i) + $root.cosmos.staking.v1beta1.UnbondingDelegation.encode(message.unbondingResponses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryDelegatorUnbondingDelegationsResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryDelegatorUnbondingDelegationsResponse} message QueryDelegatorUnbondingDelegationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegatorUnbondingDelegationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDelegatorUnbondingDelegationsResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse} QueryDelegatorUnbondingDelegationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegatorUnbondingDelegationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.unbondingResponses && message.unbondingResponses.length)) + message.unbondingResponses = []; + message.unbondingResponses.push($root.cosmos.staking.v1beta1.UnbondingDelegation.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDelegatorUnbondingDelegationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse} QueryDelegatorUnbondingDelegationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegatorUnbondingDelegationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDelegatorUnbondingDelegationsResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDelegatorUnbondingDelegationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.unbondingResponses != null && message.hasOwnProperty("unbondingResponses")) { + if (!Array.isArray(message.unbondingResponses)) + return "unbondingResponses: array expected"; + for (let i = 0; i < message.unbondingResponses.length; ++i) { + let error = $root.cosmos.staking.v1beta1.UnbondingDelegation.verify(message.unbondingResponses[i]); + if (error) + return "unbondingResponses." + error; + } + } + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryDelegatorUnbondingDelegationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse} QueryDelegatorUnbondingDelegationsResponse + */ + QueryDelegatorUnbondingDelegationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse) + return object; + let message = new $root.cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse(); + if (object.unbondingResponses) { + if (!Array.isArray(object.unbondingResponses)) + throw TypeError(".cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse.unbondingResponses: array expected"); + message.unbondingResponses = []; + for (let i = 0; i < object.unbondingResponses.length; ++i) { + if (typeof object.unbondingResponses[i] !== "object") + throw TypeError(".cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse.unbondingResponses: object expected"); + message.unbondingResponses[i] = $root.cosmos.staking.v1beta1.UnbondingDelegation.fromObject(object.unbondingResponses[i]); + } + } + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryDelegatorUnbondingDelegationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse + * @static + * @param {cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse} message QueryDelegatorUnbondingDelegationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDelegatorUnbondingDelegationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.unbondingResponses = []; + if (options.defaults) + object.pagination = null; + if (message.unbondingResponses && message.unbondingResponses.length) { + object.unbondingResponses = []; + for (let j = 0; j < message.unbondingResponses.length; ++j) + object.unbondingResponses[j] = $root.cosmos.staking.v1beta1.UnbondingDelegation.toObject(message.unbondingResponses[j], options); + } + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryDelegatorUnbondingDelegationsResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryDelegatorUnbondingDelegationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryDelegatorUnbondingDelegationsResponse; + })(v1beta1.QueryDelegatorUnbondingDelegationsResponse || {}); + + v1beta1.QueryRedelegationsRequest = (function(QueryRedelegationsRequest) { + + /** + * Properties of a QueryRedelegationsRequest. + * @memberof cosmos.staking.v1beta1 + * @interface IQueryRedelegationsRequest + * @property {string|null} [delegatorAddr] QueryRedelegationsRequest delegatorAddr + * @property {string|null} [srcValidatorAddr] QueryRedelegationsRequest srcValidatorAddr + * @property {string|null} [dstValidatorAddr] QueryRedelegationsRequest dstValidatorAddr + * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryRedelegationsRequest pagination + */ + + /** + * Constructs a new QueryRedelegationsRequest. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a QueryRedelegationsRequest. + * @implements IQueryRedelegationsRequest + * @constructor + * @param {cosmos.staking.v1beta1.IQueryRedelegationsRequest=} [properties] Properties to set + */ + function QueryRedelegationsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryRedelegationsRequest delegatorAddr. + * @member {string} delegatorAddr + * @memberof cosmos.staking.v1beta1.QueryRedelegationsRequest + * @instance + */ + QueryRedelegationsRequest.prototype.delegatorAddr = ""; + + /** + * QueryRedelegationsRequest srcValidatorAddr. + * @member {string} srcValidatorAddr + * @memberof cosmos.staking.v1beta1.QueryRedelegationsRequest + * @instance + */ + QueryRedelegationsRequest.prototype.srcValidatorAddr = ""; + + /** + * QueryRedelegationsRequest dstValidatorAddr. + * @member {string} dstValidatorAddr + * @memberof cosmos.staking.v1beta1.QueryRedelegationsRequest + * @instance + */ + QueryRedelegationsRequest.prototype.dstValidatorAddr = ""; + + /** + * QueryRedelegationsRequest pagination. + * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination + * @memberof cosmos.staking.v1beta1.QueryRedelegationsRequest + * @instance + */ + QueryRedelegationsRequest.prototype.pagination = null; + + /** + * Creates a new QueryRedelegationsRequest instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.QueryRedelegationsRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryRedelegationsRequest=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.QueryRedelegationsRequest} QueryRedelegationsRequest instance + */ + QueryRedelegationsRequest.create = function create(properties) { + return new QueryRedelegationsRequest(properties); + }; + + /** + * Encodes the specified QueryRedelegationsRequest message. Does not implicitly {@link cosmos.staking.v1beta1.QueryRedelegationsRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.QueryRedelegationsRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryRedelegationsRequest} message QueryRedelegationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryRedelegationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddr != null && Object.hasOwnProperty.call(message, "delegatorAddr")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddr); + if (message.srcValidatorAddr != null && Object.hasOwnProperty.call(message, "srcValidatorAddr")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.srcValidatorAddr); + if (message.dstValidatorAddr != null && Object.hasOwnProperty.call(message, "dstValidatorAddr")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dstValidatorAddr); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryRedelegationsRequest message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.QueryRedelegationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.QueryRedelegationsRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryRedelegationsRequest} message QueryRedelegationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryRedelegationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryRedelegationsRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.QueryRedelegationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.QueryRedelegationsRequest} QueryRedelegationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryRedelegationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.QueryRedelegationsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.srcValidatorAddr = reader.string(); + break; + case 3: + message.dstValidatorAddr = reader.string(); + break; + case 4: + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryRedelegationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.QueryRedelegationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.QueryRedelegationsRequest} QueryRedelegationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryRedelegationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryRedelegationsRequest message. + * @function verify + * @memberof cosmos.staking.v1beta1.QueryRedelegationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryRedelegationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddr != null && message.hasOwnProperty("delegatorAddr")) + if (!$util.isString(message.delegatorAddr)) + return "delegatorAddr: string expected"; + if (message.srcValidatorAddr != null && message.hasOwnProperty("srcValidatorAddr")) + if (!$util.isString(message.srcValidatorAddr)) + return "srcValidatorAddr: string expected"; + if (message.dstValidatorAddr != null && message.hasOwnProperty("dstValidatorAddr")) + if (!$util.isString(message.dstValidatorAddr)) + return "dstValidatorAddr: string expected"; + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryRedelegationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.QueryRedelegationsRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.QueryRedelegationsRequest} QueryRedelegationsRequest + */ + QueryRedelegationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.QueryRedelegationsRequest) + return object; + let message = new $root.cosmos.staking.v1beta1.QueryRedelegationsRequest(); + if (object.delegatorAddr != null) + message.delegatorAddr = String(object.delegatorAddr); + if (object.srcValidatorAddr != null) + message.srcValidatorAddr = String(object.srcValidatorAddr); + if (object.dstValidatorAddr != null) + message.dstValidatorAddr = String(object.dstValidatorAddr); + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.staking.v1beta1.QueryRedelegationsRequest.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryRedelegationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.QueryRedelegationsRequest + * @static + * @param {cosmos.staking.v1beta1.QueryRedelegationsRequest} message QueryRedelegationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryRedelegationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.delegatorAddr = ""; + object.srcValidatorAddr = ""; + object.dstValidatorAddr = ""; + object.pagination = null; + } + if (message.delegatorAddr != null && message.hasOwnProperty("delegatorAddr")) + object.delegatorAddr = message.delegatorAddr; + if (message.srcValidatorAddr != null && message.hasOwnProperty("srcValidatorAddr")) + object.srcValidatorAddr = message.srcValidatorAddr; + if (message.dstValidatorAddr != null && message.hasOwnProperty("dstValidatorAddr")) + object.dstValidatorAddr = message.dstValidatorAddr; + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryRedelegationsRequest to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.QueryRedelegationsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryRedelegationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryRedelegationsRequest; + })(v1beta1.QueryRedelegationsRequest || {}); + + v1beta1.QueryRedelegationsResponse = (function(QueryRedelegationsResponse) { + + /** + * Properties of a QueryRedelegationsResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IQueryRedelegationsResponse + * @property {Array.|null} [redelegationResponses] QueryRedelegationsResponse redelegationResponses + * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryRedelegationsResponse pagination + */ + + /** + * Constructs a new QueryRedelegationsResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a QueryRedelegationsResponse. + * @implements IQueryRedelegationsResponse + * @constructor + * @param {cosmos.staking.v1beta1.IQueryRedelegationsResponse=} [properties] Properties to set + */ + function QueryRedelegationsResponse(properties) { + this.redelegationResponses = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryRedelegationsResponse redelegationResponses. + * @member {Array.} redelegationResponses + * @memberof cosmos.staking.v1beta1.QueryRedelegationsResponse + * @instance + */ + QueryRedelegationsResponse.prototype.redelegationResponses = $util.emptyArray; + + /** + * QueryRedelegationsResponse pagination. + * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination + * @memberof cosmos.staking.v1beta1.QueryRedelegationsResponse + * @instance + */ + QueryRedelegationsResponse.prototype.pagination = null; + + /** + * Creates a new QueryRedelegationsResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.QueryRedelegationsResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryRedelegationsResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.QueryRedelegationsResponse} QueryRedelegationsResponse instance + */ + QueryRedelegationsResponse.create = function create(properties) { + return new QueryRedelegationsResponse(properties); + }; + + /** + * Encodes the specified QueryRedelegationsResponse message. Does not implicitly {@link cosmos.staking.v1beta1.QueryRedelegationsResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.QueryRedelegationsResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryRedelegationsResponse} message QueryRedelegationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryRedelegationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.redelegationResponses != null && message.redelegationResponses.length) + for (let i = 0; i < message.redelegationResponses.length; ++i) + $root.cosmos.staking.v1beta1.RedelegationResponse.encode(message.redelegationResponses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryRedelegationsResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.QueryRedelegationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.QueryRedelegationsResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryRedelegationsResponse} message QueryRedelegationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryRedelegationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryRedelegationsResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.QueryRedelegationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.QueryRedelegationsResponse} QueryRedelegationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryRedelegationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.QueryRedelegationsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.redelegationResponses && message.redelegationResponses.length)) + message.redelegationResponses = []; + message.redelegationResponses.push($root.cosmos.staking.v1beta1.RedelegationResponse.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryRedelegationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.QueryRedelegationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.QueryRedelegationsResponse} QueryRedelegationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryRedelegationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryRedelegationsResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.QueryRedelegationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryRedelegationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.redelegationResponses != null && message.hasOwnProperty("redelegationResponses")) { + if (!Array.isArray(message.redelegationResponses)) + return "redelegationResponses: array expected"; + for (let i = 0; i < message.redelegationResponses.length; ++i) { + let error = $root.cosmos.staking.v1beta1.RedelegationResponse.verify(message.redelegationResponses[i]); + if (error) + return "redelegationResponses." + error; + } + } + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryRedelegationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.QueryRedelegationsResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.QueryRedelegationsResponse} QueryRedelegationsResponse + */ + QueryRedelegationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.QueryRedelegationsResponse) + return object; + let message = new $root.cosmos.staking.v1beta1.QueryRedelegationsResponse(); + if (object.redelegationResponses) { + if (!Array.isArray(object.redelegationResponses)) + throw TypeError(".cosmos.staking.v1beta1.QueryRedelegationsResponse.redelegationResponses: array expected"); + message.redelegationResponses = []; + for (let i = 0; i < object.redelegationResponses.length; ++i) { + if (typeof object.redelegationResponses[i] !== "object") + throw TypeError(".cosmos.staking.v1beta1.QueryRedelegationsResponse.redelegationResponses: object expected"); + message.redelegationResponses[i] = $root.cosmos.staking.v1beta1.RedelegationResponse.fromObject(object.redelegationResponses[i]); + } + } + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.staking.v1beta1.QueryRedelegationsResponse.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryRedelegationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.QueryRedelegationsResponse + * @static + * @param {cosmos.staking.v1beta1.QueryRedelegationsResponse} message QueryRedelegationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryRedelegationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.redelegationResponses = []; + if (options.defaults) + object.pagination = null; + if (message.redelegationResponses && message.redelegationResponses.length) { + object.redelegationResponses = []; + for (let j = 0; j < message.redelegationResponses.length; ++j) + object.redelegationResponses[j] = $root.cosmos.staking.v1beta1.RedelegationResponse.toObject(message.redelegationResponses[j], options); + } + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryRedelegationsResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.QueryRedelegationsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryRedelegationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryRedelegationsResponse; + })(v1beta1.QueryRedelegationsResponse || {}); + + v1beta1.QueryDelegatorValidatorsRequest = (function(QueryDelegatorValidatorsRequest) { + + /** + * Properties of a QueryDelegatorValidatorsRequest. + * @memberof cosmos.staking.v1beta1 + * @interface IQueryDelegatorValidatorsRequest + * @property {string|null} [delegatorAddr] QueryDelegatorValidatorsRequest delegatorAddr + * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryDelegatorValidatorsRequest pagination + */ + + /** + * Constructs a new QueryDelegatorValidatorsRequest. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a QueryDelegatorValidatorsRequest. + * @implements IQueryDelegatorValidatorsRequest + * @constructor + * @param {cosmos.staking.v1beta1.IQueryDelegatorValidatorsRequest=} [properties] Properties to set + */ + function QueryDelegatorValidatorsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryDelegatorValidatorsRequest delegatorAddr. + * @member {string} delegatorAddr + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest + * @instance + */ + QueryDelegatorValidatorsRequest.prototype.delegatorAddr = ""; + + /** + * QueryDelegatorValidatorsRequest pagination. + * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest + * @instance + */ + QueryDelegatorValidatorsRequest.prototype.pagination = null; + + /** + * Creates a new QueryDelegatorValidatorsRequest instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryDelegatorValidatorsRequest=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest} QueryDelegatorValidatorsRequest instance + */ + QueryDelegatorValidatorsRequest.create = function create(properties) { + return new QueryDelegatorValidatorsRequest(properties); + }; + + /** + * Encodes the specified QueryDelegatorValidatorsRequest message. Does not implicitly {@link cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryDelegatorValidatorsRequest} message QueryDelegatorValidatorsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegatorValidatorsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddr != null && Object.hasOwnProperty.call(message, "delegatorAddr")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddr); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryDelegatorValidatorsRequest message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryDelegatorValidatorsRequest} message QueryDelegatorValidatorsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegatorValidatorsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDelegatorValidatorsRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest} QueryDelegatorValidatorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegatorValidatorsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDelegatorValidatorsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest} QueryDelegatorValidatorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegatorValidatorsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDelegatorValidatorsRequest message. + * @function verify + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDelegatorValidatorsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddr != null && message.hasOwnProperty("delegatorAddr")) + if (!$util.isString(message.delegatorAddr)) + return "delegatorAddr: string expected"; + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryDelegatorValidatorsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest} QueryDelegatorValidatorsRequest + */ + QueryDelegatorValidatorsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest) + return object; + let message = new $root.cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest(); + if (object.delegatorAddr != null) + message.delegatorAddr = String(object.delegatorAddr); + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryDelegatorValidatorsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest + * @static + * @param {cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest} message QueryDelegatorValidatorsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDelegatorValidatorsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.delegatorAddr = ""; + object.pagination = null; + } + if (message.delegatorAddr != null && message.hasOwnProperty("delegatorAddr")) + object.delegatorAddr = message.delegatorAddr; + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryDelegatorValidatorsRequest to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryDelegatorValidatorsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryDelegatorValidatorsRequest; + })(v1beta1.QueryDelegatorValidatorsRequest || {}); + + v1beta1.QueryDelegatorValidatorsResponse = (function(QueryDelegatorValidatorsResponse) { + + /** + * Properties of a QueryDelegatorValidatorsResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IQueryDelegatorValidatorsResponse + * @property {Array.|null} [validators] QueryDelegatorValidatorsResponse validators + * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryDelegatorValidatorsResponse pagination + */ + + /** + * Constructs a new QueryDelegatorValidatorsResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a QueryDelegatorValidatorsResponse. + * @implements IQueryDelegatorValidatorsResponse + * @constructor + * @param {cosmos.staking.v1beta1.IQueryDelegatorValidatorsResponse=} [properties] Properties to set + */ + function QueryDelegatorValidatorsResponse(properties) { + this.validators = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryDelegatorValidatorsResponse validators. + * @member {Array.} validators + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse + * @instance + */ + QueryDelegatorValidatorsResponse.prototype.validators = $util.emptyArray; + + /** + * QueryDelegatorValidatorsResponse pagination. + * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse + * @instance + */ + QueryDelegatorValidatorsResponse.prototype.pagination = null; + + /** + * Creates a new QueryDelegatorValidatorsResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryDelegatorValidatorsResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse} QueryDelegatorValidatorsResponse instance + */ + QueryDelegatorValidatorsResponse.create = function create(properties) { + return new QueryDelegatorValidatorsResponse(properties); + }; + + /** + * Encodes the specified QueryDelegatorValidatorsResponse message. Does not implicitly {@link cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryDelegatorValidatorsResponse} message QueryDelegatorValidatorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegatorValidatorsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validators != null && message.validators.length) + for (let i = 0; i < message.validators.length; ++i) + $root.cosmos.staking.v1beta1.Validator.encode(message.validators[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryDelegatorValidatorsResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryDelegatorValidatorsResponse} message QueryDelegatorValidatorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegatorValidatorsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDelegatorValidatorsResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse} QueryDelegatorValidatorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegatorValidatorsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.validators && message.validators.length)) + message.validators = []; + message.validators.push($root.cosmos.staking.v1beta1.Validator.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDelegatorValidatorsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse} QueryDelegatorValidatorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegatorValidatorsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDelegatorValidatorsResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDelegatorValidatorsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validators != null && message.hasOwnProperty("validators")) { + if (!Array.isArray(message.validators)) + return "validators: array expected"; + for (let i = 0; i < message.validators.length; ++i) { + let error = $root.cosmos.staking.v1beta1.Validator.verify(message.validators[i]); + if (error) + return "validators." + error; + } + } + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryDelegatorValidatorsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse} QueryDelegatorValidatorsResponse + */ + QueryDelegatorValidatorsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse) + return object; + let message = new $root.cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse(); + if (object.validators) { + if (!Array.isArray(object.validators)) + throw TypeError(".cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse.validators: array expected"); + message.validators = []; + for (let i = 0; i < object.validators.length; ++i) { + if (typeof object.validators[i] !== "object") + throw TypeError(".cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse.validators: object expected"); + message.validators[i] = $root.cosmos.staking.v1beta1.Validator.fromObject(object.validators[i]); + } + } + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryDelegatorValidatorsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse + * @static + * @param {cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse} message QueryDelegatorValidatorsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDelegatorValidatorsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.validators = []; + if (options.defaults) + object.pagination = null; + if (message.validators && message.validators.length) { + object.validators = []; + for (let j = 0; j < message.validators.length; ++j) + object.validators[j] = $root.cosmos.staking.v1beta1.Validator.toObject(message.validators[j], options); + } + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryDelegatorValidatorsResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryDelegatorValidatorsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryDelegatorValidatorsResponse; + })(v1beta1.QueryDelegatorValidatorsResponse || {}); + + v1beta1.QueryDelegatorValidatorRequest = (function(QueryDelegatorValidatorRequest) { + + /** + * Properties of a QueryDelegatorValidatorRequest. + * @memberof cosmos.staking.v1beta1 + * @interface IQueryDelegatorValidatorRequest + * @property {string|null} [delegatorAddr] QueryDelegatorValidatorRequest delegatorAddr + * @property {string|null} [validatorAddr] QueryDelegatorValidatorRequest validatorAddr + */ + + /** + * Constructs a new QueryDelegatorValidatorRequest. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a QueryDelegatorValidatorRequest. + * @implements IQueryDelegatorValidatorRequest + * @constructor + * @param {cosmos.staking.v1beta1.IQueryDelegatorValidatorRequest=} [properties] Properties to set + */ + function QueryDelegatorValidatorRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryDelegatorValidatorRequest delegatorAddr. + * @member {string} delegatorAddr + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorRequest + * @instance + */ + QueryDelegatorValidatorRequest.prototype.delegatorAddr = ""; + + /** + * QueryDelegatorValidatorRequest validatorAddr. + * @member {string} validatorAddr + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorRequest + * @instance + */ + QueryDelegatorValidatorRequest.prototype.validatorAddr = ""; + + /** + * Creates a new QueryDelegatorValidatorRequest instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryDelegatorValidatorRequest=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.QueryDelegatorValidatorRequest} QueryDelegatorValidatorRequest instance + */ + QueryDelegatorValidatorRequest.create = function create(properties) { + return new QueryDelegatorValidatorRequest(properties); + }; + + /** + * Encodes the specified QueryDelegatorValidatorRequest message. Does not implicitly {@link cosmos.staking.v1beta1.QueryDelegatorValidatorRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryDelegatorValidatorRequest} message QueryDelegatorValidatorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegatorValidatorRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddr != null && Object.hasOwnProperty.call(message, "delegatorAddr")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddr); + if (message.validatorAddr != null && Object.hasOwnProperty.call(message, "validatorAddr")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddr); + return writer; + }; + + /** + * Encodes the specified QueryDelegatorValidatorRequest message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.QueryDelegatorValidatorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryDelegatorValidatorRequest} message QueryDelegatorValidatorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegatorValidatorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDelegatorValidatorRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.QueryDelegatorValidatorRequest} QueryDelegatorValidatorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegatorValidatorRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.QueryDelegatorValidatorRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.validatorAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDelegatorValidatorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.QueryDelegatorValidatorRequest} QueryDelegatorValidatorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegatorValidatorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDelegatorValidatorRequest message. + * @function verify + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDelegatorValidatorRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddr != null && message.hasOwnProperty("delegatorAddr")) + if (!$util.isString(message.delegatorAddr)) + return "delegatorAddr: string expected"; + if (message.validatorAddr != null && message.hasOwnProperty("validatorAddr")) + if (!$util.isString(message.validatorAddr)) + return "validatorAddr: string expected"; + return null; + }; + + /** + * Creates a QueryDelegatorValidatorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.QueryDelegatorValidatorRequest} QueryDelegatorValidatorRequest + */ + QueryDelegatorValidatorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.QueryDelegatorValidatorRequest) + return object; + let message = new $root.cosmos.staking.v1beta1.QueryDelegatorValidatorRequest(); + if (object.delegatorAddr != null) + message.delegatorAddr = String(object.delegatorAddr); + if (object.validatorAddr != null) + message.validatorAddr = String(object.validatorAddr); + return message; + }; + + /** + * Creates a plain object from a QueryDelegatorValidatorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorRequest + * @static + * @param {cosmos.staking.v1beta1.QueryDelegatorValidatorRequest} message QueryDelegatorValidatorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDelegatorValidatorRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.delegatorAddr = ""; + object.validatorAddr = ""; + } + if (message.delegatorAddr != null && message.hasOwnProperty("delegatorAddr")) + object.delegatorAddr = message.delegatorAddr; + if (message.validatorAddr != null && message.hasOwnProperty("validatorAddr")) + object.validatorAddr = message.validatorAddr; + return object; + }; + + /** + * Converts this QueryDelegatorValidatorRequest to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorRequest + * @instance + * @returns {Object.} JSON object + */ + QueryDelegatorValidatorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryDelegatorValidatorRequest; + })(v1beta1.QueryDelegatorValidatorRequest || {}); + + v1beta1.QueryDelegatorValidatorResponse = (function(QueryDelegatorValidatorResponse) { + + /** + * Properties of a QueryDelegatorValidatorResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IQueryDelegatorValidatorResponse + * @property {cosmos.staking.v1beta1.IValidator|null} [validator] QueryDelegatorValidatorResponse validator + */ + + /** + * Constructs a new QueryDelegatorValidatorResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a QueryDelegatorValidatorResponse. + * @implements IQueryDelegatorValidatorResponse + * @constructor + * @param {cosmos.staking.v1beta1.IQueryDelegatorValidatorResponse=} [properties] Properties to set + */ + function QueryDelegatorValidatorResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryDelegatorValidatorResponse validator. + * @member {cosmos.staking.v1beta1.IValidator|null|undefined} validator + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorResponse + * @instance + */ + QueryDelegatorValidatorResponse.prototype.validator = null; + + /** + * Creates a new QueryDelegatorValidatorResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryDelegatorValidatorResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.QueryDelegatorValidatorResponse} QueryDelegatorValidatorResponse instance + */ + QueryDelegatorValidatorResponse.create = function create(properties) { + return new QueryDelegatorValidatorResponse(properties); + }; + + /** + * Encodes the specified QueryDelegatorValidatorResponse message. Does not implicitly {@link cosmos.staking.v1beta1.QueryDelegatorValidatorResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryDelegatorValidatorResponse} message QueryDelegatorValidatorResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegatorValidatorResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validator != null && Object.hasOwnProperty.call(message, "validator")) + $root.cosmos.staking.v1beta1.Validator.encode(message.validator, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryDelegatorValidatorResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.QueryDelegatorValidatorResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryDelegatorValidatorResponse} message QueryDelegatorValidatorResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDelegatorValidatorResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDelegatorValidatorResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.QueryDelegatorValidatorResponse} QueryDelegatorValidatorResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegatorValidatorResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.QueryDelegatorValidatorResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validator = $root.cosmos.staking.v1beta1.Validator.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDelegatorValidatorResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.QueryDelegatorValidatorResponse} QueryDelegatorValidatorResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDelegatorValidatorResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDelegatorValidatorResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDelegatorValidatorResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validator != null && message.hasOwnProperty("validator")) { + let error = $root.cosmos.staking.v1beta1.Validator.verify(message.validator); + if (error) + return "validator." + error; + } + return null; + }; + + /** + * Creates a QueryDelegatorValidatorResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.QueryDelegatorValidatorResponse} QueryDelegatorValidatorResponse + */ + QueryDelegatorValidatorResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.QueryDelegatorValidatorResponse) + return object; + let message = new $root.cosmos.staking.v1beta1.QueryDelegatorValidatorResponse(); + if (object.validator != null) { + if (typeof object.validator !== "object") + throw TypeError(".cosmos.staking.v1beta1.QueryDelegatorValidatorResponse.validator: object expected"); + message.validator = $root.cosmos.staking.v1beta1.Validator.fromObject(object.validator); + } + return message; + }; + + /** + * Creates a plain object from a QueryDelegatorValidatorResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorResponse + * @static + * @param {cosmos.staking.v1beta1.QueryDelegatorValidatorResponse} message QueryDelegatorValidatorResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDelegatorValidatorResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.validator = null; + if (message.validator != null && message.hasOwnProperty("validator")) + object.validator = $root.cosmos.staking.v1beta1.Validator.toObject(message.validator, options); + return object; + }; + + /** + * Converts this QueryDelegatorValidatorResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.QueryDelegatorValidatorResponse + * @instance + * @returns {Object.} JSON object + */ + QueryDelegatorValidatorResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryDelegatorValidatorResponse; + })(v1beta1.QueryDelegatorValidatorResponse || {}); + + v1beta1.QueryHistoricalInfoRequest = (function(QueryHistoricalInfoRequest) { + + /** + * Properties of a QueryHistoricalInfoRequest. + * @memberof cosmos.staking.v1beta1 + * @interface IQueryHistoricalInfoRequest + * @property {number|Long|null} [height] QueryHistoricalInfoRequest height + */ + + /** + * Constructs a new QueryHistoricalInfoRequest. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a QueryHistoricalInfoRequest. + * @implements IQueryHistoricalInfoRequest + * @constructor + * @param {cosmos.staking.v1beta1.IQueryHistoricalInfoRequest=} [properties] Properties to set + */ + function QueryHistoricalInfoRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryHistoricalInfoRequest height. + * @member {number|Long} height + * @memberof cosmos.staking.v1beta1.QueryHistoricalInfoRequest + * @instance + */ + QueryHistoricalInfoRequest.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new QueryHistoricalInfoRequest instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.QueryHistoricalInfoRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryHistoricalInfoRequest=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.QueryHistoricalInfoRequest} QueryHistoricalInfoRequest instance + */ + QueryHistoricalInfoRequest.create = function create(properties) { + return new QueryHistoricalInfoRequest(properties); + }; + + /** + * Encodes the specified QueryHistoricalInfoRequest message. Does not implicitly {@link cosmos.staking.v1beta1.QueryHistoricalInfoRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.QueryHistoricalInfoRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryHistoricalInfoRequest} message QueryHistoricalInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryHistoricalInfoRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.height); + return writer; + }; + + /** + * Encodes the specified QueryHistoricalInfoRequest message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.QueryHistoricalInfoRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.QueryHistoricalInfoRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryHistoricalInfoRequest} message QueryHistoricalInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryHistoricalInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryHistoricalInfoRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.QueryHistoricalInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.QueryHistoricalInfoRequest} QueryHistoricalInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryHistoricalInfoRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.QueryHistoricalInfoRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryHistoricalInfoRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.QueryHistoricalInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.QueryHistoricalInfoRequest} QueryHistoricalInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryHistoricalInfoRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryHistoricalInfoRequest message. + * @function verify + * @memberof cosmos.staking.v1beta1.QueryHistoricalInfoRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryHistoricalInfoRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + return null; + }; + + /** + * Creates a QueryHistoricalInfoRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.QueryHistoricalInfoRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.QueryHistoricalInfoRequest} QueryHistoricalInfoRequest + */ + QueryHistoricalInfoRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.QueryHistoricalInfoRequest) + return object; + let message = new $root.cosmos.staking.v1beta1.QueryHistoricalInfoRequest(); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a QueryHistoricalInfoRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.QueryHistoricalInfoRequest + * @static + * @param {cosmos.staking.v1beta1.QueryHistoricalInfoRequest} message QueryHistoricalInfoRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryHistoricalInfoRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + return object; + }; + + /** + * Converts this QueryHistoricalInfoRequest to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.QueryHistoricalInfoRequest + * @instance + * @returns {Object.} JSON object + */ + QueryHistoricalInfoRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryHistoricalInfoRequest; + })(v1beta1.QueryHistoricalInfoRequest || {}); + + v1beta1.QueryHistoricalInfoResponse = (function(QueryHistoricalInfoResponse) { + + /** + * Properties of a QueryHistoricalInfoResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IQueryHistoricalInfoResponse + * @property {cosmos.staking.v1beta1.IHistoricalInfo|null} [hist] QueryHistoricalInfoResponse hist + */ + + /** + * Constructs a new QueryHistoricalInfoResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a QueryHistoricalInfoResponse. + * @implements IQueryHistoricalInfoResponse + * @constructor + * @param {cosmos.staking.v1beta1.IQueryHistoricalInfoResponse=} [properties] Properties to set + */ + function QueryHistoricalInfoResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryHistoricalInfoResponse hist. + * @member {cosmos.staking.v1beta1.IHistoricalInfo|null|undefined} hist + * @memberof cosmos.staking.v1beta1.QueryHistoricalInfoResponse + * @instance + */ + QueryHistoricalInfoResponse.prototype.hist = null; + + /** + * Creates a new QueryHistoricalInfoResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.QueryHistoricalInfoResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryHistoricalInfoResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.QueryHistoricalInfoResponse} QueryHistoricalInfoResponse instance + */ + QueryHistoricalInfoResponse.create = function create(properties) { + return new QueryHistoricalInfoResponse(properties); + }; + + /** + * Encodes the specified QueryHistoricalInfoResponse message. Does not implicitly {@link cosmos.staking.v1beta1.QueryHistoricalInfoResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.QueryHistoricalInfoResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryHistoricalInfoResponse} message QueryHistoricalInfoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryHistoricalInfoResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hist != null && Object.hasOwnProperty.call(message, "hist")) + $root.cosmos.staking.v1beta1.HistoricalInfo.encode(message.hist, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryHistoricalInfoResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.QueryHistoricalInfoResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.QueryHistoricalInfoResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryHistoricalInfoResponse} message QueryHistoricalInfoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryHistoricalInfoResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryHistoricalInfoResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.QueryHistoricalInfoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.QueryHistoricalInfoResponse} QueryHistoricalInfoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryHistoricalInfoResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.QueryHistoricalInfoResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hist = $root.cosmos.staking.v1beta1.HistoricalInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryHistoricalInfoResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.QueryHistoricalInfoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.QueryHistoricalInfoResponse} QueryHistoricalInfoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryHistoricalInfoResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryHistoricalInfoResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.QueryHistoricalInfoResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryHistoricalInfoResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hist != null && message.hasOwnProperty("hist")) { + let error = $root.cosmos.staking.v1beta1.HistoricalInfo.verify(message.hist); + if (error) + return "hist." + error; + } + return null; + }; + + /** + * Creates a QueryHistoricalInfoResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.QueryHistoricalInfoResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.QueryHistoricalInfoResponse} QueryHistoricalInfoResponse + */ + QueryHistoricalInfoResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.QueryHistoricalInfoResponse) + return object; + let message = new $root.cosmos.staking.v1beta1.QueryHistoricalInfoResponse(); + if (object.hist != null) { + if (typeof object.hist !== "object") + throw TypeError(".cosmos.staking.v1beta1.QueryHistoricalInfoResponse.hist: object expected"); + message.hist = $root.cosmos.staking.v1beta1.HistoricalInfo.fromObject(object.hist); + } + return message; + }; + + /** + * Creates a plain object from a QueryHistoricalInfoResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.QueryHistoricalInfoResponse + * @static + * @param {cosmos.staking.v1beta1.QueryHistoricalInfoResponse} message QueryHistoricalInfoResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryHistoricalInfoResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.hist = null; + if (message.hist != null && message.hasOwnProperty("hist")) + object.hist = $root.cosmos.staking.v1beta1.HistoricalInfo.toObject(message.hist, options); + return object; + }; + + /** + * Converts this QueryHistoricalInfoResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.QueryHistoricalInfoResponse + * @instance + * @returns {Object.} JSON object + */ + QueryHistoricalInfoResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryHistoricalInfoResponse; + })(v1beta1.QueryHistoricalInfoResponse || {}); + + v1beta1.QueryPoolRequest = (function(QueryPoolRequest) { + + /** + * Properties of a QueryPoolRequest. + * @memberof cosmos.staking.v1beta1 + * @interface IQueryPoolRequest + */ + + /** + * Constructs a new QueryPoolRequest. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a QueryPoolRequest. + * @implements IQueryPoolRequest + * @constructor + * @param {cosmos.staking.v1beta1.IQueryPoolRequest=} [properties] Properties to set + */ + function QueryPoolRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new QueryPoolRequest instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.QueryPoolRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryPoolRequest=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.QueryPoolRequest} QueryPoolRequest instance + */ + QueryPoolRequest.create = function create(properties) { + return new QueryPoolRequest(properties); + }; + + /** + * Encodes the specified QueryPoolRequest message. Does not implicitly {@link cosmos.staking.v1beta1.QueryPoolRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.QueryPoolRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryPoolRequest} message QueryPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryPoolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified QueryPoolRequest message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.QueryPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.QueryPoolRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryPoolRequest} message QueryPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.QueryPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.QueryPoolRequest} QueryPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryPoolRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.QueryPoolRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.QueryPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.QueryPoolRequest} QueryPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryPoolRequest message. + * @function verify + * @memberof cosmos.staking.v1beta1.QueryPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryPoolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a QueryPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.QueryPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.QueryPoolRequest} QueryPoolRequest + */ + QueryPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.QueryPoolRequest) + return object; + return new $root.cosmos.staking.v1beta1.QueryPoolRequest(); + }; + + /** + * Creates a plain object from a QueryPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.QueryPoolRequest + * @static + * @param {cosmos.staking.v1beta1.QueryPoolRequest} message QueryPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryPoolRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this QueryPoolRequest to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.QueryPoolRequest + * @instance + * @returns {Object.} JSON object + */ + QueryPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryPoolRequest; + })(v1beta1.QueryPoolRequest || {}); + + v1beta1.QueryPoolResponse = (function(QueryPoolResponse) { + + /** + * Properties of a QueryPoolResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IQueryPoolResponse + * @property {cosmos.staking.v1beta1.IPool|null} [pool] QueryPoolResponse pool + */ + + /** + * Constructs a new QueryPoolResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a QueryPoolResponse. + * @implements IQueryPoolResponse + * @constructor + * @param {cosmos.staking.v1beta1.IQueryPoolResponse=} [properties] Properties to set + */ + function QueryPoolResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryPoolResponse pool. + * @member {cosmos.staking.v1beta1.IPool|null|undefined} pool + * @memberof cosmos.staking.v1beta1.QueryPoolResponse + * @instance + */ + QueryPoolResponse.prototype.pool = null; + + /** + * Creates a new QueryPoolResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.QueryPoolResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryPoolResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.QueryPoolResponse} QueryPoolResponse instance + */ + QueryPoolResponse.create = function create(properties) { + return new QueryPoolResponse(properties); + }; + + /** + * Encodes the specified QueryPoolResponse message. Does not implicitly {@link cosmos.staking.v1beta1.QueryPoolResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.QueryPoolResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryPoolResponse} message QueryPoolResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryPoolResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pool != null && Object.hasOwnProperty.call(message, "pool")) + $root.cosmos.staking.v1beta1.Pool.encode(message.pool, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryPoolResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.QueryPoolResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.QueryPoolResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryPoolResponse} message QueryPoolResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryPoolResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryPoolResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.QueryPoolResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.QueryPoolResponse} QueryPoolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryPoolResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.QueryPoolResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pool = $root.cosmos.staking.v1beta1.Pool.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryPoolResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.QueryPoolResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.QueryPoolResponse} QueryPoolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryPoolResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryPoolResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.QueryPoolResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryPoolResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pool != null && message.hasOwnProperty("pool")) { + let error = $root.cosmos.staking.v1beta1.Pool.verify(message.pool); + if (error) + return "pool." + error; + } + return null; + }; + + /** + * Creates a QueryPoolResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.QueryPoolResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.QueryPoolResponse} QueryPoolResponse + */ + QueryPoolResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.QueryPoolResponse) + return object; + let message = new $root.cosmos.staking.v1beta1.QueryPoolResponse(); + if (object.pool != null) { + if (typeof object.pool !== "object") + throw TypeError(".cosmos.staking.v1beta1.QueryPoolResponse.pool: object expected"); + message.pool = $root.cosmos.staking.v1beta1.Pool.fromObject(object.pool); + } + return message; + }; + + /** + * Creates a plain object from a QueryPoolResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.QueryPoolResponse + * @static + * @param {cosmos.staking.v1beta1.QueryPoolResponse} message QueryPoolResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryPoolResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.pool = null; + if (message.pool != null && message.hasOwnProperty("pool")) + object.pool = $root.cosmos.staking.v1beta1.Pool.toObject(message.pool, options); + return object; + }; + + /** + * Converts this QueryPoolResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.QueryPoolResponse + * @instance + * @returns {Object.} JSON object + */ + QueryPoolResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryPoolResponse; + })(v1beta1.QueryPoolResponse || {}); + + v1beta1.QueryParamsRequest = (function(QueryParamsRequest) { + + /** + * Properties of a QueryParamsRequest. + * @memberof cosmos.staking.v1beta1 + * @interface IQueryParamsRequest + */ + + /** + * Constructs a new QueryParamsRequest. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a QueryParamsRequest. + * @implements IQueryParamsRequest + * @constructor + * @param {cosmos.staking.v1beta1.IQueryParamsRequest=} [properties] Properties to set + */ + function QueryParamsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new QueryParamsRequest instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.QueryParamsRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryParamsRequest=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.QueryParamsRequest} QueryParamsRequest instance + */ + QueryParamsRequest.create = function create(properties) { + return new QueryParamsRequest(properties); + }; + + /** + * Encodes the specified QueryParamsRequest message. Does not implicitly {@link cosmos.staking.v1beta1.QueryParamsRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.QueryParamsRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.QueryParamsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.QueryParamsRequest + * @static + * @param {cosmos.staking.v1beta1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryParamsRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.QueryParamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.QueryParamsRequest} QueryParamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.QueryParamsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.QueryParamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.QueryParamsRequest} QueryParamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryParamsRequest message. + * @function verify + * @memberof cosmos.staking.v1beta1.QueryParamsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryParamsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.QueryParamsRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.QueryParamsRequest} QueryParamsRequest + */ + QueryParamsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.QueryParamsRequest) + return object; + return new $root.cosmos.staking.v1beta1.QueryParamsRequest(); + }; + + /** + * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.QueryParamsRequest + * @static + * @param {cosmos.staking.v1beta1.QueryParamsRequest} message QueryParamsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryParamsRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this QueryParamsRequest to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.QueryParamsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryParamsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryParamsRequest; + })(v1beta1.QueryParamsRequest || {}); + + v1beta1.QueryParamsResponse = (function(QueryParamsResponse) { + + /** + * Properties of a QueryParamsResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IQueryParamsResponse + * @property {cosmos.staking.v1beta1.IParams|null} [params] QueryParamsResponse params + */ + + /** + * Constructs a new QueryParamsResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a QueryParamsResponse. + * @implements IQueryParamsResponse + * @constructor + * @param {cosmos.staking.v1beta1.IQueryParamsResponse=} [properties] Properties to set + */ + function QueryParamsResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryParamsResponse params. + * @member {cosmos.staking.v1beta1.IParams|null|undefined} params + * @memberof cosmos.staking.v1beta1.QueryParamsResponse + * @instance + */ + QueryParamsResponse.prototype.params = null; + + /** + * Creates a new QueryParamsResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.QueryParamsResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryParamsResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.QueryParamsResponse} QueryParamsResponse instance + */ + QueryParamsResponse.create = function create(properties) { + return new QueryParamsResponse(properties); + }; + + /** + * Encodes the specified QueryParamsResponse message. Does not implicitly {@link cosmos.staking.v1beta1.QueryParamsResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.QueryParamsResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.cosmos.staking.v1beta1.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.QueryParamsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.QueryParamsResponse + * @static + * @param {cosmos.staking.v1beta1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryParamsResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.QueryParamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.QueryParamsResponse} QueryParamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.QueryParamsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = $root.cosmos.staking.v1beta1.Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.QueryParamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.QueryParamsResponse} QueryParamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryParamsResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.QueryParamsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryParamsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.params != null && message.hasOwnProperty("params")) { + let error = $root.cosmos.staking.v1beta1.Params.verify(message.params); + if (error) + return "params." + error; + } + return null; + }; + + /** + * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.QueryParamsResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.QueryParamsResponse} QueryParamsResponse + */ + QueryParamsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.QueryParamsResponse) + return object; + let message = new $root.cosmos.staking.v1beta1.QueryParamsResponse(); + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".cosmos.staking.v1beta1.QueryParamsResponse.params: object expected"); + message.params = $root.cosmos.staking.v1beta1.Params.fromObject(object.params); + } + return message; + }; + + /** + * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.QueryParamsResponse + * @static + * @param {cosmos.staking.v1beta1.QueryParamsResponse} message QueryParamsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryParamsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.params = null; + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.cosmos.staking.v1beta1.Params.toObject(message.params, options); + return object; + }; + + /** + * Converts this QueryParamsResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.QueryParamsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryParamsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryParamsResponse; + })(v1beta1.QueryParamsResponse || {}); + + v1beta1.HistoricalInfo = (function(HistoricalInfo) { + + /** + * Properties of a HistoricalInfo. + * @memberof cosmos.staking.v1beta1 + * @interface IHistoricalInfo + * @property {tendermint.types.IHeader|null} [header] HistoricalInfo header + * @property {Array.|null} [valset] HistoricalInfo valset + */ + + /** + * Constructs a new HistoricalInfo. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a HistoricalInfo. + * @implements IHistoricalInfo + * @constructor + * @param {cosmos.staking.v1beta1.IHistoricalInfo=} [properties] Properties to set + */ + function HistoricalInfo(properties) { + this.valset = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HistoricalInfo header. + * @member {tendermint.types.IHeader|null|undefined} header + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @instance + */ + HistoricalInfo.prototype.header = null; + + /** + * HistoricalInfo valset. + * @member {Array.} valset + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @instance + */ + HistoricalInfo.prototype.valset = $util.emptyArray; + + /** + * Creates a new HistoricalInfo instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @static + * @param {cosmos.staking.v1beta1.IHistoricalInfo=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.HistoricalInfo} HistoricalInfo instance + */ + HistoricalInfo.create = function create(properties) { + return new HistoricalInfo(properties); + }; + + /** + * Encodes the specified HistoricalInfo message. Does not implicitly {@link cosmos.staking.v1beta1.HistoricalInfo.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @static + * @param {cosmos.staking.v1beta1.IHistoricalInfo} message HistoricalInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HistoricalInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + $root.tendermint.types.Header.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.valset != null && message.valset.length) + for (let i = 0; i < message.valset.length; ++i) + $root.cosmos.staking.v1beta1.Validator.encode(message.valset[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HistoricalInfo message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.HistoricalInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @static + * @param {cosmos.staking.v1beta1.IHistoricalInfo} message HistoricalInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HistoricalInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HistoricalInfo message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.HistoricalInfo} HistoricalInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HistoricalInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.HistoricalInfo(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.header = $root.tendermint.types.Header.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.valset && message.valset.length)) + message.valset = []; + message.valset.push($root.cosmos.staking.v1beta1.Validator.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HistoricalInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.HistoricalInfo} HistoricalInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HistoricalInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HistoricalInfo message. + * @function verify + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HistoricalInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.header != null && message.hasOwnProperty("header")) { + let error = $root.tendermint.types.Header.verify(message.header); + if (error) + return "header." + error; + } + if (message.valset != null && message.hasOwnProperty("valset")) { + if (!Array.isArray(message.valset)) + return "valset: array expected"; + for (let i = 0; i < message.valset.length; ++i) { + let error = $root.cosmos.staking.v1beta1.Validator.verify(message.valset[i]); + if (error) + return "valset." + error; + } + } + return null; + }; + + /** + * Creates a HistoricalInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.HistoricalInfo} HistoricalInfo + */ + HistoricalInfo.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.HistoricalInfo) + return object; + let message = new $root.cosmos.staking.v1beta1.HistoricalInfo(); + if (object.header != null) { + if (typeof object.header !== "object") + throw TypeError(".cosmos.staking.v1beta1.HistoricalInfo.header: object expected"); + message.header = $root.tendermint.types.Header.fromObject(object.header); + } + if (object.valset) { + if (!Array.isArray(object.valset)) + throw TypeError(".cosmos.staking.v1beta1.HistoricalInfo.valset: array expected"); + message.valset = []; + for (let i = 0; i < object.valset.length; ++i) { + if (typeof object.valset[i] !== "object") + throw TypeError(".cosmos.staking.v1beta1.HistoricalInfo.valset: object expected"); + message.valset[i] = $root.cosmos.staking.v1beta1.Validator.fromObject(object.valset[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HistoricalInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @static + * @param {cosmos.staking.v1beta1.HistoricalInfo} message HistoricalInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HistoricalInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.valset = []; + if (options.defaults) + object.header = null; + if (message.header != null && message.hasOwnProperty("header")) + object.header = $root.tendermint.types.Header.toObject(message.header, options); + if (message.valset && message.valset.length) { + object.valset = []; + for (let j = 0; j < message.valset.length; ++j) + object.valset[j] = $root.cosmos.staking.v1beta1.Validator.toObject(message.valset[j], options); + } + return object; + }; + + /** + * Converts this HistoricalInfo to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.HistoricalInfo + * @instance + * @returns {Object.} JSON object + */ + HistoricalInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HistoricalInfo; + })(v1beta1.HistoricalInfo || {}); + + v1beta1.CommissionRates = (function(CommissionRates) { + + /** + * Properties of a CommissionRates. + * @memberof cosmos.staking.v1beta1 + * @interface ICommissionRates + * @property {string|null} [rate] CommissionRates rate + * @property {string|null} [maxRate] CommissionRates maxRate + * @property {string|null} [maxChangeRate] CommissionRates maxChangeRate + */ + + /** + * Constructs a new CommissionRates. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a CommissionRates. + * @implements ICommissionRates + * @constructor + * @param {cosmos.staking.v1beta1.ICommissionRates=} [properties] Properties to set + */ + function CommissionRates(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommissionRates rate. + * @member {string} rate + * @memberof cosmos.staking.v1beta1.CommissionRates + * @instance + */ + CommissionRates.prototype.rate = ""; + + /** + * CommissionRates maxRate. + * @member {string} maxRate + * @memberof cosmos.staking.v1beta1.CommissionRates + * @instance + */ + CommissionRates.prototype.maxRate = ""; + + /** + * CommissionRates maxChangeRate. + * @member {string} maxChangeRate + * @memberof cosmos.staking.v1beta1.CommissionRates + * @instance + */ + CommissionRates.prototype.maxChangeRate = ""; + + /** + * Creates a new CommissionRates instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.CommissionRates + * @static + * @param {cosmos.staking.v1beta1.ICommissionRates=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.CommissionRates} CommissionRates instance + */ + CommissionRates.create = function create(properties) { + return new CommissionRates(properties); + }; + + /** + * Encodes the specified CommissionRates message. Does not implicitly {@link cosmos.staking.v1beta1.CommissionRates.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.CommissionRates + * @static + * @param {cosmos.staking.v1beta1.ICommissionRates} message CommissionRates message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommissionRates.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rate != null && Object.hasOwnProperty.call(message, "rate")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.rate); + if (message.maxRate != null && Object.hasOwnProperty.call(message, "maxRate")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.maxRate); + if (message.maxChangeRate != null && Object.hasOwnProperty.call(message, "maxChangeRate")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.maxChangeRate); + return writer; + }; + + /** + * Encodes the specified CommissionRates message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.CommissionRates.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.CommissionRates + * @static + * @param {cosmos.staking.v1beta1.ICommissionRates} message CommissionRates message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommissionRates.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommissionRates message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.CommissionRates + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.CommissionRates} CommissionRates + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommissionRates.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.CommissionRates(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rate = reader.string(); + break; + case 2: + message.maxRate = reader.string(); + break; + case 3: + message.maxChangeRate = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommissionRates message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.CommissionRates + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.CommissionRates} CommissionRates + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommissionRates.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommissionRates message. + * @function verify + * @memberof cosmos.staking.v1beta1.CommissionRates + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommissionRates.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rate != null && message.hasOwnProperty("rate")) + if (!$util.isString(message.rate)) + return "rate: string expected"; + if (message.maxRate != null && message.hasOwnProperty("maxRate")) + if (!$util.isString(message.maxRate)) + return "maxRate: string expected"; + if (message.maxChangeRate != null && message.hasOwnProperty("maxChangeRate")) + if (!$util.isString(message.maxChangeRate)) + return "maxChangeRate: string expected"; + return null; + }; + + /** + * Creates a CommissionRates message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.CommissionRates + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.CommissionRates} CommissionRates + */ + CommissionRates.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.CommissionRates) + return object; + let message = new $root.cosmos.staking.v1beta1.CommissionRates(); + if (object.rate != null) + message.rate = String(object.rate); + if (object.maxRate != null) + message.maxRate = String(object.maxRate); + if (object.maxChangeRate != null) + message.maxChangeRate = String(object.maxChangeRate); + return message; + }; + + /** + * Creates a plain object from a CommissionRates message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.CommissionRates + * @static + * @param {cosmos.staking.v1beta1.CommissionRates} message CommissionRates + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommissionRates.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.rate = ""; + object.maxRate = ""; + object.maxChangeRate = ""; + } + if (message.rate != null && message.hasOwnProperty("rate")) + object.rate = message.rate; + if (message.maxRate != null && message.hasOwnProperty("maxRate")) + object.maxRate = message.maxRate; + if (message.maxChangeRate != null && message.hasOwnProperty("maxChangeRate")) + object.maxChangeRate = message.maxChangeRate; + return object; + }; + + /** + * Converts this CommissionRates to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.CommissionRates + * @instance + * @returns {Object.} JSON object + */ + CommissionRates.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CommissionRates; + })(v1beta1.CommissionRates || {}); + + v1beta1.Commission = (function(Commission) { + + /** + * Properties of a Commission. + * @memberof cosmos.staking.v1beta1 + * @interface ICommission + * @property {cosmos.staking.v1beta1.ICommissionRates|null} [commissionRates] Commission commissionRates + * @property {google.protobuf.ITimestamp|null} [updateTime] Commission updateTime + */ + + /** + * Constructs a new Commission. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a Commission. + * @implements ICommission + * @constructor + * @param {cosmos.staking.v1beta1.ICommission=} [properties] Properties to set + */ + function Commission(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Commission commissionRates. + * @member {cosmos.staking.v1beta1.ICommissionRates|null|undefined} commissionRates + * @memberof cosmos.staking.v1beta1.Commission + * @instance + */ + Commission.prototype.commissionRates = null; + + /** + * Commission updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof cosmos.staking.v1beta1.Commission + * @instance + */ + Commission.prototype.updateTime = null; + + /** + * Creates a new Commission instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.Commission + * @static + * @param {cosmos.staking.v1beta1.ICommission=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.Commission} Commission instance + */ + Commission.create = function create(properties) { + return new Commission(properties); + }; + + /** + * Encodes the specified Commission message. Does not implicitly {@link cosmos.staking.v1beta1.Commission.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.Commission + * @static + * @param {cosmos.staking.v1beta1.ICommission} message Commission message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Commission.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commissionRates != null && Object.hasOwnProperty.call(message, "commissionRates")) + $root.cosmos.staking.v1beta1.CommissionRates.encode(message.commissionRates, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Commission message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.Commission.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.Commission + * @static + * @param {cosmos.staking.v1beta1.ICommission} message Commission message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Commission.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Commission message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.Commission + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.Commission} Commission + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Commission.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.Commission(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.commissionRates = $root.cosmos.staking.v1beta1.CommissionRates.decode(reader, reader.uint32()); + break; + case 2: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Commission message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.Commission + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.Commission} Commission + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Commission.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Commission message. + * @function verify + * @memberof cosmos.staking.v1beta1.Commission + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Commission.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commissionRates != null && message.hasOwnProperty("commissionRates")) { + let error = $root.cosmos.staking.v1beta1.CommissionRates.verify(message.commissionRates); + if (error) + return "commissionRates." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + let error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a Commission message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.Commission + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.Commission} Commission + */ + Commission.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.Commission) + return object; + let message = new $root.cosmos.staking.v1beta1.Commission(); + if (object.commissionRates != null) { + if (typeof object.commissionRates !== "object") + throw TypeError(".cosmos.staking.v1beta1.Commission.commissionRates: object expected"); + message.commissionRates = $root.cosmos.staking.v1beta1.CommissionRates.fromObject(object.commissionRates); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".cosmos.staking.v1beta1.Commission.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a Commission message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.Commission + * @static + * @param {cosmos.staking.v1beta1.Commission} message Commission + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Commission.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.commissionRates = null; + object.updateTime = null; + } + if (message.commissionRates != null && message.hasOwnProperty("commissionRates")) + object.commissionRates = $root.cosmos.staking.v1beta1.CommissionRates.toObject(message.commissionRates, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this Commission to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.Commission + * @instance + * @returns {Object.} JSON object + */ + Commission.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Commission; + })(v1beta1.Commission || {}); + + v1beta1.Description = (function(Description) { + + /** + * Properties of a Description. + * @memberof cosmos.staking.v1beta1 + * @interface IDescription + * @property {string|null} [moniker] Description moniker + * @property {string|null} [identity] Description identity + * @property {string|null} [website] Description website + * @property {string|null} [securityContact] Description securityContact + * @property {string|null} [details] Description details + */ + + /** + * Constructs a new Description. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a Description. + * @implements IDescription + * @constructor + * @param {cosmos.staking.v1beta1.IDescription=} [properties] Properties to set + */ + function Description(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Description moniker. + * @member {string} moniker + * @memberof cosmos.staking.v1beta1.Description + * @instance + */ + Description.prototype.moniker = ""; + + /** + * Description identity. + * @member {string} identity + * @memberof cosmos.staking.v1beta1.Description + * @instance + */ + Description.prototype.identity = ""; + + /** + * Description website. + * @member {string} website + * @memberof cosmos.staking.v1beta1.Description + * @instance + */ + Description.prototype.website = ""; + + /** + * Description securityContact. + * @member {string} securityContact + * @memberof cosmos.staking.v1beta1.Description + * @instance + */ + Description.prototype.securityContact = ""; + + /** + * Description details. + * @member {string} details + * @memberof cosmos.staking.v1beta1.Description + * @instance + */ + Description.prototype.details = ""; + + /** + * Creates a new Description instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.Description + * @static + * @param {cosmos.staking.v1beta1.IDescription=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.Description} Description instance + */ + Description.create = function create(properties) { + return new Description(properties); + }; + + /** + * Encodes the specified Description message. Does not implicitly {@link cosmos.staking.v1beta1.Description.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.Description + * @static + * @param {cosmos.staking.v1beta1.IDescription} message Description message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Description.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.moniker != null && Object.hasOwnProperty.call(message, "moniker")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.moniker); + if (message.identity != null && Object.hasOwnProperty.call(message, "identity")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.identity); + if (message.website != null && Object.hasOwnProperty.call(message, "website")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.website); + if (message.securityContact != null && Object.hasOwnProperty.call(message, "securityContact")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.securityContact); + if (message.details != null && Object.hasOwnProperty.call(message, "details")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.details); + return writer; + }; + + /** + * Encodes the specified Description message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.Description.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.Description + * @static + * @param {cosmos.staking.v1beta1.IDescription} message Description message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Description.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Description message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.Description + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.Description} Description + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Description.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.Description(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.moniker = reader.string(); + break; + case 2: + message.identity = reader.string(); + break; + case 3: + message.website = reader.string(); + break; + case 4: + message.securityContact = reader.string(); + break; + case 5: + message.details = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Description message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.Description + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.Description} Description + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Description.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Description message. + * @function verify + * @memberof cosmos.staking.v1beta1.Description + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Description.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.moniker != null && message.hasOwnProperty("moniker")) + if (!$util.isString(message.moniker)) + return "moniker: string expected"; + if (message.identity != null && message.hasOwnProperty("identity")) + if (!$util.isString(message.identity)) + return "identity: string expected"; + if (message.website != null && message.hasOwnProperty("website")) + if (!$util.isString(message.website)) + return "website: string expected"; + if (message.securityContact != null && message.hasOwnProperty("securityContact")) + if (!$util.isString(message.securityContact)) + return "securityContact: string expected"; + if (message.details != null && message.hasOwnProperty("details")) + if (!$util.isString(message.details)) + return "details: string expected"; + return null; + }; + + /** + * Creates a Description message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.Description + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.Description} Description + */ + Description.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.Description) + return object; + let message = new $root.cosmos.staking.v1beta1.Description(); + if (object.moniker != null) + message.moniker = String(object.moniker); + if (object.identity != null) + message.identity = String(object.identity); + if (object.website != null) + message.website = String(object.website); + if (object.securityContact != null) + message.securityContact = String(object.securityContact); + if (object.details != null) + message.details = String(object.details); + return message; + }; + + /** + * Creates a plain object from a Description message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.Description + * @static + * @param {cosmos.staking.v1beta1.Description} message Description + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Description.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.moniker = ""; + object.identity = ""; + object.website = ""; + object.securityContact = ""; + object.details = ""; + } + if (message.moniker != null && message.hasOwnProperty("moniker")) + object.moniker = message.moniker; + if (message.identity != null && message.hasOwnProperty("identity")) + object.identity = message.identity; + if (message.website != null && message.hasOwnProperty("website")) + object.website = message.website; + if (message.securityContact != null && message.hasOwnProperty("securityContact")) + object.securityContact = message.securityContact; + if (message.details != null && message.hasOwnProperty("details")) + object.details = message.details; + return object; + }; + + /** + * Converts this Description to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.Description + * @instance + * @returns {Object.} JSON object + */ + Description.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Description; + })(v1beta1.Description || {}); + + v1beta1.Validator = (function(Validator) { + + /** + * Properties of a Validator. + * @memberof cosmos.staking.v1beta1 + * @interface IValidator + * @property {string|null} [operatorAddress] Validator operatorAddress + * @property {google.protobuf.IAny|null} [consensusPubkey] Validator consensusPubkey + * @property {boolean|null} [jailed] Validator jailed + * @property {cosmos.staking.v1beta1.BondStatus|null} [status] Validator status + * @property {string|null} [tokens] Validator tokens + * @property {string|null} [delegatorShares] Validator delegatorShares + * @property {cosmos.staking.v1beta1.IDescription|null} [description] Validator description + * @property {number|Long|null} [unbondingHeight] Validator unbondingHeight + * @property {google.protobuf.ITimestamp|null} [unbondingTime] Validator unbondingTime + * @property {cosmos.staking.v1beta1.ICommission|null} [commission] Validator commission + * @property {string|null} [minSelfDelegation] Validator minSelfDelegation + */ + + /** + * Constructs a new Validator. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a Validator. + * @implements IValidator + * @constructor + * @param {cosmos.staking.v1beta1.IValidator=} [properties] Properties to set + */ + function Validator(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Validator operatorAddress. + * @member {string} operatorAddress + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.operatorAddress = ""; + + /** + * Validator consensusPubkey. + * @member {google.protobuf.IAny|null|undefined} consensusPubkey + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.consensusPubkey = null; + + /** + * Validator jailed. + * @member {boolean} jailed + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.jailed = false; + + /** + * Validator status. + * @member {cosmos.staking.v1beta1.BondStatus} status + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.status = 0; + + /** + * Validator tokens. + * @member {string} tokens + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.tokens = ""; + + /** + * Validator delegatorShares. + * @member {string} delegatorShares + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.delegatorShares = ""; + + /** + * Validator description. + * @member {cosmos.staking.v1beta1.IDescription|null|undefined} description + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.description = null; + + /** + * Validator unbondingHeight. + * @member {number|Long} unbondingHeight + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.unbondingHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Validator unbondingTime. + * @member {google.protobuf.ITimestamp|null|undefined} unbondingTime + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.unbondingTime = null; + + /** + * Validator commission. + * @member {cosmos.staking.v1beta1.ICommission|null|undefined} commission + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.commission = null; + + /** + * Validator minSelfDelegation. + * @member {string} minSelfDelegation + * @memberof cosmos.staking.v1beta1.Validator + * @instance + */ + Validator.prototype.minSelfDelegation = ""; + + /** + * Creates a new Validator instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.Validator + * @static + * @param {cosmos.staking.v1beta1.IValidator=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.Validator} Validator instance + */ + Validator.create = function create(properties) { + return new Validator(properties); + }; + + /** + * Encodes the specified Validator message. Does not implicitly {@link cosmos.staking.v1beta1.Validator.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.Validator + * @static + * @param {cosmos.staking.v1beta1.IValidator} message Validator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Validator.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operatorAddress != null && Object.hasOwnProperty.call(message, "operatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.operatorAddress); + if (message.consensusPubkey != null && Object.hasOwnProperty.call(message, "consensusPubkey")) + $root.google.protobuf.Any.encode(message.consensusPubkey, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.jailed != null && Object.hasOwnProperty.call(message, "jailed")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.jailed); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.status); + if (message.tokens != null && Object.hasOwnProperty.call(message, "tokens")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.tokens); + if (message.delegatorShares != null && Object.hasOwnProperty.call(message, "delegatorShares")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.delegatorShares); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + $root.cosmos.staking.v1beta1.Description.encode(message.description, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.unbondingHeight != null && Object.hasOwnProperty.call(message, "unbondingHeight")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.unbondingHeight); + if (message.unbondingTime != null && Object.hasOwnProperty.call(message, "unbondingTime")) + $root.google.protobuf.Timestamp.encode(message.unbondingTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.commission != null && Object.hasOwnProperty.call(message, "commission")) + $root.cosmos.staking.v1beta1.Commission.encode(message.commission, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.minSelfDelegation != null && Object.hasOwnProperty.call(message, "minSelfDelegation")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.minSelfDelegation); + return writer; + }; + + /** + * Encodes the specified Validator message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.Validator.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.Validator + * @static + * @param {cosmos.staking.v1beta1.IValidator} message Validator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Validator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Validator message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.Validator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.Validator} Validator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Validator.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.Validator(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operatorAddress = reader.string(); + break; + case 2: + message.consensusPubkey = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 3: + message.jailed = reader.bool(); + break; + case 4: + message.status = reader.int32(); + break; + case 5: + message.tokens = reader.string(); + break; + case 6: + message.delegatorShares = reader.string(); + break; + case 7: + message.description = $root.cosmos.staking.v1beta1.Description.decode(reader, reader.uint32()); + break; + case 8: + message.unbondingHeight = reader.int64(); + break; + case 9: + message.unbondingTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 10: + message.commission = $root.cosmos.staking.v1beta1.Commission.decode(reader, reader.uint32()); + break; + case 11: + message.minSelfDelegation = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Validator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.Validator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.Validator} Validator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Validator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Validator message. + * @function verify + * @memberof cosmos.staking.v1beta1.Validator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Validator.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operatorAddress != null && message.hasOwnProperty("operatorAddress")) + if (!$util.isString(message.operatorAddress)) + return "operatorAddress: string expected"; + if (message.consensusPubkey != null && message.hasOwnProperty("consensusPubkey")) { + let error = $root.google.protobuf.Any.verify(message.consensusPubkey); + if (error) + return "consensusPubkey." + error; + } + if (message.jailed != null && message.hasOwnProperty("jailed")) + if (typeof message.jailed !== "boolean") + return "jailed: boolean expected"; + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.tokens != null && message.hasOwnProperty("tokens")) + if (!$util.isString(message.tokens)) + return "tokens: string expected"; + if (message.delegatorShares != null && message.hasOwnProperty("delegatorShares")) + if (!$util.isString(message.delegatorShares)) + return "delegatorShares: string expected"; + if (message.description != null && message.hasOwnProperty("description")) { + let error = $root.cosmos.staking.v1beta1.Description.verify(message.description); + if (error) + return "description." + error; + } + if (message.unbondingHeight != null && message.hasOwnProperty("unbondingHeight")) + if (!$util.isInteger(message.unbondingHeight) && !(message.unbondingHeight && $util.isInteger(message.unbondingHeight.low) && $util.isInteger(message.unbondingHeight.high))) + return "unbondingHeight: integer|Long expected"; + if (message.unbondingTime != null && message.hasOwnProperty("unbondingTime")) { + let error = $root.google.protobuf.Timestamp.verify(message.unbondingTime); + if (error) + return "unbondingTime." + error; + } + if (message.commission != null && message.hasOwnProperty("commission")) { + let error = $root.cosmos.staking.v1beta1.Commission.verify(message.commission); + if (error) + return "commission." + error; + } + if (message.minSelfDelegation != null && message.hasOwnProperty("minSelfDelegation")) + if (!$util.isString(message.minSelfDelegation)) + return "minSelfDelegation: string expected"; + return null; + }; + + /** + * Creates a Validator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.Validator + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.Validator} Validator + */ + Validator.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.Validator) + return object; + let message = new $root.cosmos.staking.v1beta1.Validator(); + if (object.operatorAddress != null) + message.operatorAddress = String(object.operatorAddress); + if (object.consensusPubkey != null) { + if (typeof object.consensusPubkey !== "object") + throw TypeError(".cosmos.staking.v1beta1.Validator.consensusPubkey: object expected"); + message.consensusPubkey = $root.google.protobuf.Any.fromObject(object.consensusPubkey); + } + if (object.jailed != null) + message.jailed = Boolean(object.jailed); + switch (object.status) { + case "BOND_STATUS_UNSPECIFIED": + case 0: + message.status = 0; + break; + case "BOND_STATUS_UNBONDED": + case 1: + message.status = 1; + break; + case "BOND_STATUS_UNBONDING": + case 2: + message.status = 2; + break; + case "BOND_STATUS_BONDED": + case 3: + message.status = 3; + break; + } + if (object.tokens != null) + message.tokens = String(object.tokens); + if (object.delegatorShares != null) + message.delegatorShares = String(object.delegatorShares); + if (object.description != null) { + if (typeof object.description !== "object") + throw TypeError(".cosmos.staking.v1beta1.Validator.description: object expected"); + message.description = $root.cosmos.staking.v1beta1.Description.fromObject(object.description); + } + if (object.unbondingHeight != null) + if ($util.Long) + (message.unbondingHeight = $util.Long.fromValue(object.unbondingHeight)).unsigned = false; + else if (typeof object.unbondingHeight === "string") + message.unbondingHeight = parseInt(object.unbondingHeight, 10); + else if (typeof object.unbondingHeight === "number") + message.unbondingHeight = object.unbondingHeight; + else if (typeof object.unbondingHeight === "object") + message.unbondingHeight = new $util.LongBits(object.unbondingHeight.low >>> 0, object.unbondingHeight.high >>> 0).toNumber(); + if (object.unbondingTime != null) { + if (typeof object.unbondingTime !== "object") + throw TypeError(".cosmos.staking.v1beta1.Validator.unbondingTime: object expected"); + message.unbondingTime = $root.google.protobuf.Timestamp.fromObject(object.unbondingTime); + } + if (object.commission != null) { + if (typeof object.commission !== "object") + throw TypeError(".cosmos.staking.v1beta1.Validator.commission: object expected"); + message.commission = $root.cosmos.staking.v1beta1.Commission.fromObject(object.commission); + } + if (object.minSelfDelegation != null) + message.minSelfDelegation = String(object.minSelfDelegation); + return message; + }; + + /** + * Creates a plain object from a Validator message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.Validator + * @static + * @param {cosmos.staking.v1beta1.Validator} message Validator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Validator.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.operatorAddress = ""; + object.consensusPubkey = null; + object.jailed = false; + object.status = options.enums === String ? "BOND_STATUS_UNSPECIFIED" : 0; + object.tokens = ""; + object.delegatorShares = ""; + object.description = null; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.unbondingHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.unbondingHeight = options.longs === String ? "0" : 0; + object.unbondingTime = null; + object.commission = null; + object.minSelfDelegation = ""; + } + if (message.operatorAddress != null && message.hasOwnProperty("operatorAddress")) + object.operatorAddress = message.operatorAddress; + if (message.consensusPubkey != null && message.hasOwnProperty("consensusPubkey")) + object.consensusPubkey = $root.google.protobuf.Any.toObject(message.consensusPubkey, options); + if (message.jailed != null && message.hasOwnProperty("jailed")) + object.jailed = message.jailed; + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.cosmos.staking.v1beta1.BondStatus[message.status] : message.status; + if (message.tokens != null && message.hasOwnProperty("tokens")) + object.tokens = message.tokens; + if (message.delegatorShares != null && message.hasOwnProperty("delegatorShares")) + object.delegatorShares = message.delegatorShares; + if (message.description != null && message.hasOwnProperty("description")) + object.description = $root.cosmos.staking.v1beta1.Description.toObject(message.description, options); + if (message.unbondingHeight != null && message.hasOwnProperty("unbondingHeight")) + if (typeof message.unbondingHeight === "number") + object.unbondingHeight = options.longs === String ? String(message.unbondingHeight) : message.unbondingHeight; + else + object.unbondingHeight = options.longs === String ? $util.Long.prototype.toString.call(message.unbondingHeight) : options.longs === Number ? new $util.LongBits(message.unbondingHeight.low >>> 0, message.unbondingHeight.high >>> 0).toNumber() : message.unbondingHeight; + if (message.unbondingTime != null && message.hasOwnProperty("unbondingTime")) + object.unbondingTime = $root.google.protobuf.Timestamp.toObject(message.unbondingTime, options); + if (message.commission != null && message.hasOwnProperty("commission")) + object.commission = $root.cosmos.staking.v1beta1.Commission.toObject(message.commission, options); + if (message.minSelfDelegation != null && message.hasOwnProperty("minSelfDelegation")) + object.minSelfDelegation = message.minSelfDelegation; + return object; + }; + + /** + * Converts this Validator to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.Validator + * @instance + * @returns {Object.} JSON object + */ + Validator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Validator; + })(v1beta1.Validator || {}); + + /** + * BondStatus enum. + * @name cosmos.staking.v1beta1.BondStatus + * @enum {string} + * @property {number} BOND_STATUS_UNSPECIFIED=0 BOND_STATUS_UNSPECIFIED value + * @property {number} BOND_STATUS_UNBONDED=1 BOND_STATUS_UNBONDED value + * @property {number} BOND_STATUS_UNBONDING=2 BOND_STATUS_UNBONDING value + * @property {number} BOND_STATUS_BONDED=3 BOND_STATUS_BONDED value + */ + v1beta1.BondStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BOND_STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "BOND_STATUS_UNBONDED"] = 1; + values[valuesById[2] = "BOND_STATUS_UNBONDING"] = 2; + values[valuesById[3] = "BOND_STATUS_BONDED"] = 3; + return values; + })(); + + v1beta1.ValAddresses = (function(ValAddresses) { + + /** + * Properties of a ValAddresses. + * @memberof cosmos.staking.v1beta1 + * @interface IValAddresses + * @property {Array.|null} [addresses] ValAddresses addresses + */ + + /** + * Constructs a new ValAddresses. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a ValAddresses. + * @implements IValAddresses + * @constructor + * @param {cosmos.staking.v1beta1.IValAddresses=} [properties] Properties to set + */ + function ValAddresses(properties) { + this.addresses = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValAddresses addresses. + * @member {Array.} addresses + * @memberof cosmos.staking.v1beta1.ValAddresses + * @instance + */ + ValAddresses.prototype.addresses = $util.emptyArray; + + /** + * Creates a new ValAddresses instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.ValAddresses + * @static + * @param {cosmos.staking.v1beta1.IValAddresses=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.ValAddresses} ValAddresses instance + */ + ValAddresses.create = function create(properties) { + return new ValAddresses(properties); + }; + + /** + * Encodes the specified ValAddresses message. Does not implicitly {@link cosmos.staking.v1beta1.ValAddresses.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.ValAddresses + * @static + * @param {cosmos.staking.v1beta1.IValAddresses} message ValAddresses message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValAddresses.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.addresses != null && message.addresses.length) + for (let i = 0; i < message.addresses.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.addresses[i]); + return writer; + }; + + /** + * Encodes the specified ValAddresses message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.ValAddresses.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.ValAddresses + * @static + * @param {cosmos.staking.v1beta1.IValAddresses} message ValAddresses message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValAddresses.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValAddresses message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.ValAddresses + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.ValAddresses} ValAddresses + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValAddresses.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.ValAddresses(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.addresses && message.addresses.length)) + message.addresses = []; + message.addresses.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValAddresses message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.ValAddresses + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.ValAddresses} ValAddresses + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValAddresses.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValAddresses message. + * @function verify + * @memberof cosmos.staking.v1beta1.ValAddresses + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValAddresses.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.addresses != null && message.hasOwnProperty("addresses")) { + if (!Array.isArray(message.addresses)) + return "addresses: array expected"; + for (let i = 0; i < message.addresses.length; ++i) + if (!$util.isString(message.addresses[i])) + return "addresses: string[] expected"; + } + return null; + }; + + /** + * Creates a ValAddresses message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.ValAddresses + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.ValAddresses} ValAddresses + */ + ValAddresses.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.ValAddresses) + return object; + let message = new $root.cosmos.staking.v1beta1.ValAddresses(); + if (object.addresses) { + if (!Array.isArray(object.addresses)) + throw TypeError(".cosmos.staking.v1beta1.ValAddresses.addresses: array expected"); + message.addresses = []; + for (let i = 0; i < object.addresses.length; ++i) + message.addresses[i] = String(object.addresses[i]); + } + return message; + }; + + /** + * Creates a plain object from a ValAddresses message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.ValAddresses + * @static + * @param {cosmos.staking.v1beta1.ValAddresses} message ValAddresses + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValAddresses.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.addresses = []; + if (message.addresses && message.addresses.length) { + object.addresses = []; + for (let j = 0; j < message.addresses.length; ++j) + object.addresses[j] = message.addresses[j]; + } + return object; + }; + + /** + * Converts this ValAddresses to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.ValAddresses + * @instance + * @returns {Object.} JSON object + */ + ValAddresses.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValAddresses; + })(v1beta1.ValAddresses || {}); + + v1beta1.DVPair = (function(DVPair) { + + /** + * Properties of a DVPair. + * @memberof cosmos.staking.v1beta1 + * @interface IDVPair + * @property {string|null} [delegatorAddress] DVPair delegatorAddress + * @property {string|null} [validatorAddress] DVPair validatorAddress + */ + + /** + * Constructs a new DVPair. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a DVPair. + * @implements IDVPair + * @constructor + * @param {cosmos.staking.v1beta1.IDVPair=} [properties] Properties to set + */ + function DVPair(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DVPair delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.staking.v1beta1.DVPair + * @instance + */ + DVPair.prototype.delegatorAddress = ""; + + /** + * DVPair validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.staking.v1beta1.DVPair + * @instance + */ + DVPair.prototype.validatorAddress = ""; + + /** + * Creates a new DVPair instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.DVPair + * @static + * @param {cosmos.staking.v1beta1.IDVPair=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.DVPair} DVPair instance + */ + DVPair.create = function create(properties) { + return new DVPair(properties); + }; + + /** + * Encodes the specified DVPair message. Does not implicitly {@link cosmos.staking.v1beta1.DVPair.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.DVPair + * @static + * @param {cosmos.staking.v1beta1.IDVPair} message DVPair message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DVPair.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddress); + return writer; + }; + + /** + * Encodes the specified DVPair message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.DVPair.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.DVPair + * @static + * @param {cosmos.staking.v1beta1.IDVPair} message DVPair message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DVPair.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DVPair message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.DVPair + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.DVPair} DVPair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DVPair.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.DVPair(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DVPair message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.DVPair + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.DVPair} DVPair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DVPair.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DVPair message. + * @function verify + * @memberof cosmos.staking.v1beta1.DVPair + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DVPair.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + return null; + }; + + /** + * Creates a DVPair message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.DVPair + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.DVPair} DVPair + */ + DVPair.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.DVPair) + return object; + let message = new $root.cosmos.staking.v1beta1.DVPair(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + return message; + }; + + /** + * Creates a plain object from a DVPair message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.DVPair + * @static + * @param {cosmos.staking.v1beta1.DVPair} message DVPair + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DVPair.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.delegatorAddress = ""; + object.validatorAddress = ""; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + return object; + }; + + /** + * Converts this DVPair to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.DVPair + * @instance + * @returns {Object.} JSON object + */ + DVPair.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DVPair; + })(v1beta1.DVPair || {}); + + v1beta1.DVPairs = (function(DVPairs) { + + /** + * Properties of a DVPairs. + * @memberof cosmos.staking.v1beta1 + * @interface IDVPairs + * @property {Array.|null} [pairs] DVPairs pairs + */ + + /** + * Constructs a new DVPairs. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a DVPairs. + * @implements IDVPairs + * @constructor + * @param {cosmos.staking.v1beta1.IDVPairs=} [properties] Properties to set + */ + function DVPairs(properties) { + this.pairs = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DVPairs pairs. + * @member {Array.} pairs + * @memberof cosmos.staking.v1beta1.DVPairs + * @instance + */ + DVPairs.prototype.pairs = $util.emptyArray; + + /** + * Creates a new DVPairs instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.DVPairs + * @static + * @param {cosmos.staking.v1beta1.IDVPairs=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.DVPairs} DVPairs instance + */ + DVPairs.create = function create(properties) { + return new DVPairs(properties); + }; + + /** + * Encodes the specified DVPairs message. Does not implicitly {@link cosmos.staking.v1beta1.DVPairs.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.DVPairs + * @static + * @param {cosmos.staking.v1beta1.IDVPairs} message DVPairs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DVPairs.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pairs != null && message.pairs.length) + for (let i = 0; i < message.pairs.length; ++i) + $root.cosmos.staking.v1beta1.DVPair.encode(message.pairs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DVPairs message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.DVPairs.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.DVPairs + * @static + * @param {cosmos.staking.v1beta1.IDVPairs} message DVPairs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DVPairs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DVPairs message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.DVPairs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.DVPairs} DVPairs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DVPairs.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.DVPairs(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.pairs && message.pairs.length)) + message.pairs = []; + message.pairs.push($root.cosmos.staking.v1beta1.DVPair.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DVPairs message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.DVPairs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.DVPairs} DVPairs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DVPairs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DVPairs message. + * @function verify + * @memberof cosmos.staking.v1beta1.DVPairs + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DVPairs.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pairs != null && message.hasOwnProperty("pairs")) { + if (!Array.isArray(message.pairs)) + return "pairs: array expected"; + for (let i = 0; i < message.pairs.length; ++i) { + let error = $root.cosmos.staking.v1beta1.DVPair.verify(message.pairs[i]); + if (error) + return "pairs." + error; + } + } + return null; + }; + + /** + * Creates a DVPairs message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.DVPairs + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.DVPairs} DVPairs + */ + DVPairs.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.DVPairs) + return object; + let message = new $root.cosmos.staking.v1beta1.DVPairs(); + if (object.pairs) { + if (!Array.isArray(object.pairs)) + throw TypeError(".cosmos.staking.v1beta1.DVPairs.pairs: array expected"); + message.pairs = []; + for (let i = 0; i < object.pairs.length; ++i) { + if (typeof object.pairs[i] !== "object") + throw TypeError(".cosmos.staking.v1beta1.DVPairs.pairs: object expected"); + message.pairs[i] = $root.cosmos.staking.v1beta1.DVPair.fromObject(object.pairs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DVPairs message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.DVPairs + * @static + * @param {cosmos.staking.v1beta1.DVPairs} message DVPairs + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DVPairs.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.pairs = []; + if (message.pairs && message.pairs.length) { + object.pairs = []; + for (let j = 0; j < message.pairs.length; ++j) + object.pairs[j] = $root.cosmos.staking.v1beta1.DVPair.toObject(message.pairs[j], options); + } + return object; + }; + + /** + * Converts this DVPairs to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.DVPairs + * @instance + * @returns {Object.} JSON object + */ + DVPairs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DVPairs; + })(v1beta1.DVPairs || {}); + + v1beta1.DVVTriplet = (function(DVVTriplet) { + + /** + * Properties of a DVVTriplet. + * @memberof cosmos.staking.v1beta1 + * @interface IDVVTriplet + * @property {string|null} [delegatorAddress] DVVTriplet delegatorAddress + * @property {string|null} [validatorSrcAddress] DVVTriplet validatorSrcAddress + * @property {string|null} [validatorDstAddress] DVVTriplet validatorDstAddress + */ + + /** + * Constructs a new DVVTriplet. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a DVVTriplet. + * @implements IDVVTriplet + * @constructor + * @param {cosmos.staking.v1beta1.IDVVTriplet=} [properties] Properties to set + */ + function DVVTriplet(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DVVTriplet delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @instance + */ + DVVTriplet.prototype.delegatorAddress = ""; + + /** + * DVVTriplet validatorSrcAddress. + * @member {string} validatorSrcAddress + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @instance + */ + DVVTriplet.prototype.validatorSrcAddress = ""; + + /** + * DVVTriplet validatorDstAddress. + * @member {string} validatorDstAddress + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @instance + */ + DVVTriplet.prototype.validatorDstAddress = ""; + + /** + * Creates a new DVVTriplet instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @static + * @param {cosmos.staking.v1beta1.IDVVTriplet=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.DVVTriplet} DVVTriplet instance + */ + DVVTriplet.create = function create(properties) { + return new DVVTriplet(properties); + }; + + /** + * Encodes the specified DVVTriplet message. Does not implicitly {@link cosmos.staking.v1beta1.DVVTriplet.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @static + * @param {cosmos.staking.v1beta1.IDVVTriplet} message DVVTriplet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DVVTriplet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.validatorSrcAddress != null && Object.hasOwnProperty.call(message, "validatorSrcAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorSrcAddress); + if (message.validatorDstAddress != null && Object.hasOwnProperty.call(message, "validatorDstAddress")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.validatorDstAddress); + return writer; + }; + + /** + * Encodes the specified DVVTriplet message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.DVVTriplet.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @static + * @param {cosmos.staking.v1beta1.IDVVTriplet} message DVVTriplet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DVVTriplet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DVVTriplet message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.DVVTriplet} DVVTriplet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DVVTriplet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.DVVTriplet(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorSrcAddress = reader.string(); + break; + case 3: + message.validatorDstAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DVVTriplet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.DVVTriplet} DVVTriplet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DVVTriplet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DVVTriplet message. + * @function verify + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DVVTriplet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.validatorSrcAddress != null && message.hasOwnProperty("validatorSrcAddress")) + if (!$util.isString(message.validatorSrcAddress)) + return "validatorSrcAddress: string expected"; + if (message.validatorDstAddress != null && message.hasOwnProperty("validatorDstAddress")) + if (!$util.isString(message.validatorDstAddress)) + return "validatorDstAddress: string expected"; + return null; + }; + + /** + * Creates a DVVTriplet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.DVVTriplet} DVVTriplet + */ + DVVTriplet.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.DVVTriplet) + return object; + let message = new $root.cosmos.staking.v1beta1.DVVTriplet(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.validatorSrcAddress != null) + message.validatorSrcAddress = String(object.validatorSrcAddress); + if (object.validatorDstAddress != null) + message.validatorDstAddress = String(object.validatorDstAddress); + return message; + }; + + /** + * Creates a plain object from a DVVTriplet message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @static + * @param {cosmos.staking.v1beta1.DVVTriplet} message DVVTriplet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DVVTriplet.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.delegatorAddress = ""; + object.validatorSrcAddress = ""; + object.validatorDstAddress = ""; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.validatorSrcAddress != null && message.hasOwnProperty("validatorSrcAddress")) + object.validatorSrcAddress = message.validatorSrcAddress; + if (message.validatorDstAddress != null && message.hasOwnProperty("validatorDstAddress")) + object.validatorDstAddress = message.validatorDstAddress; + return object; + }; + + /** + * Converts this DVVTriplet to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.DVVTriplet + * @instance + * @returns {Object.} JSON object + */ + DVVTriplet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DVVTriplet; + })(v1beta1.DVVTriplet || {}); + + v1beta1.DVVTriplets = (function(DVVTriplets) { + + /** + * Properties of a DVVTriplets. + * @memberof cosmos.staking.v1beta1 + * @interface IDVVTriplets + * @property {Array.|null} [triplets] DVVTriplets triplets + */ + + /** + * Constructs a new DVVTriplets. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a DVVTriplets. + * @implements IDVVTriplets + * @constructor + * @param {cosmos.staking.v1beta1.IDVVTriplets=} [properties] Properties to set + */ + function DVVTriplets(properties) { + this.triplets = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DVVTriplets triplets. + * @member {Array.} triplets + * @memberof cosmos.staking.v1beta1.DVVTriplets + * @instance + */ + DVVTriplets.prototype.triplets = $util.emptyArray; + + /** + * Creates a new DVVTriplets instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.DVVTriplets + * @static + * @param {cosmos.staking.v1beta1.IDVVTriplets=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.DVVTriplets} DVVTriplets instance + */ + DVVTriplets.create = function create(properties) { + return new DVVTriplets(properties); + }; + + /** + * Encodes the specified DVVTriplets message. Does not implicitly {@link cosmos.staking.v1beta1.DVVTriplets.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.DVVTriplets + * @static + * @param {cosmos.staking.v1beta1.IDVVTriplets} message DVVTriplets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DVVTriplets.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.triplets != null && message.triplets.length) + for (let i = 0; i < message.triplets.length; ++i) + $root.cosmos.staking.v1beta1.DVVTriplet.encode(message.triplets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DVVTriplets message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.DVVTriplets.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.DVVTriplets + * @static + * @param {cosmos.staking.v1beta1.IDVVTriplets} message DVVTriplets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DVVTriplets.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DVVTriplets message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.DVVTriplets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.DVVTriplets} DVVTriplets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DVVTriplets.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.DVVTriplets(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.triplets && message.triplets.length)) + message.triplets = []; + message.triplets.push($root.cosmos.staking.v1beta1.DVVTriplet.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DVVTriplets message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.DVVTriplets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.DVVTriplets} DVVTriplets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DVVTriplets.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DVVTriplets message. + * @function verify + * @memberof cosmos.staking.v1beta1.DVVTriplets + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DVVTriplets.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.triplets != null && message.hasOwnProperty("triplets")) { + if (!Array.isArray(message.triplets)) + return "triplets: array expected"; + for (let i = 0; i < message.triplets.length; ++i) { + let error = $root.cosmos.staking.v1beta1.DVVTriplet.verify(message.triplets[i]); + if (error) + return "triplets." + error; + } + } + return null; + }; + + /** + * Creates a DVVTriplets message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.DVVTriplets + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.DVVTriplets} DVVTriplets + */ + DVVTriplets.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.DVVTriplets) + return object; + let message = new $root.cosmos.staking.v1beta1.DVVTriplets(); + if (object.triplets) { + if (!Array.isArray(object.triplets)) + throw TypeError(".cosmos.staking.v1beta1.DVVTriplets.triplets: array expected"); + message.triplets = []; + for (let i = 0; i < object.triplets.length; ++i) { + if (typeof object.triplets[i] !== "object") + throw TypeError(".cosmos.staking.v1beta1.DVVTriplets.triplets: object expected"); + message.triplets[i] = $root.cosmos.staking.v1beta1.DVVTriplet.fromObject(object.triplets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DVVTriplets message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.DVVTriplets + * @static + * @param {cosmos.staking.v1beta1.DVVTriplets} message DVVTriplets + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DVVTriplets.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.triplets = []; + if (message.triplets && message.triplets.length) { + object.triplets = []; + for (let j = 0; j < message.triplets.length; ++j) + object.triplets[j] = $root.cosmos.staking.v1beta1.DVVTriplet.toObject(message.triplets[j], options); + } + return object; + }; + + /** + * Converts this DVVTriplets to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.DVVTriplets + * @instance + * @returns {Object.} JSON object + */ + DVVTriplets.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DVVTriplets; + })(v1beta1.DVVTriplets || {}); + + v1beta1.Delegation = (function(Delegation) { + + /** + * Properties of a Delegation. + * @memberof cosmos.staking.v1beta1 + * @interface IDelegation + * @property {string|null} [delegatorAddress] Delegation delegatorAddress + * @property {string|null} [validatorAddress] Delegation validatorAddress + * @property {string|null} [shares] Delegation shares + */ + + /** + * Constructs a new Delegation. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a Delegation. + * @implements IDelegation + * @constructor + * @param {cosmos.staking.v1beta1.IDelegation=} [properties] Properties to set + */ + function Delegation(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Delegation delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.staking.v1beta1.Delegation + * @instance + */ + Delegation.prototype.delegatorAddress = ""; + + /** + * Delegation validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.staking.v1beta1.Delegation + * @instance + */ + Delegation.prototype.validatorAddress = ""; + + /** + * Delegation shares. + * @member {string} shares + * @memberof cosmos.staking.v1beta1.Delegation + * @instance + */ + Delegation.prototype.shares = ""; + + /** + * Creates a new Delegation instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.Delegation + * @static + * @param {cosmos.staking.v1beta1.IDelegation=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.Delegation} Delegation instance + */ + Delegation.create = function create(properties) { + return new Delegation(properties); + }; + + /** + * Encodes the specified Delegation message. Does not implicitly {@link cosmos.staking.v1beta1.Delegation.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.Delegation + * @static + * @param {cosmos.staking.v1beta1.IDelegation} message Delegation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Delegation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddress); + if (message.shares != null && Object.hasOwnProperty.call(message, "shares")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.shares); + return writer; + }; + + /** + * Encodes the specified Delegation message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.Delegation.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.Delegation + * @static + * @param {cosmos.staking.v1beta1.IDelegation} message Delegation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Delegation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Delegation message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.Delegation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.Delegation} Delegation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Delegation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.Delegation(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.shares = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Delegation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.Delegation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.Delegation} Delegation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Delegation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Delegation message. + * @function verify + * @memberof cosmos.staking.v1beta1.Delegation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Delegation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + if (message.shares != null && message.hasOwnProperty("shares")) + if (!$util.isString(message.shares)) + return "shares: string expected"; + return null; + }; + + /** + * Creates a Delegation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.Delegation + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.Delegation} Delegation + */ + Delegation.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.Delegation) + return object; + let message = new $root.cosmos.staking.v1beta1.Delegation(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + if (object.shares != null) + message.shares = String(object.shares); + return message; + }; + + /** + * Creates a plain object from a Delegation message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.Delegation + * @static + * @param {cosmos.staking.v1beta1.Delegation} message Delegation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Delegation.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.delegatorAddress = ""; + object.validatorAddress = ""; + object.shares = ""; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + if (message.shares != null && message.hasOwnProperty("shares")) + object.shares = message.shares; + return object; + }; + + /** + * Converts this Delegation to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.Delegation + * @instance + * @returns {Object.} JSON object + */ + Delegation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Delegation; + })(v1beta1.Delegation || {}); + + v1beta1.UnbondingDelegation = (function(UnbondingDelegation) { + + /** + * Properties of an UnbondingDelegation. + * @memberof cosmos.staking.v1beta1 + * @interface IUnbondingDelegation + * @property {string|null} [delegatorAddress] UnbondingDelegation delegatorAddress + * @property {string|null} [validatorAddress] UnbondingDelegation validatorAddress + * @property {Array.|null} [entries] UnbondingDelegation entries + */ + + /** + * Constructs a new UnbondingDelegation. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents an UnbondingDelegation. + * @implements IUnbondingDelegation + * @constructor + * @param {cosmos.staking.v1beta1.IUnbondingDelegation=} [properties] Properties to set + */ + function UnbondingDelegation(properties) { + this.entries = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UnbondingDelegation delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @instance + */ + UnbondingDelegation.prototype.delegatorAddress = ""; + + /** + * UnbondingDelegation validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @instance + */ + UnbondingDelegation.prototype.validatorAddress = ""; + + /** + * UnbondingDelegation entries. + * @member {Array.} entries + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @instance + */ + UnbondingDelegation.prototype.entries = $util.emptyArray; + + /** + * Creates a new UnbondingDelegation instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @static + * @param {cosmos.staking.v1beta1.IUnbondingDelegation=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.UnbondingDelegation} UnbondingDelegation instance + */ + UnbondingDelegation.create = function create(properties) { + return new UnbondingDelegation(properties); + }; + + /** + * Encodes the specified UnbondingDelegation message. Does not implicitly {@link cosmos.staking.v1beta1.UnbondingDelegation.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @static + * @param {cosmos.staking.v1beta1.IUnbondingDelegation} message UnbondingDelegation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnbondingDelegation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddress); + if (message.entries != null && message.entries.length) + for (let i = 0; i < message.entries.length; ++i) + $root.cosmos.staking.v1beta1.UnbondingDelegationEntry.encode(message.entries[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UnbondingDelegation message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.UnbondingDelegation.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @static + * @param {cosmos.staking.v1beta1.IUnbondingDelegation} message UnbondingDelegation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnbondingDelegation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UnbondingDelegation message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.UnbondingDelegation} UnbondingDelegation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnbondingDelegation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.UnbondingDelegation(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.cosmos.staking.v1beta1.UnbondingDelegationEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UnbondingDelegation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.UnbondingDelegation} UnbondingDelegation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnbondingDelegation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UnbondingDelegation message. + * @function verify + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UnbondingDelegation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (let i = 0; i < message.entries.length; ++i) { + let error = $root.cosmos.staking.v1beta1.UnbondingDelegationEntry.verify(message.entries[i]); + if (error) + return "entries." + error; + } + } + return null; + }; + + /** + * Creates an UnbondingDelegation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.UnbondingDelegation} UnbondingDelegation + */ + UnbondingDelegation.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.UnbondingDelegation) + return object; + let message = new $root.cosmos.staking.v1beta1.UnbondingDelegation(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".cosmos.staking.v1beta1.UnbondingDelegation.entries: array expected"); + message.entries = []; + for (let i = 0; i < object.entries.length; ++i) { + if (typeof object.entries[i] !== "object") + throw TypeError(".cosmos.staking.v1beta1.UnbondingDelegation.entries: object expected"); + message.entries[i] = $root.cosmos.staking.v1beta1.UnbondingDelegationEntry.fromObject(object.entries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an UnbondingDelegation message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @static + * @param {cosmos.staking.v1beta1.UnbondingDelegation} message UnbondingDelegation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UnbondingDelegation.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (options.defaults) { + object.delegatorAddress = ""; + object.validatorAddress = ""; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + if (message.entries && message.entries.length) { + object.entries = []; + for (let j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.cosmos.staking.v1beta1.UnbondingDelegationEntry.toObject(message.entries[j], options); + } + return object; + }; + + /** + * Converts this UnbondingDelegation to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.UnbondingDelegation + * @instance + * @returns {Object.} JSON object + */ + UnbondingDelegation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UnbondingDelegation; + })(v1beta1.UnbondingDelegation || {}); + + v1beta1.UnbondingDelegationEntry = (function(UnbondingDelegationEntry) { + + /** + * Properties of an UnbondingDelegationEntry. + * @memberof cosmos.staking.v1beta1 + * @interface IUnbondingDelegationEntry + * @property {number|Long|null} [creationHeight] UnbondingDelegationEntry creationHeight + * @property {google.protobuf.ITimestamp|null} [completionTime] UnbondingDelegationEntry completionTime + * @property {string|null} [initialBalance] UnbondingDelegationEntry initialBalance + * @property {string|null} [balance] UnbondingDelegationEntry balance + */ + + /** + * Constructs a new UnbondingDelegationEntry. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents an UnbondingDelegationEntry. + * @implements IUnbondingDelegationEntry + * @constructor + * @param {cosmos.staking.v1beta1.IUnbondingDelegationEntry=} [properties] Properties to set + */ + function UnbondingDelegationEntry(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UnbondingDelegationEntry creationHeight. + * @member {number|Long} creationHeight + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @instance + */ + UnbondingDelegationEntry.prototype.creationHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UnbondingDelegationEntry completionTime. + * @member {google.protobuf.ITimestamp|null|undefined} completionTime + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @instance + */ + UnbondingDelegationEntry.prototype.completionTime = null; + + /** + * UnbondingDelegationEntry initialBalance. + * @member {string} initialBalance + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @instance + */ + UnbondingDelegationEntry.prototype.initialBalance = ""; + + /** + * UnbondingDelegationEntry balance. + * @member {string} balance + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @instance + */ + UnbondingDelegationEntry.prototype.balance = ""; + + /** + * Creates a new UnbondingDelegationEntry instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @static + * @param {cosmos.staking.v1beta1.IUnbondingDelegationEntry=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.UnbondingDelegationEntry} UnbondingDelegationEntry instance + */ + UnbondingDelegationEntry.create = function create(properties) { + return new UnbondingDelegationEntry(properties); + }; + + /** + * Encodes the specified UnbondingDelegationEntry message. Does not implicitly {@link cosmos.staking.v1beta1.UnbondingDelegationEntry.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @static + * @param {cosmos.staking.v1beta1.IUnbondingDelegationEntry} message UnbondingDelegationEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnbondingDelegationEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.creationHeight != null && Object.hasOwnProperty.call(message, "creationHeight")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.creationHeight); + if (message.completionTime != null && Object.hasOwnProperty.call(message, "completionTime")) + $root.google.protobuf.Timestamp.encode(message.completionTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.initialBalance != null && Object.hasOwnProperty.call(message, "initialBalance")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.initialBalance); + if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.balance); + return writer; + }; + + /** + * Encodes the specified UnbondingDelegationEntry message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.UnbondingDelegationEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @static + * @param {cosmos.staking.v1beta1.IUnbondingDelegationEntry} message UnbondingDelegationEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnbondingDelegationEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UnbondingDelegationEntry message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.UnbondingDelegationEntry} UnbondingDelegationEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnbondingDelegationEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.UnbondingDelegationEntry(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creationHeight = reader.int64(); + break; + case 2: + message.completionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.initialBalance = reader.string(); + break; + case 4: + message.balance = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UnbondingDelegationEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.UnbondingDelegationEntry} UnbondingDelegationEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnbondingDelegationEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UnbondingDelegationEntry message. + * @function verify + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UnbondingDelegationEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.creationHeight != null && message.hasOwnProperty("creationHeight")) + if (!$util.isInteger(message.creationHeight) && !(message.creationHeight && $util.isInteger(message.creationHeight.low) && $util.isInteger(message.creationHeight.high))) + return "creationHeight: integer|Long expected"; + if (message.completionTime != null && message.hasOwnProperty("completionTime")) { + let error = $root.google.protobuf.Timestamp.verify(message.completionTime); + if (error) + return "completionTime." + error; + } + if (message.initialBalance != null && message.hasOwnProperty("initialBalance")) + if (!$util.isString(message.initialBalance)) + return "initialBalance: string expected"; + if (message.balance != null && message.hasOwnProperty("balance")) + if (!$util.isString(message.balance)) + return "balance: string expected"; + return null; + }; + + /** + * Creates an UnbondingDelegationEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.UnbondingDelegationEntry} UnbondingDelegationEntry + */ + UnbondingDelegationEntry.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.UnbondingDelegationEntry) + return object; + let message = new $root.cosmos.staking.v1beta1.UnbondingDelegationEntry(); + if (object.creationHeight != null) + if ($util.Long) + (message.creationHeight = $util.Long.fromValue(object.creationHeight)).unsigned = false; + else if (typeof object.creationHeight === "string") + message.creationHeight = parseInt(object.creationHeight, 10); + else if (typeof object.creationHeight === "number") + message.creationHeight = object.creationHeight; + else if (typeof object.creationHeight === "object") + message.creationHeight = new $util.LongBits(object.creationHeight.low >>> 0, object.creationHeight.high >>> 0).toNumber(); + if (object.completionTime != null) { + if (typeof object.completionTime !== "object") + throw TypeError(".cosmos.staking.v1beta1.UnbondingDelegationEntry.completionTime: object expected"); + message.completionTime = $root.google.protobuf.Timestamp.fromObject(object.completionTime); + } + if (object.initialBalance != null) + message.initialBalance = String(object.initialBalance); + if (object.balance != null) + message.balance = String(object.balance); + return message; + }; + + /** + * Creates a plain object from an UnbondingDelegationEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @static + * @param {cosmos.staking.v1beta1.UnbondingDelegationEntry} message UnbondingDelegationEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UnbondingDelegationEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.creationHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.creationHeight = options.longs === String ? "0" : 0; + object.completionTime = null; + object.initialBalance = ""; + object.balance = ""; + } + if (message.creationHeight != null && message.hasOwnProperty("creationHeight")) + if (typeof message.creationHeight === "number") + object.creationHeight = options.longs === String ? String(message.creationHeight) : message.creationHeight; + else + object.creationHeight = options.longs === String ? $util.Long.prototype.toString.call(message.creationHeight) : options.longs === Number ? new $util.LongBits(message.creationHeight.low >>> 0, message.creationHeight.high >>> 0).toNumber() : message.creationHeight; + if (message.completionTime != null && message.hasOwnProperty("completionTime")) + object.completionTime = $root.google.protobuf.Timestamp.toObject(message.completionTime, options); + if (message.initialBalance != null && message.hasOwnProperty("initialBalance")) + object.initialBalance = message.initialBalance; + if (message.balance != null && message.hasOwnProperty("balance")) + object.balance = message.balance; + return object; + }; + + /** + * Converts this UnbondingDelegationEntry to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry + * @instance + * @returns {Object.} JSON object + */ + UnbondingDelegationEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UnbondingDelegationEntry; + })(v1beta1.UnbondingDelegationEntry || {}); + + v1beta1.RedelegationEntry = (function(RedelegationEntry) { + + /** + * Properties of a RedelegationEntry. + * @memberof cosmos.staking.v1beta1 + * @interface IRedelegationEntry + * @property {number|Long|null} [creationHeight] RedelegationEntry creationHeight + * @property {google.protobuf.ITimestamp|null} [completionTime] RedelegationEntry completionTime + * @property {string|null} [initialBalance] RedelegationEntry initialBalance + * @property {string|null} [sharesDst] RedelegationEntry sharesDst + */ + + /** + * Constructs a new RedelegationEntry. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a RedelegationEntry. + * @implements IRedelegationEntry + * @constructor + * @param {cosmos.staking.v1beta1.IRedelegationEntry=} [properties] Properties to set + */ + function RedelegationEntry(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RedelegationEntry creationHeight. + * @member {number|Long} creationHeight + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @instance + */ + RedelegationEntry.prototype.creationHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * RedelegationEntry completionTime. + * @member {google.protobuf.ITimestamp|null|undefined} completionTime + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @instance + */ + RedelegationEntry.prototype.completionTime = null; + + /** + * RedelegationEntry initialBalance. + * @member {string} initialBalance + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @instance + */ + RedelegationEntry.prototype.initialBalance = ""; + + /** + * RedelegationEntry sharesDst. + * @member {string} sharesDst + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @instance + */ + RedelegationEntry.prototype.sharesDst = ""; + + /** + * Creates a new RedelegationEntry instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @static + * @param {cosmos.staking.v1beta1.IRedelegationEntry=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.RedelegationEntry} RedelegationEntry instance + */ + RedelegationEntry.create = function create(properties) { + return new RedelegationEntry(properties); + }; + + /** + * Encodes the specified RedelegationEntry message. Does not implicitly {@link cosmos.staking.v1beta1.RedelegationEntry.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @static + * @param {cosmos.staking.v1beta1.IRedelegationEntry} message RedelegationEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedelegationEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.creationHeight != null && Object.hasOwnProperty.call(message, "creationHeight")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.creationHeight); + if (message.completionTime != null && Object.hasOwnProperty.call(message, "completionTime")) + $root.google.protobuf.Timestamp.encode(message.completionTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.initialBalance != null && Object.hasOwnProperty.call(message, "initialBalance")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.initialBalance); + if (message.sharesDst != null && Object.hasOwnProperty.call(message, "sharesDst")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.sharesDst); + return writer; + }; + + /** + * Encodes the specified RedelegationEntry message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.RedelegationEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @static + * @param {cosmos.staking.v1beta1.IRedelegationEntry} message RedelegationEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedelegationEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RedelegationEntry message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.RedelegationEntry} RedelegationEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedelegationEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.RedelegationEntry(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creationHeight = reader.int64(); + break; + case 2: + message.completionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.initialBalance = reader.string(); + break; + case 4: + message.sharesDst = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RedelegationEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.RedelegationEntry} RedelegationEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedelegationEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RedelegationEntry message. + * @function verify + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RedelegationEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.creationHeight != null && message.hasOwnProperty("creationHeight")) + if (!$util.isInteger(message.creationHeight) && !(message.creationHeight && $util.isInteger(message.creationHeight.low) && $util.isInteger(message.creationHeight.high))) + return "creationHeight: integer|Long expected"; + if (message.completionTime != null && message.hasOwnProperty("completionTime")) { + let error = $root.google.protobuf.Timestamp.verify(message.completionTime); + if (error) + return "completionTime." + error; + } + if (message.initialBalance != null && message.hasOwnProperty("initialBalance")) + if (!$util.isString(message.initialBalance)) + return "initialBalance: string expected"; + if (message.sharesDst != null && message.hasOwnProperty("sharesDst")) + if (!$util.isString(message.sharesDst)) + return "sharesDst: string expected"; + return null; + }; + + /** + * Creates a RedelegationEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.RedelegationEntry} RedelegationEntry + */ + RedelegationEntry.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.RedelegationEntry) + return object; + let message = new $root.cosmos.staking.v1beta1.RedelegationEntry(); + if (object.creationHeight != null) + if ($util.Long) + (message.creationHeight = $util.Long.fromValue(object.creationHeight)).unsigned = false; + else if (typeof object.creationHeight === "string") + message.creationHeight = parseInt(object.creationHeight, 10); + else if (typeof object.creationHeight === "number") + message.creationHeight = object.creationHeight; + else if (typeof object.creationHeight === "object") + message.creationHeight = new $util.LongBits(object.creationHeight.low >>> 0, object.creationHeight.high >>> 0).toNumber(); + if (object.completionTime != null) { + if (typeof object.completionTime !== "object") + throw TypeError(".cosmos.staking.v1beta1.RedelegationEntry.completionTime: object expected"); + message.completionTime = $root.google.protobuf.Timestamp.fromObject(object.completionTime); + } + if (object.initialBalance != null) + message.initialBalance = String(object.initialBalance); + if (object.sharesDst != null) + message.sharesDst = String(object.sharesDst); + return message; + }; + + /** + * Creates a plain object from a RedelegationEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @static + * @param {cosmos.staking.v1beta1.RedelegationEntry} message RedelegationEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RedelegationEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.creationHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.creationHeight = options.longs === String ? "0" : 0; + object.completionTime = null; + object.initialBalance = ""; + object.sharesDst = ""; + } + if (message.creationHeight != null && message.hasOwnProperty("creationHeight")) + if (typeof message.creationHeight === "number") + object.creationHeight = options.longs === String ? String(message.creationHeight) : message.creationHeight; + else + object.creationHeight = options.longs === String ? $util.Long.prototype.toString.call(message.creationHeight) : options.longs === Number ? new $util.LongBits(message.creationHeight.low >>> 0, message.creationHeight.high >>> 0).toNumber() : message.creationHeight; + if (message.completionTime != null && message.hasOwnProperty("completionTime")) + object.completionTime = $root.google.protobuf.Timestamp.toObject(message.completionTime, options); + if (message.initialBalance != null && message.hasOwnProperty("initialBalance")) + object.initialBalance = message.initialBalance; + if (message.sharesDst != null && message.hasOwnProperty("sharesDst")) + object.sharesDst = message.sharesDst; + return object; + }; + + /** + * Converts this RedelegationEntry to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.RedelegationEntry + * @instance + * @returns {Object.} JSON object + */ + RedelegationEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RedelegationEntry; + })(v1beta1.RedelegationEntry || {}); + + v1beta1.Redelegation = (function(Redelegation) { + + /** + * Properties of a Redelegation. + * @memberof cosmos.staking.v1beta1 + * @interface IRedelegation + * @property {string|null} [delegatorAddress] Redelegation delegatorAddress + * @property {string|null} [validatorSrcAddress] Redelegation validatorSrcAddress + * @property {string|null} [validatorDstAddress] Redelegation validatorDstAddress + * @property {Array.|null} [entries] Redelegation entries + */ + + /** + * Constructs a new Redelegation. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a Redelegation. + * @implements IRedelegation + * @constructor + * @param {cosmos.staking.v1beta1.IRedelegation=} [properties] Properties to set + */ + function Redelegation(properties) { + this.entries = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Redelegation delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.staking.v1beta1.Redelegation + * @instance + */ + Redelegation.prototype.delegatorAddress = ""; + + /** + * Redelegation validatorSrcAddress. + * @member {string} validatorSrcAddress + * @memberof cosmos.staking.v1beta1.Redelegation + * @instance + */ + Redelegation.prototype.validatorSrcAddress = ""; + + /** + * Redelegation validatorDstAddress. + * @member {string} validatorDstAddress + * @memberof cosmos.staking.v1beta1.Redelegation + * @instance + */ + Redelegation.prototype.validatorDstAddress = ""; + + /** + * Redelegation entries. + * @member {Array.} entries + * @memberof cosmos.staking.v1beta1.Redelegation + * @instance + */ + Redelegation.prototype.entries = $util.emptyArray; + + /** + * Creates a new Redelegation instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.Redelegation + * @static + * @param {cosmos.staking.v1beta1.IRedelegation=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.Redelegation} Redelegation instance + */ + Redelegation.create = function create(properties) { + return new Redelegation(properties); + }; + + /** + * Encodes the specified Redelegation message. Does not implicitly {@link cosmos.staking.v1beta1.Redelegation.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.Redelegation + * @static + * @param {cosmos.staking.v1beta1.IRedelegation} message Redelegation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Redelegation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.validatorSrcAddress != null && Object.hasOwnProperty.call(message, "validatorSrcAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorSrcAddress); + if (message.validatorDstAddress != null && Object.hasOwnProperty.call(message, "validatorDstAddress")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.validatorDstAddress); + if (message.entries != null && message.entries.length) + for (let i = 0; i < message.entries.length; ++i) + $root.cosmos.staking.v1beta1.RedelegationEntry.encode(message.entries[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Redelegation message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.Redelegation.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.Redelegation + * @static + * @param {cosmos.staking.v1beta1.IRedelegation} message Redelegation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Redelegation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Redelegation message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.Redelegation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.Redelegation} Redelegation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Redelegation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.Redelegation(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorSrcAddress = reader.string(); + break; + case 3: + message.validatorDstAddress = reader.string(); + break; + case 4: + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.cosmos.staking.v1beta1.RedelegationEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Redelegation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.Redelegation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.Redelegation} Redelegation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Redelegation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Redelegation message. + * @function verify + * @memberof cosmos.staking.v1beta1.Redelegation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Redelegation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.validatorSrcAddress != null && message.hasOwnProperty("validatorSrcAddress")) + if (!$util.isString(message.validatorSrcAddress)) + return "validatorSrcAddress: string expected"; + if (message.validatorDstAddress != null && message.hasOwnProperty("validatorDstAddress")) + if (!$util.isString(message.validatorDstAddress)) + return "validatorDstAddress: string expected"; + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (let i = 0; i < message.entries.length; ++i) { + let error = $root.cosmos.staking.v1beta1.RedelegationEntry.verify(message.entries[i]); + if (error) + return "entries." + error; + } + } + return null; + }; + + /** + * Creates a Redelegation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.Redelegation + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.Redelegation} Redelegation + */ + Redelegation.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.Redelegation) + return object; + let message = new $root.cosmos.staking.v1beta1.Redelegation(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.validatorSrcAddress != null) + message.validatorSrcAddress = String(object.validatorSrcAddress); + if (object.validatorDstAddress != null) + message.validatorDstAddress = String(object.validatorDstAddress); + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".cosmos.staking.v1beta1.Redelegation.entries: array expected"); + message.entries = []; + for (let i = 0; i < object.entries.length; ++i) { + if (typeof object.entries[i] !== "object") + throw TypeError(".cosmos.staking.v1beta1.Redelegation.entries: object expected"); + message.entries[i] = $root.cosmos.staking.v1beta1.RedelegationEntry.fromObject(object.entries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Redelegation message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.Redelegation + * @static + * @param {cosmos.staking.v1beta1.Redelegation} message Redelegation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Redelegation.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (options.defaults) { + object.delegatorAddress = ""; + object.validatorSrcAddress = ""; + object.validatorDstAddress = ""; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.validatorSrcAddress != null && message.hasOwnProperty("validatorSrcAddress")) + object.validatorSrcAddress = message.validatorSrcAddress; + if (message.validatorDstAddress != null && message.hasOwnProperty("validatorDstAddress")) + object.validatorDstAddress = message.validatorDstAddress; + if (message.entries && message.entries.length) { + object.entries = []; + for (let j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.cosmos.staking.v1beta1.RedelegationEntry.toObject(message.entries[j], options); + } + return object; + }; + + /** + * Converts this Redelegation to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.Redelegation + * @instance + * @returns {Object.} JSON object + */ + Redelegation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Redelegation; + })(v1beta1.Redelegation || {}); + + v1beta1.Params = (function(Params) { + + /** + * Properties of a Params. + * @memberof cosmos.staking.v1beta1 + * @interface IParams + * @property {google.protobuf.IDuration|null} [unbondingTime] Params unbondingTime + * @property {number|null} [maxValidators] Params maxValidators + * @property {number|null} [maxEntries] Params maxEntries + * @property {number|null} [historicalEntries] Params historicalEntries + * @property {string|null} [bondDenom] Params bondDenom + */ + + /** + * Constructs a new Params. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a Params. + * @implements IParams + * @constructor + * @param {cosmos.staking.v1beta1.IParams=} [properties] Properties to set + */ + function Params(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Params unbondingTime. + * @member {google.protobuf.IDuration|null|undefined} unbondingTime + * @memberof cosmos.staking.v1beta1.Params + * @instance + */ + Params.prototype.unbondingTime = null; + + /** + * Params maxValidators. + * @member {number} maxValidators + * @memberof cosmos.staking.v1beta1.Params + * @instance + */ + Params.prototype.maxValidators = 0; + + /** + * Params maxEntries. + * @member {number} maxEntries + * @memberof cosmos.staking.v1beta1.Params + * @instance + */ + Params.prototype.maxEntries = 0; + + /** + * Params historicalEntries. + * @member {number} historicalEntries + * @memberof cosmos.staking.v1beta1.Params + * @instance + */ + Params.prototype.historicalEntries = 0; + + /** + * Params bondDenom. + * @member {string} bondDenom + * @memberof cosmos.staking.v1beta1.Params + * @instance + */ + Params.prototype.bondDenom = ""; + + /** + * Creates a new Params instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.Params + * @static + * @param {cosmos.staking.v1beta1.IParams=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.Params} Params instance + */ + Params.create = function create(properties) { + return new Params(properties); + }; + + /** + * Encodes the specified Params message. Does not implicitly {@link cosmos.staking.v1beta1.Params.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.Params + * @static + * @param {cosmos.staking.v1beta1.IParams} message Params message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Params.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.unbondingTime != null && Object.hasOwnProperty.call(message, "unbondingTime")) + $root.google.protobuf.Duration.encode(message.unbondingTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.maxValidators != null && Object.hasOwnProperty.call(message, "maxValidators")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.maxValidators); + if (message.maxEntries != null && Object.hasOwnProperty.call(message, "maxEntries")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.maxEntries); + if (message.historicalEntries != null && Object.hasOwnProperty.call(message, "historicalEntries")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.historicalEntries); + if (message.bondDenom != null && Object.hasOwnProperty.call(message, "bondDenom")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.bondDenom); + return writer; + }; + + /** + * Encodes the specified Params message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.Params.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.Params + * @static + * @param {cosmos.staking.v1beta1.IParams} message Params message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Params.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Params message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.Params + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.Params} Params + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Params.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.Params(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.unbondingTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 2: + message.maxValidators = reader.uint32(); + break; + case 3: + message.maxEntries = reader.uint32(); + break; + case 4: + message.historicalEntries = reader.uint32(); + break; + case 5: + message.bondDenom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Params message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.Params + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.Params} Params + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Params.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Params message. + * @function verify + * @memberof cosmos.staking.v1beta1.Params + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Params.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.unbondingTime != null && message.hasOwnProperty("unbondingTime")) { + let error = $root.google.protobuf.Duration.verify(message.unbondingTime); + if (error) + return "unbondingTime." + error; + } + if (message.maxValidators != null && message.hasOwnProperty("maxValidators")) + if (!$util.isInteger(message.maxValidators)) + return "maxValidators: integer expected"; + if (message.maxEntries != null && message.hasOwnProperty("maxEntries")) + if (!$util.isInteger(message.maxEntries)) + return "maxEntries: integer expected"; + if (message.historicalEntries != null && message.hasOwnProperty("historicalEntries")) + if (!$util.isInteger(message.historicalEntries)) + return "historicalEntries: integer expected"; + if (message.bondDenom != null && message.hasOwnProperty("bondDenom")) + if (!$util.isString(message.bondDenom)) + return "bondDenom: string expected"; + return null; + }; + + /** + * Creates a Params message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.Params + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.Params} Params + */ + Params.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.Params) + return object; + let message = new $root.cosmos.staking.v1beta1.Params(); + if (object.unbondingTime != null) { + if (typeof object.unbondingTime !== "object") + throw TypeError(".cosmos.staking.v1beta1.Params.unbondingTime: object expected"); + message.unbondingTime = $root.google.protobuf.Duration.fromObject(object.unbondingTime); + } + if (object.maxValidators != null) + message.maxValidators = object.maxValidators >>> 0; + if (object.maxEntries != null) + message.maxEntries = object.maxEntries >>> 0; + if (object.historicalEntries != null) + message.historicalEntries = object.historicalEntries >>> 0; + if (object.bondDenom != null) + message.bondDenom = String(object.bondDenom); + return message; + }; + + /** + * Creates a plain object from a Params message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.Params + * @static + * @param {cosmos.staking.v1beta1.Params} message Params + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Params.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.unbondingTime = null; + object.maxValidators = 0; + object.maxEntries = 0; + object.historicalEntries = 0; + object.bondDenom = ""; + } + if (message.unbondingTime != null && message.hasOwnProperty("unbondingTime")) + object.unbondingTime = $root.google.protobuf.Duration.toObject(message.unbondingTime, options); + if (message.maxValidators != null && message.hasOwnProperty("maxValidators")) + object.maxValidators = message.maxValidators; + if (message.maxEntries != null && message.hasOwnProperty("maxEntries")) + object.maxEntries = message.maxEntries; + if (message.historicalEntries != null && message.hasOwnProperty("historicalEntries")) + object.historicalEntries = message.historicalEntries; + if (message.bondDenom != null && message.hasOwnProperty("bondDenom")) + object.bondDenom = message.bondDenom; + return object; + }; + + /** + * Converts this Params to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.Params + * @instance + * @returns {Object.} JSON object + */ + Params.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Params; + })(v1beta1.Params || {}); + + v1beta1.DelegationResponse = (function(DelegationResponse) { + + /** + * Properties of a DelegationResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IDelegationResponse + * @property {cosmos.staking.v1beta1.IDelegation|null} [delegation] DelegationResponse delegation + * @property {cosmos.base.v1beta1.ICoin|null} [balance] DelegationResponse balance + */ + + /** + * Constructs a new DelegationResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a DelegationResponse. + * @implements IDelegationResponse + * @constructor + * @param {cosmos.staking.v1beta1.IDelegationResponse=} [properties] Properties to set + */ + function DelegationResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DelegationResponse delegation. + * @member {cosmos.staking.v1beta1.IDelegation|null|undefined} delegation + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @instance + */ + DelegationResponse.prototype.delegation = null; + + /** + * DelegationResponse balance. + * @member {cosmos.base.v1beta1.ICoin|null|undefined} balance + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @instance + */ + DelegationResponse.prototype.balance = null; + + /** + * Creates a new DelegationResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @static + * @param {cosmos.staking.v1beta1.IDelegationResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.DelegationResponse} DelegationResponse instance + */ + DelegationResponse.create = function create(properties) { + return new DelegationResponse(properties); + }; + + /** + * Encodes the specified DelegationResponse message. Does not implicitly {@link cosmos.staking.v1beta1.DelegationResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @static + * @param {cosmos.staking.v1beta1.IDelegationResponse} message DelegationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DelegationResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegation != null && Object.hasOwnProperty.call(message, "delegation")) + $root.cosmos.staking.v1beta1.Delegation.encode(message.delegation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) + $root.cosmos.base.v1beta1.Coin.encode(message.balance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DelegationResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.DelegationResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @static + * @param {cosmos.staking.v1beta1.IDelegationResponse} message DelegationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DelegationResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DelegationResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.DelegationResponse} DelegationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DelegationResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.DelegationResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegation = $root.cosmos.staking.v1beta1.Delegation.decode(reader, reader.uint32()); + break; + case 2: + message.balance = $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DelegationResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.DelegationResponse} DelegationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DelegationResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DelegationResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DelegationResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegation != null && message.hasOwnProperty("delegation")) { + let error = $root.cosmos.staking.v1beta1.Delegation.verify(message.delegation); + if (error) + return "delegation." + error; + } + if (message.balance != null && message.hasOwnProperty("balance")) { + let error = $root.cosmos.base.v1beta1.Coin.verify(message.balance); + if (error) + return "balance." + error; + } + return null; + }; + + /** + * Creates a DelegationResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.DelegationResponse} DelegationResponse + */ + DelegationResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.DelegationResponse) + return object; + let message = new $root.cosmos.staking.v1beta1.DelegationResponse(); + if (object.delegation != null) { + if (typeof object.delegation !== "object") + throw TypeError(".cosmos.staking.v1beta1.DelegationResponse.delegation: object expected"); + message.delegation = $root.cosmos.staking.v1beta1.Delegation.fromObject(object.delegation); + } + if (object.balance != null) { + if (typeof object.balance !== "object") + throw TypeError(".cosmos.staking.v1beta1.DelegationResponse.balance: object expected"); + message.balance = $root.cosmos.base.v1beta1.Coin.fromObject(object.balance); + } + return message; + }; + + /** + * Creates a plain object from a DelegationResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @static + * @param {cosmos.staking.v1beta1.DelegationResponse} message DelegationResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DelegationResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.delegation = null; + object.balance = null; + } + if (message.delegation != null && message.hasOwnProperty("delegation")) + object.delegation = $root.cosmos.staking.v1beta1.Delegation.toObject(message.delegation, options); + if (message.balance != null && message.hasOwnProperty("balance")) + object.balance = $root.cosmos.base.v1beta1.Coin.toObject(message.balance, options); + return object; + }; + + /** + * Converts this DelegationResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.DelegationResponse + * @instance + * @returns {Object.} JSON object + */ + DelegationResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DelegationResponse; + })(v1beta1.DelegationResponse || {}); + + v1beta1.RedelegationEntryResponse = (function(RedelegationEntryResponse) { + + /** + * Properties of a RedelegationEntryResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IRedelegationEntryResponse + * @property {cosmos.staking.v1beta1.IRedelegationEntry|null} [redelegationEntry] RedelegationEntryResponse redelegationEntry + * @property {string|null} [balance] RedelegationEntryResponse balance + */ + + /** + * Constructs a new RedelegationEntryResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a RedelegationEntryResponse. + * @implements IRedelegationEntryResponse + * @constructor + * @param {cosmos.staking.v1beta1.IRedelegationEntryResponse=} [properties] Properties to set + */ + function RedelegationEntryResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RedelegationEntryResponse redelegationEntry. + * @member {cosmos.staking.v1beta1.IRedelegationEntry|null|undefined} redelegationEntry + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @instance + */ + RedelegationEntryResponse.prototype.redelegationEntry = null; + + /** + * RedelegationEntryResponse balance. + * @member {string} balance + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @instance + */ + RedelegationEntryResponse.prototype.balance = ""; + + /** + * Creates a new RedelegationEntryResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @static + * @param {cosmos.staking.v1beta1.IRedelegationEntryResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.RedelegationEntryResponse} RedelegationEntryResponse instance + */ + RedelegationEntryResponse.create = function create(properties) { + return new RedelegationEntryResponse(properties); + }; + + /** + * Encodes the specified RedelegationEntryResponse message. Does not implicitly {@link cosmos.staking.v1beta1.RedelegationEntryResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @static + * @param {cosmos.staking.v1beta1.IRedelegationEntryResponse} message RedelegationEntryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedelegationEntryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.redelegationEntry != null && Object.hasOwnProperty.call(message, "redelegationEntry")) + $root.cosmos.staking.v1beta1.RedelegationEntry.encode(message.redelegationEntry, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.balance); + return writer; + }; + + /** + * Encodes the specified RedelegationEntryResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.RedelegationEntryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @static + * @param {cosmos.staking.v1beta1.IRedelegationEntryResponse} message RedelegationEntryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedelegationEntryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RedelegationEntryResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.RedelegationEntryResponse} RedelegationEntryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedelegationEntryResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.RedelegationEntryResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.redelegationEntry = $root.cosmos.staking.v1beta1.RedelegationEntry.decode(reader, reader.uint32()); + break; + case 4: + message.balance = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RedelegationEntryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.RedelegationEntryResponse} RedelegationEntryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedelegationEntryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RedelegationEntryResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RedelegationEntryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.redelegationEntry != null && message.hasOwnProperty("redelegationEntry")) { + let error = $root.cosmos.staking.v1beta1.RedelegationEntry.verify(message.redelegationEntry); + if (error) + return "redelegationEntry." + error; + } + if (message.balance != null && message.hasOwnProperty("balance")) + if (!$util.isString(message.balance)) + return "balance: string expected"; + return null; + }; + + /** + * Creates a RedelegationEntryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.RedelegationEntryResponse} RedelegationEntryResponse + */ + RedelegationEntryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.RedelegationEntryResponse) + return object; + let message = new $root.cosmos.staking.v1beta1.RedelegationEntryResponse(); + if (object.redelegationEntry != null) { + if (typeof object.redelegationEntry !== "object") + throw TypeError(".cosmos.staking.v1beta1.RedelegationEntryResponse.redelegationEntry: object expected"); + message.redelegationEntry = $root.cosmos.staking.v1beta1.RedelegationEntry.fromObject(object.redelegationEntry); + } + if (object.balance != null) + message.balance = String(object.balance); + return message; + }; + + /** + * Creates a plain object from a RedelegationEntryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @static + * @param {cosmos.staking.v1beta1.RedelegationEntryResponse} message RedelegationEntryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RedelegationEntryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.redelegationEntry = null; + object.balance = ""; + } + if (message.redelegationEntry != null && message.hasOwnProperty("redelegationEntry")) + object.redelegationEntry = $root.cosmos.staking.v1beta1.RedelegationEntry.toObject(message.redelegationEntry, options); + if (message.balance != null && message.hasOwnProperty("balance")) + object.balance = message.balance; + return object; + }; + + /** + * Converts this RedelegationEntryResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.RedelegationEntryResponse + * @instance + * @returns {Object.} JSON object + */ + RedelegationEntryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RedelegationEntryResponse; + })(v1beta1.RedelegationEntryResponse || {}); + + v1beta1.RedelegationResponse = (function(RedelegationResponse) { + + /** + * Properties of a RedelegationResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IRedelegationResponse + * @property {cosmos.staking.v1beta1.IRedelegation|null} [redelegation] RedelegationResponse redelegation + * @property {Array.|null} [entries] RedelegationResponse entries + */ + + /** + * Constructs a new RedelegationResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a RedelegationResponse. + * @implements IRedelegationResponse + * @constructor + * @param {cosmos.staking.v1beta1.IRedelegationResponse=} [properties] Properties to set + */ + function RedelegationResponse(properties) { + this.entries = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RedelegationResponse redelegation. + * @member {cosmos.staking.v1beta1.IRedelegation|null|undefined} redelegation + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @instance + */ + RedelegationResponse.prototype.redelegation = null; + + /** + * RedelegationResponse entries. + * @member {Array.} entries + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @instance + */ + RedelegationResponse.prototype.entries = $util.emptyArray; + + /** + * Creates a new RedelegationResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @static + * @param {cosmos.staking.v1beta1.IRedelegationResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.RedelegationResponse} RedelegationResponse instance + */ + RedelegationResponse.create = function create(properties) { + return new RedelegationResponse(properties); + }; + + /** + * Encodes the specified RedelegationResponse message. Does not implicitly {@link cosmos.staking.v1beta1.RedelegationResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @static + * @param {cosmos.staking.v1beta1.IRedelegationResponse} message RedelegationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedelegationResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.redelegation != null && Object.hasOwnProperty.call(message, "redelegation")) + $root.cosmos.staking.v1beta1.Redelegation.encode(message.redelegation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.entries != null && message.entries.length) + for (let i = 0; i < message.entries.length; ++i) + $root.cosmos.staking.v1beta1.RedelegationEntryResponse.encode(message.entries[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RedelegationResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.RedelegationResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @static + * @param {cosmos.staking.v1beta1.IRedelegationResponse} message RedelegationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedelegationResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RedelegationResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.RedelegationResponse} RedelegationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedelegationResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.RedelegationResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.redelegation = $root.cosmos.staking.v1beta1.Redelegation.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.cosmos.staking.v1beta1.RedelegationEntryResponse.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RedelegationResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.RedelegationResponse} RedelegationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedelegationResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RedelegationResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RedelegationResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.redelegation != null && message.hasOwnProperty("redelegation")) { + let error = $root.cosmos.staking.v1beta1.Redelegation.verify(message.redelegation); + if (error) + return "redelegation." + error; + } + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (let i = 0; i < message.entries.length; ++i) { + let error = $root.cosmos.staking.v1beta1.RedelegationEntryResponse.verify(message.entries[i]); + if (error) + return "entries." + error; + } + } + return null; + }; + + /** + * Creates a RedelegationResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.RedelegationResponse} RedelegationResponse + */ + RedelegationResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.RedelegationResponse) + return object; + let message = new $root.cosmos.staking.v1beta1.RedelegationResponse(); + if (object.redelegation != null) { + if (typeof object.redelegation !== "object") + throw TypeError(".cosmos.staking.v1beta1.RedelegationResponse.redelegation: object expected"); + message.redelegation = $root.cosmos.staking.v1beta1.Redelegation.fromObject(object.redelegation); + } + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".cosmos.staking.v1beta1.RedelegationResponse.entries: array expected"); + message.entries = []; + for (let i = 0; i < object.entries.length; ++i) { + if (typeof object.entries[i] !== "object") + throw TypeError(".cosmos.staking.v1beta1.RedelegationResponse.entries: object expected"); + message.entries[i] = $root.cosmos.staking.v1beta1.RedelegationEntryResponse.fromObject(object.entries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RedelegationResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @static + * @param {cosmos.staking.v1beta1.RedelegationResponse} message RedelegationResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RedelegationResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (options.defaults) + object.redelegation = null; + if (message.redelegation != null && message.hasOwnProperty("redelegation")) + object.redelegation = $root.cosmos.staking.v1beta1.Redelegation.toObject(message.redelegation, options); + if (message.entries && message.entries.length) { + object.entries = []; + for (let j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.cosmos.staking.v1beta1.RedelegationEntryResponse.toObject(message.entries[j], options); + } + return object; + }; + + /** + * Converts this RedelegationResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.RedelegationResponse + * @instance + * @returns {Object.} JSON object + */ + RedelegationResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RedelegationResponse; + })(v1beta1.RedelegationResponse || {}); + + v1beta1.Pool = (function(Pool) { + + /** + * Properties of a Pool. + * @memberof cosmos.staking.v1beta1 + * @interface IPool + * @property {string|null} [notBondedTokens] Pool notBondedTokens + * @property {string|null} [bondedTokens] Pool bondedTokens + */ + + /** + * Constructs a new Pool. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a Pool. + * @implements IPool + * @constructor + * @param {cosmos.staking.v1beta1.IPool=} [properties] Properties to set + */ + function Pool(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Pool notBondedTokens. + * @member {string} notBondedTokens + * @memberof cosmos.staking.v1beta1.Pool + * @instance + */ + Pool.prototype.notBondedTokens = ""; + + /** + * Pool bondedTokens. + * @member {string} bondedTokens + * @memberof cosmos.staking.v1beta1.Pool + * @instance + */ + Pool.prototype.bondedTokens = ""; + + /** + * Creates a new Pool instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.Pool + * @static + * @param {cosmos.staking.v1beta1.IPool=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.Pool} Pool instance + */ + Pool.create = function create(properties) { + return new Pool(properties); + }; + + /** + * Encodes the specified Pool message. Does not implicitly {@link cosmos.staking.v1beta1.Pool.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.Pool + * @static + * @param {cosmos.staking.v1beta1.IPool} message Pool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Pool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.notBondedTokens != null && Object.hasOwnProperty.call(message, "notBondedTokens")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.notBondedTokens); + if (message.bondedTokens != null && Object.hasOwnProperty.call(message, "bondedTokens")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.bondedTokens); + return writer; + }; + + /** + * Encodes the specified Pool message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.Pool.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.Pool + * @static + * @param {cosmos.staking.v1beta1.IPool} message Pool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Pool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Pool message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.Pool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.Pool} Pool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Pool.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.Pool(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.notBondedTokens = reader.string(); + break; + case 2: + message.bondedTokens = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Pool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.Pool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.Pool} Pool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Pool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Pool message. + * @function verify + * @memberof cosmos.staking.v1beta1.Pool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Pool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.notBondedTokens != null && message.hasOwnProperty("notBondedTokens")) + if (!$util.isString(message.notBondedTokens)) + return "notBondedTokens: string expected"; + if (message.bondedTokens != null && message.hasOwnProperty("bondedTokens")) + if (!$util.isString(message.bondedTokens)) + return "bondedTokens: string expected"; + return null; + }; + + /** + * Creates a Pool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.Pool + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.Pool} Pool + */ + Pool.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.Pool) + return object; + let message = new $root.cosmos.staking.v1beta1.Pool(); + if (object.notBondedTokens != null) + message.notBondedTokens = String(object.notBondedTokens); + if (object.bondedTokens != null) + message.bondedTokens = String(object.bondedTokens); + return message; + }; + + /** + * Creates a plain object from a Pool message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.Pool + * @static + * @param {cosmos.staking.v1beta1.Pool} message Pool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Pool.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.notBondedTokens = ""; + object.bondedTokens = ""; + } + if (message.notBondedTokens != null && message.hasOwnProperty("notBondedTokens")) + object.notBondedTokens = message.notBondedTokens; + if (message.bondedTokens != null && message.hasOwnProperty("bondedTokens")) + object.bondedTokens = message.bondedTokens; + return object; + }; + + /** + * Converts this Pool to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.Pool + * @instance + * @returns {Object.} JSON object + */ + Pool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Pool; + })(v1beta1.Pool || {}); + + v1beta1.Msg = (function(Msg) { + + /** + * Constructs a new Msg service. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a Msg + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Msg(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; + + /** + * Creates new Msg service using the specified rpc implementation. + * @function create + * @memberof cosmos.staking.v1beta1.Msg + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Msg} RPC service. Useful where requests and/or responses are streamed. + */ + Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.staking.v1beta1.Msg#createValidator}. + * @memberof cosmos.staking.v1beta1.Msg + * @typedef CreateValidatorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.staking.v1beta1.IMsgCreateValidatorResponse} [response] MsgCreateValidatorResponse + */ + + /** + * Calls CreateValidator. + * @function createValidator + * @memberof cosmos.staking.v1beta1.Msg + * @instance + * @param {cosmos.staking.v1beta1.IMsgCreateValidator} request MsgCreateValidator message or plain object + * @param {cosmos.staking.v1beta1.Msg.CreateValidatorCallback} callback Node-style callback called with the error, if any, and MsgCreateValidatorResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.createValidator = function createValidator(request, callback) { + return this.rpcCall(createValidator, $root.cosmos.staking.v1beta1.MsgCreateValidator, $root.cosmos.staking.v1beta1.MsgCreateValidatorResponse, request, callback); + }, "name", { value: "CreateValidator" }); + + /** + * Calls CreateValidator. + * @function createValidator + * @memberof cosmos.staking.v1beta1.Msg + * @instance + * @param {cosmos.staking.v1beta1.IMsgCreateValidator} request MsgCreateValidator message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.staking.v1beta1.Msg#editValidator}. + * @memberof cosmos.staking.v1beta1.Msg + * @typedef EditValidatorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.staking.v1beta1.IMsgEditValidatorResponse} [response] MsgEditValidatorResponse + */ + + /** + * Calls EditValidator. + * @function editValidator + * @memberof cosmos.staking.v1beta1.Msg + * @instance + * @param {cosmos.staking.v1beta1.IMsgEditValidator} request MsgEditValidator message or plain object + * @param {cosmos.staking.v1beta1.Msg.EditValidatorCallback} callback Node-style callback called with the error, if any, and MsgEditValidatorResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.editValidator = function editValidator(request, callback) { + return this.rpcCall(editValidator, $root.cosmos.staking.v1beta1.MsgEditValidator, $root.cosmos.staking.v1beta1.MsgEditValidatorResponse, request, callback); + }, "name", { value: "EditValidator" }); + + /** + * Calls EditValidator. + * @function editValidator + * @memberof cosmos.staking.v1beta1.Msg + * @instance + * @param {cosmos.staking.v1beta1.IMsgEditValidator} request MsgEditValidator message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.staking.v1beta1.Msg#delegate}. + * @memberof cosmos.staking.v1beta1.Msg + * @typedef DelegateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.staking.v1beta1.IMsgDelegateResponse} [response] MsgDelegateResponse + */ + + /** + * Calls Delegate. + * @function delegate + * @memberof cosmos.staking.v1beta1.Msg + * @instance + * @param {cosmos.staking.v1beta1.IMsgDelegate} request MsgDelegate message or plain object + * @param {cosmos.staking.v1beta1.Msg.DelegateCallback} callback Node-style callback called with the error, if any, and MsgDelegateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.delegate = function delegate(request, callback) { + return this.rpcCall(delegate, $root.cosmos.staking.v1beta1.MsgDelegate, $root.cosmos.staking.v1beta1.MsgDelegateResponse, request, callback); + }, "name", { value: "Delegate" }); + + /** + * Calls Delegate. + * @function delegate + * @memberof cosmos.staking.v1beta1.Msg + * @instance + * @param {cosmos.staking.v1beta1.IMsgDelegate} request MsgDelegate message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.staking.v1beta1.Msg#beginRedelegate}. + * @memberof cosmos.staking.v1beta1.Msg + * @typedef BeginRedelegateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegateResponse} [response] MsgBeginRedelegateResponse + */ + + /** + * Calls BeginRedelegate. + * @function beginRedelegate + * @memberof cosmos.staking.v1beta1.Msg + * @instance + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegate} request MsgBeginRedelegate message or plain object + * @param {cosmos.staking.v1beta1.Msg.BeginRedelegateCallback} callback Node-style callback called with the error, if any, and MsgBeginRedelegateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.beginRedelegate = function beginRedelegate(request, callback) { + return this.rpcCall(beginRedelegate, $root.cosmos.staking.v1beta1.MsgBeginRedelegate, $root.cosmos.staking.v1beta1.MsgBeginRedelegateResponse, request, callback); + }, "name", { value: "BeginRedelegate" }); + + /** + * Calls BeginRedelegate. + * @function beginRedelegate + * @memberof cosmos.staking.v1beta1.Msg + * @instance + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegate} request MsgBeginRedelegate message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.staking.v1beta1.Msg#undelegate}. + * @memberof cosmos.staking.v1beta1.Msg + * @typedef UndelegateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.staking.v1beta1.IMsgUndelegateResponse} [response] MsgUndelegateResponse + */ + + /** + * Calls Undelegate. + * @function undelegate + * @memberof cosmos.staking.v1beta1.Msg + * @instance + * @param {cosmos.staking.v1beta1.IMsgUndelegate} request MsgUndelegate message or plain object + * @param {cosmos.staking.v1beta1.Msg.UndelegateCallback} callback Node-style callback called with the error, if any, and MsgUndelegateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.undelegate = function undelegate(request, callback) { + return this.rpcCall(undelegate, $root.cosmos.staking.v1beta1.MsgUndelegate, $root.cosmos.staking.v1beta1.MsgUndelegateResponse, request, callback); + }, "name", { value: "Undelegate" }); + + /** + * Calls Undelegate. + * @function undelegate + * @memberof cosmos.staking.v1beta1.Msg + * @instance + * @param {cosmos.staking.v1beta1.IMsgUndelegate} request MsgUndelegate message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Msg; + })(v1beta1.Msg || {}); + + v1beta1.MsgCreateValidator = (function(MsgCreateValidator) { + + /** + * Properties of a MsgCreateValidator. + * @memberof cosmos.staking.v1beta1 + * @interface IMsgCreateValidator + * @property {cosmos.staking.v1beta1.IDescription|null} [description] MsgCreateValidator description + * @property {cosmos.staking.v1beta1.ICommissionRates|null} [commission] MsgCreateValidator commission + * @property {string|null} [minSelfDelegation] MsgCreateValidator minSelfDelegation + * @property {string|null} [delegatorAddress] MsgCreateValidator delegatorAddress + * @property {string|null} [validatorAddress] MsgCreateValidator validatorAddress + * @property {google.protobuf.IAny|null} [pubkey] MsgCreateValidator pubkey + * @property {cosmos.base.v1beta1.ICoin|null} [value] MsgCreateValidator value + */ + + /** + * Constructs a new MsgCreateValidator. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a MsgCreateValidator. + * @implements IMsgCreateValidator + * @constructor + * @param {cosmos.staking.v1beta1.IMsgCreateValidator=} [properties] Properties to set + */ + function MsgCreateValidator(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgCreateValidator description. + * @member {cosmos.staking.v1beta1.IDescription|null|undefined} description + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @instance + */ + MsgCreateValidator.prototype.description = null; + + /** + * MsgCreateValidator commission. + * @member {cosmos.staking.v1beta1.ICommissionRates|null|undefined} commission + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @instance + */ + MsgCreateValidator.prototype.commission = null; + + /** + * MsgCreateValidator minSelfDelegation. + * @member {string} minSelfDelegation + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @instance + */ + MsgCreateValidator.prototype.minSelfDelegation = ""; + + /** + * MsgCreateValidator delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @instance + */ + MsgCreateValidator.prototype.delegatorAddress = ""; + + /** + * MsgCreateValidator validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @instance + */ + MsgCreateValidator.prototype.validatorAddress = ""; + + /** + * MsgCreateValidator pubkey. + * @member {google.protobuf.IAny|null|undefined} pubkey + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @instance + */ + MsgCreateValidator.prototype.pubkey = null; + + /** + * MsgCreateValidator value. + * @member {cosmos.base.v1beta1.ICoin|null|undefined} value + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @instance + */ + MsgCreateValidator.prototype.value = null; + + /** + * Creates a new MsgCreateValidator instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @static + * @param {cosmos.staking.v1beta1.IMsgCreateValidator=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.MsgCreateValidator} MsgCreateValidator instance + */ + MsgCreateValidator.create = function create(properties) { + return new MsgCreateValidator(properties); + }; + + /** + * Encodes the specified MsgCreateValidator message. Does not implicitly {@link cosmos.staking.v1beta1.MsgCreateValidator.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @static + * @param {cosmos.staking.v1beta1.IMsgCreateValidator} message MsgCreateValidator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateValidator.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + $root.cosmos.staking.v1beta1.Description.encode(message.description, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.commission != null && Object.hasOwnProperty.call(message, "commission")) + $root.cosmos.staking.v1beta1.CommissionRates.encode(message.commission, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.minSelfDelegation != null && Object.hasOwnProperty.call(message, "minSelfDelegation")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.minSelfDelegation); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.delegatorAddress); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.validatorAddress); + if (message.pubkey != null && Object.hasOwnProperty.call(message, "pubkey")) + $root.google.protobuf.Any.encode(message.pubkey, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.cosmos.base.v1beta1.Coin.encode(message.value, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MsgCreateValidator message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgCreateValidator.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @static + * @param {cosmos.staking.v1beta1.IMsgCreateValidator} message MsgCreateValidator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateValidator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgCreateValidator message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.MsgCreateValidator} MsgCreateValidator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateValidator.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.MsgCreateValidator(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.description = $root.cosmos.staking.v1beta1.Description.decode(reader, reader.uint32()); + break; + case 2: + message.commission = $root.cosmos.staking.v1beta1.CommissionRates.decode(reader, reader.uint32()); + break; + case 3: + message.minSelfDelegation = reader.string(); + break; + case 4: + message.delegatorAddress = reader.string(); + break; + case 5: + message.validatorAddress = reader.string(); + break; + case 6: + message.pubkey = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 7: + message.value = $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgCreateValidator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.MsgCreateValidator} MsgCreateValidator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateValidator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgCreateValidator message. + * @function verify + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgCreateValidator.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.description != null && message.hasOwnProperty("description")) { + let error = $root.cosmos.staking.v1beta1.Description.verify(message.description); + if (error) + return "description." + error; + } + if (message.commission != null && message.hasOwnProperty("commission")) { + let error = $root.cosmos.staking.v1beta1.CommissionRates.verify(message.commission); + if (error) + return "commission." + error; + } + if (message.minSelfDelegation != null && message.hasOwnProperty("minSelfDelegation")) + if (!$util.isString(message.minSelfDelegation)) + return "minSelfDelegation: string expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + if (message.pubkey != null && message.hasOwnProperty("pubkey")) { + let error = $root.google.protobuf.Any.verify(message.pubkey); + if (error) + return "pubkey." + error; + } + if (message.value != null && message.hasOwnProperty("value")) { + let error = $root.cosmos.base.v1beta1.Coin.verify(message.value); + if (error) + return "value." + error; + } + return null; + }; + + /** + * Creates a MsgCreateValidator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.MsgCreateValidator} MsgCreateValidator + */ + MsgCreateValidator.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.MsgCreateValidator) + return object; + let message = new $root.cosmos.staking.v1beta1.MsgCreateValidator(); + if (object.description != null) { + if (typeof object.description !== "object") + throw TypeError(".cosmos.staking.v1beta1.MsgCreateValidator.description: object expected"); + message.description = $root.cosmos.staking.v1beta1.Description.fromObject(object.description); + } + if (object.commission != null) { + if (typeof object.commission !== "object") + throw TypeError(".cosmos.staking.v1beta1.MsgCreateValidator.commission: object expected"); + message.commission = $root.cosmos.staking.v1beta1.CommissionRates.fromObject(object.commission); + } + if (object.minSelfDelegation != null) + message.minSelfDelegation = String(object.minSelfDelegation); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + if (object.pubkey != null) { + if (typeof object.pubkey !== "object") + throw TypeError(".cosmos.staking.v1beta1.MsgCreateValidator.pubkey: object expected"); + message.pubkey = $root.google.protobuf.Any.fromObject(object.pubkey); + } + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".cosmos.staking.v1beta1.MsgCreateValidator.value: object expected"); + message.value = $root.cosmos.base.v1beta1.Coin.fromObject(object.value); + } + return message; + }; + + /** + * Creates a plain object from a MsgCreateValidator message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @static + * @param {cosmos.staking.v1beta1.MsgCreateValidator} message MsgCreateValidator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgCreateValidator.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.description = null; + object.commission = null; + object.minSelfDelegation = ""; + object.delegatorAddress = ""; + object.validatorAddress = ""; + object.pubkey = null; + object.value = null; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = $root.cosmos.staking.v1beta1.Description.toObject(message.description, options); + if (message.commission != null && message.hasOwnProperty("commission")) + object.commission = $root.cosmos.staking.v1beta1.CommissionRates.toObject(message.commission, options); + if (message.minSelfDelegation != null && message.hasOwnProperty("minSelfDelegation")) + object.minSelfDelegation = message.minSelfDelegation; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + if (message.pubkey != null && message.hasOwnProperty("pubkey")) + object.pubkey = $root.google.protobuf.Any.toObject(message.pubkey, options); + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.cosmos.base.v1beta1.Coin.toObject(message.value, options); + return object; + }; + + /** + * Converts this MsgCreateValidator to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.MsgCreateValidator + * @instance + * @returns {Object.} JSON object + */ + MsgCreateValidator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgCreateValidator; + })(v1beta1.MsgCreateValidator || {}); + + v1beta1.MsgCreateValidatorResponse = (function(MsgCreateValidatorResponse) { + + /** + * Properties of a MsgCreateValidatorResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IMsgCreateValidatorResponse + */ + + /** + * Constructs a new MsgCreateValidatorResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a MsgCreateValidatorResponse. + * @implements IMsgCreateValidatorResponse + * @constructor + * @param {cosmos.staking.v1beta1.IMsgCreateValidatorResponse=} [properties] Properties to set + */ + function MsgCreateValidatorResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgCreateValidatorResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgCreateValidatorResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.MsgCreateValidatorResponse} MsgCreateValidatorResponse instance + */ + MsgCreateValidatorResponse.create = function create(properties) { + return new MsgCreateValidatorResponse(properties); + }; + + /** + * Encodes the specified MsgCreateValidatorResponse message. Does not implicitly {@link cosmos.staking.v1beta1.MsgCreateValidatorResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgCreateValidatorResponse} message MsgCreateValidatorResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateValidatorResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgCreateValidatorResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgCreateValidatorResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgCreateValidatorResponse} message MsgCreateValidatorResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateValidatorResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgCreateValidatorResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.MsgCreateValidatorResponse} MsgCreateValidatorResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateValidatorResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.MsgCreateValidatorResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgCreateValidatorResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.MsgCreateValidatorResponse} MsgCreateValidatorResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateValidatorResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgCreateValidatorResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgCreateValidatorResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgCreateValidatorResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.MsgCreateValidatorResponse} MsgCreateValidatorResponse + */ + MsgCreateValidatorResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.MsgCreateValidatorResponse) + return object; + return new $root.cosmos.staking.v1beta1.MsgCreateValidatorResponse(); + }; + + /** + * Creates a plain object from a MsgCreateValidatorResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse + * @static + * @param {cosmos.staking.v1beta1.MsgCreateValidatorResponse} message MsgCreateValidatorResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgCreateValidatorResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgCreateValidatorResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse + * @instance + * @returns {Object.} JSON object + */ + MsgCreateValidatorResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgCreateValidatorResponse; + })(v1beta1.MsgCreateValidatorResponse || {}); + + v1beta1.MsgEditValidator = (function(MsgEditValidator) { + + /** + * Properties of a MsgEditValidator. + * @memberof cosmos.staking.v1beta1 + * @interface IMsgEditValidator + * @property {cosmos.staking.v1beta1.IDescription|null} [description] MsgEditValidator description + * @property {string|null} [validatorAddress] MsgEditValidator validatorAddress + * @property {string|null} [commissionRate] MsgEditValidator commissionRate + * @property {string|null} [minSelfDelegation] MsgEditValidator minSelfDelegation + */ + + /** + * Constructs a new MsgEditValidator. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a MsgEditValidator. + * @implements IMsgEditValidator + * @constructor + * @param {cosmos.staking.v1beta1.IMsgEditValidator=} [properties] Properties to set + */ + function MsgEditValidator(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgEditValidator description. + * @member {cosmos.staking.v1beta1.IDescription|null|undefined} description + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @instance + */ + MsgEditValidator.prototype.description = null; + + /** + * MsgEditValidator validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @instance + */ + MsgEditValidator.prototype.validatorAddress = ""; + + /** + * MsgEditValidator commissionRate. + * @member {string} commissionRate + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @instance + */ + MsgEditValidator.prototype.commissionRate = ""; + + /** + * MsgEditValidator minSelfDelegation. + * @member {string} minSelfDelegation + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @instance + */ + MsgEditValidator.prototype.minSelfDelegation = ""; + + /** + * Creates a new MsgEditValidator instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @static + * @param {cosmos.staking.v1beta1.IMsgEditValidator=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.MsgEditValidator} MsgEditValidator instance + */ + MsgEditValidator.create = function create(properties) { + return new MsgEditValidator(properties); + }; + + /** + * Encodes the specified MsgEditValidator message. Does not implicitly {@link cosmos.staking.v1beta1.MsgEditValidator.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @static + * @param {cosmos.staking.v1beta1.IMsgEditValidator} message MsgEditValidator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgEditValidator.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + $root.cosmos.staking.v1beta1.Description.encode(message.description, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddress); + if (message.commissionRate != null && Object.hasOwnProperty.call(message, "commissionRate")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.commissionRate); + if (message.minSelfDelegation != null && Object.hasOwnProperty.call(message, "minSelfDelegation")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.minSelfDelegation); + return writer; + }; + + /** + * Encodes the specified MsgEditValidator message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgEditValidator.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @static + * @param {cosmos.staking.v1beta1.IMsgEditValidator} message MsgEditValidator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgEditValidator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgEditValidator message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.MsgEditValidator} MsgEditValidator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgEditValidator.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.MsgEditValidator(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.description = $root.cosmos.staking.v1beta1.Description.decode(reader, reader.uint32()); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.commissionRate = reader.string(); + break; + case 4: + message.minSelfDelegation = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgEditValidator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.MsgEditValidator} MsgEditValidator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgEditValidator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgEditValidator message. + * @function verify + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgEditValidator.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.description != null && message.hasOwnProperty("description")) { + let error = $root.cosmos.staking.v1beta1.Description.verify(message.description); + if (error) + return "description." + error; + } + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + if (message.commissionRate != null && message.hasOwnProperty("commissionRate")) + if (!$util.isString(message.commissionRate)) + return "commissionRate: string expected"; + if (message.minSelfDelegation != null && message.hasOwnProperty("minSelfDelegation")) + if (!$util.isString(message.minSelfDelegation)) + return "minSelfDelegation: string expected"; + return null; + }; + + /** + * Creates a MsgEditValidator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.MsgEditValidator} MsgEditValidator + */ + MsgEditValidator.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.MsgEditValidator) + return object; + let message = new $root.cosmos.staking.v1beta1.MsgEditValidator(); + if (object.description != null) { + if (typeof object.description !== "object") + throw TypeError(".cosmos.staking.v1beta1.MsgEditValidator.description: object expected"); + message.description = $root.cosmos.staking.v1beta1.Description.fromObject(object.description); + } + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + if (object.commissionRate != null) + message.commissionRate = String(object.commissionRate); + if (object.minSelfDelegation != null) + message.minSelfDelegation = String(object.minSelfDelegation); + return message; + }; + + /** + * Creates a plain object from a MsgEditValidator message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @static + * @param {cosmos.staking.v1beta1.MsgEditValidator} message MsgEditValidator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgEditValidator.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.description = null; + object.validatorAddress = ""; + object.commissionRate = ""; + object.minSelfDelegation = ""; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = $root.cosmos.staking.v1beta1.Description.toObject(message.description, options); + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + if (message.commissionRate != null && message.hasOwnProperty("commissionRate")) + object.commissionRate = message.commissionRate; + if (message.minSelfDelegation != null && message.hasOwnProperty("minSelfDelegation")) + object.minSelfDelegation = message.minSelfDelegation; + return object; + }; + + /** + * Converts this MsgEditValidator to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.MsgEditValidator + * @instance + * @returns {Object.} JSON object + */ + MsgEditValidator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgEditValidator; + })(v1beta1.MsgEditValidator || {}); + + v1beta1.MsgEditValidatorResponse = (function(MsgEditValidatorResponse) { + + /** + * Properties of a MsgEditValidatorResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IMsgEditValidatorResponse + */ + + /** + * Constructs a new MsgEditValidatorResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a MsgEditValidatorResponse. + * @implements IMsgEditValidatorResponse + * @constructor + * @param {cosmos.staking.v1beta1.IMsgEditValidatorResponse=} [properties] Properties to set + */ + function MsgEditValidatorResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgEditValidatorResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgEditValidatorResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.MsgEditValidatorResponse} MsgEditValidatorResponse instance + */ + MsgEditValidatorResponse.create = function create(properties) { + return new MsgEditValidatorResponse(properties); + }; + + /** + * Encodes the specified MsgEditValidatorResponse message. Does not implicitly {@link cosmos.staking.v1beta1.MsgEditValidatorResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgEditValidatorResponse} message MsgEditValidatorResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgEditValidatorResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgEditValidatorResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgEditValidatorResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgEditValidatorResponse} message MsgEditValidatorResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgEditValidatorResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgEditValidatorResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.MsgEditValidatorResponse} MsgEditValidatorResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgEditValidatorResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.MsgEditValidatorResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgEditValidatorResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.MsgEditValidatorResponse} MsgEditValidatorResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgEditValidatorResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgEditValidatorResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgEditValidatorResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgEditValidatorResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.MsgEditValidatorResponse} MsgEditValidatorResponse + */ + MsgEditValidatorResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.MsgEditValidatorResponse) + return object; + return new $root.cosmos.staking.v1beta1.MsgEditValidatorResponse(); + }; + + /** + * Creates a plain object from a MsgEditValidatorResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse + * @static + * @param {cosmos.staking.v1beta1.MsgEditValidatorResponse} message MsgEditValidatorResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgEditValidatorResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgEditValidatorResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse + * @instance + * @returns {Object.} JSON object + */ + MsgEditValidatorResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgEditValidatorResponse; + })(v1beta1.MsgEditValidatorResponse || {}); + + v1beta1.MsgDelegate = (function(MsgDelegate) { + + /** + * Properties of a MsgDelegate. + * @memberof cosmos.staking.v1beta1 + * @interface IMsgDelegate + * @property {string|null} [delegatorAddress] MsgDelegate delegatorAddress + * @property {string|null} [validatorAddress] MsgDelegate validatorAddress + * @property {cosmos.base.v1beta1.ICoin|null} [amount] MsgDelegate amount + */ + + /** + * Constructs a new MsgDelegate. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a MsgDelegate. + * @implements IMsgDelegate + * @constructor + * @param {cosmos.staking.v1beta1.IMsgDelegate=} [properties] Properties to set + */ + function MsgDelegate(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgDelegate delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @instance + */ + MsgDelegate.prototype.delegatorAddress = ""; + + /** + * MsgDelegate validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @instance + */ + MsgDelegate.prototype.validatorAddress = ""; + + /** + * MsgDelegate amount. + * @member {cosmos.base.v1beta1.ICoin|null|undefined} amount + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @instance + */ + MsgDelegate.prototype.amount = null; + + /** + * Creates a new MsgDelegate instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @static + * @param {cosmos.staking.v1beta1.IMsgDelegate=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.MsgDelegate} MsgDelegate instance + */ + MsgDelegate.create = function create(properties) { + return new MsgDelegate(properties); + }; + + /** + * Encodes the specified MsgDelegate message. Does not implicitly {@link cosmos.staking.v1beta1.MsgDelegate.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @static + * @param {cosmos.staking.v1beta1.IMsgDelegate} message MsgDelegate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgDelegate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddress); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + $root.cosmos.base.v1beta1.Coin.encode(message.amount, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MsgDelegate message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgDelegate.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @static + * @param {cosmos.staking.v1beta1.IMsgDelegate} message MsgDelegate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgDelegate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgDelegate message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.MsgDelegate} MsgDelegate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgDelegate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.MsgDelegate(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.amount = $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgDelegate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.MsgDelegate} MsgDelegate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgDelegate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgDelegate message. + * @function verify + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgDelegate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + let error = $root.cosmos.base.v1beta1.Coin.verify(message.amount); + if (error) + return "amount." + error; + } + return null; + }; + + /** + * Creates a MsgDelegate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.MsgDelegate} MsgDelegate + */ + MsgDelegate.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.MsgDelegate) + return object; + let message = new $root.cosmos.staking.v1beta1.MsgDelegate(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + if (object.amount != null) { + if (typeof object.amount !== "object") + throw TypeError(".cosmos.staking.v1beta1.MsgDelegate.amount: object expected"); + message.amount = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount); + } + return message; + }; + + /** + * Creates a plain object from a MsgDelegate message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @static + * @param {cosmos.staking.v1beta1.MsgDelegate} message MsgDelegate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgDelegate.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.delegatorAddress = ""; + object.validatorAddress = ""; + object.amount = null; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + if (message.amount != null && message.hasOwnProperty("amount")) + object.amount = $root.cosmos.base.v1beta1.Coin.toObject(message.amount, options); + return object; + }; + + /** + * Converts this MsgDelegate to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.MsgDelegate + * @instance + * @returns {Object.} JSON object + */ + MsgDelegate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgDelegate; + })(v1beta1.MsgDelegate || {}); + + v1beta1.MsgDelegateResponse = (function(MsgDelegateResponse) { + + /** + * Properties of a MsgDelegateResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IMsgDelegateResponse + */ + + /** + * Constructs a new MsgDelegateResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a MsgDelegateResponse. + * @implements IMsgDelegateResponse + * @constructor + * @param {cosmos.staking.v1beta1.IMsgDelegateResponse=} [properties] Properties to set + */ + function MsgDelegateResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgDelegateResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.MsgDelegateResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgDelegateResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.MsgDelegateResponse} MsgDelegateResponse instance + */ + MsgDelegateResponse.create = function create(properties) { + return new MsgDelegateResponse(properties); + }; + + /** + * Encodes the specified MsgDelegateResponse message. Does not implicitly {@link cosmos.staking.v1beta1.MsgDelegateResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.MsgDelegateResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgDelegateResponse} message MsgDelegateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgDelegateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgDelegateResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgDelegateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.MsgDelegateResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgDelegateResponse} message MsgDelegateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgDelegateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgDelegateResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.MsgDelegateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.MsgDelegateResponse} MsgDelegateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgDelegateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.MsgDelegateResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgDelegateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.MsgDelegateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.MsgDelegateResponse} MsgDelegateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgDelegateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgDelegateResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.MsgDelegateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgDelegateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgDelegateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.MsgDelegateResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.MsgDelegateResponse} MsgDelegateResponse + */ + MsgDelegateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.MsgDelegateResponse) + return object; + return new $root.cosmos.staking.v1beta1.MsgDelegateResponse(); + }; + + /** + * Creates a plain object from a MsgDelegateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.MsgDelegateResponse + * @static + * @param {cosmos.staking.v1beta1.MsgDelegateResponse} message MsgDelegateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgDelegateResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgDelegateResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.MsgDelegateResponse + * @instance + * @returns {Object.} JSON object + */ + MsgDelegateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgDelegateResponse; + })(v1beta1.MsgDelegateResponse || {}); + + v1beta1.MsgBeginRedelegate = (function(MsgBeginRedelegate) { + + /** + * Properties of a MsgBeginRedelegate. + * @memberof cosmos.staking.v1beta1 + * @interface IMsgBeginRedelegate + * @property {string|null} [delegatorAddress] MsgBeginRedelegate delegatorAddress + * @property {string|null} [validatorSrcAddress] MsgBeginRedelegate validatorSrcAddress + * @property {string|null} [validatorDstAddress] MsgBeginRedelegate validatorDstAddress + * @property {cosmos.base.v1beta1.ICoin|null} [amount] MsgBeginRedelegate amount + */ + + /** + * Constructs a new MsgBeginRedelegate. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a MsgBeginRedelegate. + * @implements IMsgBeginRedelegate + * @constructor + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegate=} [properties] Properties to set + */ + function MsgBeginRedelegate(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgBeginRedelegate delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @instance + */ + MsgBeginRedelegate.prototype.delegatorAddress = ""; + + /** + * MsgBeginRedelegate validatorSrcAddress. + * @member {string} validatorSrcAddress + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @instance + */ + MsgBeginRedelegate.prototype.validatorSrcAddress = ""; + + /** + * MsgBeginRedelegate validatorDstAddress. + * @member {string} validatorDstAddress + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @instance + */ + MsgBeginRedelegate.prototype.validatorDstAddress = ""; + + /** + * MsgBeginRedelegate amount. + * @member {cosmos.base.v1beta1.ICoin|null|undefined} amount + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @instance + */ + MsgBeginRedelegate.prototype.amount = null; + + /** + * Creates a new MsgBeginRedelegate instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @static + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegate=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.MsgBeginRedelegate} MsgBeginRedelegate instance + */ + MsgBeginRedelegate.create = function create(properties) { + return new MsgBeginRedelegate(properties); + }; + + /** + * Encodes the specified MsgBeginRedelegate message. Does not implicitly {@link cosmos.staking.v1beta1.MsgBeginRedelegate.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @static + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegate} message MsgBeginRedelegate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgBeginRedelegate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.validatorSrcAddress != null && Object.hasOwnProperty.call(message, "validatorSrcAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorSrcAddress); + if (message.validatorDstAddress != null && Object.hasOwnProperty.call(message, "validatorDstAddress")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.validatorDstAddress); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + $root.cosmos.base.v1beta1.Coin.encode(message.amount, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MsgBeginRedelegate message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgBeginRedelegate.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @static + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegate} message MsgBeginRedelegate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgBeginRedelegate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgBeginRedelegate message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.MsgBeginRedelegate} MsgBeginRedelegate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgBeginRedelegate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.MsgBeginRedelegate(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorSrcAddress = reader.string(); + break; + case 3: + message.validatorDstAddress = reader.string(); + break; + case 4: + message.amount = $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgBeginRedelegate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.MsgBeginRedelegate} MsgBeginRedelegate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgBeginRedelegate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgBeginRedelegate message. + * @function verify + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgBeginRedelegate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.validatorSrcAddress != null && message.hasOwnProperty("validatorSrcAddress")) + if (!$util.isString(message.validatorSrcAddress)) + return "validatorSrcAddress: string expected"; + if (message.validatorDstAddress != null && message.hasOwnProperty("validatorDstAddress")) + if (!$util.isString(message.validatorDstAddress)) + return "validatorDstAddress: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + let error = $root.cosmos.base.v1beta1.Coin.verify(message.amount); + if (error) + return "amount." + error; + } + return null; + }; + + /** + * Creates a MsgBeginRedelegate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.MsgBeginRedelegate} MsgBeginRedelegate + */ + MsgBeginRedelegate.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.MsgBeginRedelegate) + return object; + let message = new $root.cosmos.staking.v1beta1.MsgBeginRedelegate(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.validatorSrcAddress != null) + message.validatorSrcAddress = String(object.validatorSrcAddress); + if (object.validatorDstAddress != null) + message.validatorDstAddress = String(object.validatorDstAddress); + if (object.amount != null) { + if (typeof object.amount !== "object") + throw TypeError(".cosmos.staking.v1beta1.MsgBeginRedelegate.amount: object expected"); + message.amount = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount); + } + return message; + }; + + /** + * Creates a plain object from a MsgBeginRedelegate message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @static + * @param {cosmos.staking.v1beta1.MsgBeginRedelegate} message MsgBeginRedelegate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgBeginRedelegate.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.delegatorAddress = ""; + object.validatorSrcAddress = ""; + object.validatorDstAddress = ""; + object.amount = null; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.validatorSrcAddress != null && message.hasOwnProperty("validatorSrcAddress")) + object.validatorSrcAddress = message.validatorSrcAddress; + if (message.validatorDstAddress != null && message.hasOwnProperty("validatorDstAddress")) + object.validatorDstAddress = message.validatorDstAddress; + if (message.amount != null && message.hasOwnProperty("amount")) + object.amount = $root.cosmos.base.v1beta1.Coin.toObject(message.amount, options); + return object; + }; + + /** + * Converts this MsgBeginRedelegate to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegate + * @instance + * @returns {Object.} JSON object + */ + MsgBeginRedelegate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgBeginRedelegate; + })(v1beta1.MsgBeginRedelegate || {}); + + v1beta1.MsgBeginRedelegateResponse = (function(MsgBeginRedelegateResponse) { + + /** + * Properties of a MsgBeginRedelegateResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IMsgBeginRedelegateResponse + * @property {google.protobuf.ITimestamp|null} [completionTime] MsgBeginRedelegateResponse completionTime + */ + + /** + * Constructs a new MsgBeginRedelegateResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a MsgBeginRedelegateResponse. + * @implements IMsgBeginRedelegateResponse + * @constructor + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegateResponse=} [properties] Properties to set + */ + function MsgBeginRedelegateResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgBeginRedelegateResponse completionTime. + * @member {google.protobuf.ITimestamp|null|undefined} completionTime + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse + * @instance + */ + MsgBeginRedelegateResponse.prototype.completionTime = null; + + /** + * Creates a new MsgBeginRedelegateResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegateResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.MsgBeginRedelegateResponse} MsgBeginRedelegateResponse instance + */ + MsgBeginRedelegateResponse.create = function create(properties) { + return new MsgBeginRedelegateResponse(properties); + }; + + /** + * Encodes the specified MsgBeginRedelegateResponse message. Does not implicitly {@link cosmos.staking.v1beta1.MsgBeginRedelegateResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegateResponse} message MsgBeginRedelegateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgBeginRedelegateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.completionTime != null && Object.hasOwnProperty.call(message, "completionTime")) + $root.google.protobuf.Timestamp.encode(message.completionTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MsgBeginRedelegateResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgBeginRedelegateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgBeginRedelegateResponse} message MsgBeginRedelegateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgBeginRedelegateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgBeginRedelegateResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.MsgBeginRedelegateResponse} MsgBeginRedelegateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgBeginRedelegateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.MsgBeginRedelegateResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.completionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgBeginRedelegateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.MsgBeginRedelegateResponse} MsgBeginRedelegateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgBeginRedelegateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgBeginRedelegateResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgBeginRedelegateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.completionTime != null && message.hasOwnProperty("completionTime")) { + let error = $root.google.protobuf.Timestamp.verify(message.completionTime); + if (error) + return "completionTime." + error; + } + return null; + }; + + /** + * Creates a MsgBeginRedelegateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.MsgBeginRedelegateResponse} MsgBeginRedelegateResponse + */ + MsgBeginRedelegateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.MsgBeginRedelegateResponse) + return object; + let message = new $root.cosmos.staking.v1beta1.MsgBeginRedelegateResponse(); + if (object.completionTime != null) { + if (typeof object.completionTime !== "object") + throw TypeError(".cosmos.staking.v1beta1.MsgBeginRedelegateResponse.completionTime: object expected"); + message.completionTime = $root.google.protobuf.Timestamp.fromObject(object.completionTime); + } + return message; + }; + + /** + * Creates a plain object from a MsgBeginRedelegateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse + * @static + * @param {cosmos.staking.v1beta1.MsgBeginRedelegateResponse} message MsgBeginRedelegateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgBeginRedelegateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.completionTime = null; + if (message.completionTime != null && message.hasOwnProperty("completionTime")) + object.completionTime = $root.google.protobuf.Timestamp.toObject(message.completionTime, options); + return object; + }; + + /** + * Converts this MsgBeginRedelegateResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse + * @instance + * @returns {Object.} JSON object + */ + MsgBeginRedelegateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgBeginRedelegateResponse; + })(v1beta1.MsgBeginRedelegateResponse || {}); + + v1beta1.MsgUndelegate = (function(MsgUndelegate) { + + /** + * Properties of a MsgUndelegate. + * @memberof cosmos.staking.v1beta1 + * @interface IMsgUndelegate + * @property {string|null} [delegatorAddress] MsgUndelegate delegatorAddress + * @property {string|null} [validatorAddress] MsgUndelegate validatorAddress + * @property {cosmos.base.v1beta1.ICoin|null} [amount] MsgUndelegate amount + */ + + /** + * Constructs a new MsgUndelegate. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a MsgUndelegate. + * @implements IMsgUndelegate + * @constructor + * @param {cosmos.staking.v1beta1.IMsgUndelegate=} [properties] Properties to set + */ + function MsgUndelegate(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgUndelegate delegatorAddress. + * @member {string} delegatorAddress + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @instance + */ + MsgUndelegate.prototype.delegatorAddress = ""; + + /** + * MsgUndelegate validatorAddress. + * @member {string} validatorAddress + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @instance + */ + MsgUndelegate.prototype.validatorAddress = ""; + + /** + * MsgUndelegate amount. + * @member {cosmos.base.v1beta1.ICoin|null|undefined} amount + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @instance + */ + MsgUndelegate.prototype.amount = null; + + /** + * Creates a new MsgUndelegate instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @static + * @param {cosmos.staking.v1beta1.IMsgUndelegate=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.MsgUndelegate} MsgUndelegate instance + */ + MsgUndelegate.create = function create(properties) { + return new MsgUndelegate(properties); + }; + + /** + * Encodes the specified MsgUndelegate message. Does not implicitly {@link cosmos.staking.v1beta1.MsgUndelegate.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @static + * @param {cosmos.staking.v1beta1.IMsgUndelegate} message MsgUndelegate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUndelegate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddress); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + $root.cosmos.base.v1beta1.Coin.encode(message.amount, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MsgUndelegate message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgUndelegate.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @static + * @param {cosmos.staking.v1beta1.IMsgUndelegate} message MsgUndelegate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUndelegate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgUndelegate message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.MsgUndelegate} MsgUndelegate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUndelegate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.MsgUndelegate(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.amount = $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgUndelegate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.MsgUndelegate} MsgUndelegate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUndelegate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgUndelegate message. + * @function verify + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgUndelegate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + if (!$util.isString(message.delegatorAddress)) + return "delegatorAddress: string expected"; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!$util.isString(message.validatorAddress)) + return "validatorAddress: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + let error = $root.cosmos.base.v1beta1.Coin.verify(message.amount); + if (error) + return "amount." + error; + } + return null; + }; + + /** + * Creates a MsgUndelegate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.MsgUndelegate} MsgUndelegate + */ + MsgUndelegate.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.MsgUndelegate) + return object; + let message = new $root.cosmos.staking.v1beta1.MsgUndelegate(); + if (object.delegatorAddress != null) + message.delegatorAddress = String(object.delegatorAddress); + if (object.validatorAddress != null) + message.validatorAddress = String(object.validatorAddress); + if (object.amount != null) { + if (typeof object.amount !== "object") + throw TypeError(".cosmos.staking.v1beta1.MsgUndelegate.amount: object expected"); + message.amount = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount); + } + return message; + }; + + /** + * Creates a plain object from a MsgUndelegate message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @static + * @param {cosmos.staking.v1beta1.MsgUndelegate} message MsgUndelegate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgUndelegate.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.delegatorAddress = ""; + object.validatorAddress = ""; + object.amount = null; + } + if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress")) + object.delegatorAddress = message.delegatorAddress; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = message.validatorAddress; + if (message.amount != null && message.hasOwnProperty("amount")) + object.amount = $root.cosmos.base.v1beta1.Coin.toObject(message.amount, options); + return object; + }; + + /** + * Converts this MsgUndelegate to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.MsgUndelegate + * @instance + * @returns {Object.} JSON object + */ + MsgUndelegate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgUndelegate; + })(v1beta1.MsgUndelegate || {}); + + v1beta1.MsgUndelegateResponse = (function(MsgUndelegateResponse) { + + /** + * Properties of a MsgUndelegateResponse. + * @memberof cosmos.staking.v1beta1 + * @interface IMsgUndelegateResponse + * @property {google.protobuf.ITimestamp|null} [completionTime] MsgUndelegateResponse completionTime + */ + + /** + * Constructs a new MsgUndelegateResponse. + * @memberof cosmos.staking.v1beta1 + * @classdesc Represents a MsgUndelegateResponse. + * @implements IMsgUndelegateResponse + * @constructor + * @param {cosmos.staking.v1beta1.IMsgUndelegateResponse=} [properties] Properties to set + */ + function MsgUndelegateResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgUndelegateResponse completionTime. + * @member {google.protobuf.ITimestamp|null|undefined} completionTime + * @memberof cosmos.staking.v1beta1.MsgUndelegateResponse + * @instance + */ + MsgUndelegateResponse.prototype.completionTime = null; + + /** + * Creates a new MsgUndelegateResponse instance using the specified properties. + * @function create + * @memberof cosmos.staking.v1beta1.MsgUndelegateResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgUndelegateResponse=} [properties] Properties to set + * @returns {cosmos.staking.v1beta1.MsgUndelegateResponse} MsgUndelegateResponse instance + */ + MsgUndelegateResponse.create = function create(properties) { + return new MsgUndelegateResponse(properties); + }; + + /** + * Encodes the specified MsgUndelegateResponse message. Does not implicitly {@link cosmos.staking.v1beta1.MsgUndelegateResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.staking.v1beta1.MsgUndelegateResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgUndelegateResponse} message MsgUndelegateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUndelegateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.completionTime != null && Object.hasOwnProperty.call(message, "completionTime")) + $root.google.protobuf.Timestamp.encode(message.completionTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MsgUndelegateResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgUndelegateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.staking.v1beta1.MsgUndelegateResponse + * @static + * @param {cosmos.staking.v1beta1.IMsgUndelegateResponse} message MsgUndelegateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUndelegateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgUndelegateResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.staking.v1beta1.MsgUndelegateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.staking.v1beta1.MsgUndelegateResponse} MsgUndelegateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUndelegateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.staking.v1beta1.MsgUndelegateResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.completionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgUndelegateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.staking.v1beta1.MsgUndelegateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.staking.v1beta1.MsgUndelegateResponse} MsgUndelegateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUndelegateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgUndelegateResponse message. + * @function verify + * @memberof cosmos.staking.v1beta1.MsgUndelegateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgUndelegateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.completionTime != null && message.hasOwnProperty("completionTime")) { + let error = $root.google.protobuf.Timestamp.verify(message.completionTime); + if (error) + return "completionTime." + error; + } + return null; + }; + + /** + * Creates a MsgUndelegateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.staking.v1beta1.MsgUndelegateResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.staking.v1beta1.MsgUndelegateResponse} MsgUndelegateResponse + */ + MsgUndelegateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.staking.v1beta1.MsgUndelegateResponse) + return object; + let message = new $root.cosmos.staking.v1beta1.MsgUndelegateResponse(); + if (object.completionTime != null) { + if (typeof object.completionTime !== "object") + throw TypeError(".cosmos.staking.v1beta1.MsgUndelegateResponse.completionTime: object expected"); + message.completionTime = $root.google.protobuf.Timestamp.fromObject(object.completionTime); + } + return message; + }; + + /** + * Creates a plain object from a MsgUndelegateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.staking.v1beta1.MsgUndelegateResponse + * @static + * @param {cosmos.staking.v1beta1.MsgUndelegateResponse} message MsgUndelegateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgUndelegateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.completionTime = null; + if (message.completionTime != null && message.hasOwnProperty("completionTime")) + object.completionTime = $root.google.protobuf.Timestamp.toObject(message.completionTime, options); + return object; + }; + + /** + * Converts this MsgUndelegateResponse to JSON. + * @function toJSON + * @memberof cosmos.staking.v1beta1.MsgUndelegateResponse + * @instance + * @returns {Object.} JSON object + */ + MsgUndelegateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgUndelegateResponse; + })(v1beta1.MsgUndelegateResponse || {}); + + return v1beta1; + })(staking.v1beta1 || {}); + + return staking; + })(cosmos.staking || {}); + + /** + * Namespace tx. + * @memberof cosmos + * @namespace + */ + + cosmos.tx = (function(tx) { + + /** + * Namespace signing. + * @memberof cosmos.tx + * @namespace + */ + + tx.signing = (function(signing) { + + /** + * Namespace v1beta1. + * @memberof cosmos.tx.signing + * @namespace + */ + + signing.v1beta1 = (function(v1beta1) { + + /** + * SignMode enum. + * @name cosmos.tx.signing.v1beta1.SignMode + * @enum {string} + * @property {number} SIGN_MODE_UNSPECIFIED=0 SIGN_MODE_UNSPECIFIED value + * @property {number} SIGN_MODE_DIRECT=1 SIGN_MODE_DIRECT value + * @property {number} SIGN_MODE_TEXTUAL=2 SIGN_MODE_TEXTUAL value + * @property {number} SIGN_MODE_LEGACY_AMINO_JSON=127 SIGN_MODE_LEGACY_AMINO_JSON value + */ + v1beta1.SignMode = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SIGN_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SIGN_MODE_DIRECT"] = 1; + values[valuesById[2] = "SIGN_MODE_TEXTUAL"] = 2; + values[valuesById[127] = "SIGN_MODE_LEGACY_AMINO_JSON"] = 127; + return values; + })(); + + v1beta1.SignatureDescriptors = (function(SignatureDescriptors) { + + /** + * Properties of a SignatureDescriptors. + * @memberof cosmos.tx.signing.v1beta1 + * @interface ISignatureDescriptors + * @property {Array.|null} [signatures] SignatureDescriptors signatures + */ + + /** + * Constructs a new SignatureDescriptors. + * @memberof cosmos.tx.signing.v1beta1 + * @classdesc Represents a SignatureDescriptors. + * @implements ISignatureDescriptors + * @constructor + * @param {cosmos.tx.signing.v1beta1.ISignatureDescriptors=} [properties] Properties to set + */ + function SignatureDescriptors(properties) { + this.signatures = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SignatureDescriptors signatures. + * @member {Array.} signatures + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors + * @instance + */ + SignatureDescriptors.prototype.signatures = $util.emptyArray; + + /** + * Creates a new SignatureDescriptors instance using the specified properties. + * @function create + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors + * @static + * @param {cosmos.tx.signing.v1beta1.ISignatureDescriptors=} [properties] Properties to set + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptors} SignatureDescriptors instance + */ + SignatureDescriptors.create = function create(properties) { + return new SignatureDescriptors(properties); + }; + + /** + * Encodes the specified SignatureDescriptors message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptors.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors + * @static + * @param {cosmos.tx.signing.v1beta1.ISignatureDescriptors} message SignatureDescriptors message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureDescriptors.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.signatures != null && message.signatures.length) + for (let i = 0; i < message.signatures.length; ++i) + $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.encode(message.signatures[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SignatureDescriptors message, length delimited. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptors.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors + * @static + * @param {cosmos.tx.signing.v1beta1.ISignatureDescriptors} message SignatureDescriptors message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureDescriptors.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SignatureDescriptors message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptors} SignatureDescriptors + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureDescriptors.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptors(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.signatures && message.signatures.length)) + message.signatures = []; + message.signatures.push($root.cosmos.tx.signing.v1beta1.SignatureDescriptor.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SignatureDescriptors message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptors} SignatureDescriptors + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureDescriptors.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SignatureDescriptors message. + * @function verify + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SignatureDescriptors.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.signatures != null && message.hasOwnProperty("signatures")) { + if (!Array.isArray(message.signatures)) + return "signatures: array expected"; + for (let i = 0; i < message.signatures.length; ++i) { + let error = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.verify(message.signatures[i]); + if (error) + return "signatures." + error; + } + } + return null; + }; + + /** + * Creates a SignatureDescriptors message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptors} SignatureDescriptors + */ + SignatureDescriptors.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.signing.v1beta1.SignatureDescriptors) + return object; + let message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptors(); + if (object.signatures) { + if (!Array.isArray(object.signatures)) + throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptors.signatures: array expected"); + message.signatures = []; + for (let i = 0; i < object.signatures.length; ++i) { + if (typeof object.signatures[i] !== "object") + throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptors.signatures: object expected"); + message.signatures[i] = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.fromObject(object.signatures[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SignatureDescriptors message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptors} message SignatureDescriptors + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SignatureDescriptors.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.signatures = []; + if (message.signatures && message.signatures.length) { + object.signatures = []; + for (let j = 0; j < message.signatures.length; ++j) + object.signatures[j] = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.toObject(message.signatures[j], options); + } + return object; + }; + + /** + * Converts this SignatureDescriptors to JSON. + * @function toJSON + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors + * @instance + * @returns {Object.} JSON object + */ + SignatureDescriptors.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SignatureDescriptors; + })(v1beta1.SignatureDescriptors || {}); + + v1beta1.SignatureDescriptor = (function(SignatureDescriptor) { + + /** + * Properties of a SignatureDescriptor. + * @memberof cosmos.tx.signing.v1beta1 + * @interface ISignatureDescriptor + * @property {google.protobuf.IAny|null} [publicKey] SignatureDescriptor publicKey + * @property {cosmos.tx.signing.v1beta1.SignatureDescriptor.IData|null} [data] SignatureDescriptor data + * @property {number|Long|null} [sequence] SignatureDescriptor sequence + */ + + /** + * Constructs a new SignatureDescriptor. + * @memberof cosmos.tx.signing.v1beta1 + * @classdesc Represents a SignatureDescriptor. + * @implements ISignatureDescriptor + * @constructor + * @param {cosmos.tx.signing.v1beta1.ISignatureDescriptor=} [properties] Properties to set + */ + function SignatureDescriptor(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SignatureDescriptor publicKey. + * @member {google.protobuf.IAny|null|undefined} publicKey + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @instance + */ + SignatureDescriptor.prototype.publicKey = null; + + /** + * SignatureDescriptor data. + * @member {cosmos.tx.signing.v1beta1.SignatureDescriptor.IData|null|undefined} data + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @instance + */ + SignatureDescriptor.prototype.data = null; + + /** + * SignatureDescriptor sequence. + * @member {number|Long} sequence + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @instance + */ + SignatureDescriptor.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new SignatureDescriptor instance using the specified properties. + * @function create + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @static + * @param {cosmos.tx.signing.v1beta1.ISignatureDescriptor=} [properties] Properties to set + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor} SignatureDescriptor instance + */ + SignatureDescriptor.create = function create(properties) { + return new SignatureDescriptor(properties); + }; + + /** + * Encodes the specified SignatureDescriptor message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @static + * @param {cosmos.tx.signing.v1beta1.ISignatureDescriptor} message SignatureDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) + $root.google.protobuf.Any.encode(message.publicKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.encode(message.data, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.sequence); + return writer; + }; + + /** + * Encodes the specified SignatureDescriptor message, length delimited. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @static + * @param {cosmos.tx.signing.v1beta1.ISignatureDescriptor} message SignatureDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SignatureDescriptor message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor} SignatureDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publicKey = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 2: + message.data = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.decode(reader, reader.uint32()); + break; + case 3: + message.sequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SignatureDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor} SignatureDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SignatureDescriptor message. + * @function verify + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SignatureDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.publicKey != null && message.hasOwnProperty("publicKey")) { + let error = $root.google.protobuf.Any.verify(message.publicKey); + if (error) + return "publicKey." + error; + } + if (message.data != null && message.hasOwnProperty("data")) { + let error = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.verify(message.data); + if (error) + return "data." + error; + } + if (message.sequence != null && message.hasOwnProperty("sequence")) + if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) + return "sequence: integer|Long expected"; + return null; + }; + + /** + * Creates a SignatureDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor} SignatureDescriptor + */ + SignatureDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.signing.v1beta1.SignatureDescriptor) + return object; + let message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor(); + if (object.publicKey != null) { + if (typeof object.publicKey !== "object") + throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.publicKey: object expected"); + message.publicKey = $root.google.protobuf.Any.fromObject(object.publicKey); + } + if (object.data != null) { + if (typeof object.data !== "object") + throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.data: object expected"); + message.data = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.fromObject(object.data); + } + if (object.sequence != null) + if ($util.Long) + (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; + else if (typeof object.sequence === "string") + message.sequence = parseInt(object.sequence, 10); + else if (typeof object.sequence === "number") + message.sequence = object.sequence; + else if (typeof object.sequence === "object") + message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a SignatureDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor} message SignatureDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SignatureDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.publicKey = null; + object.data = null; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sequence = options.longs === String ? "0" : 0; + } + if (message.publicKey != null && message.hasOwnProperty("publicKey")) + object.publicKey = $root.google.protobuf.Any.toObject(message.publicKey, options); + if (message.data != null && message.hasOwnProperty("data")) + object.data = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.toObject(message.data, options); + if (message.sequence != null && message.hasOwnProperty("sequence")) + if (typeof message.sequence === "number") + object.sequence = options.longs === String ? String(message.sequence) : message.sequence; + else + object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; + return object; + }; + + /** + * Converts this SignatureDescriptor to JSON. + * @function toJSON + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @instance + * @returns {Object.} JSON object + */ + SignatureDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + SignatureDescriptor.Data = (function(Data) { + + /** + * Properties of a Data. + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @interface IData + * @property {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle|null} [single] Data single + * @property {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti|null} [multi] Data multi + */ + + /** + * Constructs a new Data. + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor + * @classdesc Represents a Data. + * @implements IData + * @constructor + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.IData=} [properties] Properties to set + */ + function Data(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Data single. + * @member {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle|null|undefined} single + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @instance + */ + Data.prototype.single = null; + + /** + * Data multi. + * @member {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti|null|undefined} multi + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @instance + */ + Data.prototype.multi = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Data sum. + * @member {"single"|"multi"|undefined} sum + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @instance + */ + Object.defineProperty(Data.prototype, "sum", { + get: $util.oneOfGetter($oneOfFields = ["single", "multi"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Data instance using the specified properties. + * @function create + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.IData=} [properties] Properties to set + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data} Data instance + */ + Data.create = function create(properties) { + return new Data(properties); + }; + + /** + * Encodes the specified Data message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.IData} message Data message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Data.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.single != null && Object.hasOwnProperty.call(message, "single")) + $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.encode(message.single, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.multi != null && Object.hasOwnProperty.call(message, "multi")) + $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.encode(message.multi, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Data message, length delimited. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.IData} message Data message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Data.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Data message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data} Data + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Data.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.single = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.decode(reader, reader.uint32()); + break; + case 2: + message.multi = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Data message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data} Data + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Data.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Data message. + * @function verify + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Data.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + let properties = {}; + if (message.single != null && message.hasOwnProperty("single")) { + properties.sum = 1; + { + let error = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.verify(message.single); + if (error) + return "single." + error; + } + } + if (message.multi != null && message.hasOwnProperty("multi")) { + if (properties.sum === 1) + return "sum: multiple values"; + properties.sum = 1; + { + let error = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.verify(message.multi); + if (error) + return "multi." + error; + } + } + return null; + }; + + /** + * Creates a Data message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data} Data + */ + Data.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data) + return object; + let message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data(); + if (object.single != null) { + if (typeof object.single !== "object") + throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.single: object expected"); + message.single = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.fromObject(object.single); + } + if (object.multi != null) { + if (typeof object.multi !== "object") + throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.multi: object expected"); + message.multi = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.fromObject(object.multi); + } + return message; + }; + + /** + * Creates a plain object from a Data message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data} message Data + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Data.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.single != null && message.hasOwnProperty("single")) { + object.single = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.toObject(message.single, options); + if (options.oneofs) + object.sum = "single"; + } + if (message.multi != null && message.hasOwnProperty("multi")) { + object.multi = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.toObject(message.multi, options); + if (options.oneofs) + object.sum = "multi"; + } + return object; + }; + + /** + * Converts this Data to JSON. + * @function toJSON + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @instance + * @returns {Object.} JSON object + */ + Data.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Data.Single = (function(Single) { + + /** + * Properties of a Single. + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @interface ISingle + * @property {cosmos.tx.signing.v1beta1.SignMode|null} [mode] Single mode + * @property {Uint8Array|null} [signature] Single signature + */ + + /** + * Constructs a new Single. + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @classdesc Represents a Single. + * @implements ISingle + * @constructor + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle=} [properties] Properties to set + */ + function Single(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Single mode. + * @member {cosmos.tx.signing.v1beta1.SignMode} mode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @instance + */ + Single.prototype.mode = 0; + + /** + * Single signature. + * @member {Uint8Array} signature + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @instance + */ + Single.prototype.signature = $util.newBuffer([]); + + /** + * Creates a new Single instance using the specified properties. + * @function create + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle=} [properties] Properties to set + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single} Single instance + */ + Single.create = function create(properties) { + return new Single(properties); + }; + + /** + * Encodes the specified Single message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle} message Single message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Single.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); + if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.signature); + return writer; + }; + + /** + * Encodes the specified Single message, length delimited. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle} message Single message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Single.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Single message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single} Single + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Single.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mode = reader.int32(); + break; + case 2: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Single message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single} Single + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Single.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Single message. + * @function verify + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Single.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + case 127: + break; + } + if (message.signature != null && message.hasOwnProperty("signature")) + if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) + return "signature: buffer expected"; + return null; + }; + + /** + * Creates a Single message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single} Single + */ + Single.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single) + return object; + let message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single(); + switch (object.mode) { + case "SIGN_MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "SIGN_MODE_DIRECT": + case 1: + message.mode = 1; + break; + case "SIGN_MODE_TEXTUAL": + case 2: + message.mode = 2; + break; + case "SIGN_MODE_LEGACY_AMINO_JSON": + case 127: + message.mode = 127; + break; + } + if (object.signature != null) + if (typeof object.signature === "string") + $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); + else if (object.signature.length) + message.signature = object.signature; + return message; + }; + + /** + * Creates a plain object from a Single message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single} message Single + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Single.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.mode = options.enums === String ? "SIGN_MODE_UNSPECIFIED" : 0; + if (options.bytes === String) + object.signature = ""; + else { + object.signature = []; + if (options.bytes !== Array) + object.signature = $util.newBuffer(object.signature); + } + } + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.cosmos.tx.signing.v1beta1.SignMode[message.mode] : message.mode; + if (message.signature != null && message.hasOwnProperty("signature")) + object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; + return object; + }; + + /** + * Converts this Single to JSON. + * @function toJSON + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single + * @instance + * @returns {Object.} JSON object + */ + Single.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Single; + })(Data.Single || {}); + + Data.Multi = (function(Multi) { + + /** + * Properties of a Multi. + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @interface IMulti + * @property {cosmos.crypto.multisig.v1beta1.ICompactBitArray|null} [bitarray] Multi bitarray + * @property {Array.|null} [signatures] Multi signatures + */ + + /** + * Constructs a new Multi. + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data + * @classdesc Represents a Multi. + * @implements IMulti + * @constructor + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti=} [properties] Properties to set + */ + function Multi(properties) { + this.signatures = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Multi bitarray. + * @member {cosmos.crypto.multisig.v1beta1.ICompactBitArray|null|undefined} bitarray + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @instance + */ + Multi.prototype.bitarray = null; + + /** + * Multi signatures. + * @member {Array.} signatures + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @instance + */ + Multi.prototype.signatures = $util.emptyArray; + + /** + * Creates a new Multi instance using the specified properties. + * @function create + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti=} [properties] Properties to set + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi} Multi instance + */ + Multi.create = function create(properties) { + return new Multi(properties); + }; + + /** + * Encodes the specified Multi message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti} message Multi message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Multi.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bitarray != null && Object.hasOwnProperty.call(message, "bitarray")) + $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.encode(message.bitarray, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.signatures != null && message.signatures.length) + for (let i = 0; i < message.signatures.length; ++i) + $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.encode(message.signatures[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Multi message, length delimited. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti} message Multi message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Multi.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Multi message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi} Multi + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Multi.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bitarray = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.signatures && message.signatures.length)) + message.signatures = []; + message.signatures.push($root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Multi message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi} Multi + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Multi.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Multi message. + * @function verify + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Multi.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bitarray != null && message.hasOwnProperty("bitarray")) { + let error = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.verify(message.bitarray); + if (error) + return "bitarray." + error; + } + if (message.signatures != null && message.hasOwnProperty("signatures")) { + if (!Array.isArray(message.signatures)) + return "signatures: array expected"; + for (let i = 0; i < message.signatures.length; ++i) { + let error = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.verify(message.signatures[i]); + if (error) + return "signatures." + error; + } + } + return null; + }; + + /** + * Creates a Multi message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi} Multi + */ + Multi.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi) + return object; + let message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi(); + if (object.bitarray != null) { + if (typeof object.bitarray !== "object") + throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.bitarray: object expected"); + message.bitarray = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.fromObject(object.bitarray); + } + if (object.signatures) { + if (!Array.isArray(object.signatures)) + throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.signatures: array expected"); + message.signatures = []; + for (let i = 0; i < object.signatures.length; ++i) { + if (typeof object.signatures[i] !== "object") + throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.signatures: object expected"); + message.signatures[i] = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.fromObject(object.signatures[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Multi message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @static + * @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi} message Multi + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Multi.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.signatures = []; + if (options.defaults) + object.bitarray = null; + if (message.bitarray != null && message.hasOwnProperty("bitarray")) + object.bitarray = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.toObject(message.bitarray, options); + if (message.signatures && message.signatures.length) { + object.signatures = []; + for (let j = 0; j < message.signatures.length; ++j) + object.signatures[j] = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.toObject(message.signatures[j], options); + } + return object; + }; + + /** + * Converts this Multi to JSON. + * @function toJSON + * @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi + * @instance + * @returns {Object.} JSON object + */ + Multi.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Multi; + })(Data.Multi || {}); + + return Data; + })(SignatureDescriptor.Data || {}); + + return SignatureDescriptor; + })(v1beta1.SignatureDescriptor || {}); + + return v1beta1; + })(signing.v1beta1 || {}); + + return signing; + })(tx.signing || {}); + + /** + * Namespace v1beta1. + * @memberof cosmos.tx + * @namespace + */ + + tx.v1beta1 = (function(v1beta1) { + + v1beta1.Service = (function(Service) { + + /** + * Constructs a new Service service. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents a Service + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Service(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Service.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Service; + + /** + * Creates new Service service using the specified rpc implementation. + * @function create + * @memberof cosmos.tx.v1beta1.Service + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Service} RPC service. Useful where requests and/or responses are streamed. + */ + Service.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.tx.v1beta1.Service#simulate}. + * @memberof cosmos.tx.v1beta1.Service + * @typedef SimulateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.tx.v1beta1.ISimulateResponse} [response] SimulateResponse + */ + + /** + * Calls Simulate. + * @function simulate + * @memberof cosmos.tx.v1beta1.Service + * @instance + * @param {cosmos.tx.v1beta1.ISimulateRequest} request SimulateRequest message or plain object + * @param {cosmos.tx.v1beta1.Service.SimulateCallback} callback Node-style callback called with the error, if any, and SimulateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Service.prototype.simulate = function simulate(request, callback) { + return this.rpcCall(simulate, $root.cosmos.tx.v1beta1.SimulateRequest, $root.cosmos.tx.v1beta1.SimulateResponse, request, callback); + }, "name", { value: "Simulate" }); + + /** + * Calls Simulate. + * @function simulate + * @memberof cosmos.tx.v1beta1.Service + * @instance + * @param {cosmos.tx.v1beta1.ISimulateRequest} request SimulateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.tx.v1beta1.Service#getTx}. + * @memberof cosmos.tx.v1beta1.Service + * @typedef GetTxCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.tx.v1beta1.IGetTxResponse} [response] GetTxResponse + */ + + /** + * Calls GetTx. + * @function getTx + * @memberof cosmos.tx.v1beta1.Service + * @instance + * @param {cosmos.tx.v1beta1.IGetTxRequest} request GetTxRequest message or plain object + * @param {cosmos.tx.v1beta1.Service.GetTxCallback} callback Node-style callback called with the error, if any, and GetTxResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Service.prototype.getTx = function getTx(request, callback) { + return this.rpcCall(getTx, $root.cosmos.tx.v1beta1.GetTxRequest, $root.cosmos.tx.v1beta1.GetTxResponse, request, callback); + }, "name", { value: "GetTx" }); + + /** + * Calls GetTx. + * @function getTx + * @memberof cosmos.tx.v1beta1.Service + * @instance + * @param {cosmos.tx.v1beta1.IGetTxRequest} request GetTxRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.tx.v1beta1.Service#broadcastTx}. + * @memberof cosmos.tx.v1beta1.Service + * @typedef BroadcastTxCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.tx.v1beta1.IBroadcastTxResponse} [response] BroadcastTxResponse + */ + + /** + * Calls BroadcastTx. + * @function broadcastTx + * @memberof cosmos.tx.v1beta1.Service + * @instance + * @param {cosmos.tx.v1beta1.IBroadcastTxRequest} request BroadcastTxRequest message or plain object + * @param {cosmos.tx.v1beta1.Service.BroadcastTxCallback} callback Node-style callback called with the error, if any, and BroadcastTxResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Service.prototype.broadcastTx = function broadcastTx(request, callback) { + return this.rpcCall(broadcastTx, $root.cosmos.tx.v1beta1.BroadcastTxRequest, $root.cosmos.tx.v1beta1.BroadcastTxResponse, request, callback); + }, "name", { value: "BroadcastTx" }); + + /** + * Calls BroadcastTx. + * @function broadcastTx + * @memberof cosmos.tx.v1beta1.Service + * @instance + * @param {cosmos.tx.v1beta1.IBroadcastTxRequest} request BroadcastTxRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.tx.v1beta1.Service#getTxsEvent}. + * @memberof cosmos.tx.v1beta1.Service + * @typedef GetTxsEventCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.tx.v1beta1.IGetTxsEventResponse} [response] GetTxsEventResponse + */ + + /** + * Calls GetTxsEvent. + * @function getTxsEvent + * @memberof cosmos.tx.v1beta1.Service + * @instance + * @param {cosmos.tx.v1beta1.IGetTxsEventRequest} request GetTxsEventRequest message or plain object + * @param {cosmos.tx.v1beta1.Service.GetTxsEventCallback} callback Node-style callback called with the error, if any, and GetTxsEventResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Service.prototype.getTxsEvent = function getTxsEvent(request, callback) { + return this.rpcCall(getTxsEvent, $root.cosmos.tx.v1beta1.GetTxsEventRequest, $root.cosmos.tx.v1beta1.GetTxsEventResponse, request, callback); + }, "name", { value: "GetTxsEvent" }); + + /** + * Calls GetTxsEvent. + * @function getTxsEvent + * @memberof cosmos.tx.v1beta1.Service + * @instance + * @param {cosmos.tx.v1beta1.IGetTxsEventRequest} request GetTxsEventRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Service; + })(v1beta1.Service || {}); + + v1beta1.GetTxsEventRequest = (function(GetTxsEventRequest) { + + /** + * Properties of a GetTxsEventRequest. + * @memberof cosmos.tx.v1beta1 + * @interface IGetTxsEventRequest + * @property {Array.|null} [events] GetTxsEventRequest events + * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] GetTxsEventRequest pagination + * @property {cosmos.tx.v1beta1.OrderBy|null} [orderBy] GetTxsEventRequest orderBy + */ + + /** + * Constructs a new GetTxsEventRequest. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents a GetTxsEventRequest. + * @implements IGetTxsEventRequest + * @constructor + * @param {cosmos.tx.v1beta1.IGetTxsEventRequest=} [properties] Properties to set + */ + function GetTxsEventRequest(properties) { + this.events = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTxsEventRequest events. + * @member {Array.} events + * @memberof cosmos.tx.v1beta1.GetTxsEventRequest + * @instance + */ + GetTxsEventRequest.prototype.events = $util.emptyArray; + + /** + * GetTxsEventRequest pagination. + * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination + * @memberof cosmos.tx.v1beta1.GetTxsEventRequest + * @instance + */ + GetTxsEventRequest.prototype.pagination = null; + + /** + * GetTxsEventRequest orderBy. + * @member {cosmos.tx.v1beta1.OrderBy} orderBy + * @memberof cosmos.tx.v1beta1.GetTxsEventRequest + * @instance + */ + GetTxsEventRequest.prototype.orderBy = 0; + + /** + * Creates a new GetTxsEventRequest instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.GetTxsEventRequest + * @static + * @param {cosmos.tx.v1beta1.IGetTxsEventRequest=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.GetTxsEventRequest} GetTxsEventRequest instance + */ + GetTxsEventRequest.create = function create(properties) { + return new GetTxsEventRequest(properties); + }; + + /** + * Encodes the specified GetTxsEventRequest message. Does not implicitly {@link cosmos.tx.v1beta1.GetTxsEventRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.GetTxsEventRequest + * @static + * @param {cosmos.tx.v1beta1.IGetTxsEventRequest} message GetTxsEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTxsEventRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.events != null && message.events.length) + for (let i = 0; i < message.events.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.events[i]); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.orderBy); + return writer; + }; + + /** + * Encodes the specified GetTxsEventRequest message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.GetTxsEventRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.GetTxsEventRequest + * @static + * @param {cosmos.tx.v1beta1.IGetTxsEventRequest} message GetTxsEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTxsEventRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTxsEventRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.GetTxsEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.GetTxsEventRequest} GetTxsEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTxsEventRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.GetTxsEventRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.events && message.events.length)) + message.events = []; + message.events.push(reader.string()); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); + break; + case 3: + message.orderBy = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTxsEventRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.GetTxsEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.GetTxsEventRequest} GetTxsEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTxsEventRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTxsEventRequest message. + * @function verify + * @memberof cosmos.tx.v1beta1.GetTxsEventRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTxsEventRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.events != null && message.hasOwnProperty("events")) { + if (!Array.isArray(message.events)) + return "events: array expected"; + for (let i = 0; i < message.events.length; ++i) + if (!$util.isString(message.events[i])) + return "events: string[] expected"; + } + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); + if (error) + return "pagination." + error; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + switch (message.orderBy) { + default: + return "orderBy: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GetTxsEventRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.GetTxsEventRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.GetTxsEventRequest} GetTxsEventRequest + */ + GetTxsEventRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.GetTxsEventRequest) + return object; + let message = new $root.cosmos.tx.v1beta1.GetTxsEventRequest(); + if (object.events) { + if (!Array.isArray(object.events)) + throw TypeError(".cosmos.tx.v1beta1.GetTxsEventRequest.events: array expected"); + message.events = []; + for (let i = 0; i < object.events.length; ++i) + message.events[i] = String(object.events[i]); + } + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.tx.v1beta1.GetTxsEventRequest.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); + } + switch (object.orderBy) { + case "ORDER_BY_UNSPECIFIED": + case 0: + message.orderBy = 0; + break; + case "ORDER_BY_ASC": + case 1: + message.orderBy = 1; + break; + case "ORDER_BY_DESC": + case 2: + message.orderBy = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetTxsEventRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.GetTxsEventRequest + * @static + * @param {cosmos.tx.v1beta1.GetTxsEventRequest} message GetTxsEventRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTxsEventRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.events = []; + if (options.defaults) { + object.pagination = null; + object.orderBy = options.enums === String ? "ORDER_BY_UNSPECIFIED" : 0; + } + if (message.events && message.events.length) { + object.events = []; + for (let j = 0; j < message.events.length; ++j) + object.events[j] = message.events[j]; + } + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = options.enums === String ? $root.cosmos.tx.v1beta1.OrderBy[message.orderBy] : message.orderBy; + return object; + }; + + /** + * Converts this GetTxsEventRequest to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.GetTxsEventRequest + * @instance + * @returns {Object.} JSON object + */ + GetTxsEventRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetTxsEventRequest; + })(v1beta1.GetTxsEventRequest || {}); + + /** + * OrderBy enum. + * @name cosmos.tx.v1beta1.OrderBy + * @enum {string} + * @property {number} ORDER_BY_UNSPECIFIED=0 ORDER_BY_UNSPECIFIED value + * @property {number} ORDER_BY_ASC=1 ORDER_BY_ASC value + * @property {number} ORDER_BY_DESC=2 ORDER_BY_DESC value + */ + v1beta1.OrderBy = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ORDER_BY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORDER_BY_ASC"] = 1; + values[valuesById[2] = "ORDER_BY_DESC"] = 2; + return values; + })(); + + v1beta1.GetTxsEventResponse = (function(GetTxsEventResponse) { + + /** + * Properties of a GetTxsEventResponse. + * @memberof cosmos.tx.v1beta1 + * @interface IGetTxsEventResponse + * @property {Array.|null} [txs] GetTxsEventResponse txs + * @property {Array.|null} [txResponses] GetTxsEventResponse txResponses + * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] GetTxsEventResponse pagination + */ + + /** + * Constructs a new GetTxsEventResponse. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents a GetTxsEventResponse. + * @implements IGetTxsEventResponse + * @constructor + * @param {cosmos.tx.v1beta1.IGetTxsEventResponse=} [properties] Properties to set + */ + function GetTxsEventResponse(properties) { + this.txs = []; + this.txResponses = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTxsEventResponse txs. + * @member {Array.} txs + * @memberof cosmos.tx.v1beta1.GetTxsEventResponse + * @instance + */ + GetTxsEventResponse.prototype.txs = $util.emptyArray; + + /** + * GetTxsEventResponse txResponses. + * @member {Array.} txResponses + * @memberof cosmos.tx.v1beta1.GetTxsEventResponse + * @instance + */ + GetTxsEventResponse.prototype.txResponses = $util.emptyArray; + + /** + * GetTxsEventResponse pagination. + * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination + * @memberof cosmos.tx.v1beta1.GetTxsEventResponse + * @instance + */ + GetTxsEventResponse.prototype.pagination = null; + + /** + * Creates a new GetTxsEventResponse instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.GetTxsEventResponse + * @static + * @param {cosmos.tx.v1beta1.IGetTxsEventResponse=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.GetTxsEventResponse} GetTxsEventResponse instance + */ + GetTxsEventResponse.create = function create(properties) { + return new GetTxsEventResponse(properties); + }; + + /** + * Encodes the specified GetTxsEventResponse message. Does not implicitly {@link cosmos.tx.v1beta1.GetTxsEventResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.GetTxsEventResponse + * @static + * @param {cosmos.tx.v1beta1.IGetTxsEventResponse} message GetTxsEventResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTxsEventResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.txs != null && message.txs.length) + for (let i = 0; i < message.txs.length; ++i) + $root.cosmos.tx.v1beta1.Tx.encode(message.txs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.txResponses != null && message.txResponses.length) + for (let i = 0; i < message.txResponses.length; ++i) + $root.cosmos.base.abci.v1beta1.TxResponse.encode(message.txResponses[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTxsEventResponse message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.GetTxsEventResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.GetTxsEventResponse + * @static + * @param {cosmos.tx.v1beta1.IGetTxsEventResponse} message GetTxsEventResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTxsEventResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTxsEventResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.GetTxsEventResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.GetTxsEventResponse} GetTxsEventResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTxsEventResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.GetTxsEventResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.txs && message.txs.length)) + message.txs = []; + message.txs.push($root.cosmos.tx.v1beta1.Tx.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.txResponses && message.txResponses.length)) + message.txResponses = []; + message.txResponses.push($root.cosmos.base.abci.v1beta1.TxResponse.decode(reader, reader.uint32())); + break; + case 3: + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTxsEventResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.GetTxsEventResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.GetTxsEventResponse} GetTxsEventResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTxsEventResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTxsEventResponse message. + * @function verify + * @memberof cosmos.tx.v1beta1.GetTxsEventResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTxsEventResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.txs != null && message.hasOwnProperty("txs")) { + if (!Array.isArray(message.txs)) + return "txs: array expected"; + for (let i = 0; i < message.txs.length; ++i) { + let error = $root.cosmos.tx.v1beta1.Tx.verify(message.txs[i]); + if (error) + return "txs." + error; + } + } + if (message.txResponses != null && message.hasOwnProperty("txResponses")) { + if (!Array.isArray(message.txResponses)) + return "txResponses: array expected"; + for (let i = 0; i < message.txResponses.length; ++i) { + let error = $root.cosmos.base.abci.v1beta1.TxResponse.verify(message.txResponses[i]); + if (error) + return "txResponses." + error; + } + } + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a GetTxsEventResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.GetTxsEventResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.GetTxsEventResponse} GetTxsEventResponse + */ + GetTxsEventResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.GetTxsEventResponse) + return object; + let message = new $root.cosmos.tx.v1beta1.GetTxsEventResponse(); + if (object.txs) { + if (!Array.isArray(object.txs)) + throw TypeError(".cosmos.tx.v1beta1.GetTxsEventResponse.txs: array expected"); + message.txs = []; + for (let i = 0; i < object.txs.length; ++i) { + if (typeof object.txs[i] !== "object") + throw TypeError(".cosmos.tx.v1beta1.GetTxsEventResponse.txs: object expected"); + message.txs[i] = $root.cosmos.tx.v1beta1.Tx.fromObject(object.txs[i]); + } + } + if (object.txResponses) { + if (!Array.isArray(object.txResponses)) + throw TypeError(".cosmos.tx.v1beta1.GetTxsEventResponse.txResponses: array expected"); + message.txResponses = []; + for (let i = 0; i < object.txResponses.length; ++i) { + if (typeof object.txResponses[i] !== "object") + throw TypeError(".cosmos.tx.v1beta1.GetTxsEventResponse.txResponses: object expected"); + message.txResponses[i] = $root.cosmos.base.abci.v1beta1.TxResponse.fromObject(object.txResponses[i]); + } + } + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".cosmos.tx.v1beta1.GetTxsEventResponse.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a GetTxsEventResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.GetTxsEventResponse + * @static + * @param {cosmos.tx.v1beta1.GetTxsEventResponse} message GetTxsEventResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTxsEventResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) { + object.txs = []; + object.txResponses = []; + } + if (options.defaults) + object.pagination = null; + if (message.txs && message.txs.length) { + object.txs = []; + for (let j = 0; j < message.txs.length; ++j) + object.txs[j] = $root.cosmos.tx.v1beta1.Tx.toObject(message.txs[j], options); + } + if (message.txResponses && message.txResponses.length) { + object.txResponses = []; + for (let j = 0; j < message.txResponses.length; ++j) + object.txResponses[j] = $root.cosmos.base.abci.v1beta1.TxResponse.toObject(message.txResponses[j], options); + } + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this GetTxsEventResponse to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.GetTxsEventResponse + * @instance + * @returns {Object.} JSON object + */ + GetTxsEventResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetTxsEventResponse; + })(v1beta1.GetTxsEventResponse || {}); + + v1beta1.BroadcastTxRequest = (function(BroadcastTxRequest) { + + /** + * Properties of a BroadcastTxRequest. + * @memberof cosmos.tx.v1beta1 + * @interface IBroadcastTxRequest + * @property {Uint8Array|null} [txBytes] BroadcastTxRequest txBytes + * @property {cosmos.tx.v1beta1.BroadcastMode|null} [mode] BroadcastTxRequest mode + */ + + /** + * Constructs a new BroadcastTxRequest. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents a BroadcastTxRequest. + * @implements IBroadcastTxRequest + * @constructor + * @param {cosmos.tx.v1beta1.IBroadcastTxRequest=} [properties] Properties to set + */ + function BroadcastTxRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BroadcastTxRequest txBytes. + * @member {Uint8Array} txBytes + * @memberof cosmos.tx.v1beta1.BroadcastTxRequest + * @instance + */ + BroadcastTxRequest.prototype.txBytes = $util.newBuffer([]); + + /** + * BroadcastTxRequest mode. + * @member {cosmos.tx.v1beta1.BroadcastMode} mode + * @memberof cosmos.tx.v1beta1.BroadcastTxRequest + * @instance + */ + BroadcastTxRequest.prototype.mode = 0; + + /** + * Creates a new BroadcastTxRequest instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.BroadcastTxRequest + * @static + * @param {cosmos.tx.v1beta1.IBroadcastTxRequest=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.BroadcastTxRequest} BroadcastTxRequest instance + */ + BroadcastTxRequest.create = function create(properties) { + return new BroadcastTxRequest(properties); + }; + + /** + * Encodes the specified BroadcastTxRequest message. Does not implicitly {@link cosmos.tx.v1beta1.BroadcastTxRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.BroadcastTxRequest + * @static + * @param {cosmos.tx.v1beta1.IBroadcastTxRequest} message BroadcastTxRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BroadcastTxRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.txBytes != null && Object.hasOwnProperty.call(message, "txBytes")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.txBytes); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.mode); + return writer; + }; + + /** + * Encodes the specified BroadcastTxRequest message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.BroadcastTxRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.BroadcastTxRequest + * @static + * @param {cosmos.tx.v1beta1.IBroadcastTxRequest} message BroadcastTxRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BroadcastTxRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BroadcastTxRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.BroadcastTxRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.BroadcastTxRequest} BroadcastTxRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BroadcastTxRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.BroadcastTxRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txBytes = reader.bytes(); + break; + case 2: + message.mode = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BroadcastTxRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.BroadcastTxRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.BroadcastTxRequest} BroadcastTxRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BroadcastTxRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BroadcastTxRequest message. + * @function verify + * @memberof cosmos.tx.v1beta1.BroadcastTxRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BroadcastTxRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.txBytes != null && message.hasOwnProperty("txBytes")) + if (!(message.txBytes && typeof message.txBytes.length === "number" || $util.isString(message.txBytes))) + return "txBytes: buffer expected"; + if (message.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a BroadcastTxRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.BroadcastTxRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.BroadcastTxRequest} BroadcastTxRequest + */ + BroadcastTxRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.BroadcastTxRequest) + return object; + let message = new $root.cosmos.tx.v1beta1.BroadcastTxRequest(); + if (object.txBytes != null) + if (typeof object.txBytes === "string") + $util.base64.decode(object.txBytes, message.txBytes = $util.newBuffer($util.base64.length(object.txBytes)), 0); + else if (object.txBytes.length) + message.txBytes = object.txBytes; + switch (object.mode) { + case "BROADCAST_MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "BROADCAST_MODE_BLOCK": + case 1: + message.mode = 1; + break; + case "BROADCAST_MODE_SYNC": + case 2: + message.mode = 2; + break; + case "BROADCAST_MODE_ASYNC": + case 3: + message.mode = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a BroadcastTxRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.BroadcastTxRequest + * @static + * @param {cosmos.tx.v1beta1.BroadcastTxRequest} message BroadcastTxRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BroadcastTxRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if (options.bytes === String) + object.txBytes = ""; + else { + object.txBytes = []; + if (options.bytes !== Array) + object.txBytes = $util.newBuffer(object.txBytes); + } + object.mode = options.enums === String ? "BROADCAST_MODE_UNSPECIFIED" : 0; + } + if (message.txBytes != null && message.hasOwnProperty("txBytes")) + object.txBytes = options.bytes === String ? $util.base64.encode(message.txBytes, 0, message.txBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.txBytes) : message.txBytes; + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.cosmos.tx.v1beta1.BroadcastMode[message.mode] : message.mode; + return object; + }; + + /** + * Converts this BroadcastTxRequest to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.BroadcastTxRequest + * @instance + * @returns {Object.} JSON object + */ + BroadcastTxRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BroadcastTxRequest; + })(v1beta1.BroadcastTxRequest || {}); + + /** + * BroadcastMode enum. + * @name cosmos.tx.v1beta1.BroadcastMode + * @enum {string} + * @property {number} BROADCAST_MODE_UNSPECIFIED=0 BROADCAST_MODE_UNSPECIFIED value + * @property {number} BROADCAST_MODE_BLOCK=1 BROADCAST_MODE_BLOCK value + * @property {number} BROADCAST_MODE_SYNC=2 BROADCAST_MODE_SYNC value + * @property {number} BROADCAST_MODE_ASYNC=3 BROADCAST_MODE_ASYNC value + */ + v1beta1.BroadcastMode = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BROADCAST_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "BROADCAST_MODE_BLOCK"] = 1; + values[valuesById[2] = "BROADCAST_MODE_SYNC"] = 2; + values[valuesById[3] = "BROADCAST_MODE_ASYNC"] = 3; + return values; + })(); + + v1beta1.BroadcastTxResponse = (function(BroadcastTxResponse) { + + /** + * Properties of a BroadcastTxResponse. + * @memberof cosmos.tx.v1beta1 + * @interface IBroadcastTxResponse + * @property {cosmos.base.abci.v1beta1.ITxResponse|null} [txResponse] BroadcastTxResponse txResponse + */ + + /** + * Constructs a new BroadcastTxResponse. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents a BroadcastTxResponse. + * @implements IBroadcastTxResponse + * @constructor + * @param {cosmos.tx.v1beta1.IBroadcastTxResponse=} [properties] Properties to set + */ + function BroadcastTxResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BroadcastTxResponse txResponse. + * @member {cosmos.base.abci.v1beta1.ITxResponse|null|undefined} txResponse + * @memberof cosmos.tx.v1beta1.BroadcastTxResponse + * @instance + */ + BroadcastTxResponse.prototype.txResponse = null; + + /** + * Creates a new BroadcastTxResponse instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.BroadcastTxResponse + * @static + * @param {cosmos.tx.v1beta1.IBroadcastTxResponse=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.BroadcastTxResponse} BroadcastTxResponse instance + */ + BroadcastTxResponse.create = function create(properties) { + return new BroadcastTxResponse(properties); + }; + + /** + * Encodes the specified BroadcastTxResponse message. Does not implicitly {@link cosmos.tx.v1beta1.BroadcastTxResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.BroadcastTxResponse + * @static + * @param {cosmos.tx.v1beta1.IBroadcastTxResponse} message BroadcastTxResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BroadcastTxResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.txResponse != null && Object.hasOwnProperty.call(message, "txResponse")) + $root.cosmos.base.abci.v1beta1.TxResponse.encode(message.txResponse, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BroadcastTxResponse message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.BroadcastTxResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.BroadcastTxResponse + * @static + * @param {cosmos.tx.v1beta1.IBroadcastTxResponse} message BroadcastTxResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BroadcastTxResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BroadcastTxResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.BroadcastTxResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.BroadcastTxResponse} BroadcastTxResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BroadcastTxResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.BroadcastTxResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txResponse = $root.cosmos.base.abci.v1beta1.TxResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BroadcastTxResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.BroadcastTxResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.BroadcastTxResponse} BroadcastTxResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BroadcastTxResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BroadcastTxResponse message. + * @function verify + * @memberof cosmos.tx.v1beta1.BroadcastTxResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BroadcastTxResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.txResponse != null && message.hasOwnProperty("txResponse")) { + let error = $root.cosmos.base.abci.v1beta1.TxResponse.verify(message.txResponse); + if (error) + return "txResponse." + error; + } + return null; + }; + + /** + * Creates a BroadcastTxResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.BroadcastTxResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.BroadcastTxResponse} BroadcastTxResponse + */ + BroadcastTxResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.BroadcastTxResponse) + return object; + let message = new $root.cosmos.tx.v1beta1.BroadcastTxResponse(); + if (object.txResponse != null) { + if (typeof object.txResponse !== "object") + throw TypeError(".cosmos.tx.v1beta1.BroadcastTxResponse.txResponse: object expected"); + message.txResponse = $root.cosmos.base.abci.v1beta1.TxResponse.fromObject(object.txResponse); + } + return message; + }; + + /** + * Creates a plain object from a BroadcastTxResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.BroadcastTxResponse + * @static + * @param {cosmos.tx.v1beta1.BroadcastTxResponse} message BroadcastTxResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BroadcastTxResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.txResponse = null; + if (message.txResponse != null && message.hasOwnProperty("txResponse")) + object.txResponse = $root.cosmos.base.abci.v1beta1.TxResponse.toObject(message.txResponse, options); + return object; + }; + + /** + * Converts this BroadcastTxResponse to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.BroadcastTxResponse + * @instance + * @returns {Object.} JSON object + */ + BroadcastTxResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BroadcastTxResponse; + })(v1beta1.BroadcastTxResponse || {}); + + v1beta1.SimulateRequest = (function(SimulateRequest) { + + /** + * Properties of a SimulateRequest. + * @memberof cosmos.tx.v1beta1 + * @interface ISimulateRequest + * @property {cosmos.tx.v1beta1.ITx|null} [tx] SimulateRequest tx + */ + + /** + * Constructs a new SimulateRequest. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents a SimulateRequest. + * @implements ISimulateRequest + * @constructor + * @param {cosmos.tx.v1beta1.ISimulateRequest=} [properties] Properties to set + */ + function SimulateRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SimulateRequest tx. + * @member {cosmos.tx.v1beta1.ITx|null|undefined} tx + * @memberof cosmos.tx.v1beta1.SimulateRequest + * @instance + */ + SimulateRequest.prototype.tx = null; + + /** + * Creates a new SimulateRequest instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.SimulateRequest + * @static + * @param {cosmos.tx.v1beta1.ISimulateRequest=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.SimulateRequest} SimulateRequest instance + */ + SimulateRequest.create = function create(properties) { + return new SimulateRequest(properties); + }; + + /** + * Encodes the specified SimulateRequest message. Does not implicitly {@link cosmos.tx.v1beta1.SimulateRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.SimulateRequest + * @static + * @param {cosmos.tx.v1beta1.ISimulateRequest} message SimulateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SimulateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tx != null && Object.hasOwnProperty.call(message, "tx")) + $root.cosmos.tx.v1beta1.Tx.encode(message.tx, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SimulateRequest message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.SimulateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.SimulateRequest + * @static + * @param {cosmos.tx.v1beta1.ISimulateRequest} message SimulateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SimulateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SimulateRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.SimulateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.SimulateRequest} SimulateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SimulateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.SimulateRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = $root.cosmos.tx.v1beta1.Tx.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SimulateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.SimulateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.SimulateRequest} SimulateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SimulateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SimulateRequest message. + * @function verify + * @memberof cosmos.tx.v1beta1.SimulateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SimulateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tx != null && message.hasOwnProperty("tx")) { + let error = $root.cosmos.tx.v1beta1.Tx.verify(message.tx); + if (error) + return "tx." + error; + } + return null; + }; + + /** + * Creates a SimulateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.SimulateRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.SimulateRequest} SimulateRequest + */ + SimulateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.SimulateRequest) + return object; + let message = new $root.cosmos.tx.v1beta1.SimulateRequest(); + if (object.tx != null) { + if (typeof object.tx !== "object") + throw TypeError(".cosmos.tx.v1beta1.SimulateRequest.tx: object expected"); + message.tx = $root.cosmos.tx.v1beta1.Tx.fromObject(object.tx); + } + return message; + }; + + /** + * Creates a plain object from a SimulateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.SimulateRequest + * @static + * @param {cosmos.tx.v1beta1.SimulateRequest} message SimulateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SimulateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.tx = null; + if (message.tx != null && message.hasOwnProperty("tx")) + object.tx = $root.cosmos.tx.v1beta1.Tx.toObject(message.tx, options); + return object; + }; + + /** + * Converts this SimulateRequest to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.SimulateRequest + * @instance + * @returns {Object.} JSON object + */ + SimulateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SimulateRequest; + })(v1beta1.SimulateRequest || {}); + + v1beta1.SimulateResponse = (function(SimulateResponse) { + + /** + * Properties of a SimulateResponse. + * @memberof cosmos.tx.v1beta1 + * @interface ISimulateResponse + * @property {cosmos.base.abci.v1beta1.IGasInfo|null} [gasInfo] SimulateResponse gasInfo + * @property {cosmos.base.abci.v1beta1.IResult|null} [result] SimulateResponse result + */ + + /** + * Constructs a new SimulateResponse. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents a SimulateResponse. + * @implements ISimulateResponse + * @constructor + * @param {cosmos.tx.v1beta1.ISimulateResponse=} [properties] Properties to set + */ + function SimulateResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SimulateResponse gasInfo. + * @member {cosmos.base.abci.v1beta1.IGasInfo|null|undefined} gasInfo + * @memberof cosmos.tx.v1beta1.SimulateResponse + * @instance + */ + SimulateResponse.prototype.gasInfo = null; + + /** + * SimulateResponse result. + * @member {cosmos.base.abci.v1beta1.IResult|null|undefined} result + * @memberof cosmos.tx.v1beta1.SimulateResponse + * @instance + */ + SimulateResponse.prototype.result = null; + + /** + * Creates a new SimulateResponse instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.SimulateResponse + * @static + * @param {cosmos.tx.v1beta1.ISimulateResponse=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.SimulateResponse} SimulateResponse instance + */ + SimulateResponse.create = function create(properties) { + return new SimulateResponse(properties); + }; + + /** + * Encodes the specified SimulateResponse message. Does not implicitly {@link cosmos.tx.v1beta1.SimulateResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.SimulateResponse + * @static + * @param {cosmos.tx.v1beta1.ISimulateResponse} message SimulateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SimulateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gasInfo != null && Object.hasOwnProperty.call(message, "gasInfo")) + $root.cosmos.base.abci.v1beta1.GasInfo.encode(message.gasInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.result != null && Object.hasOwnProperty.call(message, "result")) + $root.cosmos.base.abci.v1beta1.Result.encode(message.result, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SimulateResponse message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.SimulateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.SimulateResponse + * @static + * @param {cosmos.tx.v1beta1.ISimulateResponse} message SimulateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SimulateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SimulateResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.SimulateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.SimulateResponse} SimulateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SimulateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.SimulateResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gasInfo = $root.cosmos.base.abci.v1beta1.GasInfo.decode(reader, reader.uint32()); + break; + case 2: + message.result = $root.cosmos.base.abci.v1beta1.Result.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SimulateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.SimulateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.SimulateResponse} SimulateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SimulateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SimulateResponse message. + * @function verify + * @memberof cosmos.tx.v1beta1.SimulateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SimulateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gasInfo != null && message.hasOwnProperty("gasInfo")) { + let error = $root.cosmos.base.abci.v1beta1.GasInfo.verify(message.gasInfo); + if (error) + return "gasInfo." + error; + } + if (message.result != null && message.hasOwnProperty("result")) { + let error = $root.cosmos.base.abci.v1beta1.Result.verify(message.result); + if (error) + return "result." + error; + } + return null; + }; + + /** + * Creates a SimulateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.SimulateResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.SimulateResponse} SimulateResponse + */ + SimulateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.SimulateResponse) + return object; + let message = new $root.cosmos.tx.v1beta1.SimulateResponse(); + if (object.gasInfo != null) { + if (typeof object.gasInfo !== "object") + throw TypeError(".cosmos.tx.v1beta1.SimulateResponse.gasInfo: object expected"); + message.gasInfo = $root.cosmos.base.abci.v1beta1.GasInfo.fromObject(object.gasInfo); + } + if (object.result != null) { + if (typeof object.result !== "object") + throw TypeError(".cosmos.tx.v1beta1.SimulateResponse.result: object expected"); + message.result = $root.cosmos.base.abci.v1beta1.Result.fromObject(object.result); + } + return message; + }; + + /** + * Creates a plain object from a SimulateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.SimulateResponse + * @static + * @param {cosmos.tx.v1beta1.SimulateResponse} message SimulateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SimulateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.gasInfo = null; + object.result = null; + } + if (message.gasInfo != null && message.hasOwnProperty("gasInfo")) + object.gasInfo = $root.cosmos.base.abci.v1beta1.GasInfo.toObject(message.gasInfo, options); + if (message.result != null && message.hasOwnProperty("result")) + object.result = $root.cosmos.base.abci.v1beta1.Result.toObject(message.result, options); + return object; + }; + + /** + * Converts this SimulateResponse to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.SimulateResponse + * @instance + * @returns {Object.} JSON object + */ + SimulateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SimulateResponse; + })(v1beta1.SimulateResponse || {}); + + v1beta1.GetTxRequest = (function(GetTxRequest) { + + /** + * Properties of a GetTxRequest. + * @memberof cosmos.tx.v1beta1 + * @interface IGetTxRequest + * @property {string|null} [hash] GetTxRequest hash + */ + + /** + * Constructs a new GetTxRequest. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents a GetTxRequest. + * @implements IGetTxRequest + * @constructor + * @param {cosmos.tx.v1beta1.IGetTxRequest=} [properties] Properties to set + */ + function GetTxRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTxRequest hash. + * @member {string} hash + * @memberof cosmos.tx.v1beta1.GetTxRequest + * @instance + */ + GetTxRequest.prototype.hash = ""; + + /** + * Creates a new GetTxRequest instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.GetTxRequest + * @static + * @param {cosmos.tx.v1beta1.IGetTxRequest=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.GetTxRequest} GetTxRequest instance + */ + GetTxRequest.create = function create(properties) { + return new GetTxRequest(properties); + }; + + /** + * Encodes the specified GetTxRequest message. Does not implicitly {@link cosmos.tx.v1beta1.GetTxRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.GetTxRequest + * @static + * @param {cosmos.tx.v1beta1.IGetTxRequest} message GetTxRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTxRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.hash); + return writer; + }; + + /** + * Encodes the specified GetTxRequest message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.GetTxRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.GetTxRequest + * @static + * @param {cosmos.tx.v1beta1.IGetTxRequest} message GetTxRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTxRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTxRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.GetTxRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.GetTxRequest} GetTxRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTxRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.GetTxRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTxRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.GetTxRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.GetTxRequest} GetTxRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTxRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTxRequest message. + * @function verify + * @memberof cosmos.tx.v1beta1.GetTxRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTxRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!$util.isString(message.hash)) + return "hash: string expected"; + return null; + }; + + /** + * Creates a GetTxRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.GetTxRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.GetTxRequest} GetTxRequest + */ + GetTxRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.GetTxRequest) + return object; + let message = new $root.cosmos.tx.v1beta1.GetTxRequest(); + if (object.hash != null) + message.hash = String(object.hash); + return message; + }; + + /** + * Creates a plain object from a GetTxRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.GetTxRequest + * @static + * @param {cosmos.tx.v1beta1.GetTxRequest} message GetTxRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTxRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.hash = ""; + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = message.hash; + return object; + }; + + /** + * Converts this GetTxRequest to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.GetTxRequest + * @instance + * @returns {Object.} JSON object + */ + GetTxRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetTxRequest; + })(v1beta1.GetTxRequest || {}); + + v1beta1.GetTxResponse = (function(GetTxResponse) { + + /** + * Properties of a GetTxResponse. + * @memberof cosmos.tx.v1beta1 + * @interface IGetTxResponse + * @property {cosmos.tx.v1beta1.ITx|null} [tx] GetTxResponse tx + * @property {cosmos.base.abci.v1beta1.ITxResponse|null} [txResponse] GetTxResponse txResponse + */ + + /** + * Constructs a new GetTxResponse. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents a GetTxResponse. + * @implements IGetTxResponse + * @constructor + * @param {cosmos.tx.v1beta1.IGetTxResponse=} [properties] Properties to set + */ + function GetTxResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTxResponse tx. + * @member {cosmos.tx.v1beta1.ITx|null|undefined} tx + * @memberof cosmos.tx.v1beta1.GetTxResponse + * @instance + */ + GetTxResponse.prototype.tx = null; + + /** + * GetTxResponse txResponse. + * @member {cosmos.base.abci.v1beta1.ITxResponse|null|undefined} txResponse + * @memberof cosmos.tx.v1beta1.GetTxResponse + * @instance + */ + GetTxResponse.prototype.txResponse = null; + + /** + * Creates a new GetTxResponse instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.GetTxResponse + * @static + * @param {cosmos.tx.v1beta1.IGetTxResponse=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.GetTxResponse} GetTxResponse instance + */ + GetTxResponse.create = function create(properties) { + return new GetTxResponse(properties); + }; + + /** + * Encodes the specified GetTxResponse message. Does not implicitly {@link cosmos.tx.v1beta1.GetTxResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.GetTxResponse + * @static + * @param {cosmos.tx.v1beta1.IGetTxResponse} message GetTxResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTxResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tx != null && Object.hasOwnProperty.call(message, "tx")) + $root.cosmos.tx.v1beta1.Tx.encode(message.tx, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.txResponse != null && Object.hasOwnProperty.call(message, "txResponse")) + $root.cosmos.base.abci.v1beta1.TxResponse.encode(message.txResponse, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTxResponse message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.GetTxResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.GetTxResponse + * @static + * @param {cosmos.tx.v1beta1.IGetTxResponse} message GetTxResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTxResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTxResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.GetTxResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.GetTxResponse} GetTxResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTxResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.GetTxResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = $root.cosmos.tx.v1beta1.Tx.decode(reader, reader.uint32()); + break; + case 2: + message.txResponse = $root.cosmos.base.abci.v1beta1.TxResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTxResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.GetTxResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.GetTxResponse} GetTxResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTxResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTxResponse message. + * @function verify + * @memberof cosmos.tx.v1beta1.GetTxResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTxResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tx != null && message.hasOwnProperty("tx")) { + let error = $root.cosmos.tx.v1beta1.Tx.verify(message.tx); + if (error) + return "tx." + error; + } + if (message.txResponse != null && message.hasOwnProperty("txResponse")) { + let error = $root.cosmos.base.abci.v1beta1.TxResponse.verify(message.txResponse); + if (error) + return "txResponse." + error; + } + return null; + }; + + /** + * Creates a GetTxResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.GetTxResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.GetTxResponse} GetTxResponse + */ + GetTxResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.GetTxResponse) + return object; + let message = new $root.cosmos.tx.v1beta1.GetTxResponse(); + if (object.tx != null) { + if (typeof object.tx !== "object") + throw TypeError(".cosmos.tx.v1beta1.GetTxResponse.tx: object expected"); + message.tx = $root.cosmos.tx.v1beta1.Tx.fromObject(object.tx); + } + if (object.txResponse != null) { + if (typeof object.txResponse !== "object") + throw TypeError(".cosmos.tx.v1beta1.GetTxResponse.txResponse: object expected"); + message.txResponse = $root.cosmos.base.abci.v1beta1.TxResponse.fromObject(object.txResponse); + } + return message; + }; + + /** + * Creates a plain object from a GetTxResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.GetTxResponse + * @static + * @param {cosmos.tx.v1beta1.GetTxResponse} message GetTxResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTxResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.tx = null; + object.txResponse = null; + } + if (message.tx != null && message.hasOwnProperty("tx")) + object.tx = $root.cosmos.tx.v1beta1.Tx.toObject(message.tx, options); + if (message.txResponse != null && message.hasOwnProperty("txResponse")) + object.txResponse = $root.cosmos.base.abci.v1beta1.TxResponse.toObject(message.txResponse, options); + return object; + }; + + /** + * Converts this GetTxResponse to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.GetTxResponse + * @instance + * @returns {Object.} JSON object + */ + GetTxResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetTxResponse; + })(v1beta1.GetTxResponse || {}); + + v1beta1.Tx = (function(Tx) { + + /** + * Properties of a Tx. + * @memberof cosmos.tx.v1beta1 + * @interface ITx + * @property {cosmos.tx.v1beta1.ITxBody|null} [body] Tx body + * @property {cosmos.tx.v1beta1.IAuthInfo|null} [authInfo] Tx authInfo + * @property {Array.|null} [signatures] Tx signatures + */ + + /** + * Constructs a new Tx. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents a Tx. + * @implements ITx + * @constructor + * @param {cosmos.tx.v1beta1.ITx=} [properties] Properties to set + */ + function Tx(properties) { + this.signatures = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Tx body. + * @member {cosmos.tx.v1beta1.ITxBody|null|undefined} body + * @memberof cosmos.tx.v1beta1.Tx + * @instance + */ + Tx.prototype.body = null; + + /** + * Tx authInfo. + * @member {cosmos.tx.v1beta1.IAuthInfo|null|undefined} authInfo + * @memberof cosmos.tx.v1beta1.Tx + * @instance + */ + Tx.prototype.authInfo = null; + + /** + * Tx signatures. + * @member {Array.} signatures + * @memberof cosmos.tx.v1beta1.Tx + * @instance + */ + Tx.prototype.signatures = $util.emptyArray; + + /** + * Creates a new Tx instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.Tx + * @static + * @param {cosmos.tx.v1beta1.ITx=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.Tx} Tx instance + */ + Tx.create = function create(properties) { + return new Tx(properties); + }; + + /** + * Encodes the specified Tx message. Does not implicitly {@link cosmos.tx.v1beta1.Tx.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.Tx + * @static + * @param {cosmos.tx.v1beta1.ITx} message Tx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tx.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + $root.cosmos.tx.v1beta1.TxBody.encode(message.body, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.authInfo != null && Object.hasOwnProperty.call(message, "authInfo")) + $root.cosmos.tx.v1beta1.AuthInfo.encode(message.authInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.signatures != null && message.signatures.length) + for (let i = 0; i < message.signatures.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.signatures[i]); + return writer; + }; + + /** + * Encodes the specified Tx message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.Tx.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.Tx + * @static + * @param {cosmos.tx.v1beta1.ITx} message Tx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tx.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Tx message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.Tx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.Tx} Tx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tx.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.Tx(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.body = $root.cosmos.tx.v1beta1.TxBody.decode(reader, reader.uint32()); + break; + case 2: + message.authInfo = $root.cosmos.tx.v1beta1.AuthInfo.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.signatures && message.signatures.length)) + message.signatures = []; + message.signatures.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Tx message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.Tx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.Tx} Tx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tx.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Tx message. + * @function verify + * @memberof cosmos.tx.v1beta1.Tx + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Tx.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.body != null && message.hasOwnProperty("body")) { + let error = $root.cosmos.tx.v1beta1.TxBody.verify(message.body); + if (error) + return "body." + error; + } + if (message.authInfo != null && message.hasOwnProperty("authInfo")) { + let error = $root.cosmos.tx.v1beta1.AuthInfo.verify(message.authInfo); + if (error) + return "authInfo." + error; + } + if (message.signatures != null && message.hasOwnProperty("signatures")) { + if (!Array.isArray(message.signatures)) + return "signatures: array expected"; + for (let i = 0; i < message.signatures.length; ++i) + if (!(message.signatures[i] && typeof message.signatures[i].length === "number" || $util.isString(message.signatures[i]))) + return "signatures: buffer[] expected"; + } + return null; + }; + + /** + * Creates a Tx message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.Tx + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.Tx} Tx + */ + Tx.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.Tx) + return object; + let message = new $root.cosmos.tx.v1beta1.Tx(); + if (object.body != null) { + if (typeof object.body !== "object") + throw TypeError(".cosmos.tx.v1beta1.Tx.body: object expected"); + message.body = $root.cosmos.tx.v1beta1.TxBody.fromObject(object.body); + } + if (object.authInfo != null) { + if (typeof object.authInfo !== "object") + throw TypeError(".cosmos.tx.v1beta1.Tx.authInfo: object expected"); + message.authInfo = $root.cosmos.tx.v1beta1.AuthInfo.fromObject(object.authInfo); + } + if (object.signatures) { + if (!Array.isArray(object.signatures)) + throw TypeError(".cosmos.tx.v1beta1.Tx.signatures: array expected"); + message.signatures = []; + for (let i = 0; i < object.signatures.length; ++i) + if (typeof object.signatures[i] === "string") + $util.base64.decode(object.signatures[i], message.signatures[i] = $util.newBuffer($util.base64.length(object.signatures[i])), 0); + else if (object.signatures[i].length) + message.signatures[i] = object.signatures[i]; + } + return message; + }; + + /** + * Creates a plain object from a Tx message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.Tx + * @static + * @param {cosmos.tx.v1beta1.Tx} message Tx + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Tx.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.signatures = []; + if (options.defaults) { + object.body = null; + object.authInfo = null; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = $root.cosmos.tx.v1beta1.TxBody.toObject(message.body, options); + if (message.authInfo != null && message.hasOwnProperty("authInfo")) + object.authInfo = $root.cosmos.tx.v1beta1.AuthInfo.toObject(message.authInfo, options); + if (message.signatures && message.signatures.length) { + object.signatures = []; + for (let j = 0; j < message.signatures.length; ++j) + object.signatures[j] = options.bytes === String ? $util.base64.encode(message.signatures[j], 0, message.signatures[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.signatures[j]) : message.signatures[j]; + } + return object; + }; + + /** + * Converts this Tx to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.Tx + * @instance + * @returns {Object.} JSON object + */ + Tx.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Tx; + })(v1beta1.Tx || {}); + + v1beta1.TxRaw = (function(TxRaw) { + + /** + * Properties of a TxRaw. + * @memberof cosmos.tx.v1beta1 + * @interface ITxRaw + * @property {Uint8Array|null} [bodyBytes] TxRaw bodyBytes + * @property {Uint8Array|null} [authInfoBytes] TxRaw authInfoBytes + * @property {Array.|null} [signatures] TxRaw signatures + */ + + /** + * Constructs a new TxRaw. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents a TxRaw. + * @implements ITxRaw + * @constructor + * @param {cosmos.tx.v1beta1.ITxRaw=} [properties] Properties to set + */ + function TxRaw(properties) { + this.signatures = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TxRaw bodyBytes. + * @member {Uint8Array} bodyBytes + * @memberof cosmos.tx.v1beta1.TxRaw + * @instance + */ + TxRaw.prototype.bodyBytes = $util.newBuffer([]); + + /** + * TxRaw authInfoBytes. + * @member {Uint8Array} authInfoBytes + * @memberof cosmos.tx.v1beta1.TxRaw + * @instance + */ + TxRaw.prototype.authInfoBytes = $util.newBuffer([]); + + /** + * TxRaw signatures. + * @member {Array.} signatures + * @memberof cosmos.tx.v1beta1.TxRaw + * @instance + */ + TxRaw.prototype.signatures = $util.emptyArray; + + /** + * Creates a new TxRaw instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.TxRaw + * @static + * @param {cosmos.tx.v1beta1.ITxRaw=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.TxRaw} TxRaw instance + */ + TxRaw.create = function create(properties) { + return new TxRaw(properties); + }; + + /** + * Encodes the specified TxRaw message. Does not implicitly {@link cosmos.tx.v1beta1.TxRaw.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.TxRaw + * @static + * @param {cosmos.tx.v1beta1.ITxRaw} message TxRaw message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TxRaw.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bodyBytes != null && Object.hasOwnProperty.call(message, "bodyBytes")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.bodyBytes); + if (message.authInfoBytes != null && Object.hasOwnProperty.call(message, "authInfoBytes")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.authInfoBytes); + if (message.signatures != null && message.signatures.length) + for (let i = 0; i < message.signatures.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.signatures[i]); + return writer; + }; + + /** + * Encodes the specified TxRaw message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.TxRaw.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.TxRaw + * @static + * @param {cosmos.tx.v1beta1.ITxRaw} message TxRaw message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TxRaw.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TxRaw message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.TxRaw + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.TxRaw} TxRaw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TxRaw.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.TxRaw(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bodyBytes = reader.bytes(); + break; + case 2: + message.authInfoBytes = reader.bytes(); + break; + case 3: + if (!(message.signatures && message.signatures.length)) + message.signatures = []; + message.signatures.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TxRaw message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.TxRaw + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.TxRaw} TxRaw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TxRaw.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TxRaw message. + * @function verify + * @memberof cosmos.tx.v1beta1.TxRaw + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TxRaw.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bodyBytes != null && message.hasOwnProperty("bodyBytes")) + if (!(message.bodyBytes && typeof message.bodyBytes.length === "number" || $util.isString(message.bodyBytes))) + return "bodyBytes: buffer expected"; + if (message.authInfoBytes != null && message.hasOwnProperty("authInfoBytes")) + if (!(message.authInfoBytes && typeof message.authInfoBytes.length === "number" || $util.isString(message.authInfoBytes))) + return "authInfoBytes: buffer expected"; + if (message.signatures != null && message.hasOwnProperty("signatures")) { + if (!Array.isArray(message.signatures)) + return "signatures: array expected"; + for (let i = 0; i < message.signatures.length; ++i) + if (!(message.signatures[i] && typeof message.signatures[i].length === "number" || $util.isString(message.signatures[i]))) + return "signatures: buffer[] expected"; + } + return null; + }; + + /** + * Creates a TxRaw message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.TxRaw + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.TxRaw} TxRaw + */ + TxRaw.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.TxRaw) + return object; + let message = new $root.cosmos.tx.v1beta1.TxRaw(); + if (object.bodyBytes != null) + if (typeof object.bodyBytes === "string") + $util.base64.decode(object.bodyBytes, message.bodyBytes = $util.newBuffer($util.base64.length(object.bodyBytes)), 0); + else if (object.bodyBytes.length) + message.bodyBytes = object.bodyBytes; + if (object.authInfoBytes != null) + if (typeof object.authInfoBytes === "string") + $util.base64.decode(object.authInfoBytes, message.authInfoBytes = $util.newBuffer($util.base64.length(object.authInfoBytes)), 0); + else if (object.authInfoBytes.length) + message.authInfoBytes = object.authInfoBytes; + if (object.signatures) { + if (!Array.isArray(object.signatures)) + throw TypeError(".cosmos.tx.v1beta1.TxRaw.signatures: array expected"); + message.signatures = []; + for (let i = 0; i < object.signatures.length; ++i) + if (typeof object.signatures[i] === "string") + $util.base64.decode(object.signatures[i], message.signatures[i] = $util.newBuffer($util.base64.length(object.signatures[i])), 0); + else if (object.signatures[i].length) + message.signatures[i] = object.signatures[i]; + } + return message; + }; + + /** + * Creates a plain object from a TxRaw message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.TxRaw + * @static + * @param {cosmos.tx.v1beta1.TxRaw} message TxRaw + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TxRaw.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.signatures = []; + if (options.defaults) { + if (options.bytes === String) + object.bodyBytes = ""; + else { + object.bodyBytes = []; + if (options.bytes !== Array) + object.bodyBytes = $util.newBuffer(object.bodyBytes); + } + if (options.bytes === String) + object.authInfoBytes = ""; + else { + object.authInfoBytes = []; + if (options.bytes !== Array) + object.authInfoBytes = $util.newBuffer(object.authInfoBytes); + } + } + if (message.bodyBytes != null && message.hasOwnProperty("bodyBytes")) + object.bodyBytes = options.bytes === String ? $util.base64.encode(message.bodyBytes, 0, message.bodyBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.bodyBytes) : message.bodyBytes; + if (message.authInfoBytes != null && message.hasOwnProperty("authInfoBytes")) + object.authInfoBytes = options.bytes === String ? $util.base64.encode(message.authInfoBytes, 0, message.authInfoBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.authInfoBytes) : message.authInfoBytes; + if (message.signatures && message.signatures.length) { + object.signatures = []; + for (let j = 0; j < message.signatures.length; ++j) + object.signatures[j] = options.bytes === String ? $util.base64.encode(message.signatures[j], 0, message.signatures[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.signatures[j]) : message.signatures[j]; + } + return object; + }; + + /** + * Converts this TxRaw to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.TxRaw + * @instance + * @returns {Object.} JSON object + */ + TxRaw.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TxRaw; + })(v1beta1.TxRaw || {}); + + v1beta1.SignDoc = (function(SignDoc) { + + /** + * Properties of a SignDoc. + * @memberof cosmos.tx.v1beta1 + * @interface ISignDoc + * @property {Uint8Array|null} [bodyBytes] SignDoc bodyBytes + * @property {Uint8Array|null} [authInfoBytes] SignDoc authInfoBytes + * @property {string|null} [chainId] SignDoc chainId + * @property {number|Long|null} [accountNumber] SignDoc accountNumber + */ + + /** + * Constructs a new SignDoc. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents a SignDoc. + * @implements ISignDoc + * @constructor + * @param {cosmos.tx.v1beta1.ISignDoc=} [properties] Properties to set + */ + function SignDoc(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SignDoc bodyBytes. + * @member {Uint8Array} bodyBytes + * @memberof cosmos.tx.v1beta1.SignDoc + * @instance + */ + SignDoc.prototype.bodyBytes = $util.newBuffer([]); + + /** + * SignDoc authInfoBytes. + * @member {Uint8Array} authInfoBytes + * @memberof cosmos.tx.v1beta1.SignDoc + * @instance + */ + SignDoc.prototype.authInfoBytes = $util.newBuffer([]); + + /** + * SignDoc chainId. + * @member {string} chainId + * @memberof cosmos.tx.v1beta1.SignDoc + * @instance + */ + SignDoc.prototype.chainId = ""; + + /** + * SignDoc accountNumber. + * @member {number|Long} accountNumber + * @memberof cosmos.tx.v1beta1.SignDoc + * @instance + */ + SignDoc.prototype.accountNumber = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new SignDoc instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.SignDoc + * @static + * @param {cosmos.tx.v1beta1.ISignDoc=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.SignDoc} SignDoc instance + */ + SignDoc.create = function create(properties) { + return new SignDoc(properties); + }; + + /** + * Encodes the specified SignDoc message. Does not implicitly {@link cosmos.tx.v1beta1.SignDoc.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.SignDoc + * @static + * @param {cosmos.tx.v1beta1.ISignDoc} message SignDoc message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignDoc.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bodyBytes != null && Object.hasOwnProperty.call(message, "bodyBytes")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.bodyBytes); + if (message.authInfoBytes != null && Object.hasOwnProperty.call(message, "authInfoBytes")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.authInfoBytes); + if (message.chainId != null && Object.hasOwnProperty.call(message, "chainId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.chainId); + if (message.accountNumber != null && Object.hasOwnProperty.call(message, "accountNumber")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.accountNumber); + return writer; + }; + + /** + * Encodes the specified SignDoc message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.SignDoc.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.SignDoc + * @static + * @param {cosmos.tx.v1beta1.ISignDoc} message SignDoc message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignDoc.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SignDoc message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.SignDoc + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.SignDoc} SignDoc + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignDoc.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.SignDoc(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bodyBytes = reader.bytes(); + break; + case 2: + message.authInfoBytes = reader.bytes(); + break; + case 3: + message.chainId = reader.string(); + break; + case 4: + message.accountNumber = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SignDoc message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.SignDoc + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.SignDoc} SignDoc + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignDoc.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SignDoc message. + * @function verify + * @memberof cosmos.tx.v1beta1.SignDoc + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SignDoc.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bodyBytes != null && message.hasOwnProperty("bodyBytes")) + if (!(message.bodyBytes && typeof message.bodyBytes.length === "number" || $util.isString(message.bodyBytes))) + return "bodyBytes: buffer expected"; + if (message.authInfoBytes != null && message.hasOwnProperty("authInfoBytes")) + if (!(message.authInfoBytes && typeof message.authInfoBytes.length === "number" || $util.isString(message.authInfoBytes))) + return "authInfoBytes: buffer expected"; + if (message.chainId != null && message.hasOwnProperty("chainId")) + if (!$util.isString(message.chainId)) + return "chainId: string expected"; + if (message.accountNumber != null && message.hasOwnProperty("accountNumber")) + if (!$util.isInteger(message.accountNumber) && !(message.accountNumber && $util.isInteger(message.accountNumber.low) && $util.isInteger(message.accountNumber.high))) + return "accountNumber: integer|Long expected"; + return null; + }; + + /** + * Creates a SignDoc message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.SignDoc + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.SignDoc} SignDoc + */ + SignDoc.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.SignDoc) + return object; + let message = new $root.cosmos.tx.v1beta1.SignDoc(); + if (object.bodyBytes != null) + if (typeof object.bodyBytes === "string") + $util.base64.decode(object.bodyBytes, message.bodyBytes = $util.newBuffer($util.base64.length(object.bodyBytes)), 0); + else if (object.bodyBytes.length) + message.bodyBytes = object.bodyBytes; + if (object.authInfoBytes != null) + if (typeof object.authInfoBytes === "string") + $util.base64.decode(object.authInfoBytes, message.authInfoBytes = $util.newBuffer($util.base64.length(object.authInfoBytes)), 0); + else if (object.authInfoBytes.length) + message.authInfoBytes = object.authInfoBytes; + if (object.chainId != null) + message.chainId = String(object.chainId); + if (object.accountNumber != null) + if ($util.Long) + (message.accountNumber = $util.Long.fromValue(object.accountNumber)).unsigned = true; + else if (typeof object.accountNumber === "string") + message.accountNumber = parseInt(object.accountNumber, 10); + else if (typeof object.accountNumber === "number") + message.accountNumber = object.accountNumber; + else if (typeof object.accountNumber === "object") + message.accountNumber = new $util.LongBits(object.accountNumber.low >>> 0, object.accountNumber.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a SignDoc message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.SignDoc + * @static + * @param {cosmos.tx.v1beta1.SignDoc} message SignDoc + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SignDoc.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if (options.bytes === String) + object.bodyBytes = ""; + else { + object.bodyBytes = []; + if (options.bytes !== Array) + object.bodyBytes = $util.newBuffer(object.bodyBytes); + } + if (options.bytes === String) + object.authInfoBytes = ""; + else { + object.authInfoBytes = []; + if (options.bytes !== Array) + object.authInfoBytes = $util.newBuffer(object.authInfoBytes); + } + object.chainId = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.accountNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.accountNumber = options.longs === String ? "0" : 0; + } + if (message.bodyBytes != null && message.hasOwnProperty("bodyBytes")) + object.bodyBytes = options.bytes === String ? $util.base64.encode(message.bodyBytes, 0, message.bodyBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.bodyBytes) : message.bodyBytes; + if (message.authInfoBytes != null && message.hasOwnProperty("authInfoBytes")) + object.authInfoBytes = options.bytes === String ? $util.base64.encode(message.authInfoBytes, 0, message.authInfoBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.authInfoBytes) : message.authInfoBytes; + if (message.chainId != null && message.hasOwnProperty("chainId")) + object.chainId = message.chainId; + if (message.accountNumber != null && message.hasOwnProperty("accountNumber")) + if (typeof message.accountNumber === "number") + object.accountNumber = options.longs === String ? String(message.accountNumber) : message.accountNumber; + else + object.accountNumber = options.longs === String ? $util.Long.prototype.toString.call(message.accountNumber) : options.longs === Number ? new $util.LongBits(message.accountNumber.low >>> 0, message.accountNumber.high >>> 0).toNumber(true) : message.accountNumber; + return object; + }; + + /** + * Converts this SignDoc to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.SignDoc + * @instance + * @returns {Object.} JSON object + */ + SignDoc.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SignDoc; + })(v1beta1.SignDoc || {}); + + v1beta1.TxBody = (function(TxBody) { + + /** + * Properties of a TxBody. + * @memberof cosmos.tx.v1beta1 + * @interface ITxBody + * @property {Array.|null} [messages] TxBody messages + * @property {string|null} [memo] TxBody memo + * @property {number|Long|null} [timeoutHeight] TxBody timeoutHeight + * @property {Array.|null} [extensionOptions] TxBody extensionOptions + * @property {Array.|null} [nonCriticalExtensionOptions] TxBody nonCriticalExtensionOptions + */ + + /** + * Constructs a new TxBody. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents a TxBody. + * @implements ITxBody + * @constructor + * @param {cosmos.tx.v1beta1.ITxBody=} [properties] Properties to set + */ + function TxBody(properties) { + this.messages = []; + this.extensionOptions = []; + this.nonCriticalExtensionOptions = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TxBody messages. + * @member {Array.} messages + * @memberof cosmos.tx.v1beta1.TxBody + * @instance + */ + TxBody.prototype.messages = $util.emptyArray; + + /** + * TxBody memo. + * @member {string} memo + * @memberof cosmos.tx.v1beta1.TxBody + * @instance + */ + TxBody.prototype.memo = ""; + + /** + * TxBody timeoutHeight. + * @member {number|Long} timeoutHeight + * @memberof cosmos.tx.v1beta1.TxBody + * @instance + */ + TxBody.prototype.timeoutHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * TxBody extensionOptions. + * @member {Array.} extensionOptions + * @memberof cosmos.tx.v1beta1.TxBody + * @instance + */ + TxBody.prototype.extensionOptions = $util.emptyArray; + + /** + * TxBody nonCriticalExtensionOptions. + * @member {Array.} nonCriticalExtensionOptions + * @memberof cosmos.tx.v1beta1.TxBody + * @instance + */ + TxBody.prototype.nonCriticalExtensionOptions = $util.emptyArray; + + /** + * Creates a new TxBody instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.TxBody + * @static + * @param {cosmos.tx.v1beta1.ITxBody=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.TxBody} TxBody instance + */ + TxBody.create = function create(properties) { + return new TxBody(properties); + }; + + /** + * Encodes the specified TxBody message. Does not implicitly {@link cosmos.tx.v1beta1.TxBody.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.TxBody + * @static + * @param {cosmos.tx.v1beta1.ITxBody} message TxBody message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TxBody.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messages != null && message.messages.length) + for (let i = 0; i < message.messages.length; ++i) + $root.google.protobuf.Any.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.memo != null && Object.hasOwnProperty.call(message, "memo")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.memo); + if (message.timeoutHeight != null && Object.hasOwnProperty.call(message, "timeoutHeight")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.timeoutHeight); + if (message.extensionOptions != null && message.extensionOptions.length) + for (let i = 0; i < message.extensionOptions.length; ++i) + $root.google.protobuf.Any.encode(message.extensionOptions[i], writer.uint32(/* id 1023, wireType 2 =*/8186).fork()).ldelim(); + if (message.nonCriticalExtensionOptions != null && message.nonCriticalExtensionOptions.length) + for (let i = 0; i < message.nonCriticalExtensionOptions.length; ++i) + $root.google.protobuf.Any.encode(message.nonCriticalExtensionOptions[i], writer.uint32(/* id 2047, wireType 2 =*/16378).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TxBody message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.TxBody.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.TxBody + * @static + * @param {cosmos.tx.v1beta1.ITxBody} message TxBody message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TxBody.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TxBody message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.TxBody + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.TxBody} TxBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TxBody.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.TxBody(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + case 2: + message.memo = reader.string(); + break; + case 3: + message.timeoutHeight = reader.uint64(); + break; + case 1023: + if (!(message.extensionOptions && message.extensionOptions.length)) + message.extensionOptions = []; + message.extensionOptions.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + case 2047: + if (!(message.nonCriticalExtensionOptions && message.nonCriticalExtensionOptions.length)) + message.nonCriticalExtensionOptions = []; + message.nonCriticalExtensionOptions.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TxBody message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.TxBody + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.TxBody} TxBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TxBody.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TxBody message. + * @function verify + * @memberof cosmos.tx.v1beta1.TxBody + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TxBody.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (let i = 0; i < message.messages.length; ++i) { + let error = $root.google.protobuf.Any.verify(message.messages[i]); + if (error) + return "messages." + error; + } + } + if (message.memo != null && message.hasOwnProperty("memo")) + if (!$util.isString(message.memo)) + return "memo: string expected"; + if (message.timeoutHeight != null && message.hasOwnProperty("timeoutHeight")) + if (!$util.isInteger(message.timeoutHeight) && !(message.timeoutHeight && $util.isInteger(message.timeoutHeight.low) && $util.isInteger(message.timeoutHeight.high))) + return "timeoutHeight: integer|Long expected"; + if (message.extensionOptions != null && message.hasOwnProperty("extensionOptions")) { + if (!Array.isArray(message.extensionOptions)) + return "extensionOptions: array expected"; + for (let i = 0; i < message.extensionOptions.length; ++i) { + let error = $root.google.protobuf.Any.verify(message.extensionOptions[i]); + if (error) + return "extensionOptions." + error; + } + } + if (message.nonCriticalExtensionOptions != null && message.hasOwnProperty("nonCriticalExtensionOptions")) { + if (!Array.isArray(message.nonCriticalExtensionOptions)) + return "nonCriticalExtensionOptions: array expected"; + for (let i = 0; i < message.nonCriticalExtensionOptions.length; ++i) { + let error = $root.google.protobuf.Any.verify(message.nonCriticalExtensionOptions[i]); + if (error) + return "nonCriticalExtensionOptions." + error; + } + } + return null; + }; + + /** + * Creates a TxBody message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.TxBody + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.TxBody} TxBody + */ + TxBody.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.TxBody) + return object; + let message = new $root.cosmos.tx.v1beta1.TxBody(); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".cosmos.tx.v1beta1.TxBody.messages: array expected"); + message.messages = []; + for (let i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".cosmos.tx.v1beta1.TxBody.messages: object expected"); + message.messages[i] = $root.google.protobuf.Any.fromObject(object.messages[i]); + } + } + if (object.memo != null) + message.memo = String(object.memo); + if (object.timeoutHeight != null) + if ($util.Long) + (message.timeoutHeight = $util.Long.fromValue(object.timeoutHeight)).unsigned = true; + else if (typeof object.timeoutHeight === "string") + message.timeoutHeight = parseInt(object.timeoutHeight, 10); + else if (typeof object.timeoutHeight === "number") + message.timeoutHeight = object.timeoutHeight; + else if (typeof object.timeoutHeight === "object") + message.timeoutHeight = new $util.LongBits(object.timeoutHeight.low >>> 0, object.timeoutHeight.high >>> 0).toNumber(true); + if (object.extensionOptions) { + if (!Array.isArray(object.extensionOptions)) + throw TypeError(".cosmos.tx.v1beta1.TxBody.extensionOptions: array expected"); + message.extensionOptions = []; + for (let i = 0; i < object.extensionOptions.length; ++i) { + if (typeof object.extensionOptions[i] !== "object") + throw TypeError(".cosmos.tx.v1beta1.TxBody.extensionOptions: object expected"); + message.extensionOptions[i] = $root.google.protobuf.Any.fromObject(object.extensionOptions[i]); + } + } + if (object.nonCriticalExtensionOptions) { + if (!Array.isArray(object.nonCriticalExtensionOptions)) + throw TypeError(".cosmos.tx.v1beta1.TxBody.nonCriticalExtensionOptions: array expected"); + message.nonCriticalExtensionOptions = []; + for (let i = 0; i < object.nonCriticalExtensionOptions.length; ++i) { + if (typeof object.nonCriticalExtensionOptions[i] !== "object") + throw TypeError(".cosmos.tx.v1beta1.TxBody.nonCriticalExtensionOptions: object expected"); + message.nonCriticalExtensionOptions[i] = $root.google.protobuf.Any.fromObject(object.nonCriticalExtensionOptions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TxBody message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.TxBody + * @static + * @param {cosmos.tx.v1beta1.TxBody} message TxBody + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TxBody.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) { + object.messages = []; + object.extensionOptions = []; + object.nonCriticalExtensionOptions = []; + } + if (options.defaults) { + object.memo = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.timeoutHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timeoutHeight = options.longs === String ? "0" : 0; + } + if (message.messages && message.messages.length) { + object.messages = []; + for (let j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.protobuf.Any.toObject(message.messages[j], options); + } + if (message.memo != null && message.hasOwnProperty("memo")) + object.memo = message.memo; + if (message.timeoutHeight != null && message.hasOwnProperty("timeoutHeight")) + if (typeof message.timeoutHeight === "number") + object.timeoutHeight = options.longs === String ? String(message.timeoutHeight) : message.timeoutHeight; + else + object.timeoutHeight = options.longs === String ? $util.Long.prototype.toString.call(message.timeoutHeight) : options.longs === Number ? new $util.LongBits(message.timeoutHeight.low >>> 0, message.timeoutHeight.high >>> 0).toNumber(true) : message.timeoutHeight; + if (message.extensionOptions && message.extensionOptions.length) { + object.extensionOptions = []; + for (let j = 0; j < message.extensionOptions.length; ++j) + object.extensionOptions[j] = $root.google.protobuf.Any.toObject(message.extensionOptions[j], options); + } + if (message.nonCriticalExtensionOptions && message.nonCriticalExtensionOptions.length) { + object.nonCriticalExtensionOptions = []; + for (let j = 0; j < message.nonCriticalExtensionOptions.length; ++j) + object.nonCriticalExtensionOptions[j] = $root.google.protobuf.Any.toObject(message.nonCriticalExtensionOptions[j], options); + } + return object; + }; + + /** + * Converts this TxBody to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.TxBody + * @instance + * @returns {Object.} JSON object + */ + TxBody.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TxBody; + })(v1beta1.TxBody || {}); + + v1beta1.AuthInfo = (function(AuthInfo) { + + /** + * Properties of an AuthInfo. + * @memberof cosmos.tx.v1beta1 + * @interface IAuthInfo + * @property {Array.|null} [signerInfos] AuthInfo signerInfos + * @property {cosmos.tx.v1beta1.IFee|null} [fee] AuthInfo fee + */ + + /** + * Constructs a new AuthInfo. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents an AuthInfo. + * @implements IAuthInfo + * @constructor + * @param {cosmos.tx.v1beta1.IAuthInfo=} [properties] Properties to set + */ + function AuthInfo(properties) { + this.signerInfos = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuthInfo signerInfos. + * @member {Array.} signerInfos + * @memberof cosmos.tx.v1beta1.AuthInfo + * @instance + */ + AuthInfo.prototype.signerInfos = $util.emptyArray; + + /** + * AuthInfo fee. + * @member {cosmos.tx.v1beta1.IFee|null|undefined} fee + * @memberof cosmos.tx.v1beta1.AuthInfo + * @instance + */ + AuthInfo.prototype.fee = null; + + /** + * Creates a new AuthInfo instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.AuthInfo + * @static + * @param {cosmos.tx.v1beta1.IAuthInfo=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.AuthInfo} AuthInfo instance + */ + AuthInfo.create = function create(properties) { + return new AuthInfo(properties); + }; + + /** + * Encodes the specified AuthInfo message. Does not implicitly {@link cosmos.tx.v1beta1.AuthInfo.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.AuthInfo + * @static + * @param {cosmos.tx.v1beta1.IAuthInfo} message AuthInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.signerInfos != null && message.signerInfos.length) + for (let i = 0; i < message.signerInfos.length; ++i) + $root.cosmos.tx.v1beta1.SignerInfo.encode(message.signerInfos[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fee != null && Object.hasOwnProperty.call(message, "fee")) + $root.cosmos.tx.v1beta1.Fee.encode(message.fee, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuthInfo message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.AuthInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.AuthInfo + * @static + * @param {cosmos.tx.v1beta1.IAuthInfo} message AuthInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuthInfo message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.AuthInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.AuthInfo} AuthInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.AuthInfo(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.signerInfos && message.signerInfos.length)) + message.signerInfos = []; + message.signerInfos.push($root.cosmos.tx.v1beta1.SignerInfo.decode(reader, reader.uint32())); + break; + case 2: + message.fee = $root.cosmos.tx.v1beta1.Fee.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuthInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.AuthInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.AuthInfo} AuthInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuthInfo message. + * @function verify + * @memberof cosmos.tx.v1beta1.AuthInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuthInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.signerInfos != null && message.hasOwnProperty("signerInfos")) { + if (!Array.isArray(message.signerInfos)) + return "signerInfos: array expected"; + for (let i = 0; i < message.signerInfos.length; ++i) { + let error = $root.cosmos.tx.v1beta1.SignerInfo.verify(message.signerInfos[i]); + if (error) + return "signerInfos." + error; + } + } + if (message.fee != null && message.hasOwnProperty("fee")) { + let error = $root.cosmos.tx.v1beta1.Fee.verify(message.fee); + if (error) + return "fee." + error; + } + return null; + }; + + /** + * Creates an AuthInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.AuthInfo + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.AuthInfo} AuthInfo + */ + AuthInfo.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.AuthInfo) + return object; + let message = new $root.cosmos.tx.v1beta1.AuthInfo(); + if (object.signerInfos) { + if (!Array.isArray(object.signerInfos)) + throw TypeError(".cosmos.tx.v1beta1.AuthInfo.signerInfos: array expected"); + message.signerInfos = []; + for (let i = 0; i < object.signerInfos.length; ++i) { + if (typeof object.signerInfos[i] !== "object") + throw TypeError(".cosmos.tx.v1beta1.AuthInfo.signerInfos: object expected"); + message.signerInfos[i] = $root.cosmos.tx.v1beta1.SignerInfo.fromObject(object.signerInfos[i]); + } + } + if (object.fee != null) { + if (typeof object.fee !== "object") + throw TypeError(".cosmos.tx.v1beta1.AuthInfo.fee: object expected"); + message.fee = $root.cosmos.tx.v1beta1.Fee.fromObject(object.fee); + } + return message; + }; + + /** + * Creates a plain object from an AuthInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.AuthInfo + * @static + * @param {cosmos.tx.v1beta1.AuthInfo} message AuthInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuthInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.signerInfos = []; + if (options.defaults) + object.fee = null; + if (message.signerInfos && message.signerInfos.length) { + object.signerInfos = []; + for (let j = 0; j < message.signerInfos.length; ++j) + object.signerInfos[j] = $root.cosmos.tx.v1beta1.SignerInfo.toObject(message.signerInfos[j], options); + } + if (message.fee != null && message.hasOwnProperty("fee")) + object.fee = $root.cosmos.tx.v1beta1.Fee.toObject(message.fee, options); + return object; + }; + + /** + * Converts this AuthInfo to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.AuthInfo + * @instance + * @returns {Object.} JSON object + */ + AuthInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AuthInfo; + })(v1beta1.AuthInfo || {}); + + v1beta1.SignerInfo = (function(SignerInfo) { + + /** + * Properties of a SignerInfo. + * @memberof cosmos.tx.v1beta1 + * @interface ISignerInfo + * @property {google.protobuf.IAny|null} [publicKey] SignerInfo publicKey + * @property {cosmos.tx.v1beta1.IModeInfo|null} [modeInfo] SignerInfo modeInfo + * @property {number|Long|null} [sequence] SignerInfo sequence + */ + + /** + * Constructs a new SignerInfo. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents a SignerInfo. + * @implements ISignerInfo + * @constructor + * @param {cosmos.tx.v1beta1.ISignerInfo=} [properties] Properties to set + */ + function SignerInfo(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SignerInfo publicKey. + * @member {google.protobuf.IAny|null|undefined} publicKey + * @memberof cosmos.tx.v1beta1.SignerInfo + * @instance + */ + SignerInfo.prototype.publicKey = null; + + /** + * SignerInfo modeInfo. + * @member {cosmos.tx.v1beta1.IModeInfo|null|undefined} modeInfo + * @memberof cosmos.tx.v1beta1.SignerInfo + * @instance + */ + SignerInfo.prototype.modeInfo = null; + + /** + * SignerInfo sequence. + * @member {number|Long} sequence + * @memberof cosmos.tx.v1beta1.SignerInfo + * @instance + */ + SignerInfo.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new SignerInfo instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.SignerInfo + * @static + * @param {cosmos.tx.v1beta1.ISignerInfo=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.SignerInfo} SignerInfo instance + */ + SignerInfo.create = function create(properties) { + return new SignerInfo(properties); + }; + + /** + * Encodes the specified SignerInfo message. Does not implicitly {@link cosmos.tx.v1beta1.SignerInfo.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.SignerInfo + * @static + * @param {cosmos.tx.v1beta1.ISignerInfo} message SignerInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignerInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) + $root.google.protobuf.Any.encode(message.publicKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.modeInfo != null && Object.hasOwnProperty.call(message, "modeInfo")) + $root.cosmos.tx.v1beta1.ModeInfo.encode(message.modeInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.sequence); + return writer; + }; + + /** + * Encodes the specified SignerInfo message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.SignerInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.SignerInfo + * @static + * @param {cosmos.tx.v1beta1.ISignerInfo} message SignerInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignerInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SignerInfo message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.SignerInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.SignerInfo} SignerInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignerInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.SignerInfo(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publicKey = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 2: + message.modeInfo = $root.cosmos.tx.v1beta1.ModeInfo.decode(reader, reader.uint32()); + break; + case 3: + message.sequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SignerInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.SignerInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.SignerInfo} SignerInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignerInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SignerInfo message. + * @function verify + * @memberof cosmos.tx.v1beta1.SignerInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SignerInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.publicKey != null && message.hasOwnProperty("publicKey")) { + let error = $root.google.protobuf.Any.verify(message.publicKey); + if (error) + return "publicKey." + error; + } + if (message.modeInfo != null && message.hasOwnProperty("modeInfo")) { + let error = $root.cosmos.tx.v1beta1.ModeInfo.verify(message.modeInfo); + if (error) + return "modeInfo." + error; + } + if (message.sequence != null && message.hasOwnProperty("sequence")) + if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) + return "sequence: integer|Long expected"; + return null; + }; + + /** + * Creates a SignerInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.SignerInfo + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.SignerInfo} SignerInfo + */ + SignerInfo.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.SignerInfo) + return object; + let message = new $root.cosmos.tx.v1beta1.SignerInfo(); + if (object.publicKey != null) { + if (typeof object.publicKey !== "object") + throw TypeError(".cosmos.tx.v1beta1.SignerInfo.publicKey: object expected"); + message.publicKey = $root.google.protobuf.Any.fromObject(object.publicKey); + } + if (object.modeInfo != null) { + if (typeof object.modeInfo !== "object") + throw TypeError(".cosmos.tx.v1beta1.SignerInfo.modeInfo: object expected"); + message.modeInfo = $root.cosmos.tx.v1beta1.ModeInfo.fromObject(object.modeInfo); + } + if (object.sequence != null) + if ($util.Long) + (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; + else if (typeof object.sequence === "string") + message.sequence = parseInt(object.sequence, 10); + else if (typeof object.sequence === "number") + message.sequence = object.sequence; + else if (typeof object.sequence === "object") + message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a SignerInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.SignerInfo + * @static + * @param {cosmos.tx.v1beta1.SignerInfo} message SignerInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SignerInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.publicKey = null; + object.modeInfo = null; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sequence = options.longs === String ? "0" : 0; + } + if (message.publicKey != null && message.hasOwnProperty("publicKey")) + object.publicKey = $root.google.protobuf.Any.toObject(message.publicKey, options); + if (message.modeInfo != null && message.hasOwnProperty("modeInfo")) + object.modeInfo = $root.cosmos.tx.v1beta1.ModeInfo.toObject(message.modeInfo, options); + if (message.sequence != null && message.hasOwnProperty("sequence")) + if (typeof message.sequence === "number") + object.sequence = options.longs === String ? String(message.sequence) : message.sequence; + else + object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; + return object; + }; + + /** + * Converts this SignerInfo to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.SignerInfo + * @instance + * @returns {Object.} JSON object + */ + SignerInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SignerInfo; + })(v1beta1.SignerInfo || {}); + + v1beta1.ModeInfo = (function(ModeInfo) { + + /** + * Properties of a ModeInfo. + * @memberof cosmos.tx.v1beta1 + * @interface IModeInfo + * @property {cosmos.tx.v1beta1.ModeInfo.ISingle|null} [single] ModeInfo single + * @property {cosmos.tx.v1beta1.ModeInfo.IMulti|null} [multi] ModeInfo multi + */ + + /** + * Constructs a new ModeInfo. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents a ModeInfo. + * @implements IModeInfo + * @constructor + * @param {cosmos.tx.v1beta1.IModeInfo=} [properties] Properties to set + */ + function ModeInfo(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModeInfo single. + * @member {cosmos.tx.v1beta1.ModeInfo.ISingle|null|undefined} single + * @memberof cosmos.tx.v1beta1.ModeInfo + * @instance + */ + ModeInfo.prototype.single = null; + + /** + * ModeInfo multi. + * @member {cosmos.tx.v1beta1.ModeInfo.IMulti|null|undefined} multi + * @memberof cosmos.tx.v1beta1.ModeInfo + * @instance + */ + ModeInfo.prototype.multi = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ModeInfo sum. + * @member {"single"|"multi"|undefined} sum + * @memberof cosmos.tx.v1beta1.ModeInfo + * @instance + */ + Object.defineProperty(ModeInfo.prototype, "sum", { + get: $util.oneOfGetter($oneOfFields = ["single", "multi"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ModeInfo instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.ModeInfo + * @static + * @param {cosmos.tx.v1beta1.IModeInfo=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.ModeInfo} ModeInfo instance + */ + ModeInfo.create = function create(properties) { + return new ModeInfo(properties); + }; + + /** + * Encodes the specified ModeInfo message. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.ModeInfo + * @static + * @param {cosmos.tx.v1beta1.IModeInfo} message ModeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.single != null && Object.hasOwnProperty.call(message, "single")) + $root.cosmos.tx.v1beta1.ModeInfo.Single.encode(message.single, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.multi != null && Object.hasOwnProperty.call(message, "multi")) + $root.cosmos.tx.v1beta1.ModeInfo.Multi.encode(message.multi, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ModeInfo message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.ModeInfo + * @static + * @param {cosmos.tx.v1beta1.IModeInfo} message ModeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModeInfo message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.ModeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.ModeInfo} ModeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.ModeInfo(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.single = $root.cosmos.tx.v1beta1.ModeInfo.Single.decode(reader, reader.uint32()); + break; + case 2: + message.multi = $root.cosmos.tx.v1beta1.ModeInfo.Multi.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.ModeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.ModeInfo} ModeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModeInfo message. + * @function verify + * @memberof cosmos.tx.v1beta1.ModeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + let properties = {}; + if (message.single != null && message.hasOwnProperty("single")) { + properties.sum = 1; + { + let error = $root.cosmos.tx.v1beta1.ModeInfo.Single.verify(message.single); + if (error) + return "single." + error; + } + } + if (message.multi != null && message.hasOwnProperty("multi")) { + if (properties.sum === 1) + return "sum: multiple values"; + properties.sum = 1; + { + let error = $root.cosmos.tx.v1beta1.ModeInfo.Multi.verify(message.multi); + if (error) + return "multi." + error; + } + } + return null; + }; + + /** + * Creates a ModeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.ModeInfo + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.ModeInfo} ModeInfo + */ + ModeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.ModeInfo) + return object; + let message = new $root.cosmos.tx.v1beta1.ModeInfo(); + if (object.single != null) { + if (typeof object.single !== "object") + throw TypeError(".cosmos.tx.v1beta1.ModeInfo.single: object expected"); + message.single = $root.cosmos.tx.v1beta1.ModeInfo.Single.fromObject(object.single); + } + if (object.multi != null) { + if (typeof object.multi !== "object") + throw TypeError(".cosmos.tx.v1beta1.ModeInfo.multi: object expected"); + message.multi = $root.cosmos.tx.v1beta1.ModeInfo.Multi.fromObject(object.multi); + } + return message; + }; + + /** + * Creates a plain object from a ModeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.ModeInfo + * @static + * @param {cosmos.tx.v1beta1.ModeInfo} message ModeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.single != null && message.hasOwnProperty("single")) { + object.single = $root.cosmos.tx.v1beta1.ModeInfo.Single.toObject(message.single, options); + if (options.oneofs) + object.sum = "single"; + } + if (message.multi != null && message.hasOwnProperty("multi")) { + object.multi = $root.cosmos.tx.v1beta1.ModeInfo.Multi.toObject(message.multi, options); + if (options.oneofs) + object.sum = "multi"; + } + return object; + }; + + /** + * Converts this ModeInfo to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.ModeInfo + * @instance + * @returns {Object.} JSON object + */ + ModeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + ModeInfo.Single = (function(Single) { + + /** + * Properties of a Single. + * @memberof cosmos.tx.v1beta1.ModeInfo + * @interface ISingle + * @property {cosmos.tx.signing.v1beta1.SignMode|null} [mode] Single mode + */ + + /** + * Constructs a new Single. + * @memberof cosmos.tx.v1beta1.ModeInfo + * @classdesc Represents a Single. + * @implements ISingle + * @constructor + * @param {cosmos.tx.v1beta1.ModeInfo.ISingle=} [properties] Properties to set + */ + function Single(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Single mode. + * @member {cosmos.tx.signing.v1beta1.SignMode} mode + * @memberof cosmos.tx.v1beta1.ModeInfo.Single + * @instance + */ + Single.prototype.mode = 0; + + /** + * Creates a new Single instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.ModeInfo.Single + * @static + * @param {cosmos.tx.v1beta1.ModeInfo.ISingle=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.ModeInfo.Single} Single instance + */ + Single.create = function create(properties) { + return new Single(properties); + }; + + /** + * Encodes the specified Single message. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.Single.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.ModeInfo.Single + * @static + * @param {cosmos.tx.v1beta1.ModeInfo.ISingle} message Single message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Single.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); + return writer; + }; + + /** + * Encodes the specified Single message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.Single.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.ModeInfo.Single + * @static + * @param {cosmos.tx.v1beta1.ModeInfo.ISingle} message Single message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Single.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Single message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.ModeInfo.Single + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.ModeInfo.Single} Single + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Single.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.ModeInfo.Single(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mode = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Single message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.ModeInfo.Single + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.ModeInfo.Single} Single + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Single.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Single message. + * @function verify + * @memberof cosmos.tx.v1beta1.ModeInfo.Single + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Single.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + case 127: + break; + } + return null; + }; + + /** + * Creates a Single message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.ModeInfo.Single + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.ModeInfo.Single} Single + */ + Single.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.ModeInfo.Single) + return object; + let message = new $root.cosmos.tx.v1beta1.ModeInfo.Single(); + switch (object.mode) { + case "SIGN_MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "SIGN_MODE_DIRECT": + case 1: + message.mode = 1; + break; + case "SIGN_MODE_TEXTUAL": + case 2: + message.mode = 2; + break; + case "SIGN_MODE_LEGACY_AMINO_JSON": + case 127: + message.mode = 127; + break; + } + return message; + }; + + /** + * Creates a plain object from a Single message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.ModeInfo.Single + * @static + * @param {cosmos.tx.v1beta1.ModeInfo.Single} message Single + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Single.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.mode = options.enums === String ? "SIGN_MODE_UNSPECIFIED" : 0; + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.cosmos.tx.signing.v1beta1.SignMode[message.mode] : message.mode; + return object; + }; + + /** + * Converts this Single to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.ModeInfo.Single + * @instance + * @returns {Object.} JSON object + */ + Single.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Single; + })(ModeInfo.Single || {}); + + ModeInfo.Multi = (function(Multi) { + + /** + * Properties of a Multi. + * @memberof cosmos.tx.v1beta1.ModeInfo + * @interface IMulti + * @property {cosmos.crypto.multisig.v1beta1.ICompactBitArray|null} [bitarray] Multi bitarray + * @property {Array.|null} [modeInfos] Multi modeInfos + */ + + /** + * Constructs a new Multi. + * @memberof cosmos.tx.v1beta1.ModeInfo + * @classdesc Represents a Multi. + * @implements IMulti + * @constructor + * @param {cosmos.tx.v1beta1.ModeInfo.IMulti=} [properties] Properties to set + */ + function Multi(properties) { + this.modeInfos = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Multi bitarray. + * @member {cosmos.crypto.multisig.v1beta1.ICompactBitArray|null|undefined} bitarray + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @instance + */ + Multi.prototype.bitarray = null; + + /** + * Multi modeInfos. + * @member {Array.} modeInfos + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @instance + */ + Multi.prototype.modeInfos = $util.emptyArray; + + /** + * Creates a new Multi instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @static + * @param {cosmos.tx.v1beta1.ModeInfo.IMulti=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.ModeInfo.Multi} Multi instance + */ + Multi.create = function create(properties) { + return new Multi(properties); + }; + + /** + * Encodes the specified Multi message. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.Multi.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @static + * @param {cosmos.tx.v1beta1.ModeInfo.IMulti} message Multi message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Multi.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bitarray != null && Object.hasOwnProperty.call(message, "bitarray")) + $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.encode(message.bitarray, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.modeInfos != null && message.modeInfos.length) + for (let i = 0; i < message.modeInfos.length; ++i) + $root.cosmos.tx.v1beta1.ModeInfo.encode(message.modeInfos[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Multi message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.Multi.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @static + * @param {cosmos.tx.v1beta1.ModeInfo.IMulti} message Multi message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Multi.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Multi message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.ModeInfo.Multi} Multi + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Multi.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.ModeInfo.Multi(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bitarray = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.modeInfos && message.modeInfos.length)) + message.modeInfos = []; + message.modeInfos.push($root.cosmos.tx.v1beta1.ModeInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Multi message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.ModeInfo.Multi} Multi + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Multi.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Multi message. + * @function verify + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Multi.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bitarray != null && message.hasOwnProperty("bitarray")) { + let error = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.verify(message.bitarray); + if (error) + return "bitarray." + error; + } + if (message.modeInfos != null && message.hasOwnProperty("modeInfos")) { + if (!Array.isArray(message.modeInfos)) + return "modeInfos: array expected"; + for (let i = 0; i < message.modeInfos.length; ++i) { + let error = $root.cosmos.tx.v1beta1.ModeInfo.verify(message.modeInfos[i]); + if (error) + return "modeInfos." + error; + } + } + return null; + }; + + /** + * Creates a Multi message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.ModeInfo.Multi} Multi + */ + Multi.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.ModeInfo.Multi) + return object; + let message = new $root.cosmos.tx.v1beta1.ModeInfo.Multi(); + if (object.bitarray != null) { + if (typeof object.bitarray !== "object") + throw TypeError(".cosmos.tx.v1beta1.ModeInfo.Multi.bitarray: object expected"); + message.bitarray = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.fromObject(object.bitarray); + } + if (object.modeInfos) { + if (!Array.isArray(object.modeInfos)) + throw TypeError(".cosmos.tx.v1beta1.ModeInfo.Multi.modeInfos: array expected"); + message.modeInfos = []; + for (let i = 0; i < object.modeInfos.length; ++i) { + if (typeof object.modeInfos[i] !== "object") + throw TypeError(".cosmos.tx.v1beta1.ModeInfo.Multi.modeInfos: object expected"); + message.modeInfos[i] = $root.cosmos.tx.v1beta1.ModeInfo.fromObject(object.modeInfos[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Multi message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @static + * @param {cosmos.tx.v1beta1.ModeInfo.Multi} message Multi + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Multi.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.modeInfos = []; + if (options.defaults) + object.bitarray = null; + if (message.bitarray != null && message.hasOwnProperty("bitarray")) + object.bitarray = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.toObject(message.bitarray, options); + if (message.modeInfos && message.modeInfos.length) { + object.modeInfos = []; + for (let j = 0; j < message.modeInfos.length; ++j) + object.modeInfos[j] = $root.cosmos.tx.v1beta1.ModeInfo.toObject(message.modeInfos[j], options); + } + return object; + }; + + /** + * Converts this Multi to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.ModeInfo.Multi + * @instance + * @returns {Object.} JSON object + */ + Multi.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Multi; + })(ModeInfo.Multi || {}); + + return ModeInfo; + })(v1beta1.ModeInfo || {}); + + v1beta1.Fee = (function(Fee) { + + /** + * Properties of a Fee. + * @memberof cosmos.tx.v1beta1 + * @interface IFee + * @property {Array.|null} [amount] Fee amount + * @property {number|Long|null} [gasLimit] Fee gasLimit + * @property {string|null} [payer] Fee payer + * @property {string|null} [granter] Fee granter + */ + + /** + * Constructs a new Fee. + * @memberof cosmos.tx.v1beta1 + * @classdesc Represents a Fee. + * @implements IFee + * @constructor + * @param {cosmos.tx.v1beta1.IFee=} [properties] Properties to set + */ + function Fee(properties) { + this.amount = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Fee amount. + * @member {Array.} amount + * @memberof cosmos.tx.v1beta1.Fee + * @instance + */ + Fee.prototype.amount = $util.emptyArray; + + /** + * Fee gasLimit. + * @member {number|Long} gasLimit + * @memberof cosmos.tx.v1beta1.Fee + * @instance + */ + Fee.prototype.gasLimit = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Fee payer. + * @member {string} payer + * @memberof cosmos.tx.v1beta1.Fee + * @instance + */ + Fee.prototype.payer = ""; + + /** + * Fee granter. + * @member {string} granter + * @memberof cosmos.tx.v1beta1.Fee + * @instance + */ + Fee.prototype.granter = ""; + + /** + * Creates a new Fee instance using the specified properties. + * @function create + * @memberof cosmos.tx.v1beta1.Fee + * @static + * @param {cosmos.tx.v1beta1.IFee=} [properties] Properties to set + * @returns {cosmos.tx.v1beta1.Fee} Fee instance + */ + Fee.create = function create(properties) { + return new Fee(properties); + }; + + /** + * Encodes the specified Fee message. Does not implicitly {@link cosmos.tx.v1beta1.Fee.verify|verify} messages. + * @function encode + * @memberof cosmos.tx.v1beta1.Fee + * @static + * @param {cosmos.tx.v1beta1.IFee} message Fee message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fee.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.amount != null && message.amount.length) + for (let i = 0; i < message.amount.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.amount[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.gasLimit != null && Object.hasOwnProperty.call(message, "gasLimit")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.gasLimit); + if (message.payer != null && Object.hasOwnProperty.call(message, "payer")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.payer); + if (message.granter != null && Object.hasOwnProperty.call(message, "granter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.granter); + return writer; + }; + + /** + * Encodes the specified Fee message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.Fee.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.tx.v1beta1.Fee + * @static + * @param {cosmos.tx.v1beta1.IFee} message Fee message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fee.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Fee message from the specified reader or buffer. + * @function decode + * @memberof cosmos.tx.v1beta1.Fee + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.tx.v1beta1.Fee} Fee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fee.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.tx.v1beta1.Fee(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.amount && message.amount.length)) + message.amount = []; + message.amount.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + case 2: + message.gasLimit = reader.uint64(); + break; + case 3: + message.payer = reader.string(); + break; + case 4: + message.granter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Fee message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.tx.v1beta1.Fee + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.tx.v1beta1.Fee} Fee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fee.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Fee message. + * @function verify + * @memberof cosmos.tx.v1beta1.Fee + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Fee.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + if (!Array.isArray(message.amount)) + return "amount: array expected"; + for (let i = 0; i < message.amount.length; ++i) { + let error = $root.cosmos.base.v1beta1.Coin.verify(message.amount[i]); + if (error) + return "amount." + error; + } + } + if (message.gasLimit != null && message.hasOwnProperty("gasLimit")) + if (!$util.isInteger(message.gasLimit) && !(message.gasLimit && $util.isInteger(message.gasLimit.low) && $util.isInteger(message.gasLimit.high))) + return "gasLimit: integer|Long expected"; + if (message.payer != null && message.hasOwnProperty("payer")) + if (!$util.isString(message.payer)) + return "payer: string expected"; + if (message.granter != null && message.hasOwnProperty("granter")) + if (!$util.isString(message.granter)) + return "granter: string expected"; + return null; + }; + + /** + * Creates a Fee message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.tx.v1beta1.Fee + * @static + * @param {Object.} object Plain object + * @returns {cosmos.tx.v1beta1.Fee} Fee + */ + Fee.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.tx.v1beta1.Fee) + return object; + let message = new $root.cosmos.tx.v1beta1.Fee(); + if (object.amount) { + if (!Array.isArray(object.amount)) + throw TypeError(".cosmos.tx.v1beta1.Fee.amount: array expected"); + message.amount = []; + for (let i = 0; i < object.amount.length; ++i) { + if (typeof object.amount[i] !== "object") + throw TypeError(".cosmos.tx.v1beta1.Fee.amount: object expected"); + message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]); + } + } + if (object.gasLimit != null) + if ($util.Long) + (message.gasLimit = $util.Long.fromValue(object.gasLimit)).unsigned = true; + else if (typeof object.gasLimit === "string") + message.gasLimit = parseInt(object.gasLimit, 10); + else if (typeof object.gasLimit === "number") + message.gasLimit = object.gasLimit; + else if (typeof object.gasLimit === "object") + message.gasLimit = new $util.LongBits(object.gasLimit.low >>> 0, object.gasLimit.high >>> 0).toNumber(true); + if (object.payer != null) + message.payer = String(object.payer); + if (object.granter != null) + message.granter = String(object.granter); + return message; + }; + + /** + * Creates a plain object from a Fee message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.tx.v1beta1.Fee + * @static + * @param {cosmos.tx.v1beta1.Fee} message Fee + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Fee.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.amount = []; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.gasLimit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.gasLimit = options.longs === String ? "0" : 0; + object.payer = ""; + object.granter = ""; + } + if (message.amount && message.amount.length) { + object.amount = []; + for (let j = 0; j < message.amount.length; ++j) + object.amount[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.amount[j], options); + } + if (message.gasLimit != null && message.hasOwnProperty("gasLimit")) + if (typeof message.gasLimit === "number") + object.gasLimit = options.longs === String ? String(message.gasLimit) : message.gasLimit; + else + object.gasLimit = options.longs === String ? $util.Long.prototype.toString.call(message.gasLimit) : options.longs === Number ? new $util.LongBits(message.gasLimit.low >>> 0, message.gasLimit.high >>> 0).toNumber(true) : message.gasLimit; + if (message.payer != null && message.hasOwnProperty("payer")) + object.payer = message.payer; + if (message.granter != null && message.hasOwnProperty("granter")) + object.granter = message.granter; + return object; + }; + + /** + * Converts this Fee to JSON. + * @function toJSON + * @memberof cosmos.tx.v1beta1.Fee + * @instance + * @returns {Object.} JSON object + */ + Fee.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Fee; + })(v1beta1.Fee || {}); + + return v1beta1; + })(tx.v1beta1 || {}); + + return tx; + })(cosmos.tx || {}); + + /** + * Namespace upgrade. + * @memberof cosmos + * @namespace + */ + + cosmos.upgrade = (function(upgrade) { + + /** + * Namespace v1beta1. + * @memberof cosmos.upgrade + * @namespace + */ + + upgrade.v1beta1 = (function(v1beta1) { + + v1beta1.Query = (function(Query) { + + /** + * Constructs a new Query service. + * @memberof cosmos.upgrade.v1beta1 + * @classdesc Represents a Query + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Query(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; + + /** + * Creates new Query service using the specified rpc implementation. + * @function create + * @memberof cosmos.upgrade.v1beta1.Query + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Query} RPC service. Useful where requests and/or responses are streamed. + */ + Query.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.upgrade.v1beta1.Query#currentPlan}. + * @memberof cosmos.upgrade.v1beta1.Query + * @typedef CurrentPlanCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.upgrade.v1beta1.IQueryCurrentPlanResponse} [response] QueryCurrentPlanResponse + */ + + /** + * Calls CurrentPlan. + * @function currentPlan + * @memberof cosmos.upgrade.v1beta1.Query + * @instance + * @param {cosmos.upgrade.v1beta1.IQueryCurrentPlanRequest} request QueryCurrentPlanRequest message or plain object + * @param {cosmos.upgrade.v1beta1.Query.CurrentPlanCallback} callback Node-style callback called with the error, if any, and QueryCurrentPlanResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.currentPlan = function currentPlan(request, callback) { + return this.rpcCall(currentPlan, $root.cosmos.upgrade.v1beta1.QueryCurrentPlanRequest, $root.cosmos.upgrade.v1beta1.QueryCurrentPlanResponse, request, callback); + }, "name", { value: "CurrentPlan" }); + + /** + * Calls CurrentPlan. + * @function currentPlan + * @memberof cosmos.upgrade.v1beta1.Query + * @instance + * @param {cosmos.upgrade.v1beta1.IQueryCurrentPlanRequest} request QueryCurrentPlanRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.upgrade.v1beta1.Query#appliedPlan}. + * @memberof cosmos.upgrade.v1beta1.Query + * @typedef AppliedPlanCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.upgrade.v1beta1.IQueryAppliedPlanResponse} [response] QueryAppliedPlanResponse + */ + + /** + * Calls AppliedPlan. + * @function appliedPlan + * @memberof cosmos.upgrade.v1beta1.Query + * @instance + * @param {cosmos.upgrade.v1beta1.IQueryAppliedPlanRequest} request QueryAppliedPlanRequest message or plain object + * @param {cosmos.upgrade.v1beta1.Query.AppliedPlanCallback} callback Node-style callback called with the error, if any, and QueryAppliedPlanResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.appliedPlan = function appliedPlan(request, callback) { + return this.rpcCall(appliedPlan, $root.cosmos.upgrade.v1beta1.QueryAppliedPlanRequest, $root.cosmos.upgrade.v1beta1.QueryAppliedPlanResponse, request, callback); + }, "name", { value: "AppliedPlan" }); + + /** + * Calls AppliedPlan. + * @function appliedPlan + * @memberof cosmos.upgrade.v1beta1.Query + * @instance + * @param {cosmos.upgrade.v1beta1.IQueryAppliedPlanRequest} request QueryAppliedPlanRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link cosmos.upgrade.v1beta1.Query#upgradedConsensusState}. + * @memberof cosmos.upgrade.v1beta1.Query + * @typedef UpgradedConsensusStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.upgrade.v1beta1.IQueryUpgradedConsensusStateResponse} [response] QueryUpgradedConsensusStateResponse + */ + + /** + * Calls UpgradedConsensusState. + * @function upgradedConsensusState + * @memberof cosmos.upgrade.v1beta1.Query + * @instance + * @param {cosmos.upgrade.v1beta1.IQueryUpgradedConsensusStateRequest} request QueryUpgradedConsensusStateRequest message or plain object + * @param {cosmos.upgrade.v1beta1.Query.UpgradedConsensusStateCallback} callback Node-style callback called with the error, if any, and QueryUpgradedConsensusStateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.upgradedConsensusState = function upgradedConsensusState(request, callback) { + return this.rpcCall(upgradedConsensusState, $root.cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest, $root.cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse, request, callback); + }, "name", { value: "UpgradedConsensusState" }); + + /** + * Calls UpgradedConsensusState. + * @function upgradedConsensusState + * @memberof cosmos.upgrade.v1beta1.Query + * @instance + * @param {cosmos.upgrade.v1beta1.IQueryUpgradedConsensusStateRequest} request QueryUpgradedConsensusStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Query; + })(v1beta1.Query || {}); + + v1beta1.QueryCurrentPlanRequest = (function(QueryCurrentPlanRequest) { + + /** + * Properties of a QueryCurrentPlanRequest. + * @memberof cosmos.upgrade.v1beta1 + * @interface IQueryCurrentPlanRequest + */ + + /** + * Constructs a new QueryCurrentPlanRequest. + * @memberof cosmos.upgrade.v1beta1 + * @classdesc Represents a QueryCurrentPlanRequest. + * @implements IQueryCurrentPlanRequest + * @constructor + * @param {cosmos.upgrade.v1beta1.IQueryCurrentPlanRequest=} [properties] Properties to set + */ + function QueryCurrentPlanRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new QueryCurrentPlanRequest instance using the specified properties. + * @function create + * @memberof cosmos.upgrade.v1beta1.QueryCurrentPlanRequest + * @static + * @param {cosmos.upgrade.v1beta1.IQueryCurrentPlanRequest=} [properties] Properties to set + * @returns {cosmos.upgrade.v1beta1.QueryCurrentPlanRequest} QueryCurrentPlanRequest instance + */ + QueryCurrentPlanRequest.create = function create(properties) { + return new QueryCurrentPlanRequest(properties); + }; + + /** + * Encodes the specified QueryCurrentPlanRequest message. Does not implicitly {@link cosmos.upgrade.v1beta1.QueryCurrentPlanRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.upgrade.v1beta1.QueryCurrentPlanRequest + * @static + * @param {cosmos.upgrade.v1beta1.IQueryCurrentPlanRequest} message QueryCurrentPlanRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryCurrentPlanRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified QueryCurrentPlanRequest message, length delimited. Does not implicitly {@link cosmos.upgrade.v1beta1.QueryCurrentPlanRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.upgrade.v1beta1.QueryCurrentPlanRequest + * @static + * @param {cosmos.upgrade.v1beta1.IQueryCurrentPlanRequest} message QueryCurrentPlanRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryCurrentPlanRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryCurrentPlanRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.upgrade.v1beta1.QueryCurrentPlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.upgrade.v1beta1.QueryCurrentPlanRequest} QueryCurrentPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryCurrentPlanRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.upgrade.v1beta1.QueryCurrentPlanRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryCurrentPlanRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.upgrade.v1beta1.QueryCurrentPlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.upgrade.v1beta1.QueryCurrentPlanRequest} QueryCurrentPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryCurrentPlanRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryCurrentPlanRequest message. + * @function verify + * @memberof cosmos.upgrade.v1beta1.QueryCurrentPlanRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryCurrentPlanRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a QueryCurrentPlanRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.upgrade.v1beta1.QueryCurrentPlanRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.upgrade.v1beta1.QueryCurrentPlanRequest} QueryCurrentPlanRequest + */ + QueryCurrentPlanRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.upgrade.v1beta1.QueryCurrentPlanRequest) + return object; + return new $root.cosmos.upgrade.v1beta1.QueryCurrentPlanRequest(); + }; + + /** + * Creates a plain object from a QueryCurrentPlanRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.upgrade.v1beta1.QueryCurrentPlanRequest + * @static + * @param {cosmos.upgrade.v1beta1.QueryCurrentPlanRequest} message QueryCurrentPlanRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryCurrentPlanRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this QueryCurrentPlanRequest to JSON. + * @function toJSON + * @memberof cosmos.upgrade.v1beta1.QueryCurrentPlanRequest + * @instance + * @returns {Object.} JSON object + */ + QueryCurrentPlanRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryCurrentPlanRequest; + })(v1beta1.QueryCurrentPlanRequest || {}); + + v1beta1.QueryCurrentPlanResponse = (function(QueryCurrentPlanResponse) { + + /** + * Properties of a QueryCurrentPlanResponse. + * @memberof cosmos.upgrade.v1beta1 + * @interface IQueryCurrentPlanResponse + * @property {cosmos.upgrade.v1beta1.IPlan|null} [plan] QueryCurrentPlanResponse plan + */ + + /** + * Constructs a new QueryCurrentPlanResponse. + * @memberof cosmos.upgrade.v1beta1 + * @classdesc Represents a QueryCurrentPlanResponse. + * @implements IQueryCurrentPlanResponse + * @constructor + * @param {cosmos.upgrade.v1beta1.IQueryCurrentPlanResponse=} [properties] Properties to set + */ + function QueryCurrentPlanResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryCurrentPlanResponse plan. + * @member {cosmos.upgrade.v1beta1.IPlan|null|undefined} plan + * @memberof cosmos.upgrade.v1beta1.QueryCurrentPlanResponse + * @instance + */ + QueryCurrentPlanResponse.prototype.plan = null; + + /** + * Creates a new QueryCurrentPlanResponse instance using the specified properties. + * @function create + * @memberof cosmos.upgrade.v1beta1.QueryCurrentPlanResponse + * @static + * @param {cosmos.upgrade.v1beta1.IQueryCurrentPlanResponse=} [properties] Properties to set + * @returns {cosmos.upgrade.v1beta1.QueryCurrentPlanResponse} QueryCurrentPlanResponse instance + */ + QueryCurrentPlanResponse.create = function create(properties) { + return new QueryCurrentPlanResponse(properties); + }; + + /** + * Encodes the specified QueryCurrentPlanResponse message. Does not implicitly {@link cosmos.upgrade.v1beta1.QueryCurrentPlanResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.upgrade.v1beta1.QueryCurrentPlanResponse + * @static + * @param {cosmos.upgrade.v1beta1.IQueryCurrentPlanResponse} message QueryCurrentPlanResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryCurrentPlanResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.plan != null && Object.hasOwnProperty.call(message, "plan")) + $root.cosmos.upgrade.v1beta1.Plan.encode(message.plan, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryCurrentPlanResponse message, length delimited. Does not implicitly {@link cosmos.upgrade.v1beta1.QueryCurrentPlanResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.upgrade.v1beta1.QueryCurrentPlanResponse + * @static + * @param {cosmos.upgrade.v1beta1.IQueryCurrentPlanResponse} message QueryCurrentPlanResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryCurrentPlanResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryCurrentPlanResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.upgrade.v1beta1.QueryCurrentPlanResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.upgrade.v1beta1.QueryCurrentPlanResponse} QueryCurrentPlanResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryCurrentPlanResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.upgrade.v1beta1.QueryCurrentPlanResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.plan = $root.cosmos.upgrade.v1beta1.Plan.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryCurrentPlanResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.upgrade.v1beta1.QueryCurrentPlanResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.upgrade.v1beta1.QueryCurrentPlanResponse} QueryCurrentPlanResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryCurrentPlanResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryCurrentPlanResponse message. + * @function verify + * @memberof cosmos.upgrade.v1beta1.QueryCurrentPlanResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryCurrentPlanResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.plan != null && message.hasOwnProperty("plan")) { + let error = $root.cosmos.upgrade.v1beta1.Plan.verify(message.plan); + if (error) + return "plan." + error; + } + return null; + }; + + /** + * Creates a QueryCurrentPlanResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.upgrade.v1beta1.QueryCurrentPlanResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.upgrade.v1beta1.QueryCurrentPlanResponse} QueryCurrentPlanResponse + */ + QueryCurrentPlanResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.upgrade.v1beta1.QueryCurrentPlanResponse) + return object; + let message = new $root.cosmos.upgrade.v1beta1.QueryCurrentPlanResponse(); + if (object.plan != null) { + if (typeof object.plan !== "object") + throw TypeError(".cosmos.upgrade.v1beta1.QueryCurrentPlanResponse.plan: object expected"); + message.plan = $root.cosmos.upgrade.v1beta1.Plan.fromObject(object.plan); + } + return message; + }; + + /** + * Creates a plain object from a QueryCurrentPlanResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.upgrade.v1beta1.QueryCurrentPlanResponse + * @static + * @param {cosmos.upgrade.v1beta1.QueryCurrentPlanResponse} message QueryCurrentPlanResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryCurrentPlanResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.plan = null; + if (message.plan != null && message.hasOwnProperty("plan")) + object.plan = $root.cosmos.upgrade.v1beta1.Plan.toObject(message.plan, options); + return object; + }; + + /** + * Converts this QueryCurrentPlanResponse to JSON. + * @function toJSON + * @memberof cosmos.upgrade.v1beta1.QueryCurrentPlanResponse + * @instance + * @returns {Object.} JSON object + */ + QueryCurrentPlanResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryCurrentPlanResponse; + })(v1beta1.QueryCurrentPlanResponse || {}); + + v1beta1.QueryAppliedPlanRequest = (function(QueryAppliedPlanRequest) { + + /** + * Properties of a QueryAppliedPlanRequest. + * @memberof cosmos.upgrade.v1beta1 + * @interface IQueryAppliedPlanRequest + * @property {string|null} [name] QueryAppliedPlanRequest name + */ + + /** + * Constructs a new QueryAppliedPlanRequest. + * @memberof cosmos.upgrade.v1beta1 + * @classdesc Represents a QueryAppliedPlanRequest. + * @implements IQueryAppliedPlanRequest + * @constructor + * @param {cosmos.upgrade.v1beta1.IQueryAppliedPlanRequest=} [properties] Properties to set + */ + function QueryAppliedPlanRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryAppliedPlanRequest name. + * @member {string} name + * @memberof cosmos.upgrade.v1beta1.QueryAppliedPlanRequest + * @instance + */ + QueryAppliedPlanRequest.prototype.name = ""; + + /** + * Creates a new QueryAppliedPlanRequest instance using the specified properties. + * @function create + * @memberof cosmos.upgrade.v1beta1.QueryAppliedPlanRequest + * @static + * @param {cosmos.upgrade.v1beta1.IQueryAppliedPlanRequest=} [properties] Properties to set + * @returns {cosmos.upgrade.v1beta1.QueryAppliedPlanRequest} QueryAppliedPlanRequest instance + */ + QueryAppliedPlanRequest.create = function create(properties) { + return new QueryAppliedPlanRequest(properties); + }; + + /** + * Encodes the specified QueryAppliedPlanRequest message. Does not implicitly {@link cosmos.upgrade.v1beta1.QueryAppliedPlanRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.upgrade.v1beta1.QueryAppliedPlanRequest + * @static + * @param {cosmos.upgrade.v1beta1.IQueryAppliedPlanRequest} message QueryAppliedPlanRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAppliedPlanRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified QueryAppliedPlanRequest message, length delimited. Does not implicitly {@link cosmos.upgrade.v1beta1.QueryAppliedPlanRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.upgrade.v1beta1.QueryAppliedPlanRequest + * @static + * @param {cosmos.upgrade.v1beta1.IQueryAppliedPlanRequest} message QueryAppliedPlanRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAppliedPlanRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryAppliedPlanRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.upgrade.v1beta1.QueryAppliedPlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.upgrade.v1beta1.QueryAppliedPlanRequest} QueryAppliedPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAppliedPlanRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.upgrade.v1beta1.QueryAppliedPlanRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryAppliedPlanRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.upgrade.v1beta1.QueryAppliedPlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.upgrade.v1beta1.QueryAppliedPlanRequest} QueryAppliedPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAppliedPlanRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryAppliedPlanRequest message. + * @function verify + * @memberof cosmos.upgrade.v1beta1.QueryAppliedPlanRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryAppliedPlanRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a QueryAppliedPlanRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.upgrade.v1beta1.QueryAppliedPlanRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.upgrade.v1beta1.QueryAppliedPlanRequest} QueryAppliedPlanRequest + */ + QueryAppliedPlanRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.upgrade.v1beta1.QueryAppliedPlanRequest) + return object; + let message = new $root.cosmos.upgrade.v1beta1.QueryAppliedPlanRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a QueryAppliedPlanRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.upgrade.v1beta1.QueryAppliedPlanRequest + * @static + * @param {cosmos.upgrade.v1beta1.QueryAppliedPlanRequest} message QueryAppliedPlanRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryAppliedPlanRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this QueryAppliedPlanRequest to JSON. + * @function toJSON + * @memberof cosmos.upgrade.v1beta1.QueryAppliedPlanRequest + * @instance + * @returns {Object.} JSON object + */ + QueryAppliedPlanRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryAppliedPlanRequest; + })(v1beta1.QueryAppliedPlanRequest || {}); + + v1beta1.QueryAppliedPlanResponse = (function(QueryAppliedPlanResponse) { + + /** + * Properties of a QueryAppliedPlanResponse. + * @memberof cosmos.upgrade.v1beta1 + * @interface IQueryAppliedPlanResponse + * @property {number|Long|null} [height] QueryAppliedPlanResponse height + */ + + /** + * Constructs a new QueryAppliedPlanResponse. + * @memberof cosmos.upgrade.v1beta1 + * @classdesc Represents a QueryAppliedPlanResponse. + * @implements IQueryAppliedPlanResponse + * @constructor + * @param {cosmos.upgrade.v1beta1.IQueryAppliedPlanResponse=} [properties] Properties to set + */ + function QueryAppliedPlanResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryAppliedPlanResponse height. + * @member {number|Long} height + * @memberof cosmos.upgrade.v1beta1.QueryAppliedPlanResponse + * @instance + */ + QueryAppliedPlanResponse.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new QueryAppliedPlanResponse instance using the specified properties. + * @function create + * @memberof cosmos.upgrade.v1beta1.QueryAppliedPlanResponse + * @static + * @param {cosmos.upgrade.v1beta1.IQueryAppliedPlanResponse=} [properties] Properties to set + * @returns {cosmos.upgrade.v1beta1.QueryAppliedPlanResponse} QueryAppliedPlanResponse instance + */ + QueryAppliedPlanResponse.create = function create(properties) { + return new QueryAppliedPlanResponse(properties); + }; + + /** + * Encodes the specified QueryAppliedPlanResponse message. Does not implicitly {@link cosmos.upgrade.v1beta1.QueryAppliedPlanResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.upgrade.v1beta1.QueryAppliedPlanResponse + * @static + * @param {cosmos.upgrade.v1beta1.IQueryAppliedPlanResponse} message QueryAppliedPlanResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAppliedPlanResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.height); + return writer; + }; + + /** + * Encodes the specified QueryAppliedPlanResponse message, length delimited. Does not implicitly {@link cosmos.upgrade.v1beta1.QueryAppliedPlanResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.upgrade.v1beta1.QueryAppliedPlanResponse + * @static + * @param {cosmos.upgrade.v1beta1.IQueryAppliedPlanResponse} message QueryAppliedPlanResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAppliedPlanResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryAppliedPlanResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.upgrade.v1beta1.QueryAppliedPlanResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.upgrade.v1beta1.QueryAppliedPlanResponse} QueryAppliedPlanResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAppliedPlanResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.upgrade.v1beta1.QueryAppliedPlanResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryAppliedPlanResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.upgrade.v1beta1.QueryAppliedPlanResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.upgrade.v1beta1.QueryAppliedPlanResponse} QueryAppliedPlanResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAppliedPlanResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryAppliedPlanResponse message. + * @function verify + * @memberof cosmos.upgrade.v1beta1.QueryAppliedPlanResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryAppliedPlanResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + return null; + }; + + /** + * Creates a QueryAppliedPlanResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.upgrade.v1beta1.QueryAppliedPlanResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.upgrade.v1beta1.QueryAppliedPlanResponse} QueryAppliedPlanResponse + */ + QueryAppliedPlanResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.upgrade.v1beta1.QueryAppliedPlanResponse) + return object; + let message = new $root.cosmos.upgrade.v1beta1.QueryAppliedPlanResponse(); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a QueryAppliedPlanResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.upgrade.v1beta1.QueryAppliedPlanResponse + * @static + * @param {cosmos.upgrade.v1beta1.QueryAppliedPlanResponse} message QueryAppliedPlanResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryAppliedPlanResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + return object; + }; + + /** + * Converts this QueryAppliedPlanResponse to JSON. + * @function toJSON + * @memberof cosmos.upgrade.v1beta1.QueryAppliedPlanResponse + * @instance + * @returns {Object.} JSON object + */ + QueryAppliedPlanResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryAppliedPlanResponse; + })(v1beta1.QueryAppliedPlanResponse || {}); + + v1beta1.QueryUpgradedConsensusStateRequest = (function(QueryUpgradedConsensusStateRequest) { + + /** + * Properties of a QueryUpgradedConsensusStateRequest. + * @memberof cosmos.upgrade.v1beta1 + * @interface IQueryUpgradedConsensusStateRequest + * @property {number|Long|null} [lastHeight] QueryUpgradedConsensusStateRequest lastHeight + */ + + /** + * Constructs a new QueryUpgradedConsensusStateRequest. + * @memberof cosmos.upgrade.v1beta1 + * @classdesc Represents a QueryUpgradedConsensusStateRequest. + * @implements IQueryUpgradedConsensusStateRequest + * @constructor + * @param {cosmos.upgrade.v1beta1.IQueryUpgradedConsensusStateRequest=} [properties] Properties to set + */ + function QueryUpgradedConsensusStateRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryUpgradedConsensusStateRequest lastHeight. + * @member {number|Long} lastHeight + * @memberof cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest + * @instance + */ + QueryUpgradedConsensusStateRequest.prototype.lastHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new QueryUpgradedConsensusStateRequest instance using the specified properties. + * @function create + * @memberof cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest + * @static + * @param {cosmos.upgrade.v1beta1.IQueryUpgradedConsensusStateRequest=} [properties] Properties to set + * @returns {cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest} QueryUpgradedConsensusStateRequest instance + */ + QueryUpgradedConsensusStateRequest.create = function create(properties) { + return new QueryUpgradedConsensusStateRequest(properties); + }; + + /** + * Encodes the specified QueryUpgradedConsensusStateRequest message. Does not implicitly {@link cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest + * @static + * @param {cosmos.upgrade.v1beta1.IQueryUpgradedConsensusStateRequest} message QueryUpgradedConsensusStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryUpgradedConsensusStateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lastHeight != null && Object.hasOwnProperty.call(message, "lastHeight")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.lastHeight); + return writer; + }; + + /** + * Encodes the specified QueryUpgradedConsensusStateRequest message, length delimited. Does not implicitly {@link cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest + * @static + * @param {cosmos.upgrade.v1beta1.IQueryUpgradedConsensusStateRequest} message QueryUpgradedConsensusStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryUpgradedConsensusStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryUpgradedConsensusStateRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest} QueryUpgradedConsensusStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryUpgradedConsensusStateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lastHeight = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryUpgradedConsensusStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest} QueryUpgradedConsensusStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryUpgradedConsensusStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryUpgradedConsensusStateRequest message. + * @function verify + * @memberof cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryUpgradedConsensusStateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.lastHeight != null && message.hasOwnProperty("lastHeight")) + if (!$util.isInteger(message.lastHeight) && !(message.lastHeight && $util.isInteger(message.lastHeight.low) && $util.isInteger(message.lastHeight.high))) + return "lastHeight: integer|Long expected"; + return null; + }; + + /** + * Creates a QueryUpgradedConsensusStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest} QueryUpgradedConsensusStateRequest + */ + QueryUpgradedConsensusStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest) + return object; + let message = new $root.cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest(); + if (object.lastHeight != null) + if ($util.Long) + (message.lastHeight = $util.Long.fromValue(object.lastHeight)).unsigned = false; + else if (typeof object.lastHeight === "string") + message.lastHeight = parseInt(object.lastHeight, 10); + else if (typeof object.lastHeight === "number") + message.lastHeight = object.lastHeight; + else if (typeof object.lastHeight === "object") + message.lastHeight = new $util.LongBits(object.lastHeight.low >>> 0, object.lastHeight.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a QueryUpgradedConsensusStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest + * @static + * @param {cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest} message QueryUpgradedConsensusStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryUpgradedConsensusStateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.lastHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.lastHeight = options.longs === String ? "0" : 0; + if (message.lastHeight != null && message.hasOwnProperty("lastHeight")) + if (typeof message.lastHeight === "number") + object.lastHeight = options.longs === String ? String(message.lastHeight) : message.lastHeight; + else + object.lastHeight = options.longs === String ? $util.Long.prototype.toString.call(message.lastHeight) : options.longs === Number ? new $util.LongBits(message.lastHeight.low >>> 0, message.lastHeight.high >>> 0).toNumber() : message.lastHeight; + return object; + }; + + /** + * Converts this QueryUpgradedConsensusStateRequest to JSON. + * @function toJSON + * @memberof cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest + * @instance + * @returns {Object.} JSON object + */ + QueryUpgradedConsensusStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryUpgradedConsensusStateRequest; + })(v1beta1.QueryUpgradedConsensusStateRequest || {}); + + v1beta1.QueryUpgradedConsensusStateResponse = (function(QueryUpgradedConsensusStateResponse) { + + /** + * Properties of a QueryUpgradedConsensusStateResponse. + * @memberof cosmos.upgrade.v1beta1 + * @interface IQueryUpgradedConsensusStateResponse + * @property {google.protobuf.IAny|null} [upgradedConsensusState] QueryUpgradedConsensusStateResponse upgradedConsensusState + */ + + /** + * Constructs a new QueryUpgradedConsensusStateResponse. + * @memberof cosmos.upgrade.v1beta1 + * @classdesc Represents a QueryUpgradedConsensusStateResponse. + * @implements IQueryUpgradedConsensusStateResponse + * @constructor + * @param {cosmos.upgrade.v1beta1.IQueryUpgradedConsensusStateResponse=} [properties] Properties to set + */ + function QueryUpgradedConsensusStateResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryUpgradedConsensusStateResponse upgradedConsensusState. + * @member {google.protobuf.IAny|null|undefined} upgradedConsensusState + * @memberof cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse + * @instance + */ + QueryUpgradedConsensusStateResponse.prototype.upgradedConsensusState = null; + + /** + * Creates a new QueryUpgradedConsensusStateResponse instance using the specified properties. + * @function create + * @memberof cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse + * @static + * @param {cosmos.upgrade.v1beta1.IQueryUpgradedConsensusStateResponse=} [properties] Properties to set + * @returns {cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse} QueryUpgradedConsensusStateResponse instance + */ + QueryUpgradedConsensusStateResponse.create = function create(properties) { + return new QueryUpgradedConsensusStateResponse(properties); + }; + + /** + * Encodes the specified QueryUpgradedConsensusStateResponse message. Does not implicitly {@link cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse + * @static + * @param {cosmos.upgrade.v1beta1.IQueryUpgradedConsensusStateResponse} message QueryUpgradedConsensusStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryUpgradedConsensusStateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.upgradedConsensusState != null && Object.hasOwnProperty.call(message, "upgradedConsensusState")) + $root.google.protobuf.Any.encode(message.upgradedConsensusState, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryUpgradedConsensusStateResponse message, length delimited. Does not implicitly {@link cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse + * @static + * @param {cosmos.upgrade.v1beta1.IQueryUpgradedConsensusStateResponse} message QueryUpgradedConsensusStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryUpgradedConsensusStateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryUpgradedConsensusStateResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse} QueryUpgradedConsensusStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryUpgradedConsensusStateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.upgradedConsensusState = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryUpgradedConsensusStateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse} QueryUpgradedConsensusStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryUpgradedConsensusStateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryUpgradedConsensusStateResponse message. + * @function verify + * @memberof cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryUpgradedConsensusStateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.upgradedConsensusState != null && message.hasOwnProperty("upgradedConsensusState")) { + let error = $root.google.protobuf.Any.verify(message.upgradedConsensusState); + if (error) + return "upgradedConsensusState." + error; + } + return null; + }; + + /** + * Creates a QueryUpgradedConsensusStateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse} QueryUpgradedConsensusStateResponse + */ + QueryUpgradedConsensusStateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse) + return object; + let message = new $root.cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse(); + if (object.upgradedConsensusState != null) { + if (typeof object.upgradedConsensusState !== "object") + throw TypeError(".cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse.upgradedConsensusState: object expected"); + message.upgradedConsensusState = $root.google.protobuf.Any.fromObject(object.upgradedConsensusState); + } + return message; + }; + + /** + * Creates a plain object from a QueryUpgradedConsensusStateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse + * @static + * @param {cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse} message QueryUpgradedConsensusStateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryUpgradedConsensusStateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.upgradedConsensusState = null; + if (message.upgradedConsensusState != null && message.hasOwnProperty("upgradedConsensusState")) + object.upgradedConsensusState = $root.google.protobuf.Any.toObject(message.upgradedConsensusState, options); + return object; + }; + + /** + * Converts this QueryUpgradedConsensusStateResponse to JSON. + * @function toJSON + * @memberof cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse + * @instance + * @returns {Object.} JSON object + */ + QueryUpgradedConsensusStateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryUpgradedConsensusStateResponse; + })(v1beta1.QueryUpgradedConsensusStateResponse || {}); + + v1beta1.Plan = (function(Plan) { + + /** + * Properties of a Plan. + * @memberof cosmos.upgrade.v1beta1 + * @interface IPlan + * @property {string|null} [name] Plan name + * @property {google.protobuf.ITimestamp|null} [time] Plan time + * @property {number|Long|null} [height] Plan height + * @property {string|null} [info] Plan info + * @property {google.protobuf.IAny|null} [upgradedClientState] Plan upgradedClientState + */ + + /** + * Constructs a new Plan. + * @memberof cosmos.upgrade.v1beta1 + * @classdesc Represents a Plan. + * @implements IPlan + * @constructor + * @param {cosmos.upgrade.v1beta1.IPlan=} [properties] Properties to set + */ + function Plan(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Plan name. + * @member {string} name + * @memberof cosmos.upgrade.v1beta1.Plan + * @instance + */ + Plan.prototype.name = ""; + + /** + * Plan time. + * @member {google.protobuf.ITimestamp|null|undefined} time + * @memberof cosmos.upgrade.v1beta1.Plan + * @instance + */ + Plan.prototype.time = null; + + /** + * Plan height. + * @member {number|Long} height + * @memberof cosmos.upgrade.v1beta1.Plan + * @instance + */ + Plan.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Plan info. + * @member {string} info + * @memberof cosmos.upgrade.v1beta1.Plan + * @instance + */ + Plan.prototype.info = ""; + + /** + * Plan upgradedClientState. + * @member {google.protobuf.IAny|null|undefined} upgradedClientState + * @memberof cosmos.upgrade.v1beta1.Plan + * @instance + */ + Plan.prototype.upgradedClientState = null; + + /** + * Creates a new Plan instance using the specified properties. + * @function create + * @memberof cosmos.upgrade.v1beta1.Plan + * @static + * @param {cosmos.upgrade.v1beta1.IPlan=} [properties] Properties to set + * @returns {cosmos.upgrade.v1beta1.Plan} Plan instance + */ + Plan.create = function create(properties) { + return new Plan(properties); + }; + + /** + * Encodes the specified Plan message. Does not implicitly {@link cosmos.upgrade.v1beta1.Plan.verify|verify} messages. + * @function encode + * @memberof cosmos.upgrade.v1beta1.Plan + * @static + * @param {cosmos.upgrade.v1beta1.IPlan} message Plan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Plan.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.time != null && Object.hasOwnProperty.call(message, "time")) + $root.google.protobuf.Timestamp.encode(message.time, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.height); + if (message.info != null && Object.hasOwnProperty.call(message, "info")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.info); + if (message.upgradedClientState != null && Object.hasOwnProperty.call(message, "upgradedClientState")) + $root.google.protobuf.Any.encode(message.upgradedClientState, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Plan message, length delimited. Does not implicitly {@link cosmos.upgrade.v1beta1.Plan.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.upgrade.v1beta1.Plan + * @static + * @param {cosmos.upgrade.v1beta1.IPlan} message Plan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Plan.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Plan message from the specified reader or buffer. + * @function decode + * @memberof cosmos.upgrade.v1beta1.Plan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.upgrade.v1beta1.Plan} Plan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Plan.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.upgrade.v1beta1.Plan(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.height = reader.int64(); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.upgradedClientState = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Plan message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.upgrade.v1beta1.Plan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.upgrade.v1beta1.Plan} Plan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Plan.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Plan message. + * @function verify + * @memberof cosmos.upgrade.v1beta1.Plan + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Plan.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.time != null && message.hasOwnProperty("time")) { + let error = $root.google.protobuf.Timestamp.verify(message.time); + if (error) + return "time." + error; + } + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.info != null && message.hasOwnProperty("info")) + if (!$util.isString(message.info)) + return "info: string expected"; + if (message.upgradedClientState != null && message.hasOwnProperty("upgradedClientState")) { + let error = $root.google.protobuf.Any.verify(message.upgradedClientState); + if (error) + return "upgradedClientState." + error; + } + return null; + }; + + /** + * Creates a Plan message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.upgrade.v1beta1.Plan + * @static + * @param {Object.} object Plain object + * @returns {cosmos.upgrade.v1beta1.Plan} Plan + */ + Plan.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.upgrade.v1beta1.Plan) + return object; + let message = new $root.cosmos.upgrade.v1beta1.Plan(); + if (object.name != null) + message.name = String(object.name); + if (object.time != null) { + if (typeof object.time !== "object") + throw TypeError(".cosmos.upgrade.v1beta1.Plan.time: object expected"); + message.time = $root.google.protobuf.Timestamp.fromObject(object.time); + } + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + if (object.info != null) + message.info = String(object.info); + if (object.upgradedClientState != null) { + if (typeof object.upgradedClientState !== "object") + throw TypeError(".cosmos.upgrade.v1beta1.Plan.upgradedClientState: object expected"); + message.upgradedClientState = $root.google.protobuf.Any.fromObject(object.upgradedClientState); + } + return message; + }; + + /** + * Creates a plain object from a Plan message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.upgrade.v1beta1.Plan + * @static + * @param {cosmos.upgrade.v1beta1.Plan} message Plan + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Plan.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.name = ""; + object.time = null; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.info = ""; + object.upgradedClientState = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.time != null && message.hasOwnProperty("time")) + object.time = $root.google.protobuf.Timestamp.toObject(message.time, options); + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + if (message.info != null && message.hasOwnProperty("info")) + object.info = message.info; + if (message.upgradedClientState != null && message.hasOwnProperty("upgradedClientState")) + object.upgradedClientState = $root.google.protobuf.Any.toObject(message.upgradedClientState, options); + return object; + }; + + /** + * Converts this Plan to JSON. + * @function toJSON + * @memberof cosmos.upgrade.v1beta1.Plan + * @instance + * @returns {Object.} JSON object + */ + Plan.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Plan; + })(v1beta1.Plan || {}); + + v1beta1.SoftwareUpgradeProposal = (function(SoftwareUpgradeProposal) { + + /** + * Properties of a SoftwareUpgradeProposal. + * @memberof cosmos.upgrade.v1beta1 + * @interface ISoftwareUpgradeProposal + * @property {string|null} [title] SoftwareUpgradeProposal title + * @property {string|null} [description] SoftwareUpgradeProposal description + * @property {cosmos.upgrade.v1beta1.IPlan|null} [plan] SoftwareUpgradeProposal plan + */ + + /** + * Constructs a new SoftwareUpgradeProposal. + * @memberof cosmos.upgrade.v1beta1 + * @classdesc Represents a SoftwareUpgradeProposal. + * @implements ISoftwareUpgradeProposal + * @constructor + * @param {cosmos.upgrade.v1beta1.ISoftwareUpgradeProposal=} [properties] Properties to set + */ + function SoftwareUpgradeProposal(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SoftwareUpgradeProposal title. + * @member {string} title + * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal + * @instance + */ + SoftwareUpgradeProposal.prototype.title = ""; + + /** + * SoftwareUpgradeProposal description. + * @member {string} description + * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal + * @instance + */ + SoftwareUpgradeProposal.prototype.description = ""; + + /** + * SoftwareUpgradeProposal plan. + * @member {cosmos.upgrade.v1beta1.IPlan|null|undefined} plan + * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal + * @instance + */ + SoftwareUpgradeProposal.prototype.plan = null; + + /** + * Creates a new SoftwareUpgradeProposal instance using the specified properties. + * @function create + * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal + * @static + * @param {cosmos.upgrade.v1beta1.ISoftwareUpgradeProposal=} [properties] Properties to set + * @returns {cosmos.upgrade.v1beta1.SoftwareUpgradeProposal} SoftwareUpgradeProposal instance + */ + SoftwareUpgradeProposal.create = function create(properties) { + return new SoftwareUpgradeProposal(properties); + }; + + /** + * Encodes the specified SoftwareUpgradeProposal message. Does not implicitly {@link cosmos.upgrade.v1beta1.SoftwareUpgradeProposal.verify|verify} messages. + * @function encode + * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal + * @static + * @param {cosmos.upgrade.v1beta1.ISoftwareUpgradeProposal} message SoftwareUpgradeProposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SoftwareUpgradeProposal.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.plan != null && Object.hasOwnProperty.call(message, "plan")) + $root.cosmos.upgrade.v1beta1.Plan.encode(message.plan, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SoftwareUpgradeProposal message, length delimited. Does not implicitly {@link cosmos.upgrade.v1beta1.SoftwareUpgradeProposal.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal + * @static + * @param {cosmos.upgrade.v1beta1.ISoftwareUpgradeProposal} message SoftwareUpgradeProposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SoftwareUpgradeProposal.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SoftwareUpgradeProposal message from the specified reader or buffer. + * @function decode + * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.upgrade.v1beta1.SoftwareUpgradeProposal} SoftwareUpgradeProposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SoftwareUpgradeProposal.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.upgrade.v1beta1.SoftwareUpgradeProposal(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.plan = $root.cosmos.upgrade.v1beta1.Plan.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SoftwareUpgradeProposal message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.upgrade.v1beta1.SoftwareUpgradeProposal} SoftwareUpgradeProposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SoftwareUpgradeProposal.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SoftwareUpgradeProposal message. + * @function verify + * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SoftwareUpgradeProposal.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.plan != null && message.hasOwnProperty("plan")) { + let error = $root.cosmos.upgrade.v1beta1.Plan.verify(message.plan); + if (error) + return "plan." + error; + } + return null; + }; + + /** + * Creates a SoftwareUpgradeProposal message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal + * @static + * @param {Object.} object Plain object + * @returns {cosmos.upgrade.v1beta1.SoftwareUpgradeProposal} SoftwareUpgradeProposal + */ + SoftwareUpgradeProposal.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.upgrade.v1beta1.SoftwareUpgradeProposal) + return object; + let message = new $root.cosmos.upgrade.v1beta1.SoftwareUpgradeProposal(); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.plan != null) { + if (typeof object.plan !== "object") + throw TypeError(".cosmos.upgrade.v1beta1.SoftwareUpgradeProposal.plan: object expected"); + message.plan = $root.cosmos.upgrade.v1beta1.Plan.fromObject(object.plan); + } + return message; + }; + + /** + * Creates a plain object from a SoftwareUpgradeProposal message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal + * @static + * @param {cosmos.upgrade.v1beta1.SoftwareUpgradeProposal} message SoftwareUpgradeProposal + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SoftwareUpgradeProposal.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.title = ""; + object.description = ""; + object.plan = null; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.plan != null && message.hasOwnProperty("plan")) + object.plan = $root.cosmos.upgrade.v1beta1.Plan.toObject(message.plan, options); + return object; + }; + + /** + * Converts this SoftwareUpgradeProposal to JSON. + * @function toJSON + * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal + * @instance + * @returns {Object.} JSON object + */ + SoftwareUpgradeProposal.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SoftwareUpgradeProposal; + })(v1beta1.SoftwareUpgradeProposal || {}); + + v1beta1.CancelSoftwareUpgradeProposal = (function(CancelSoftwareUpgradeProposal) { + + /** + * Properties of a CancelSoftwareUpgradeProposal. + * @memberof cosmos.upgrade.v1beta1 + * @interface ICancelSoftwareUpgradeProposal + * @property {string|null} [title] CancelSoftwareUpgradeProposal title + * @property {string|null} [description] CancelSoftwareUpgradeProposal description + */ + + /** + * Constructs a new CancelSoftwareUpgradeProposal. + * @memberof cosmos.upgrade.v1beta1 + * @classdesc Represents a CancelSoftwareUpgradeProposal. + * @implements ICancelSoftwareUpgradeProposal + * @constructor + * @param {cosmos.upgrade.v1beta1.ICancelSoftwareUpgradeProposal=} [properties] Properties to set + */ + function CancelSoftwareUpgradeProposal(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelSoftwareUpgradeProposal title. + * @member {string} title + * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal + * @instance + */ + CancelSoftwareUpgradeProposal.prototype.title = ""; + + /** + * CancelSoftwareUpgradeProposal description. + * @member {string} description + * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal + * @instance + */ + CancelSoftwareUpgradeProposal.prototype.description = ""; + + /** + * Creates a new CancelSoftwareUpgradeProposal instance using the specified properties. + * @function create + * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal + * @static + * @param {cosmos.upgrade.v1beta1.ICancelSoftwareUpgradeProposal=} [properties] Properties to set + * @returns {cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal} CancelSoftwareUpgradeProposal instance + */ + CancelSoftwareUpgradeProposal.create = function create(properties) { + return new CancelSoftwareUpgradeProposal(properties); + }; + + /** + * Encodes the specified CancelSoftwareUpgradeProposal message. Does not implicitly {@link cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal.verify|verify} messages. + * @function encode + * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal + * @static + * @param {cosmos.upgrade.v1beta1.ICancelSoftwareUpgradeProposal} message CancelSoftwareUpgradeProposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelSoftwareUpgradeProposal.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + return writer; + }; + + /** + * Encodes the specified CancelSoftwareUpgradeProposal message, length delimited. Does not implicitly {@link cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal + * @static + * @param {cosmos.upgrade.v1beta1.ICancelSoftwareUpgradeProposal} message CancelSoftwareUpgradeProposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelSoftwareUpgradeProposal.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelSoftwareUpgradeProposal message from the specified reader or buffer. + * @function decode + * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal} CancelSoftwareUpgradeProposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelSoftwareUpgradeProposal.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelSoftwareUpgradeProposal message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal} CancelSoftwareUpgradeProposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelSoftwareUpgradeProposal.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelSoftwareUpgradeProposal message. + * @function verify + * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelSoftwareUpgradeProposal.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a CancelSoftwareUpgradeProposal message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal + * @static + * @param {Object.} object Plain object + * @returns {cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal} CancelSoftwareUpgradeProposal + */ + CancelSoftwareUpgradeProposal.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal) + return object; + let message = new $root.cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal(); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a CancelSoftwareUpgradeProposal message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal + * @static + * @param {cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal} message CancelSoftwareUpgradeProposal + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelSoftwareUpgradeProposal.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.title = ""; + object.description = ""; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this CancelSoftwareUpgradeProposal to JSON. + * @function toJSON + * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal + * @instance + * @returns {Object.} JSON object + */ + CancelSoftwareUpgradeProposal.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CancelSoftwareUpgradeProposal; + })(v1beta1.CancelSoftwareUpgradeProposal || {}); + + return v1beta1; + })(upgrade.v1beta1 || {}); + + return upgrade; + })(cosmos.upgrade || {}); + + /** + * Namespace vesting. + * @memberof cosmos + * @namespace + */ + + cosmos.vesting = (function(vesting) { + + /** + * Namespace v1beta1. + * @memberof cosmos.vesting + * @namespace + */ + + vesting.v1beta1 = (function(v1beta1) { + + v1beta1.Msg = (function(Msg) { + + /** + * Constructs a new Msg service. + * @memberof cosmos.vesting.v1beta1 + * @classdesc Represents a Msg + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Msg(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; + + /** + * Creates new Msg service using the specified rpc implementation. + * @function create + * @memberof cosmos.vesting.v1beta1.Msg + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Msg} RPC service. Useful where requests and/or responses are streamed. + */ + Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link cosmos.vesting.v1beta1.Msg#createVestingAccount}. + * @memberof cosmos.vesting.v1beta1.Msg + * @typedef CreateVestingAccountCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccountResponse} [response] MsgCreateVestingAccountResponse + */ + + /** + * Calls CreateVestingAccount. + * @function createVestingAccount + * @memberof cosmos.vesting.v1beta1.Msg + * @instance + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccount} request MsgCreateVestingAccount message or plain object + * @param {cosmos.vesting.v1beta1.Msg.CreateVestingAccountCallback} callback Node-style callback called with the error, if any, and MsgCreateVestingAccountResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.createVestingAccount = function createVestingAccount(request, callback) { + return this.rpcCall(createVestingAccount, $root.cosmos.vesting.v1beta1.MsgCreateVestingAccount, $root.cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse, request, callback); + }, "name", { value: "CreateVestingAccount" }); + + /** + * Calls CreateVestingAccount. + * @function createVestingAccount + * @memberof cosmos.vesting.v1beta1.Msg + * @instance + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccount} request MsgCreateVestingAccount message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Msg; + })(v1beta1.Msg || {}); + + v1beta1.MsgCreateVestingAccount = (function(MsgCreateVestingAccount) { + + /** + * Properties of a MsgCreateVestingAccount. + * @memberof cosmos.vesting.v1beta1 + * @interface IMsgCreateVestingAccount + * @property {string|null} [fromAddress] MsgCreateVestingAccount fromAddress + * @property {string|null} [toAddress] MsgCreateVestingAccount toAddress + * @property {Array.|null} [amount] MsgCreateVestingAccount amount + * @property {number|Long|null} [endTime] MsgCreateVestingAccount endTime + * @property {boolean|null} [delayed] MsgCreateVestingAccount delayed + */ + + /** + * Constructs a new MsgCreateVestingAccount. + * @memberof cosmos.vesting.v1beta1 + * @classdesc Represents a MsgCreateVestingAccount. + * @implements IMsgCreateVestingAccount + * @constructor + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccount=} [properties] Properties to set + */ + function MsgCreateVestingAccount(properties) { + this.amount = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgCreateVestingAccount fromAddress. + * @member {string} fromAddress + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @instance + */ + MsgCreateVestingAccount.prototype.fromAddress = ""; + + /** + * MsgCreateVestingAccount toAddress. + * @member {string} toAddress + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @instance + */ + MsgCreateVestingAccount.prototype.toAddress = ""; + + /** + * MsgCreateVestingAccount amount. + * @member {Array.} amount + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @instance + */ + MsgCreateVestingAccount.prototype.amount = $util.emptyArray; + + /** + * MsgCreateVestingAccount endTime. + * @member {number|Long} endTime + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @instance + */ + MsgCreateVestingAccount.prototype.endTime = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * MsgCreateVestingAccount delayed. + * @member {boolean} delayed + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @instance + */ + MsgCreateVestingAccount.prototype.delayed = false; + + /** + * Creates a new MsgCreateVestingAccount instance using the specified properties. + * @function create + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @static + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccount=} [properties] Properties to set + * @returns {cosmos.vesting.v1beta1.MsgCreateVestingAccount} MsgCreateVestingAccount instance + */ + MsgCreateVestingAccount.create = function create(properties) { + return new MsgCreateVestingAccount(properties); + }; + + /** + * Encodes the specified MsgCreateVestingAccount message. Does not implicitly {@link cosmos.vesting.v1beta1.MsgCreateVestingAccount.verify|verify} messages. + * @function encode + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @static + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccount} message MsgCreateVestingAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateVestingAccount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fromAddress != null && Object.hasOwnProperty.call(message, "fromAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fromAddress); + if (message.toAddress != null && Object.hasOwnProperty.call(message, "toAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.toAddress); + if (message.amount != null && message.amount.length) + for (let i = 0; i < message.amount.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.amount[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.endTime); + if (message.delayed != null && Object.hasOwnProperty.call(message, "delayed")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.delayed); + return writer; + }; + + /** + * Encodes the specified MsgCreateVestingAccount message, length delimited. Does not implicitly {@link cosmos.vesting.v1beta1.MsgCreateVestingAccount.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @static + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccount} message MsgCreateVestingAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateVestingAccount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgCreateVestingAccount message from the specified reader or buffer. + * @function decode + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.vesting.v1beta1.MsgCreateVestingAccount} MsgCreateVestingAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateVestingAccount.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.vesting.v1beta1.MsgCreateVestingAccount(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fromAddress = reader.string(); + break; + case 2: + message.toAddress = reader.string(); + break; + case 3: + if (!(message.amount && message.amount.length)) + message.amount = []; + message.amount.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + case 4: + message.endTime = reader.int64(); + break; + case 5: + message.delayed = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgCreateVestingAccount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.vesting.v1beta1.MsgCreateVestingAccount} MsgCreateVestingAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateVestingAccount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgCreateVestingAccount message. + * @function verify + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgCreateVestingAccount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fromAddress != null && message.hasOwnProperty("fromAddress")) + if (!$util.isString(message.fromAddress)) + return "fromAddress: string expected"; + if (message.toAddress != null && message.hasOwnProperty("toAddress")) + if (!$util.isString(message.toAddress)) + return "toAddress: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + if (!Array.isArray(message.amount)) + return "amount: array expected"; + for (let i = 0; i < message.amount.length; ++i) { + let error = $root.cosmos.base.v1beta1.Coin.verify(message.amount[i]); + if (error) + return "amount." + error; + } + } + if (message.endTime != null && message.hasOwnProperty("endTime")) + if (!$util.isInteger(message.endTime) && !(message.endTime && $util.isInteger(message.endTime.low) && $util.isInteger(message.endTime.high))) + return "endTime: integer|Long expected"; + if (message.delayed != null && message.hasOwnProperty("delayed")) + if (typeof message.delayed !== "boolean") + return "delayed: boolean expected"; + return null; + }; + + /** + * Creates a MsgCreateVestingAccount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @static + * @param {Object.} object Plain object + * @returns {cosmos.vesting.v1beta1.MsgCreateVestingAccount} MsgCreateVestingAccount + */ + MsgCreateVestingAccount.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.vesting.v1beta1.MsgCreateVestingAccount) + return object; + let message = new $root.cosmos.vesting.v1beta1.MsgCreateVestingAccount(); + if (object.fromAddress != null) + message.fromAddress = String(object.fromAddress); + if (object.toAddress != null) + message.toAddress = String(object.toAddress); + if (object.amount) { + if (!Array.isArray(object.amount)) + throw TypeError(".cosmos.vesting.v1beta1.MsgCreateVestingAccount.amount: array expected"); + message.amount = []; + for (let i = 0; i < object.amount.length; ++i) { + if (typeof object.amount[i] !== "object") + throw TypeError(".cosmos.vesting.v1beta1.MsgCreateVestingAccount.amount: object expected"); + message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]); + } + } + if (object.endTime != null) + if ($util.Long) + (message.endTime = $util.Long.fromValue(object.endTime)).unsigned = false; + else if (typeof object.endTime === "string") + message.endTime = parseInt(object.endTime, 10); + else if (typeof object.endTime === "number") + message.endTime = object.endTime; + else if (typeof object.endTime === "object") + message.endTime = new $util.LongBits(object.endTime.low >>> 0, object.endTime.high >>> 0).toNumber(); + if (object.delayed != null) + message.delayed = Boolean(object.delayed); + return message; + }; + + /** + * Creates a plain object from a MsgCreateVestingAccount message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @static + * @param {cosmos.vesting.v1beta1.MsgCreateVestingAccount} message MsgCreateVestingAccount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgCreateVestingAccount.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.amount = []; + if (options.defaults) { + object.fromAddress = ""; + object.toAddress = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.endTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.endTime = options.longs === String ? "0" : 0; + object.delayed = false; + } + if (message.fromAddress != null && message.hasOwnProperty("fromAddress")) + object.fromAddress = message.fromAddress; + if (message.toAddress != null && message.hasOwnProperty("toAddress")) + object.toAddress = message.toAddress; + if (message.amount && message.amount.length) { + object.amount = []; + for (let j = 0; j < message.amount.length; ++j) + object.amount[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.amount[j], options); + } + if (message.endTime != null && message.hasOwnProperty("endTime")) + if (typeof message.endTime === "number") + object.endTime = options.longs === String ? String(message.endTime) : message.endTime; + else + object.endTime = options.longs === String ? $util.Long.prototype.toString.call(message.endTime) : options.longs === Number ? new $util.LongBits(message.endTime.low >>> 0, message.endTime.high >>> 0).toNumber() : message.endTime; + if (message.delayed != null && message.hasOwnProperty("delayed")) + object.delayed = message.delayed; + return object; + }; + + /** + * Converts this MsgCreateVestingAccount to JSON. + * @function toJSON + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount + * @instance + * @returns {Object.} JSON object + */ + MsgCreateVestingAccount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgCreateVestingAccount; + })(v1beta1.MsgCreateVestingAccount || {}); + + v1beta1.MsgCreateVestingAccountResponse = (function(MsgCreateVestingAccountResponse) { + + /** + * Properties of a MsgCreateVestingAccountResponse. + * @memberof cosmos.vesting.v1beta1 + * @interface IMsgCreateVestingAccountResponse + */ + + /** + * Constructs a new MsgCreateVestingAccountResponse. + * @memberof cosmos.vesting.v1beta1 + * @classdesc Represents a MsgCreateVestingAccountResponse. + * @implements IMsgCreateVestingAccountResponse + * @constructor + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccountResponse=} [properties] Properties to set + */ + function MsgCreateVestingAccountResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgCreateVestingAccountResponse instance using the specified properties. + * @function create + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse + * @static + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccountResponse=} [properties] Properties to set + * @returns {cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse} MsgCreateVestingAccountResponse instance + */ + MsgCreateVestingAccountResponse.create = function create(properties) { + return new MsgCreateVestingAccountResponse(properties); + }; + + /** + * Encodes the specified MsgCreateVestingAccountResponse message. Does not implicitly {@link cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse + * @static + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccountResponse} message MsgCreateVestingAccountResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateVestingAccountResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgCreateVestingAccountResponse message, length delimited. Does not implicitly {@link cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse + * @static + * @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccountResponse} message MsgCreateVestingAccountResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateVestingAccountResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgCreateVestingAccountResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse} MsgCreateVestingAccountResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateVestingAccountResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgCreateVestingAccountResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse} MsgCreateVestingAccountResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateVestingAccountResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgCreateVestingAccountResponse message. + * @function verify + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgCreateVestingAccountResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgCreateVestingAccountResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse} MsgCreateVestingAccountResponse + */ + MsgCreateVestingAccountResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse) + return object; + return new $root.cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse(); + }; + + /** + * Creates a plain object from a MsgCreateVestingAccountResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse + * @static + * @param {cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse} message MsgCreateVestingAccountResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgCreateVestingAccountResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgCreateVestingAccountResponse to JSON. + * @function toJSON + * @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse + * @instance + * @returns {Object.} JSON object + */ + MsgCreateVestingAccountResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgCreateVestingAccountResponse; + })(v1beta1.MsgCreateVestingAccountResponse || {}); + + v1beta1.BaseVestingAccount = (function(BaseVestingAccount) { + + /** + * Properties of a BaseVestingAccount. + * @memberof cosmos.vesting.v1beta1 + * @interface IBaseVestingAccount + * @property {cosmos.auth.v1beta1.IBaseAccount|null} [baseAccount] BaseVestingAccount baseAccount + * @property {Array.|null} [originalVesting] BaseVestingAccount originalVesting + * @property {Array.|null} [delegatedFree] BaseVestingAccount delegatedFree + * @property {Array.|null} [delegatedVesting] BaseVestingAccount delegatedVesting + * @property {number|Long|null} [endTime] BaseVestingAccount endTime + */ + + /** + * Constructs a new BaseVestingAccount. + * @memberof cosmos.vesting.v1beta1 + * @classdesc Represents a BaseVestingAccount. + * @implements IBaseVestingAccount + * @constructor + * @param {cosmos.vesting.v1beta1.IBaseVestingAccount=} [properties] Properties to set + */ + function BaseVestingAccount(properties) { + this.originalVesting = []; + this.delegatedFree = []; + this.delegatedVesting = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BaseVestingAccount baseAccount. + * @member {cosmos.auth.v1beta1.IBaseAccount|null|undefined} baseAccount + * @memberof cosmos.vesting.v1beta1.BaseVestingAccount + * @instance + */ + BaseVestingAccount.prototype.baseAccount = null; + + /** + * BaseVestingAccount originalVesting. + * @member {Array.} originalVesting + * @memberof cosmos.vesting.v1beta1.BaseVestingAccount + * @instance + */ + BaseVestingAccount.prototype.originalVesting = $util.emptyArray; + + /** + * BaseVestingAccount delegatedFree. + * @member {Array.} delegatedFree + * @memberof cosmos.vesting.v1beta1.BaseVestingAccount + * @instance + */ + BaseVestingAccount.prototype.delegatedFree = $util.emptyArray; + + /** + * BaseVestingAccount delegatedVesting. + * @member {Array.} delegatedVesting + * @memberof cosmos.vesting.v1beta1.BaseVestingAccount + * @instance + */ + BaseVestingAccount.prototype.delegatedVesting = $util.emptyArray; + + /** + * BaseVestingAccount endTime. + * @member {number|Long} endTime + * @memberof cosmos.vesting.v1beta1.BaseVestingAccount + * @instance + */ + BaseVestingAccount.prototype.endTime = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new BaseVestingAccount instance using the specified properties. + * @function create + * @memberof cosmos.vesting.v1beta1.BaseVestingAccount + * @static + * @param {cosmos.vesting.v1beta1.IBaseVestingAccount=} [properties] Properties to set + * @returns {cosmos.vesting.v1beta1.BaseVestingAccount} BaseVestingAccount instance + */ + BaseVestingAccount.create = function create(properties) { + return new BaseVestingAccount(properties); + }; + + /** + * Encodes the specified BaseVestingAccount message. Does not implicitly {@link cosmos.vesting.v1beta1.BaseVestingAccount.verify|verify} messages. + * @function encode + * @memberof cosmos.vesting.v1beta1.BaseVestingAccount + * @static + * @param {cosmos.vesting.v1beta1.IBaseVestingAccount} message BaseVestingAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BaseVestingAccount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.baseAccount != null && Object.hasOwnProperty.call(message, "baseAccount")) + $root.cosmos.auth.v1beta1.BaseAccount.encode(message.baseAccount, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.originalVesting != null && message.originalVesting.length) + for (let i = 0; i < message.originalVesting.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.originalVesting[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.delegatedFree != null && message.delegatedFree.length) + for (let i = 0; i < message.delegatedFree.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.delegatedFree[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.delegatedVesting != null && message.delegatedVesting.length) + for (let i = 0; i < message.delegatedVesting.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.delegatedVesting[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.endTime); + return writer; + }; + + /** + * Encodes the specified BaseVestingAccount message, length delimited. Does not implicitly {@link cosmos.vesting.v1beta1.BaseVestingAccount.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.vesting.v1beta1.BaseVestingAccount + * @static + * @param {cosmos.vesting.v1beta1.IBaseVestingAccount} message BaseVestingAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BaseVestingAccount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BaseVestingAccount message from the specified reader or buffer. + * @function decode + * @memberof cosmos.vesting.v1beta1.BaseVestingAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.vesting.v1beta1.BaseVestingAccount} BaseVestingAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BaseVestingAccount.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.vesting.v1beta1.BaseVestingAccount(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseAccount = $root.cosmos.auth.v1beta1.BaseAccount.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.originalVesting && message.originalVesting.length)) + message.originalVesting = []; + message.originalVesting.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.delegatedFree && message.delegatedFree.length)) + message.delegatedFree = []; + message.delegatedFree.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.delegatedVesting && message.delegatedVesting.length)) + message.delegatedVesting = []; + message.delegatedVesting.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + case 5: + message.endTime = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BaseVestingAccount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.vesting.v1beta1.BaseVestingAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.vesting.v1beta1.BaseVestingAccount} BaseVestingAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BaseVestingAccount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BaseVestingAccount message. + * @function verify + * @memberof cosmos.vesting.v1beta1.BaseVestingAccount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BaseVestingAccount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.baseAccount != null && message.hasOwnProperty("baseAccount")) { + let error = $root.cosmos.auth.v1beta1.BaseAccount.verify(message.baseAccount); + if (error) + return "baseAccount." + error; + } + if (message.originalVesting != null && message.hasOwnProperty("originalVesting")) { + if (!Array.isArray(message.originalVesting)) + return "originalVesting: array expected"; + for (let i = 0; i < message.originalVesting.length; ++i) { + let error = $root.cosmos.base.v1beta1.Coin.verify(message.originalVesting[i]); + if (error) + return "originalVesting." + error; + } + } + if (message.delegatedFree != null && message.hasOwnProperty("delegatedFree")) { + if (!Array.isArray(message.delegatedFree)) + return "delegatedFree: array expected"; + for (let i = 0; i < message.delegatedFree.length; ++i) { + let error = $root.cosmos.base.v1beta1.Coin.verify(message.delegatedFree[i]); + if (error) + return "delegatedFree." + error; + } + } + if (message.delegatedVesting != null && message.hasOwnProperty("delegatedVesting")) { + if (!Array.isArray(message.delegatedVesting)) + return "delegatedVesting: array expected"; + for (let i = 0; i < message.delegatedVesting.length; ++i) { + let error = $root.cosmos.base.v1beta1.Coin.verify(message.delegatedVesting[i]); + if (error) + return "delegatedVesting." + error; + } + } + if (message.endTime != null && message.hasOwnProperty("endTime")) + if (!$util.isInteger(message.endTime) && !(message.endTime && $util.isInteger(message.endTime.low) && $util.isInteger(message.endTime.high))) + return "endTime: integer|Long expected"; + return null; + }; + + /** + * Creates a BaseVestingAccount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.vesting.v1beta1.BaseVestingAccount + * @static + * @param {Object.} object Plain object + * @returns {cosmos.vesting.v1beta1.BaseVestingAccount} BaseVestingAccount + */ + BaseVestingAccount.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.vesting.v1beta1.BaseVestingAccount) + return object; + let message = new $root.cosmos.vesting.v1beta1.BaseVestingAccount(); + if (object.baseAccount != null) { + if (typeof object.baseAccount !== "object") + throw TypeError(".cosmos.vesting.v1beta1.BaseVestingAccount.baseAccount: object expected"); + message.baseAccount = $root.cosmos.auth.v1beta1.BaseAccount.fromObject(object.baseAccount); + } + if (object.originalVesting) { + if (!Array.isArray(object.originalVesting)) + throw TypeError(".cosmos.vesting.v1beta1.BaseVestingAccount.originalVesting: array expected"); + message.originalVesting = []; + for (let i = 0; i < object.originalVesting.length; ++i) { + if (typeof object.originalVesting[i] !== "object") + throw TypeError(".cosmos.vesting.v1beta1.BaseVestingAccount.originalVesting: object expected"); + message.originalVesting[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.originalVesting[i]); + } + } + if (object.delegatedFree) { + if (!Array.isArray(object.delegatedFree)) + throw TypeError(".cosmos.vesting.v1beta1.BaseVestingAccount.delegatedFree: array expected"); + message.delegatedFree = []; + for (let i = 0; i < object.delegatedFree.length; ++i) { + if (typeof object.delegatedFree[i] !== "object") + throw TypeError(".cosmos.vesting.v1beta1.BaseVestingAccount.delegatedFree: object expected"); + message.delegatedFree[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.delegatedFree[i]); + } + } + if (object.delegatedVesting) { + if (!Array.isArray(object.delegatedVesting)) + throw TypeError(".cosmos.vesting.v1beta1.BaseVestingAccount.delegatedVesting: array expected"); + message.delegatedVesting = []; + for (let i = 0; i < object.delegatedVesting.length; ++i) { + if (typeof object.delegatedVesting[i] !== "object") + throw TypeError(".cosmos.vesting.v1beta1.BaseVestingAccount.delegatedVesting: object expected"); + message.delegatedVesting[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.delegatedVesting[i]); + } + } + if (object.endTime != null) + if ($util.Long) + (message.endTime = $util.Long.fromValue(object.endTime)).unsigned = false; + else if (typeof object.endTime === "string") + message.endTime = parseInt(object.endTime, 10); + else if (typeof object.endTime === "number") + message.endTime = object.endTime; + else if (typeof object.endTime === "object") + message.endTime = new $util.LongBits(object.endTime.low >>> 0, object.endTime.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a BaseVestingAccount message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.vesting.v1beta1.BaseVestingAccount + * @static + * @param {cosmos.vesting.v1beta1.BaseVestingAccount} message BaseVestingAccount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BaseVestingAccount.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) { + object.originalVesting = []; + object.delegatedFree = []; + object.delegatedVesting = []; + } + if (options.defaults) { + object.baseAccount = null; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.endTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.endTime = options.longs === String ? "0" : 0; + } + if (message.baseAccount != null && message.hasOwnProperty("baseAccount")) + object.baseAccount = $root.cosmos.auth.v1beta1.BaseAccount.toObject(message.baseAccount, options); + if (message.originalVesting && message.originalVesting.length) { + object.originalVesting = []; + for (let j = 0; j < message.originalVesting.length; ++j) + object.originalVesting[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.originalVesting[j], options); + } + if (message.delegatedFree && message.delegatedFree.length) { + object.delegatedFree = []; + for (let j = 0; j < message.delegatedFree.length; ++j) + object.delegatedFree[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.delegatedFree[j], options); + } + if (message.delegatedVesting && message.delegatedVesting.length) { + object.delegatedVesting = []; + for (let j = 0; j < message.delegatedVesting.length; ++j) + object.delegatedVesting[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.delegatedVesting[j], options); + } + if (message.endTime != null && message.hasOwnProperty("endTime")) + if (typeof message.endTime === "number") + object.endTime = options.longs === String ? String(message.endTime) : message.endTime; + else + object.endTime = options.longs === String ? $util.Long.prototype.toString.call(message.endTime) : options.longs === Number ? new $util.LongBits(message.endTime.low >>> 0, message.endTime.high >>> 0).toNumber() : message.endTime; + return object; + }; + + /** + * Converts this BaseVestingAccount to JSON. + * @function toJSON + * @memberof cosmos.vesting.v1beta1.BaseVestingAccount + * @instance + * @returns {Object.} JSON object + */ + BaseVestingAccount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BaseVestingAccount; + })(v1beta1.BaseVestingAccount || {}); + + v1beta1.ContinuousVestingAccount = (function(ContinuousVestingAccount) { + + /** + * Properties of a ContinuousVestingAccount. + * @memberof cosmos.vesting.v1beta1 + * @interface IContinuousVestingAccount + * @property {cosmos.vesting.v1beta1.IBaseVestingAccount|null} [baseVestingAccount] ContinuousVestingAccount baseVestingAccount + * @property {number|Long|null} [startTime] ContinuousVestingAccount startTime + */ + + /** + * Constructs a new ContinuousVestingAccount. + * @memberof cosmos.vesting.v1beta1 + * @classdesc Represents a ContinuousVestingAccount. + * @implements IContinuousVestingAccount + * @constructor + * @param {cosmos.vesting.v1beta1.IContinuousVestingAccount=} [properties] Properties to set + */ + function ContinuousVestingAccount(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContinuousVestingAccount baseVestingAccount. + * @member {cosmos.vesting.v1beta1.IBaseVestingAccount|null|undefined} baseVestingAccount + * @memberof cosmos.vesting.v1beta1.ContinuousVestingAccount + * @instance + */ + ContinuousVestingAccount.prototype.baseVestingAccount = null; + + /** + * ContinuousVestingAccount startTime. + * @member {number|Long} startTime + * @memberof cosmos.vesting.v1beta1.ContinuousVestingAccount + * @instance + */ + ContinuousVestingAccount.prototype.startTime = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ContinuousVestingAccount instance using the specified properties. + * @function create + * @memberof cosmos.vesting.v1beta1.ContinuousVestingAccount + * @static + * @param {cosmos.vesting.v1beta1.IContinuousVestingAccount=} [properties] Properties to set + * @returns {cosmos.vesting.v1beta1.ContinuousVestingAccount} ContinuousVestingAccount instance + */ + ContinuousVestingAccount.create = function create(properties) { + return new ContinuousVestingAccount(properties); + }; + + /** + * Encodes the specified ContinuousVestingAccount message. Does not implicitly {@link cosmos.vesting.v1beta1.ContinuousVestingAccount.verify|verify} messages. + * @function encode + * @memberof cosmos.vesting.v1beta1.ContinuousVestingAccount + * @static + * @param {cosmos.vesting.v1beta1.IContinuousVestingAccount} message ContinuousVestingAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousVestingAccount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.baseVestingAccount != null && Object.hasOwnProperty.call(message, "baseVestingAccount")) + $root.cosmos.vesting.v1beta1.BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.startTime); + return writer; + }; + + /** + * Encodes the specified ContinuousVestingAccount message, length delimited. Does not implicitly {@link cosmos.vesting.v1beta1.ContinuousVestingAccount.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.vesting.v1beta1.ContinuousVestingAccount + * @static + * @param {cosmos.vesting.v1beta1.IContinuousVestingAccount} message ContinuousVestingAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousVestingAccount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContinuousVestingAccount message from the specified reader or buffer. + * @function decode + * @memberof cosmos.vesting.v1beta1.ContinuousVestingAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.vesting.v1beta1.ContinuousVestingAccount} ContinuousVestingAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousVestingAccount.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.vesting.v1beta1.ContinuousVestingAccount(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseVestingAccount = $root.cosmos.vesting.v1beta1.BaseVestingAccount.decode(reader, reader.uint32()); + break; + case 2: + message.startTime = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContinuousVestingAccount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.vesting.v1beta1.ContinuousVestingAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.vesting.v1beta1.ContinuousVestingAccount} ContinuousVestingAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousVestingAccount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContinuousVestingAccount message. + * @function verify + * @memberof cosmos.vesting.v1beta1.ContinuousVestingAccount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContinuousVestingAccount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.baseVestingAccount != null && message.hasOwnProperty("baseVestingAccount")) { + let error = $root.cosmos.vesting.v1beta1.BaseVestingAccount.verify(message.baseVestingAccount); + if (error) + return "baseVestingAccount." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + if (!$util.isInteger(message.startTime) && !(message.startTime && $util.isInteger(message.startTime.low) && $util.isInteger(message.startTime.high))) + return "startTime: integer|Long expected"; + return null; + }; + + /** + * Creates a ContinuousVestingAccount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.vesting.v1beta1.ContinuousVestingAccount + * @static + * @param {Object.} object Plain object + * @returns {cosmos.vesting.v1beta1.ContinuousVestingAccount} ContinuousVestingAccount + */ + ContinuousVestingAccount.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.vesting.v1beta1.ContinuousVestingAccount) + return object; + let message = new $root.cosmos.vesting.v1beta1.ContinuousVestingAccount(); + if (object.baseVestingAccount != null) { + if (typeof object.baseVestingAccount !== "object") + throw TypeError(".cosmos.vesting.v1beta1.ContinuousVestingAccount.baseVestingAccount: object expected"); + message.baseVestingAccount = $root.cosmos.vesting.v1beta1.BaseVestingAccount.fromObject(object.baseVestingAccount); + } + if (object.startTime != null) + if ($util.Long) + (message.startTime = $util.Long.fromValue(object.startTime)).unsigned = false; + else if (typeof object.startTime === "string") + message.startTime = parseInt(object.startTime, 10); + else if (typeof object.startTime === "number") + message.startTime = object.startTime; + else if (typeof object.startTime === "object") + message.startTime = new $util.LongBits(object.startTime.low >>> 0, object.startTime.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ContinuousVestingAccount message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.vesting.v1beta1.ContinuousVestingAccount + * @static + * @param {cosmos.vesting.v1beta1.ContinuousVestingAccount} message ContinuousVestingAccount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContinuousVestingAccount.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.baseVestingAccount = null; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.startTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.startTime = options.longs === String ? "0" : 0; + } + if (message.baseVestingAccount != null && message.hasOwnProperty("baseVestingAccount")) + object.baseVestingAccount = $root.cosmos.vesting.v1beta1.BaseVestingAccount.toObject(message.baseVestingAccount, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + if (typeof message.startTime === "number") + object.startTime = options.longs === String ? String(message.startTime) : message.startTime; + else + object.startTime = options.longs === String ? $util.Long.prototype.toString.call(message.startTime) : options.longs === Number ? new $util.LongBits(message.startTime.low >>> 0, message.startTime.high >>> 0).toNumber() : message.startTime; + return object; + }; + + /** + * Converts this ContinuousVestingAccount to JSON. + * @function toJSON + * @memberof cosmos.vesting.v1beta1.ContinuousVestingAccount + * @instance + * @returns {Object.} JSON object + */ + ContinuousVestingAccount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContinuousVestingAccount; + })(v1beta1.ContinuousVestingAccount || {}); + + v1beta1.DelayedVestingAccount = (function(DelayedVestingAccount) { + + /** + * Properties of a DelayedVestingAccount. + * @memberof cosmos.vesting.v1beta1 + * @interface IDelayedVestingAccount + * @property {cosmos.vesting.v1beta1.IBaseVestingAccount|null} [baseVestingAccount] DelayedVestingAccount baseVestingAccount + */ + + /** + * Constructs a new DelayedVestingAccount. + * @memberof cosmos.vesting.v1beta1 + * @classdesc Represents a DelayedVestingAccount. + * @implements IDelayedVestingAccount + * @constructor + * @param {cosmos.vesting.v1beta1.IDelayedVestingAccount=} [properties] Properties to set + */ + function DelayedVestingAccount(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DelayedVestingAccount baseVestingAccount. + * @member {cosmos.vesting.v1beta1.IBaseVestingAccount|null|undefined} baseVestingAccount + * @memberof cosmos.vesting.v1beta1.DelayedVestingAccount + * @instance + */ + DelayedVestingAccount.prototype.baseVestingAccount = null; + + /** + * Creates a new DelayedVestingAccount instance using the specified properties. + * @function create + * @memberof cosmos.vesting.v1beta1.DelayedVestingAccount + * @static + * @param {cosmos.vesting.v1beta1.IDelayedVestingAccount=} [properties] Properties to set + * @returns {cosmos.vesting.v1beta1.DelayedVestingAccount} DelayedVestingAccount instance + */ + DelayedVestingAccount.create = function create(properties) { + return new DelayedVestingAccount(properties); + }; + + /** + * Encodes the specified DelayedVestingAccount message. Does not implicitly {@link cosmos.vesting.v1beta1.DelayedVestingAccount.verify|verify} messages. + * @function encode + * @memberof cosmos.vesting.v1beta1.DelayedVestingAccount + * @static + * @param {cosmos.vesting.v1beta1.IDelayedVestingAccount} message DelayedVestingAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DelayedVestingAccount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.baseVestingAccount != null && Object.hasOwnProperty.call(message, "baseVestingAccount")) + $root.cosmos.vesting.v1beta1.BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DelayedVestingAccount message, length delimited. Does not implicitly {@link cosmos.vesting.v1beta1.DelayedVestingAccount.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.vesting.v1beta1.DelayedVestingAccount + * @static + * @param {cosmos.vesting.v1beta1.IDelayedVestingAccount} message DelayedVestingAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DelayedVestingAccount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DelayedVestingAccount message from the specified reader or buffer. + * @function decode + * @memberof cosmos.vesting.v1beta1.DelayedVestingAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.vesting.v1beta1.DelayedVestingAccount} DelayedVestingAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DelayedVestingAccount.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.vesting.v1beta1.DelayedVestingAccount(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseVestingAccount = $root.cosmos.vesting.v1beta1.BaseVestingAccount.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DelayedVestingAccount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.vesting.v1beta1.DelayedVestingAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.vesting.v1beta1.DelayedVestingAccount} DelayedVestingAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DelayedVestingAccount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DelayedVestingAccount message. + * @function verify + * @memberof cosmos.vesting.v1beta1.DelayedVestingAccount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DelayedVestingAccount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.baseVestingAccount != null && message.hasOwnProperty("baseVestingAccount")) { + let error = $root.cosmos.vesting.v1beta1.BaseVestingAccount.verify(message.baseVestingAccount); + if (error) + return "baseVestingAccount." + error; + } + return null; + }; + + /** + * Creates a DelayedVestingAccount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.vesting.v1beta1.DelayedVestingAccount + * @static + * @param {Object.} object Plain object + * @returns {cosmos.vesting.v1beta1.DelayedVestingAccount} DelayedVestingAccount + */ + DelayedVestingAccount.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.vesting.v1beta1.DelayedVestingAccount) + return object; + let message = new $root.cosmos.vesting.v1beta1.DelayedVestingAccount(); + if (object.baseVestingAccount != null) { + if (typeof object.baseVestingAccount !== "object") + throw TypeError(".cosmos.vesting.v1beta1.DelayedVestingAccount.baseVestingAccount: object expected"); + message.baseVestingAccount = $root.cosmos.vesting.v1beta1.BaseVestingAccount.fromObject(object.baseVestingAccount); + } + return message; + }; + + /** + * Creates a plain object from a DelayedVestingAccount message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.vesting.v1beta1.DelayedVestingAccount + * @static + * @param {cosmos.vesting.v1beta1.DelayedVestingAccount} message DelayedVestingAccount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DelayedVestingAccount.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.baseVestingAccount = null; + if (message.baseVestingAccount != null && message.hasOwnProperty("baseVestingAccount")) + object.baseVestingAccount = $root.cosmos.vesting.v1beta1.BaseVestingAccount.toObject(message.baseVestingAccount, options); + return object; + }; + + /** + * Converts this DelayedVestingAccount to JSON. + * @function toJSON + * @memberof cosmos.vesting.v1beta1.DelayedVestingAccount + * @instance + * @returns {Object.} JSON object + */ + DelayedVestingAccount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DelayedVestingAccount; + })(v1beta1.DelayedVestingAccount || {}); + + v1beta1.Period = (function(Period) { + + /** + * Properties of a Period. + * @memberof cosmos.vesting.v1beta1 + * @interface IPeriod + * @property {number|Long|null} [length] Period length + * @property {Array.|null} [amount] Period amount + */ + + /** + * Constructs a new Period. + * @memberof cosmos.vesting.v1beta1 + * @classdesc Represents a Period. + * @implements IPeriod + * @constructor + * @param {cosmos.vesting.v1beta1.IPeriod=} [properties] Properties to set + */ + function Period(properties) { + this.amount = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Period length. + * @member {number|Long} length + * @memberof cosmos.vesting.v1beta1.Period + * @instance + */ + Period.prototype.length = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Period amount. + * @member {Array.} amount + * @memberof cosmos.vesting.v1beta1.Period + * @instance + */ + Period.prototype.amount = $util.emptyArray; + + /** + * Creates a new Period instance using the specified properties. + * @function create + * @memberof cosmos.vesting.v1beta1.Period + * @static + * @param {cosmos.vesting.v1beta1.IPeriod=} [properties] Properties to set + * @returns {cosmos.vesting.v1beta1.Period} Period instance + */ + Period.create = function create(properties) { + return new Period(properties); + }; + + /** + * Encodes the specified Period message. Does not implicitly {@link cosmos.vesting.v1beta1.Period.verify|verify} messages. + * @function encode + * @memberof cosmos.vesting.v1beta1.Period + * @static + * @param {cosmos.vesting.v1beta1.IPeriod} message Period message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Period.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.length != null && Object.hasOwnProperty.call(message, "length")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.length); + if (message.amount != null && message.amount.length) + for (let i = 0; i < message.amount.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.amount[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Period message, length delimited. Does not implicitly {@link cosmos.vesting.v1beta1.Period.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.vesting.v1beta1.Period + * @static + * @param {cosmos.vesting.v1beta1.IPeriod} message Period message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Period.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Period message from the specified reader or buffer. + * @function decode + * @memberof cosmos.vesting.v1beta1.Period + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.vesting.v1beta1.Period} Period + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Period.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.vesting.v1beta1.Period(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.length = reader.int64(); + break; + case 2: + if (!(message.amount && message.amount.length)) + message.amount = []; + message.amount.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Period message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.vesting.v1beta1.Period + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.vesting.v1beta1.Period} Period + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Period.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Period message. + * @function verify + * @memberof cosmos.vesting.v1beta1.Period + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Period.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.length != null && message.hasOwnProperty("length")) + if (!$util.isInteger(message.length) && !(message.length && $util.isInteger(message.length.low) && $util.isInteger(message.length.high))) + return "length: integer|Long expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + if (!Array.isArray(message.amount)) + return "amount: array expected"; + for (let i = 0; i < message.amount.length; ++i) { + let error = $root.cosmos.base.v1beta1.Coin.verify(message.amount[i]); + if (error) + return "amount." + error; + } + } + return null; + }; + + /** + * Creates a Period message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.vesting.v1beta1.Period + * @static + * @param {Object.} object Plain object + * @returns {cosmos.vesting.v1beta1.Period} Period + */ + Period.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.vesting.v1beta1.Period) + return object; + let message = new $root.cosmos.vesting.v1beta1.Period(); + if (object.length != null) + if ($util.Long) + (message.length = $util.Long.fromValue(object.length)).unsigned = false; + else if (typeof object.length === "string") + message.length = parseInt(object.length, 10); + else if (typeof object.length === "number") + message.length = object.length; + else if (typeof object.length === "object") + message.length = new $util.LongBits(object.length.low >>> 0, object.length.high >>> 0).toNumber(); + if (object.amount) { + if (!Array.isArray(object.amount)) + throw TypeError(".cosmos.vesting.v1beta1.Period.amount: array expected"); + message.amount = []; + for (let i = 0; i < object.amount.length; ++i) { + if (typeof object.amount[i] !== "object") + throw TypeError(".cosmos.vesting.v1beta1.Period.amount: object expected"); + message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Period message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.vesting.v1beta1.Period + * @static + * @param {cosmos.vesting.v1beta1.Period} message Period + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Period.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.amount = []; + if (options.defaults) + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.length = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.length = options.longs === String ? "0" : 0; + if (message.length != null && message.hasOwnProperty("length")) + if (typeof message.length === "number") + object.length = options.longs === String ? String(message.length) : message.length; + else + object.length = options.longs === String ? $util.Long.prototype.toString.call(message.length) : options.longs === Number ? new $util.LongBits(message.length.low >>> 0, message.length.high >>> 0).toNumber() : message.length; + if (message.amount && message.amount.length) { + object.amount = []; + for (let j = 0; j < message.amount.length; ++j) + object.amount[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.amount[j], options); + } + return object; + }; + + /** + * Converts this Period to JSON. + * @function toJSON + * @memberof cosmos.vesting.v1beta1.Period + * @instance + * @returns {Object.} JSON object + */ + Period.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Period; + })(v1beta1.Period || {}); + + v1beta1.PeriodicVestingAccount = (function(PeriodicVestingAccount) { + + /** + * Properties of a PeriodicVestingAccount. + * @memberof cosmos.vesting.v1beta1 + * @interface IPeriodicVestingAccount + * @property {cosmos.vesting.v1beta1.IBaseVestingAccount|null} [baseVestingAccount] PeriodicVestingAccount baseVestingAccount + * @property {number|Long|null} [startTime] PeriodicVestingAccount startTime + * @property {Array.|null} [vestingPeriods] PeriodicVestingAccount vestingPeriods + */ + + /** + * Constructs a new PeriodicVestingAccount. + * @memberof cosmos.vesting.v1beta1 + * @classdesc Represents a PeriodicVestingAccount. + * @implements IPeriodicVestingAccount + * @constructor + * @param {cosmos.vesting.v1beta1.IPeriodicVestingAccount=} [properties] Properties to set + */ + function PeriodicVestingAccount(properties) { + this.vestingPeriods = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PeriodicVestingAccount baseVestingAccount. + * @member {cosmos.vesting.v1beta1.IBaseVestingAccount|null|undefined} baseVestingAccount + * @memberof cosmos.vesting.v1beta1.PeriodicVestingAccount + * @instance + */ + PeriodicVestingAccount.prototype.baseVestingAccount = null; + + /** + * PeriodicVestingAccount startTime. + * @member {number|Long} startTime + * @memberof cosmos.vesting.v1beta1.PeriodicVestingAccount + * @instance + */ + PeriodicVestingAccount.prototype.startTime = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PeriodicVestingAccount vestingPeriods. + * @member {Array.} vestingPeriods + * @memberof cosmos.vesting.v1beta1.PeriodicVestingAccount + * @instance + */ + PeriodicVestingAccount.prototype.vestingPeriods = $util.emptyArray; + + /** + * Creates a new PeriodicVestingAccount instance using the specified properties. + * @function create + * @memberof cosmos.vesting.v1beta1.PeriodicVestingAccount + * @static + * @param {cosmos.vesting.v1beta1.IPeriodicVestingAccount=} [properties] Properties to set + * @returns {cosmos.vesting.v1beta1.PeriodicVestingAccount} PeriodicVestingAccount instance + */ + PeriodicVestingAccount.create = function create(properties) { + return new PeriodicVestingAccount(properties); + }; + + /** + * Encodes the specified PeriodicVestingAccount message. Does not implicitly {@link cosmos.vesting.v1beta1.PeriodicVestingAccount.verify|verify} messages. + * @function encode + * @memberof cosmos.vesting.v1beta1.PeriodicVestingAccount + * @static + * @param {cosmos.vesting.v1beta1.IPeriodicVestingAccount} message PeriodicVestingAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PeriodicVestingAccount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.baseVestingAccount != null && Object.hasOwnProperty.call(message, "baseVestingAccount")) + $root.cosmos.vesting.v1beta1.BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.startTime); + if (message.vestingPeriods != null && message.vestingPeriods.length) + for (let i = 0; i < message.vestingPeriods.length; ++i) + $root.cosmos.vesting.v1beta1.Period.encode(message.vestingPeriods[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PeriodicVestingAccount message, length delimited. Does not implicitly {@link cosmos.vesting.v1beta1.PeriodicVestingAccount.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.vesting.v1beta1.PeriodicVestingAccount + * @static + * @param {cosmos.vesting.v1beta1.IPeriodicVestingAccount} message PeriodicVestingAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PeriodicVestingAccount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PeriodicVestingAccount message from the specified reader or buffer. + * @function decode + * @memberof cosmos.vesting.v1beta1.PeriodicVestingAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.vesting.v1beta1.PeriodicVestingAccount} PeriodicVestingAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PeriodicVestingAccount.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.vesting.v1beta1.PeriodicVestingAccount(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseVestingAccount = $root.cosmos.vesting.v1beta1.BaseVestingAccount.decode(reader, reader.uint32()); + break; + case 2: + message.startTime = reader.int64(); + break; + case 3: + if (!(message.vestingPeriods && message.vestingPeriods.length)) + message.vestingPeriods = []; + message.vestingPeriods.push($root.cosmos.vesting.v1beta1.Period.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PeriodicVestingAccount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.vesting.v1beta1.PeriodicVestingAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.vesting.v1beta1.PeriodicVestingAccount} PeriodicVestingAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PeriodicVestingAccount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PeriodicVestingAccount message. + * @function verify + * @memberof cosmos.vesting.v1beta1.PeriodicVestingAccount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PeriodicVestingAccount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.baseVestingAccount != null && message.hasOwnProperty("baseVestingAccount")) { + let error = $root.cosmos.vesting.v1beta1.BaseVestingAccount.verify(message.baseVestingAccount); + if (error) + return "baseVestingAccount." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + if (!$util.isInteger(message.startTime) && !(message.startTime && $util.isInteger(message.startTime.low) && $util.isInteger(message.startTime.high))) + return "startTime: integer|Long expected"; + if (message.vestingPeriods != null && message.hasOwnProperty("vestingPeriods")) { + if (!Array.isArray(message.vestingPeriods)) + return "vestingPeriods: array expected"; + for (let i = 0; i < message.vestingPeriods.length; ++i) { + let error = $root.cosmos.vesting.v1beta1.Period.verify(message.vestingPeriods[i]); + if (error) + return "vestingPeriods." + error; + } + } + return null; + }; + + /** + * Creates a PeriodicVestingAccount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.vesting.v1beta1.PeriodicVestingAccount + * @static + * @param {Object.} object Plain object + * @returns {cosmos.vesting.v1beta1.PeriodicVestingAccount} PeriodicVestingAccount + */ + PeriodicVestingAccount.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.vesting.v1beta1.PeriodicVestingAccount) + return object; + let message = new $root.cosmos.vesting.v1beta1.PeriodicVestingAccount(); + if (object.baseVestingAccount != null) { + if (typeof object.baseVestingAccount !== "object") + throw TypeError(".cosmos.vesting.v1beta1.PeriodicVestingAccount.baseVestingAccount: object expected"); + message.baseVestingAccount = $root.cosmos.vesting.v1beta1.BaseVestingAccount.fromObject(object.baseVestingAccount); + } + if (object.startTime != null) + if ($util.Long) + (message.startTime = $util.Long.fromValue(object.startTime)).unsigned = false; + else if (typeof object.startTime === "string") + message.startTime = parseInt(object.startTime, 10); + else if (typeof object.startTime === "number") + message.startTime = object.startTime; + else if (typeof object.startTime === "object") + message.startTime = new $util.LongBits(object.startTime.low >>> 0, object.startTime.high >>> 0).toNumber(); + if (object.vestingPeriods) { + if (!Array.isArray(object.vestingPeriods)) + throw TypeError(".cosmos.vesting.v1beta1.PeriodicVestingAccount.vestingPeriods: array expected"); + message.vestingPeriods = []; + for (let i = 0; i < object.vestingPeriods.length; ++i) { + if (typeof object.vestingPeriods[i] !== "object") + throw TypeError(".cosmos.vesting.v1beta1.PeriodicVestingAccount.vestingPeriods: object expected"); + message.vestingPeriods[i] = $root.cosmos.vesting.v1beta1.Period.fromObject(object.vestingPeriods[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PeriodicVestingAccount message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.vesting.v1beta1.PeriodicVestingAccount + * @static + * @param {cosmos.vesting.v1beta1.PeriodicVestingAccount} message PeriodicVestingAccount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PeriodicVestingAccount.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.vestingPeriods = []; + if (options.defaults) { + object.baseVestingAccount = null; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.startTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.startTime = options.longs === String ? "0" : 0; + } + if (message.baseVestingAccount != null && message.hasOwnProperty("baseVestingAccount")) + object.baseVestingAccount = $root.cosmos.vesting.v1beta1.BaseVestingAccount.toObject(message.baseVestingAccount, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + if (typeof message.startTime === "number") + object.startTime = options.longs === String ? String(message.startTime) : message.startTime; + else + object.startTime = options.longs === String ? $util.Long.prototype.toString.call(message.startTime) : options.longs === Number ? new $util.LongBits(message.startTime.low >>> 0, message.startTime.high >>> 0).toNumber() : message.startTime; + if (message.vestingPeriods && message.vestingPeriods.length) { + object.vestingPeriods = []; + for (let j = 0; j < message.vestingPeriods.length; ++j) + object.vestingPeriods[j] = $root.cosmos.vesting.v1beta1.Period.toObject(message.vestingPeriods[j], options); + } + return object; + }; + + /** + * Converts this PeriodicVestingAccount to JSON. + * @function toJSON + * @memberof cosmos.vesting.v1beta1.PeriodicVestingAccount + * @instance + * @returns {Object.} JSON object + */ + PeriodicVestingAccount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PeriodicVestingAccount; + })(v1beta1.PeriodicVestingAccount || {}); + + return v1beta1; + })(vesting.v1beta1 || {}); + + return vesting; + })(cosmos.vesting || {}); + + return cosmos; +})($root.cosmos || {}); + +/** + * Namespace google. + * @exports google + * @namespace + */ + +export const google = $root.google = ((google) => { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + + google.protobuf = (function(protobuf) { + + protobuf.Any = (function(Any) { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type_url = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + let message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Any; + })(protobuf.Any || {}); + + protobuf.Timestamp = (function(Timestamp) { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + let message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Timestamp; + })(protobuf.Timestamp || {}); + + protobuf.Duration = (function(Duration) { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + let message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Duration; + })(protobuf.Duration || {}); + + return protobuf; + })(google.protobuf || {}); + + return google; +})($root.google || {}); + +/** + * Namespace ibc. + * @exports ibc + * @namespace + */ + +export const ibc = $root.ibc = ((ibc) => { + + /** + * Namespace applications. + * @memberof ibc + * @namespace + */ + + ibc.applications = (function(applications) { + + /** + * Namespace transfer. + * @memberof ibc.applications + * @namespace + */ + + applications.transfer = (function(transfer) { + + /** + * Namespace v1. + * @memberof ibc.applications.transfer + * @namespace + */ + + transfer.v1 = (function(v1) { + + v1.GenesisState = (function(GenesisState) { + + /** + * Properties of a GenesisState. + * @memberof ibc.applications.transfer.v1 + * @interface IGenesisState + * @property {string|null} [portId] GenesisState portId + * @property {Array.|null} [denomTraces] GenesisState denomTraces + * @property {ibc.applications.transfer.v1.IParams|null} [params] GenesisState params + */ + + /** + * Constructs a new GenesisState. + * @memberof ibc.applications.transfer.v1 + * @classdesc Represents a GenesisState. + * @implements IGenesisState + * @constructor + * @param {ibc.applications.transfer.v1.IGenesisState=} [properties] Properties to set + */ + function GenesisState(properties) { + this.denomTraces = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenesisState portId. + * @member {string} portId + * @memberof ibc.applications.transfer.v1.GenesisState + * @instance + */ + GenesisState.prototype.portId = ""; + + /** + * GenesisState denomTraces. + * @member {Array.} denomTraces + * @memberof ibc.applications.transfer.v1.GenesisState + * @instance + */ + GenesisState.prototype.denomTraces = $util.emptyArray; + + /** + * GenesisState params. + * @member {ibc.applications.transfer.v1.IParams|null|undefined} params + * @memberof ibc.applications.transfer.v1.GenesisState + * @instance + */ + GenesisState.prototype.params = null; + + /** + * Creates a new GenesisState instance using the specified properties. + * @function create + * @memberof ibc.applications.transfer.v1.GenesisState + * @static + * @param {ibc.applications.transfer.v1.IGenesisState=} [properties] Properties to set + * @returns {ibc.applications.transfer.v1.GenesisState} GenesisState instance + */ + GenesisState.create = function create(properties) { + return new GenesisState(properties); + }; + + /** + * Encodes the specified GenesisState message. Does not implicitly {@link ibc.applications.transfer.v1.GenesisState.verify|verify} messages. + * @function encode + * @memberof ibc.applications.transfer.v1.GenesisState + * @static + * @param {ibc.applications.transfer.v1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.portId != null && Object.hasOwnProperty.call(message, "portId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.portId); + if (message.denomTraces != null && message.denomTraces.length) + for (let i = 0; i < message.denomTraces.length; ++i) + $root.ibc.applications.transfer.v1.DenomTrace.encode(message.denomTraces[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.ibc.applications.transfer.v1.Params.encode(message.params, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.GenesisState.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.applications.transfer.v1.GenesisState + * @static + * @param {ibc.applications.transfer.v1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer. + * @function decode + * @memberof ibc.applications.transfer.v1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.applications.transfer.v1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.GenesisState(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + if (!(message.denomTraces && message.denomTraces.length)) + message.denomTraces = []; + message.denomTraces.push($root.ibc.applications.transfer.v1.DenomTrace.decode(reader, reader.uint32())); + break; + case 3: + message.params = $root.ibc.applications.transfer.v1.Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.applications.transfer.v1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.applications.transfer.v1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenesisState message. + * @function verify + * @memberof ibc.applications.transfer.v1.GenesisState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenesisState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.portId != null && message.hasOwnProperty("portId")) + if (!$util.isString(message.portId)) + return "portId: string expected"; + if (message.denomTraces != null && message.hasOwnProperty("denomTraces")) { + if (!Array.isArray(message.denomTraces)) + return "denomTraces: array expected"; + for (let i = 0; i < message.denomTraces.length; ++i) { + let error = $root.ibc.applications.transfer.v1.DenomTrace.verify(message.denomTraces[i]); + if (error) + return "denomTraces." + error; + } + } + if (message.params != null && message.hasOwnProperty("params")) { + let error = $root.ibc.applications.transfer.v1.Params.verify(message.params); + if (error) + return "params." + error; + } + return null; + }; + + /** + * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.applications.transfer.v1.GenesisState + * @static + * @param {Object.} object Plain object + * @returns {ibc.applications.transfer.v1.GenesisState} GenesisState + */ + GenesisState.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.applications.transfer.v1.GenesisState) + return object; + let message = new $root.ibc.applications.transfer.v1.GenesisState(); + if (object.portId != null) + message.portId = String(object.portId); + if (object.denomTraces) { + if (!Array.isArray(object.denomTraces)) + throw TypeError(".ibc.applications.transfer.v1.GenesisState.denomTraces: array expected"); + message.denomTraces = []; + for (let i = 0; i < object.denomTraces.length; ++i) { + if (typeof object.denomTraces[i] !== "object") + throw TypeError(".ibc.applications.transfer.v1.GenesisState.denomTraces: object expected"); + message.denomTraces[i] = $root.ibc.applications.transfer.v1.DenomTrace.fromObject(object.denomTraces[i]); + } + } + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".ibc.applications.transfer.v1.GenesisState.params: object expected"); + message.params = $root.ibc.applications.transfer.v1.Params.fromObject(object.params); + } + return message; + }; + + /** + * Creates a plain object from a GenesisState message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.applications.transfer.v1.GenesisState + * @static + * @param {ibc.applications.transfer.v1.GenesisState} message GenesisState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenesisState.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.denomTraces = []; + if (options.defaults) { + object.portId = ""; + object.params = null; + } + if (message.portId != null && message.hasOwnProperty("portId")) + object.portId = message.portId; + if (message.denomTraces && message.denomTraces.length) { + object.denomTraces = []; + for (let j = 0; j < message.denomTraces.length; ++j) + object.denomTraces[j] = $root.ibc.applications.transfer.v1.DenomTrace.toObject(message.denomTraces[j], options); + } + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.ibc.applications.transfer.v1.Params.toObject(message.params, options); + return object; + }; + + /** + * Converts this GenesisState to JSON. + * @function toJSON + * @memberof ibc.applications.transfer.v1.GenesisState + * @instance + * @returns {Object.} JSON object + */ + GenesisState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GenesisState; + })(v1.GenesisState || {}); + + v1.Query = (function(Query) { + + /** + * Constructs a new Query service. + * @memberof ibc.applications.transfer.v1 + * @classdesc Represents a Query + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Query(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; + + /** + * Creates new Query service using the specified rpc implementation. + * @function create + * @memberof ibc.applications.transfer.v1.Query + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Query} RPC service. Useful where requests and/or responses are streamed. + */ + Query.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link ibc.applications.transfer.v1.Query#denomTrace}. + * @memberof ibc.applications.transfer.v1.Query + * @typedef DenomTraceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.applications.transfer.v1.IQueryDenomTraceResponse} [response] QueryDenomTraceResponse + */ + + /** + * Calls DenomTrace. + * @function denomTrace + * @memberof ibc.applications.transfer.v1.Query + * @instance + * @param {ibc.applications.transfer.v1.IQueryDenomTraceRequest} request QueryDenomTraceRequest message or plain object + * @param {ibc.applications.transfer.v1.Query.DenomTraceCallback} callback Node-style callback called with the error, if any, and QueryDenomTraceResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.denomTrace = function denomTrace(request, callback) { + return this.rpcCall(denomTrace, $root.ibc.applications.transfer.v1.QueryDenomTraceRequest, $root.ibc.applications.transfer.v1.QueryDenomTraceResponse, request, callback); + }, "name", { value: "DenomTrace" }); + + /** + * Calls DenomTrace. + * @function denomTrace + * @memberof ibc.applications.transfer.v1.Query + * @instance + * @param {ibc.applications.transfer.v1.IQueryDenomTraceRequest} request QueryDenomTraceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.applications.transfer.v1.Query#denomTraces}. + * @memberof ibc.applications.transfer.v1.Query + * @typedef DenomTracesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.applications.transfer.v1.IQueryDenomTracesResponse} [response] QueryDenomTracesResponse + */ + + /** + * Calls DenomTraces. + * @function denomTraces + * @memberof ibc.applications.transfer.v1.Query + * @instance + * @param {ibc.applications.transfer.v1.IQueryDenomTracesRequest} request QueryDenomTracesRequest message or plain object + * @param {ibc.applications.transfer.v1.Query.DenomTracesCallback} callback Node-style callback called with the error, if any, and QueryDenomTracesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.denomTraces = function denomTraces(request, callback) { + return this.rpcCall(denomTraces, $root.ibc.applications.transfer.v1.QueryDenomTracesRequest, $root.ibc.applications.transfer.v1.QueryDenomTracesResponse, request, callback); + }, "name", { value: "DenomTraces" }); + + /** + * Calls DenomTraces. + * @function denomTraces + * @memberof ibc.applications.transfer.v1.Query + * @instance + * @param {ibc.applications.transfer.v1.IQueryDenomTracesRequest} request QueryDenomTracesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.applications.transfer.v1.Query#params}. + * @memberof ibc.applications.transfer.v1.Query + * @typedef ParamsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.applications.transfer.v1.IQueryParamsResponse} [response] QueryParamsResponse + */ + + /** + * Calls Params. + * @function params + * @memberof ibc.applications.transfer.v1.Query + * @instance + * @param {ibc.applications.transfer.v1.IQueryParamsRequest} request QueryParamsRequest message or plain object + * @param {ibc.applications.transfer.v1.Query.ParamsCallback} callback Node-style callback called with the error, if any, and QueryParamsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.params = function params(request, callback) { + return this.rpcCall(params, $root.ibc.applications.transfer.v1.QueryParamsRequest, $root.ibc.applications.transfer.v1.QueryParamsResponse, request, callback); + }, "name", { value: "Params" }); + + /** + * Calls Params. + * @function params + * @memberof ibc.applications.transfer.v1.Query + * @instance + * @param {ibc.applications.transfer.v1.IQueryParamsRequest} request QueryParamsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Query; + })(v1.Query || {}); + + v1.QueryDenomTraceRequest = (function(QueryDenomTraceRequest) { + + /** + * Properties of a QueryDenomTraceRequest. + * @memberof ibc.applications.transfer.v1 + * @interface IQueryDenomTraceRequest + * @property {string|null} [hash] QueryDenomTraceRequest hash + */ + + /** + * Constructs a new QueryDenomTraceRequest. + * @memberof ibc.applications.transfer.v1 + * @classdesc Represents a QueryDenomTraceRequest. + * @implements IQueryDenomTraceRequest + * @constructor + * @param {ibc.applications.transfer.v1.IQueryDenomTraceRequest=} [properties] Properties to set + */ + function QueryDenomTraceRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryDenomTraceRequest hash. + * @member {string} hash + * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest + * @instance + */ + QueryDenomTraceRequest.prototype.hash = ""; + + /** + * Creates a new QueryDenomTraceRequest instance using the specified properties. + * @function create + * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest + * @static + * @param {ibc.applications.transfer.v1.IQueryDenomTraceRequest=} [properties] Properties to set + * @returns {ibc.applications.transfer.v1.QueryDenomTraceRequest} QueryDenomTraceRequest instance + */ + QueryDenomTraceRequest.create = function create(properties) { + return new QueryDenomTraceRequest(properties); + }; + + /** + * Encodes the specified QueryDenomTraceRequest message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTraceRequest.verify|verify} messages. + * @function encode + * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest + * @static + * @param {ibc.applications.transfer.v1.IQueryDenomTraceRequest} message QueryDenomTraceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDenomTraceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.hash); + return writer; + }; + + /** + * Encodes the specified QueryDenomTraceRequest message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTraceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest + * @static + * @param {ibc.applications.transfer.v1.IQueryDenomTraceRequest} message QueryDenomTraceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDenomTraceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDenomTraceRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.applications.transfer.v1.QueryDenomTraceRequest} QueryDenomTraceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDenomTraceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryDenomTraceRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDenomTraceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.applications.transfer.v1.QueryDenomTraceRequest} QueryDenomTraceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDenomTraceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDenomTraceRequest message. + * @function verify + * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDenomTraceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!$util.isString(message.hash)) + return "hash: string expected"; + return null; + }; + + /** + * Creates a QueryDenomTraceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.applications.transfer.v1.QueryDenomTraceRequest} QueryDenomTraceRequest + */ + QueryDenomTraceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.applications.transfer.v1.QueryDenomTraceRequest) + return object; + let message = new $root.ibc.applications.transfer.v1.QueryDenomTraceRequest(); + if (object.hash != null) + message.hash = String(object.hash); + return message; + }; + + /** + * Creates a plain object from a QueryDenomTraceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest + * @static + * @param {ibc.applications.transfer.v1.QueryDenomTraceRequest} message QueryDenomTraceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDenomTraceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.hash = ""; + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = message.hash; + return object; + }; + + /** + * Converts this QueryDenomTraceRequest to JSON. + * @function toJSON + * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest + * @instance + * @returns {Object.} JSON object + */ + QueryDenomTraceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryDenomTraceRequest; + })(v1.QueryDenomTraceRequest || {}); + + v1.QueryDenomTraceResponse = (function(QueryDenomTraceResponse) { + + /** + * Properties of a QueryDenomTraceResponse. + * @memberof ibc.applications.transfer.v1 + * @interface IQueryDenomTraceResponse + * @property {ibc.applications.transfer.v1.IDenomTrace|null} [denomTrace] QueryDenomTraceResponse denomTrace + */ + + /** + * Constructs a new QueryDenomTraceResponse. + * @memberof ibc.applications.transfer.v1 + * @classdesc Represents a QueryDenomTraceResponse. + * @implements IQueryDenomTraceResponse + * @constructor + * @param {ibc.applications.transfer.v1.IQueryDenomTraceResponse=} [properties] Properties to set + */ + function QueryDenomTraceResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryDenomTraceResponse denomTrace. + * @member {ibc.applications.transfer.v1.IDenomTrace|null|undefined} denomTrace + * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse + * @instance + */ + QueryDenomTraceResponse.prototype.denomTrace = null; + + /** + * Creates a new QueryDenomTraceResponse instance using the specified properties. + * @function create + * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse + * @static + * @param {ibc.applications.transfer.v1.IQueryDenomTraceResponse=} [properties] Properties to set + * @returns {ibc.applications.transfer.v1.QueryDenomTraceResponse} QueryDenomTraceResponse instance + */ + QueryDenomTraceResponse.create = function create(properties) { + return new QueryDenomTraceResponse(properties); + }; + + /** + * Encodes the specified QueryDenomTraceResponse message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTraceResponse.verify|verify} messages. + * @function encode + * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse + * @static + * @param {ibc.applications.transfer.v1.IQueryDenomTraceResponse} message QueryDenomTraceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDenomTraceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.denomTrace != null && Object.hasOwnProperty.call(message, "denomTrace")) + $root.ibc.applications.transfer.v1.DenomTrace.encode(message.denomTrace, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryDenomTraceResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTraceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse + * @static + * @param {ibc.applications.transfer.v1.IQueryDenomTraceResponse} message QueryDenomTraceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDenomTraceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDenomTraceResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.applications.transfer.v1.QueryDenomTraceResponse} QueryDenomTraceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDenomTraceResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryDenomTraceResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denomTrace = $root.ibc.applications.transfer.v1.DenomTrace.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDenomTraceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.applications.transfer.v1.QueryDenomTraceResponse} QueryDenomTraceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDenomTraceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDenomTraceResponse message. + * @function verify + * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDenomTraceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.denomTrace != null && message.hasOwnProperty("denomTrace")) { + let error = $root.ibc.applications.transfer.v1.DenomTrace.verify(message.denomTrace); + if (error) + return "denomTrace." + error; + } + return null; + }; + + /** + * Creates a QueryDenomTraceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.applications.transfer.v1.QueryDenomTraceResponse} QueryDenomTraceResponse + */ + QueryDenomTraceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.applications.transfer.v1.QueryDenomTraceResponse) + return object; + let message = new $root.ibc.applications.transfer.v1.QueryDenomTraceResponse(); + if (object.denomTrace != null) { + if (typeof object.denomTrace !== "object") + throw TypeError(".ibc.applications.transfer.v1.QueryDenomTraceResponse.denomTrace: object expected"); + message.denomTrace = $root.ibc.applications.transfer.v1.DenomTrace.fromObject(object.denomTrace); + } + return message; + }; + + /** + * Creates a plain object from a QueryDenomTraceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse + * @static + * @param {ibc.applications.transfer.v1.QueryDenomTraceResponse} message QueryDenomTraceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDenomTraceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.denomTrace = null; + if (message.denomTrace != null && message.hasOwnProperty("denomTrace")) + object.denomTrace = $root.ibc.applications.transfer.v1.DenomTrace.toObject(message.denomTrace, options); + return object; + }; + + /** + * Converts this QueryDenomTraceResponse to JSON. + * @function toJSON + * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse + * @instance + * @returns {Object.} JSON object + */ + QueryDenomTraceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryDenomTraceResponse; + })(v1.QueryDenomTraceResponse || {}); + + v1.QueryDenomTracesRequest = (function(QueryDenomTracesRequest) { + + /** + * Properties of a QueryDenomTracesRequest. + * @memberof ibc.applications.transfer.v1 + * @interface IQueryDenomTracesRequest + * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryDenomTracesRequest pagination + */ + + /** + * Constructs a new QueryDenomTracesRequest. + * @memberof ibc.applications.transfer.v1 + * @classdesc Represents a QueryDenomTracesRequest. + * @implements IQueryDenomTracesRequest + * @constructor + * @param {ibc.applications.transfer.v1.IQueryDenomTracesRequest=} [properties] Properties to set + */ + function QueryDenomTracesRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryDenomTracesRequest pagination. + * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination + * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest + * @instance + */ + QueryDenomTracesRequest.prototype.pagination = null; + + /** + * Creates a new QueryDenomTracesRequest instance using the specified properties. + * @function create + * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest + * @static + * @param {ibc.applications.transfer.v1.IQueryDenomTracesRequest=} [properties] Properties to set + * @returns {ibc.applications.transfer.v1.QueryDenomTracesRequest} QueryDenomTracesRequest instance + */ + QueryDenomTracesRequest.create = function create(properties) { + return new QueryDenomTracesRequest(properties); + }; + + /** + * Encodes the specified QueryDenomTracesRequest message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTracesRequest.verify|verify} messages. + * @function encode + * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest + * @static + * @param {ibc.applications.transfer.v1.IQueryDenomTracesRequest} message QueryDenomTracesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDenomTracesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryDenomTracesRequest message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTracesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest + * @static + * @param {ibc.applications.transfer.v1.IQueryDenomTracesRequest} message QueryDenomTracesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDenomTracesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDenomTracesRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.applications.transfer.v1.QueryDenomTracesRequest} QueryDenomTracesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDenomTracesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryDenomTracesRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDenomTracesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.applications.transfer.v1.QueryDenomTracesRequest} QueryDenomTracesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDenomTracesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDenomTracesRequest message. + * @function verify + * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDenomTracesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryDenomTracesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.applications.transfer.v1.QueryDenomTracesRequest} QueryDenomTracesRequest + */ + QueryDenomTracesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.applications.transfer.v1.QueryDenomTracesRequest) + return object; + let message = new $root.ibc.applications.transfer.v1.QueryDenomTracesRequest(); + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".ibc.applications.transfer.v1.QueryDenomTracesRequest.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryDenomTracesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest + * @static + * @param {ibc.applications.transfer.v1.QueryDenomTracesRequest} message QueryDenomTracesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDenomTracesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.pagination = null; + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryDenomTracesRequest to JSON. + * @function toJSON + * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest + * @instance + * @returns {Object.} JSON object + */ + QueryDenomTracesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryDenomTracesRequest; + })(v1.QueryDenomTracesRequest || {}); + + v1.QueryDenomTracesResponse = (function(QueryDenomTracesResponse) { + + /** + * Properties of a QueryDenomTracesResponse. + * @memberof ibc.applications.transfer.v1 + * @interface IQueryDenomTracesResponse + * @property {Array.|null} [denomTraces] QueryDenomTracesResponse denomTraces + * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryDenomTracesResponse pagination + */ + + /** + * Constructs a new QueryDenomTracesResponse. + * @memberof ibc.applications.transfer.v1 + * @classdesc Represents a QueryDenomTracesResponse. + * @implements IQueryDenomTracesResponse + * @constructor + * @param {ibc.applications.transfer.v1.IQueryDenomTracesResponse=} [properties] Properties to set + */ + function QueryDenomTracesResponse(properties) { + this.denomTraces = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryDenomTracesResponse denomTraces. + * @member {Array.} denomTraces + * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse + * @instance + */ + QueryDenomTracesResponse.prototype.denomTraces = $util.emptyArray; + + /** + * QueryDenomTracesResponse pagination. + * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination + * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse + * @instance + */ + QueryDenomTracesResponse.prototype.pagination = null; + + /** + * Creates a new QueryDenomTracesResponse instance using the specified properties. + * @function create + * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse + * @static + * @param {ibc.applications.transfer.v1.IQueryDenomTracesResponse=} [properties] Properties to set + * @returns {ibc.applications.transfer.v1.QueryDenomTracesResponse} QueryDenomTracesResponse instance + */ + QueryDenomTracesResponse.create = function create(properties) { + return new QueryDenomTracesResponse(properties); + }; + + /** + * Encodes the specified QueryDenomTracesResponse message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTracesResponse.verify|verify} messages. + * @function encode + * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse + * @static + * @param {ibc.applications.transfer.v1.IQueryDenomTracesResponse} message QueryDenomTracesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDenomTracesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.denomTraces != null && message.denomTraces.length) + for (let i = 0; i < message.denomTraces.length; ++i) + $root.ibc.applications.transfer.v1.DenomTrace.encode(message.denomTraces[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryDenomTracesResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTracesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse + * @static + * @param {ibc.applications.transfer.v1.IQueryDenomTracesResponse} message QueryDenomTracesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDenomTracesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDenomTracesResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.applications.transfer.v1.QueryDenomTracesResponse} QueryDenomTracesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDenomTracesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryDenomTracesResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.denomTraces && message.denomTraces.length)) + message.denomTraces = []; + message.denomTraces.push($root.ibc.applications.transfer.v1.DenomTrace.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDenomTracesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.applications.transfer.v1.QueryDenomTracesResponse} QueryDenomTracesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDenomTracesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDenomTracesResponse message. + * @function verify + * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDenomTracesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.denomTraces != null && message.hasOwnProperty("denomTraces")) { + if (!Array.isArray(message.denomTraces)) + return "denomTraces: array expected"; + for (let i = 0; i < message.denomTraces.length; ++i) { + let error = $root.ibc.applications.transfer.v1.DenomTrace.verify(message.denomTraces[i]); + if (error) + return "denomTraces." + error; + } + } + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryDenomTracesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.applications.transfer.v1.QueryDenomTracesResponse} QueryDenomTracesResponse + */ + QueryDenomTracesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.applications.transfer.v1.QueryDenomTracesResponse) + return object; + let message = new $root.ibc.applications.transfer.v1.QueryDenomTracesResponse(); + if (object.denomTraces) { + if (!Array.isArray(object.denomTraces)) + throw TypeError(".ibc.applications.transfer.v1.QueryDenomTracesResponse.denomTraces: array expected"); + message.denomTraces = []; + for (let i = 0; i < object.denomTraces.length; ++i) { + if (typeof object.denomTraces[i] !== "object") + throw TypeError(".ibc.applications.transfer.v1.QueryDenomTracesResponse.denomTraces: object expected"); + message.denomTraces[i] = $root.ibc.applications.transfer.v1.DenomTrace.fromObject(object.denomTraces[i]); + } + } + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".ibc.applications.transfer.v1.QueryDenomTracesResponse.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryDenomTracesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse + * @static + * @param {ibc.applications.transfer.v1.QueryDenomTracesResponse} message QueryDenomTracesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDenomTracesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.denomTraces = []; + if (options.defaults) + object.pagination = null; + if (message.denomTraces && message.denomTraces.length) { + object.denomTraces = []; + for (let j = 0; j < message.denomTraces.length; ++j) + object.denomTraces[j] = $root.ibc.applications.transfer.v1.DenomTrace.toObject(message.denomTraces[j], options); + } + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryDenomTracesResponse to JSON. + * @function toJSON + * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse + * @instance + * @returns {Object.} JSON object + */ + QueryDenomTracesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryDenomTracesResponse; + })(v1.QueryDenomTracesResponse || {}); + + v1.QueryParamsRequest = (function(QueryParamsRequest) { + + /** + * Properties of a QueryParamsRequest. + * @memberof ibc.applications.transfer.v1 + * @interface IQueryParamsRequest + */ + + /** + * Constructs a new QueryParamsRequest. + * @memberof ibc.applications.transfer.v1 + * @classdesc Represents a QueryParamsRequest. + * @implements IQueryParamsRequest + * @constructor + * @param {ibc.applications.transfer.v1.IQueryParamsRequest=} [properties] Properties to set + */ + function QueryParamsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new QueryParamsRequest instance using the specified properties. + * @function create + * @memberof ibc.applications.transfer.v1.QueryParamsRequest + * @static + * @param {ibc.applications.transfer.v1.IQueryParamsRequest=} [properties] Properties to set + * @returns {ibc.applications.transfer.v1.QueryParamsRequest} QueryParamsRequest instance + */ + QueryParamsRequest.create = function create(properties) { + return new QueryParamsRequest(properties); + }; + + /** + * Encodes the specified QueryParamsRequest message. Does not implicitly {@link ibc.applications.transfer.v1.QueryParamsRequest.verify|verify} messages. + * @function encode + * @memberof ibc.applications.transfer.v1.QueryParamsRequest + * @static + * @param {ibc.applications.transfer.v1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryParamsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.applications.transfer.v1.QueryParamsRequest + * @static + * @param {ibc.applications.transfer.v1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryParamsRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.applications.transfer.v1.QueryParamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.applications.transfer.v1.QueryParamsRequest} QueryParamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryParamsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.applications.transfer.v1.QueryParamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.applications.transfer.v1.QueryParamsRequest} QueryParamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryParamsRequest message. + * @function verify + * @memberof ibc.applications.transfer.v1.QueryParamsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryParamsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.applications.transfer.v1.QueryParamsRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.applications.transfer.v1.QueryParamsRequest} QueryParamsRequest + */ + QueryParamsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.applications.transfer.v1.QueryParamsRequest) + return object; + return new $root.ibc.applications.transfer.v1.QueryParamsRequest(); + }; + + /** + * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.applications.transfer.v1.QueryParamsRequest + * @static + * @param {ibc.applications.transfer.v1.QueryParamsRequest} message QueryParamsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryParamsRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this QueryParamsRequest to JSON. + * @function toJSON + * @memberof ibc.applications.transfer.v1.QueryParamsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryParamsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryParamsRequest; + })(v1.QueryParamsRequest || {}); + + v1.QueryParamsResponse = (function(QueryParamsResponse) { + + /** + * Properties of a QueryParamsResponse. + * @memberof ibc.applications.transfer.v1 + * @interface IQueryParamsResponse + * @property {ibc.applications.transfer.v1.IParams|null} [params] QueryParamsResponse params + */ + + /** + * Constructs a new QueryParamsResponse. + * @memberof ibc.applications.transfer.v1 + * @classdesc Represents a QueryParamsResponse. + * @implements IQueryParamsResponse + * @constructor + * @param {ibc.applications.transfer.v1.IQueryParamsResponse=} [properties] Properties to set + */ + function QueryParamsResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryParamsResponse params. + * @member {ibc.applications.transfer.v1.IParams|null|undefined} params + * @memberof ibc.applications.transfer.v1.QueryParamsResponse + * @instance + */ + QueryParamsResponse.prototype.params = null; + + /** + * Creates a new QueryParamsResponse instance using the specified properties. + * @function create + * @memberof ibc.applications.transfer.v1.QueryParamsResponse + * @static + * @param {ibc.applications.transfer.v1.IQueryParamsResponse=} [properties] Properties to set + * @returns {ibc.applications.transfer.v1.QueryParamsResponse} QueryParamsResponse instance + */ + QueryParamsResponse.create = function create(properties) { + return new QueryParamsResponse(properties); + }; + + /** + * Encodes the specified QueryParamsResponse message. Does not implicitly {@link ibc.applications.transfer.v1.QueryParamsResponse.verify|verify} messages. + * @function encode + * @memberof ibc.applications.transfer.v1.QueryParamsResponse + * @static + * @param {ibc.applications.transfer.v1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.ibc.applications.transfer.v1.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryParamsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.applications.transfer.v1.QueryParamsResponse + * @static + * @param {ibc.applications.transfer.v1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryParamsResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.applications.transfer.v1.QueryParamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.applications.transfer.v1.QueryParamsResponse} QueryParamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryParamsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = $root.ibc.applications.transfer.v1.Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.applications.transfer.v1.QueryParamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.applications.transfer.v1.QueryParamsResponse} QueryParamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParamsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryParamsResponse message. + * @function verify + * @memberof ibc.applications.transfer.v1.QueryParamsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryParamsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.params != null && message.hasOwnProperty("params")) { + let error = $root.ibc.applications.transfer.v1.Params.verify(message.params); + if (error) + return "params." + error; + } + return null; + }; + + /** + * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.applications.transfer.v1.QueryParamsResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.applications.transfer.v1.QueryParamsResponse} QueryParamsResponse + */ + QueryParamsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.applications.transfer.v1.QueryParamsResponse) + return object; + let message = new $root.ibc.applications.transfer.v1.QueryParamsResponse(); + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".ibc.applications.transfer.v1.QueryParamsResponse.params: object expected"); + message.params = $root.ibc.applications.transfer.v1.Params.fromObject(object.params); + } + return message; + }; + + /** + * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.applications.transfer.v1.QueryParamsResponse + * @static + * @param {ibc.applications.transfer.v1.QueryParamsResponse} message QueryParamsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryParamsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.params = null; + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.ibc.applications.transfer.v1.Params.toObject(message.params, options); + return object; + }; + + /** + * Converts this QueryParamsResponse to JSON. + * @function toJSON + * @memberof ibc.applications.transfer.v1.QueryParamsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryParamsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryParamsResponse; + })(v1.QueryParamsResponse || {}); + + v1.FungibleTokenPacketData = (function(FungibleTokenPacketData) { + + /** + * Properties of a FungibleTokenPacketData. + * @memberof ibc.applications.transfer.v1 + * @interface IFungibleTokenPacketData + * @property {string|null} [denom] FungibleTokenPacketData denom + * @property {number|Long|null} [amount] FungibleTokenPacketData amount + * @property {string|null} [sender] FungibleTokenPacketData sender + * @property {string|null} [receiver] FungibleTokenPacketData receiver + */ + + /** + * Constructs a new FungibleTokenPacketData. + * @memberof ibc.applications.transfer.v1 + * @classdesc Represents a FungibleTokenPacketData. + * @implements IFungibleTokenPacketData + * @constructor + * @param {ibc.applications.transfer.v1.IFungibleTokenPacketData=} [properties] Properties to set + */ + function FungibleTokenPacketData(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FungibleTokenPacketData denom. + * @member {string} denom + * @memberof ibc.applications.transfer.v1.FungibleTokenPacketData + * @instance + */ + FungibleTokenPacketData.prototype.denom = ""; + + /** + * FungibleTokenPacketData amount. + * @member {number|Long} amount + * @memberof ibc.applications.transfer.v1.FungibleTokenPacketData + * @instance + */ + FungibleTokenPacketData.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * FungibleTokenPacketData sender. + * @member {string} sender + * @memberof ibc.applications.transfer.v1.FungibleTokenPacketData + * @instance + */ + FungibleTokenPacketData.prototype.sender = ""; + + /** + * FungibleTokenPacketData receiver. + * @member {string} receiver + * @memberof ibc.applications.transfer.v1.FungibleTokenPacketData + * @instance + */ + FungibleTokenPacketData.prototype.receiver = ""; + + /** + * Creates a new FungibleTokenPacketData instance using the specified properties. + * @function create + * @memberof ibc.applications.transfer.v1.FungibleTokenPacketData + * @static + * @param {ibc.applications.transfer.v1.IFungibleTokenPacketData=} [properties] Properties to set + * @returns {ibc.applications.transfer.v1.FungibleTokenPacketData} FungibleTokenPacketData instance + */ + FungibleTokenPacketData.create = function create(properties) { + return new FungibleTokenPacketData(properties); + }; + + /** + * Encodes the specified FungibleTokenPacketData message. Does not implicitly {@link ibc.applications.transfer.v1.FungibleTokenPacketData.verify|verify} messages. + * @function encode + * @memberof ibc.applications.transfer.v1.FungibleTokenPacketData + * @static + * @param {ibc.applications.transfer.v1.IFungibleTokenPacketData} message FungibleTokenPacketData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FungibleTokenPacketData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amount); + if (message.sender != null && Object.hasOwnProperty.call(message, "sender")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sender); + if (message.receiver != null && Object.hasOwnProperty.call(message, "receiver")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.receiver); + return writer; + }; + + /** + * Encodes the specified FungibleTokenPacketData message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.FungibleTokenPacketData.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.applications.transfer.v1.FungibleTokenPacketData + * @static + * @param {ibc.applications.transfer.v1.IFungibleTokenPacketData} message FungibleTokenPacketData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FungibleTokenPacketData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FungibleTokenPacketData message from the specified reader or buffer. + * @function decode + * @memberof ibc.applications.transfer.v1.FungibleTokenPacketData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.applications.transfer.v1.FungibleTokenPacketData} FungibleTokenPacketData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FungibleTokenPacketData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.FungibleTokenPacketData(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.uint64(); + break; + case 3: + message.sender = reader.string(); + break; + case 4: + message.receiver = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FungibleTokenPacketData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.applications.transfer.v1.FungibleTokenPacketData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.applications.transfer.v1.FungibleTokenPacketData} FungibleTokenPacketData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FungibleTokenPacketData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FungibleTokenPacketData message. + * @function verify + * @memberof ibc.applications.transfer.v1.FungibleTokenPacketData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FungibleTokenPacketData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.denom != null && message.hasOwnProperty("denom")) + if (!$util.isString(message.denom)) + return "denom: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) + if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high))) + return "amount: integer|Long expected"; + if (message.sender != null && message.hasOwnProperty("sender")) + if (!$util.isString(message.sender)) + return "sender: string expected"; + if (message.receiver != null && message.hasOwnProperty("receiver")) + if (!$util.isString(message.receiver)) + return "receiver: string expected"; + return null; + }; + + /** + * Creates a FungibleTokenPacketData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.applications.transfer.v1.FungibleTokenPacketData + * @static + * @param {Object.} object Plain object + * @returns {ibc.applications.transfer.v1.FungibleTokenPacketData} FungibleTokenPacketData + */ + FungibleTokenPacketData.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.applications.transfer.v1.FungibleTokenPacketData) + return object; + let message = new $root.ibc.applications.transfer.v1.FungibleTokenPacketData(); + if (object.denom != null) + message.denom = String(object.denom); + if (object.amount != null) + if ($util.Long) + (message.amount = $util.Long.fromValue(object.amount)).unsigned = true; + else if (typeof object.amount === "string") + message.amount = parseInt(object.amount, 10); + else if (typeof object.amount === "number") + message.amount = object.amount; + else if (typeof object.amount === "object") + message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber(true); + if (object.sender != null) + message.sender = String(object.sender); + if (object.receiver != null) + message.receiver = String(object.receiver); + return message; + }; + + /** + * Creates a plain object from a FungibleTokenPacketData message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.applications.transfer.v1.FungibleTokenPacketData + * @static + * @param {ibc.applications.transfer.v1.FungibleTokenPacketData} message FungibleTokenPacketData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FungibleTokenPacketData.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.denom = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amount = options.longs === String ? "0" : 0; + object.sender = ""; + object.receiver = ""; + } + if (message.denom != null && message.hasOwnProperty("denom")) + object.denom = message.denom; + if (message.amount != null && message.hasOwnProperty("amount")) + if (typeof message.amount === "number") + object.amount = options.longs === String ? String(message.amount) : message.amount; + else + object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber(true) : message.amount; + if (message.sender != null && message.hasOwnProperty("sender")) + object.sender = message.sender; + if (message.receiver != null && message.hasOwnProperty("receiver")) + object.receiver = message.receiver; + return object; + }; + + /** + * Converts this FungibleTokenPacketData to JSON. + * @function toJSON + * @memberof ibc.applications.transfer.v1.FungibleTokenPacketData + * @instance + * @returns {Object.} JSON object + */ + FungibleTokenPacketData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FungibleTokenPacketData; + })(v1.FungibleTokenPacketData || {}); + + v1.DenomTrace = (function(DenomTrace) { + + /** + * Properties of a DenomTrace. + * @memberof ibc.applications.transfer.v1 + * @interface IDenomTrace + * @property {string|null} [path] DenomTrace path + * @property {string|null} [baseDenom] DenomTrace baseDenom + */ + + /** + * Constructs a new DenomTrace. + * @memberof ibc.applications.transfer.v1 + * @classdesc Represents a DenomTrace. + * @implements IDenomTrace + * @constructor + * @param {ibc.applications.transfer.v1.IDenomTrace=} [properties] Properties to set + */ + function DenomTrace(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DenomTrace path. + * @member {string} path + * @memberof ibc.applications.transfer.v1.DenomTrace + * @instance + */ + DenomTrace.prototype.path = ""; + + /** + * DenomTrace baseDenom. + * @member {string} baseDenom + * @memberof ibc.applications.transfer.v1.DenomTrace + * @instance + */ + DenomTrace.prototype.baseDenom = ""; + + /** + * Creates a new DenomTrace instance using the specified properties. + * @function create + * @memberof ibc.applications.transfer.v1.DenomTrace + * @static + * @param {ibc.applications.transfer.v1.IDenomTrace=} [properties] Properties to set + * @returns {ibc.applications.transfer.v1.DenomTrace} DenomTrace instance + */ + DenomTrace.create = function create(properties) { + return new DenomTrace(properties); + }; + + /** + * Encodes the specified DenomTrace message. Does not implicitly {@link ibc.applications.transfer.v1.DenomTrace.verify|verify} messages. + * @function encode + * @memberof ibc.applications.transfer.v1.DenomTrace + * @static + * @param {ibc.applications.transfer.v1.IDenomTrace} message DenomTrace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DenomTrace.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.path); + if (message.baseDenom != null && Object.hasOwnProperty.call(message, "baseDenom")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.baseDenom); + return writer; + }; + + /** + * Encodes the specified DenomTrace message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.DenomTrace.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.applications.transfer.v1.DenomTrace + * @static + * @param {ibc.applications.transfer.v1.IDenomTrace} message DenomTrace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DenomTrace.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DenomTrace message from the specified reader or buffer. + * @function decode + * @memberof ibc.applications.transfer.v1.DenomTrace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.applications.transfer.v1.DenomTrace} DenomTrace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DenomTrace.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.DenomTrace(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.string(); + break; + case 2: + message.baseDenom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DenomTrace message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.applications.transfer.v1.DenomTrace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.applications.transfer.v1.DenomTrace} DenomTrace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DenomTrace.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DenomTrace message. + * @function verify + * @memberof ibc.applications.transfer.v1.DenomTrace + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DenomTrace.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + if (message.baseDenom != null && message.hasOwnProperty("baseDenom")) + if (!$util.isString(message.baseDenom)) + return "baseDenom: string expected"; + return null; + }; + + /** + * Creates a DenomTrace message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.applications.transfer.v1.DenomTrace + * @static + * @param {Object.} object Plain object + * @returns {ibc.applications.transfer.v1.DenomTrace} DenomTrace + */ + DenomTrace.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.applications.transfer.v1.DenomTrace) + return object; + let message = new $root.ibc.applications.transfer.v1.DenomTrace(); + if (object.path != null) + message.path = String(object.path); + if (object.baseDenom != null) + message.baseDenom = String(object.baseDenom); + return message; + }; + + /** + * Creates a plain object from a DenomTrace message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.applications.transfer.v1.DenomTrace + * @static + * @param {ibc.applications.transfer.v1.DenomTrace} message DenomTrace + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DenomTrace.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.path = ""; + object.baseDenom = ""; + } + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + if (message.baseDenom != null && message.hasOwnProperty("baseDenom")) + object.baseDenom = message.baseDenom; + return object; + }; + + /** + * Converts this DenomTrace to JSON. + * @function toJSON + * @memberof ibc.applications.transfer.v1.DenomTrace + * @instance + * @returns {Object.} JSON object + */ + DenomTrace.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DenomTrace; + })(v1.DenomTrace || {}); + + v1.Params = (function(Params) { + + /** + * Properties of a Params. + * @memberof ibc.applications.transfer.v1 + * @interface IParams + * @property {boolean|null} [sendEnabled] Params sendEnabled + * @property {boolean|null} [receiveEnabled] Params receiveEnabled + */ + + /** + * Constructs a new Params. + * @memberof ibc.applications.transfer.v1 + * @classdesc Represents a Params. + * @implements IParams + * @constructor + * @param {ibc.applications.transfer.v1.IParams=} [properties] Properties to set + */ + function Params(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Params sendEnabled. + * @member {boolean} sendEnabled + * @memberof ibc.applications.transfer.v1.Params + * @instance + */ + Params.prototype.sendEnabled = false; + + /** + * Params receiveEnabled. + * @member {boolean} receiveEnabled + * @memberof ibc.applications.transfer.v1.Params + * @instance + */ + Params.prototype.receiveEnabled = false; + + /** + * Creates a new Params instance using the specified properties. + * @function create + * @memberof ibc.applications.transfer.v1.Params + * @static + * @param {ibc.applications.transfer.v1.IParams=} [properties] Properties to set + * @returns {ibc.applications.transfer.v1.Params} Params instance + */ + Params.create = function create(properties) { + return new Params(properties); + }; + + /** + * Encodes the specified Params message. Does not implicitly {@link ibc.applications.transfer.v1.Params.verify|verify} messages. + * @function encode + * @memberof ibc.applications.transfer.v1.Params + * @static + * @param {ibc.applications.transfer.v1.IParams} message Params message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Params.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sendEnabled != null && Object.hasOwnProperty.call(message, "sendEnabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.sendEnabled); + if (message.receiveEnabled != null && Object.hasOwnProperty.call(message, "receiveEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.receiveEnabled); + return writer; + }; + + /** + * Encodes the specified Params message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.Params.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.applications.transfer.v1.Params + * @static + * @param {ibc.applications.transfer.v1.IParams} message Params message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Params.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Params message from the specified reader or buffer. + * @function decode + * @memberof ibc.applications.transfer.v1.Params + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.applications.transfer.v1.Params} Params + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Params.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.Params(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sendEnabled = reader.bool(); + break; + case 2: + message.receiveEnabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Params message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.applications.transfer.v1.Params + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.applications.transfer.v1.Params} Params + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Params.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Params message. + * @function verify + * @memberof ibc.applications.transfer.v1.Params + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Params.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sendEnabled != null && message.hasOwnProperty("sendEnabled")) + if (typeof message.sendEnabled !== "boolean") + return "sendEnabled: boolean expected"; + if (message.receiveEnabled != null && message.hasOwnProperty("receiveEnabled")) + if (typeof message.receiveEnabled !== "boolean") + return "receiveEnabled: boolean expected"; + return null; + }; + + /** + * Creates a Params message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.applications.transfer.v1.Params + * @static + * @param {Object.} object Plain object + * @returns {ibc.applications.transfer.v1.Params} Params + */ + Params.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.applications.transfer.v1.Params) + return object; + let message = new $root.ibc.applications.transfer.v1.Params(); + if (object.sendEnabled != null) + message.sendEnabled = Boolean(object.sendEnabled); + if (object.receiveEnabled != null) + message.receiveEnabled = Boolean(object.receiveEnabled); + return message; + }; + + /** + * Creates a plain object from a Params message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.applications.transfer.v1.Params + * @static + * @param {ibc.applications.transfer.v1.Params} message Params + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Params.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.sendEnabled = false; + object.receiveEnabled = false; + } + if (message.sendEnabled != null && message.hasOwnProperty("sendEnabled")) + object.sendEnabled = message.sendEnabled; + if (message.receiveEnabled != null && message.hasOwnProperty("receiveEnabled")) + object.receiveEnabled = message.receiveEnabled; + return object; + }; + + /** + * Converts this Params to JSON. + * @function toJSON + * @memberof ibc.applications.transfer.v1.Params + * @instance + * @returns {Object.} JSON object + */ + Params.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Params; + })(v1.Params || {}); + + v1.Msg = (function(Msg) { + + /** + * Constructs a new Msg service. + * @memberof ibc.applications.transfer.v1 + * @classdesc Represents a Msg + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Msg(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; + + /** + * Creates new Msg service using the specified rpc implementation. + * @function create + * @memberof ibc.applications.transfer.v1.Msg + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Msg} RPC service. Useful where requests and/or responses are streamed. + */ + Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link ibc.applications.transfer.v1.Msg#transfer}. + * @memberof ibc.applications.transfer.v1.Msg + * @typedef TransferCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.applications.transfer.v1.IMsgTransferResponse} [response] MsgTransferResponse + */ + + /** + * Calls Transfer. + * @function transfer + * @memberof ibc.applications.transfer.v1.Msg + * @instance + * @param {ibc.applications.transfer.v1.IMsgTransfer} request MsgTransfer message or plain object + * @param {ibc.applications.transfer.v1.Msg.TransferCallback} callback Node-style callback called with the error, if any, and MsgTransferResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.transfer = function transfer(request, callback) { + return this.rpcCall(transfer, $root.ibc.applications.transfer.v1.MsgTransfer, $root.ibc.applications.transfer.v1.MsgTransferResponse, request, callback); + }, "name", { value: "Transfer" }); + + /** + * Calls Transfer. + * @function transfer + * @memberof ibc.applications.transfer.v1.Msg + * @instance + * @param {ibc.applications.transfer.v1.IMsgTransfer} request MsgTransfer message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Msg; + })(v1.Msg || {}); + + v1.MsgTransfer = (function(MsgTransfer) { + + /** + * Properties of a MsgTransfer. + * @memberof ibc.applications.transfer.v1 + * @interface IMsgTransfer + * @property {string|null} [sourcePort] MsgTransfer sourcePort + * @property {string|null} [sourceChannel] MsgTransfer sourceChannel + * @property {cosmos.base.v1beta1.ICoin|null} [token] MsgTransfer token + * @property {string|null} [sender] MsgTransfer sender + * @property {string|null} [receiver] MsgTransfer receiver + * @property {ibc.core.client.v1.IHeight|null} [timeoutHeight] MsgTransfer timeoutHeight + * @property {number|Long|null} [timeoutTimestamp] MsgTransfer timeoutTimestamp + */ + + /** + * Constructs a new MsgTransfer. + * @memberof ibc.applications.transfer.v1 + * @classdesc Represents a MsgTransfer. + * @implements IMsgTransfer + * @constructor + * @param {ibc.applications.transfer.v1.IMsgTransfer=} [properties] Properties to set + */ + function MsgTransfer(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgTransfer sourcePort. + * @member {string} sourcePort + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @instance + */ + MsgTransfer.prototype.sourcePort = ""; + + /** + * MsgTransfer sourceChannel. + * @member {string} sourceChannel + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @instance + */ + MsgTransfer.prototype.sourceChannel = ""; + + /** + * MsgTransfer token. + * @member {cosmos.base.v1beta1.ICoin|null|undefined} token + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @instance + */ + MsgTransfer.prototype.token = null; + + /** + * MsgTransfer sender. + * @member {string} sender + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @instance + */ + MsgTransfer.prototype.sender = ""; + + /** + * MsgTransfer receiver. + * @member {string} receiver + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @instance + */ + MsgTransfer.prototype.receiver = ""; + + /** + * MsgTransfer timeoutHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} timeoutHeight + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @instance + */ + MsgTransfer.prototype.timeoutHeight = null; + + /** + * MsgTransfer timeoutTimestamp. + * @member {number|Long} timeoutTimestamp + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @instance + */ + MsgTransfer.prototype.timeoutTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new MsgTransfer instance using the specified properties. + * @function create + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @static + * @param {ibc.applications.transfer.v1.IMsgTransfer=} [properties] Properties to set + * @returns {ibc.applications.transfer.v1.MsgTransfer} MsgTransfer instance + */ + MsgTransfer.create = function create(properties) { + return new MsgTransfer(properties); + }; + + /** + * Encodes the specified MsgTransfer message. Does not implicitly {@link ibc.applications.transfer.v1.MsgTransfer.verify|verify} messages. + * @function encode + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @static + * @param {ibc.applications.transfer.v1.IMsgTransfer} message MsgTransfer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgTransfer.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourcePort != null && Object.hasOwnProperty.call(message, "sourcePort")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourcePort); + if (message.sourceChannel != null && Object.hasOwnProperty.call(message, "sourceChannel")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceChannel); + if (message.token != null && Object.hasOwnProperty.call(message, "token")) + $root.cosmos.base.v1beta1.Coin.encode(message.token, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.sender != null && Object.hasOwnProperty.call(message, "sender")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.sender); + if (message.receiver != null && Object.hasOwnProperty.call(message, "receiver")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.receiver); + if (message.timeoutHeight != null && Object.hasOwnProperty.call(message, "timeoutHeight")) + $root.ibc.core.client.v1.Height.encode(message.timeoutHeight, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.timeoutTimestamp != null && Object.hasOwnProperty.call(message, "timeoutTimestamp")) + writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.timeoutTimestamp); + return writer; + }; + + /** + * Encodes the specified MsgTransfer message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.MsgTransfer.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @static + * @param {ibc.applications.transfer.v1.IMsgTransfer} message MsgTransfer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgTransfer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgTransfer message from the specified reader or buffer. + * @function decode + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.applications.transfer.v1.MsgTransfer} MsgTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgTransfer.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.MsgTransfer(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sourcePort = reader.string(); + break; + case 2: + message.sourceChannel = reader.string(); + break; + case 3: + message.token = $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()); + break; + case 4: + message.sender = reader.string(); + break; + case 5: + message.receiver = reader.string(); + break; + case 6: + message.timeoutHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + case 7: + message.timeoutTimestamp = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgTransfer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.applications.transfer.v1.MsgTransfer} MsgTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgTransfer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgTransfer message. + * @function verify + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgTransfer.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sourcePort != null && message.hasOwnProperty("sourcePort")) + if (!$util.isString(message.sourcePort)) + return "sourcePort: string expected"; + if (message.sourceChannel != null && message.hasOwnProperty("sourceChannel")) + if (!$util.isString(message.sourceChannel)) + return "sourceChannel: string expected"; + if (message.token != null && message.hasOwnProperty("token")) { + let error = $root.cosmos.base.v1beta1.Coin.verify(message.token); + if (error) + return "token." + error; + } + if (message.sender != null && message.hasOwnProperty("sender")) + if (!$util.isString(message.sender)) + return "sender: string expected"; + if (message.receiver != null && message.hasOwnProperty("receiver")) + if (!$util.isString(message.receiver)) + return "receiver: string expected"; + if (message.timeoutHeight != null && message.hasOwnProperty("timeoutHeight")) { + let error = $root.ibc.core.client.v1.Height.verify(message.timeoutHeight); + if (error) + return "timeoutHeight." + error; + } + if (message.timeoutTimestamp != null && message.hasOwnProperty("timeoutTimestamp")) + if (!$util.isInteger(message.timeoutTimestamp) && !(message.timeoutTimestamp && $util.isInteger(message.timeoutTimestamp.low) && $util.isInteger(message.timeoutTimestamp.high))) + return "timeoutTimestamp: integer|Long expected"; + return null; + }; + + /** + * Creates a MsgTransfer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @static + * @param {Object.} object Plain object + * @returns {ibc.applications.transfer.v1.MsgTransfer} MsgTransfer + */ + MsgTransfer.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.applications.transfer.v1.MsgTransfer) + return object; + let message = new $root.ibc.applications.transfer.v1.MsgTransfer(); + if (object.sourcePort != null) + message.sourcePort = String(object.sourcePort); + if (object.sourceChannel != null) + message.sourceChannel = String(object.sourceChannel); + if (object.token != null) { + if (typeof object.token !== "object") + throw TypeError(".ibc.applications.transfer.v1.MsgTransfer.token: object expected"); + message.token = $root.cosmos.base.v1beta1.Coin.fromObject(object.token); + } + if (object.sender != null) + message.sender = String(object.sender); + if (object.receiver != null) + message.receiver = String(object.receiver); + if (object.timeoutHeight != null) { + if (typeof object.timeoutHeight !== "object") + throw TypeError(".ibc.applications.transfer.v1.MsgTransfer.timeoutHeight: object expected"); + message.timeoutHeight = $root.ibc.core.client.v1.Height.fromObject(object.timeoutHeight); + } + if (object.timeoutTimestamp != null) + if ($util.Long) + (message.timeoutTimestamp = $util.Long.fromValue(object.timeoutTimestamp)).unsigned = true; + else if (typeof object.timeoutTimestamp === "string") + message.timeoutTimestamp = parseInt(object.timeoutTimestamp, 10); + else if (typeof object.timeoutTimestamp === "number") + message.timeoutTimestamp = object.timeoutTimestamp; + else if (typeof object.timeoutTimestamp === "object") + message.timeoutTimestamp = new $util.LongBits(object.timeoutTimestamp.low >>> 0, object.timeoutTimestamp.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a MsgTransfer message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @static + * @param {ibc.applications.transfer.v1.MsgTransfer} message MsgTransfer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgTransfer.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.sourcePort = ""; + object.sourceChannel = ""; + object.token = null; + object.sender = ""; + object.receiver = ""; + object.timeoutHeight = null; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.timeoutTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timeoutTimestamp = options.longs === String ? "0" : 0; + } + if (message.sourcePort != null && message.hasOwnProperty("sourcePort")) + object.sourcePort = message.sourcePort; + if (message.sourceChannel != null && message.hasOwnProperty("sourceChannel")) + object.sourceChannel = message.sourceChannel; + if (message.token != null && message.hasOwnProperty("token")) + object.token = $root.cosmos.base.v1beta1.Coin.toObject(message.token, options); + if (message.sender != null && message.hasOwnProperty("sender")) + object.sender = message.sender; + if (message.receiver != null && message.hasOwnProperty("receiver")) + object.receiver = message.receiver; + if (message.timeoutHeight != null && message.hasOwnProperty("timeoutHeight")) + object.timeoutHeight = $root.ibc.core.client.v1.Height.toObject(message.timeoutHeight, options); + if (message.timeoutTimestamp != null && message.hasOwnProperty("timeoutTimestamp")) + if (typeof message.timeoutTimestamp === "number") + object.timeoutTimestamp = options.longs === String ? String(message.timeoutTimestamp) : message.timeoutTimestamp; + else + object.timeoutTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timeoutTimestamp) : options.longs === Number ? new $util.LongBits(message.timeoutTimestamp.low >>> 0, message.timeoutTimestamp.high >>> 0).toNumber(true) : message.timeoutTimestamp; + return object; + }; + + /** + * Converts this MsgTransfer to JSON. + * @function toJSON + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @instance + * @returns {Object.} JSON object + */ + MsgTransfer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgTransfer; + })(v1.MsgTransfer || {}); + + v1.MsgTransferResponse = (function(MsgTransferResponse) { + + /** + * Properties of a MsgTransferResponse. + * @memberof ibc.applications.transfer.v1 + * @interface IMsgTransferResponse + */ + + /** + * Constructs a new MsgTransferResponse. + * @memberof ibc.applications.transfer.v1 + * @classdesc Represents a MsgTransferResponse. + * @implements IMsgTransferResponse + * @constructor + * @param {ibc.applications.transfer.v1.IMsgTransferResponse=} [properties] Properties to set + */ + function MsgTransferResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgTransferResponse instance using the specified properties. + * @function create + * @memberof ibc.applications.transfer.v1.MsgTransferResponse + * @static + * @param {ibc.applications.transfer.v1.IMsgTransferResponse=} [properties] Properties to set + * @returns {ibc.applications.transfer.v1.MsgTransferResponse} MsgTransferResponse instance + */ + MsgTransferResponse.create = function create(properties) { + return new MsgTransferResponse(properties); + }; + + /** + * Encodes the specified MsgTransferResponse message. Does not implicitly {@link ibc.applications.transfer.v1.MsgTransferResponse.verify|verify} messages. + * @function encode + * @memberof ibc.applications.transfer.v1.MsgTransferResponse + * @static + * @param {ibc.applications.transfer.v1.IMsgTransferResponse} message MsgTransferResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgTransferResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgTransferResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.MsgTransferResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.applications.transfer.v1.MsgTransferResponse + * @static + * @param {ibc.applications.transfer.v1.IMsgTransferResponse} message MsgTransferResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgTransferResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgTransferResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.applications.transfer.v1.MsgTransferResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.applications.transfer.v1.MsgTransferResponse} MsgTransferResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgTransferResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.MsgTransferResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgTransferResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.applications.transfer.v1.MsgTransferResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.applications.transfer.v1.MsgTransferResponse} MsgTransferResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgTransferResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgTransferResponse message. + * @function verify + * @memberof ibc.applications.transfer.v1.MsgTransferResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgTransferResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgTransferResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.applications.transfer.v1.MsgTransferResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.applications.transfer.v1.MsgTransferResponse} MsgTransferResponse + */ + MsgTransferResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.applications.transfer.v1.MsgTransferResponse) + return object; + return new $root.ibc.applications.transfer.v1.MsgTransferResponse(); + }; + + /** + * Creates a plain object from a MsgTransferResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.applications.transfer.v1.MsgTransferResponse + * @static + * @param {ibc.applications.transfer.v1.MsgTransferResponse} message MsgTransferResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgTransferResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgTransferResponse to JSON. + * @function toJSON + * @memberof ibc.applications.transfer.v1.MsgTransferResponse + * @instance + * @returns {Object.} JSON object + */ + MsgTransferResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgTransferResponse; + })(v1.MsgTransferResponse || {}); + + return v1; + })(transfer.v1 || {}); + + return transfer; + })(applications.transfer || {}); + + return applications; + })(ibc.applications || {}); + + /** + * Namespace core. + * @memberof ibc + * @namespace + */ + + ibc.core = (function(core) { + + /** + * Namespace channel. + * @memberof ibc.core + * @namespace + */ + + core.channel = (function(channel) { + + /** + * Namespace v1. + * @memberof ibc.core.channel + * @namespace + */ + + channel.v1 = (function(v1) { + + v1.Channel = (function(Channel) { + + /** + * Properties of a Channel. + * @memberof ibc.core.channel.v1 + * @interface IChannel + * @property {ibc.core.channel.v1.State|null} [state] Channel state + * @property {ibc.core.channel.v1.Order|null} [ordering] Channel ordering + * @property {ibc.core.channel.v1.ICounterparty|null} [counterparty] Channel counterparty + * @property {Array.|null} [connectionHops] Channel connectionHops + * @property {string|null} [version] Channel version + */ + + /** + * Constructs a new Channel. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a Channel. + * @implements IChannel + * @constructor + * @param {ibc.core.channel.v1.IChannel=} [properties] Properties to set + */ + function Channel(properties) { + this.connectionHops = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Channel state. + * @member {ibc.core.channel.v1.State} state + * @memberof ibc.core.channel.v1.Channel + * @instance + */ + Channel.prototype.state = 0; + + /** + * Channel ordering. + * @member {ibc.core.channel.v1.Order} ordering + * @memberof ibc.core.channel.v1.Channel + * @instance + */ + Channel.prototype.ordering = 0; + + /** + * Channel counterparty. + * @member {ibc.core.channel.v1.ICounterparty|null|undefined} counterparty + * @memberof ibc.core.channel.v1.Channel + * @instance + */ + Channel.prototype.counterparty = null; + + /** + * Channel connectionHops. + * @member {Array.} connectionHops + * @memberof ibc.core.channel.v1.Channel + * @instance + */ + Channel.prototype.connectionHops = $util.emptyArray; + + /** + * Channel version. + * @member {string} version + * @memberof ibc.core.channel.v1.Channel + * @instance + */ + Channel.prototype.version = ""; + + /** + * Creates a new Channel instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.Channel + * @static + * @param {ibc.core.channel.v1.IChannel=} [properties] Properties to set + * @returns {ibc.core.channel.v1.Channel} Channel instance + */ + Channel.create = function create(properties) { + return new Channel(properties); + }; + + /** + * Encodes the specified Channel message. Does not implicitly {@link ibc.core.channel.v1.Channel.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.Channel + * @static + * @param {ibc.core.channel.v1.IChannel} message Channel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Channel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.ordering != null && Object.hasOwnProperty.call(message, "ordering")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.ordering); + if (message.counterparty != null && Object.hasOwnProperty.call(message, "counterparty")) + $root.ibc.core.channel.v1.Counterparty.encode(message.counterparty, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.connectionHops != null && message.connectionHops.length) + for (let i = 0; i < message.connectionHops.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.connectionHops[i]); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.version); + return writer; + }; + + /** + * Encodes the specified Channel message, length delimited. Does not implicitly {@link ibc.core.channel.v1.Channel.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.Channel + * @static + * @param {ibc.core.channel.v1.IChannel} message Channel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Channel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Channel message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.Channel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.Channel} Channel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Channel.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.Channel(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = reader.int32(); + break; + case 2: + message.ordering = reader.int32(); + break; + case 3: + message.counterparty = $root.ibc.core.channel.v1.Counterparty.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.connectionHops && message.connectionHops.length)) + message.connectionHops = []; + message.connectionHops.push(reader.string()); + break; + case 5: + message.version = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Channel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.Channel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.Channel} Channel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Channel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Channel message. + * @function verify + * @memberof ibc.core.channel.v1.Channel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Channel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.ordering != null && message.hasOwnProperty("ordering")) + switch (message.ordering) { + default: + return "ordering: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.counterparty != null && message.hasOwnProperty("counterparty")) { + let error = $root.ibc.core.channel.v1.Counterparty.verify(message.counterparty); + if (error) + return "counterparty." + error; + } + if (message.connectionHops != null && message.hasOwnProperty("connectionHops")) { + if (!Array.isArray(message.connectionHops)) + return "connectionHops: array expected"; + for (let i = 0; i < message.connectionHops.length; ++i) + if (!$util.isString(message.connectionHops[i])) + return "connectionHops: string[] expected"; + } + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; + + /** + * Creates a Channel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.Channel + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.Channel} Channel + */ + Channel.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.Channel) + return object; + let message = new $root.ibc.core.channel.v1.Channel(); + switch (object.state) { + case "STATE_UNINITIALIZED_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "STATE_INIT": + case 1: + message.state = 1; + break; + case "STATE_TRYOPEN": + case 2: + message.state = 2; + break; + case "STATE_OPEN": + case 3: + message.state = 3; + break; + case "STATE_CLOSED": + case 4: + message.state = 4; + break; + } + switch (object.ordering) { + case "ORDER_NONE_UNSPECIFIED": + case 0: + message.ordering = 0; + break; + case "ORDER_UNORDERED": + case 1: + message.ordering = 1; + break; + case "ORDER_ORDERED": + case 2: + message.ordering = 2; + break; + } + if (object.counterparty != null) { + if (typeof object.counterparty !== "object") + throw TypeError(".ibc.core.channel.v1.Channel.counterparty: object expected"); + message.counterparty = $root.ibc.core.channel.v1.Counterparty.fromObject(object.counterparty); + } + if (object.connectionHops) { + if (!Array.isArray(object.connectionHops)) + throw TypeError(".ibc.core.channel.v1.Channel.connectionHops: array expected"); + message.connectionHops = []; + for (let i = 0; i < object.connectionHops.length; ++i) + message.connectionHops[i] = String(object.connectionHops[i]); + } + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from a Channel message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.Channel + * @static + * @param {ibc.core.channel.v1.Channel} message Channel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Channel.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.connectionHops = []; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNINITIALIZED_UNSPECIFIED" : 0; + object.ordering = options.enums === String ? "ORDER_NONE_UNSPECIFIED" : 0; + object.counterparty = null; + object.version = ""; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.ibc.core.channel.v1.State[message.state] : message.state; + if (message.ordering != null && message.hasOwnProperty("ordering")) + object.ordering = options.enums === String ? $root.ibc.core.channel.v1.Order[message.ordering] : message.ordering; + if (message.counterparty != null && message.hasOwnProperty("counterparty")) + object.counterparty = $root.ibc.core.channel.v1.Counterparty.toObject(message.counterparty, options); + if (message.connectionHops && message.connectionHops.length) { + object.connectionHops = []; + for (let j = 0; j < message.connectionHops.length; ++j) + object.connectionHops[j] = message.connectionHops[j]; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this Channel to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.Channel + * @instance + * @returns {Object.} JSON object + */ + Channel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Channel; + })(v1.Channel || {}); + + v1.IdentifiedChannel = (function(IdentifiedChannel) { + + /** + * Properties of an IdentifiedChannel. + * @memberof ibc.core.channel.v1 + * @interface IIdentifiedChannel + * @property {ibc.core.channel.v1.State|null} [state] IdentifiedChannel state + * @property {ibc.core.channel.v1.Order|null} [ordering] IdentifiedChannel ordering + * @property {ibc.core.channel.v1.ICounterparty|null} [counterparty] IdentifiedChannel counterparty + * @property {Array.|null} [connectionHops] IdentifiedChannel connectionHops + * @property {string|null} [version] IdentifiedChannel version + * @property {string|null} [portId] IdentifiedChannel portId + * @property {string|null} [channelId] IdentifiedChannel channelId + */ + + /** + * Constructs a new IdentifiedChannel. + * @memberof ibc.core.channel.v1 + * @classdesc Represents an IdentifiedChannel. + * @implements IIdentifiedChannel + * @constructor + * @param {ibc.core.channel.v1.IIdentifiedChannel=} [properties] Properties to set + */ + function IdentifiedChannel(properties) { + this.connectionHops = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IdentifiedChannel state. + * @member {ibc.core.channel.v1.State} state + * @memberof ibc.core.channel.v1.IdentifiedChannel + * @instance + */ + IdentifiedChannel.prototype.state = 0; + + /** + * IdentifiedChannel ordering. + * @member {ibc.core.channel.v1.Order} ordering + * @memberof ibc.core.channel.v1.IdentifiedChannel + * @instance + */ + IdentifiedChannel.prototype.ordering = 0; + + /** + * IdentifiedChannel counterparty. + * @member {ibc.core.channel.v1.ICounterparty|null|undefined} counterparty + * @memberof ibc.core.channel.v1.IdentifiedChannel + * @instance + */ + IdentifiedChannel.prototype.counterparty = null; + + /** + * IdentifiedChannel connectionHops. + * @member {Array.} connectionHops + * @memberof ibc.core.channel.v1.IdentifiedChannel + * @instance + */ + IdentifiedChannel.prototype.connectionHops = $util.emptyArray; + + /** + * IdentifiedChannel version. + * @member {string} version + * @memberof ibc.core.channel.v1.IdentifiedChannel + * @instance + */ + IdentifiedChannel.prototype.version = ""; + + /** + * IdentifiedChannel portId. + * @member {string} portId + * @memberof ibc.core.channel.v1.IdentifiedChannel + * @instance + */ + IdentifiedChannel.prototype.portId = ""; + + /** + * IdentifiedChannel channelId. + * @member {string} channelId + * @memberof ibc.core.channel.v1.IdentifiedChannel + * @instance + */ + IdentifiedChannel.prototype.channelId = ""; + + /** + * Creates a new IdentifiedChannel instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.IdentifiedChannel + * @static + * @param {ibc.core.channel.v1.IIdentifiedChannel=} [properties] Properties to set + * @returns {ibc.core.channel.v1.IdentifiedChannel} IdentifiedChannel instance + */ + IdentifiedChannel.create = function create(properties) { + return new IdentifiedChannel(properties); + }; + + /** + * Encodes the specified IdentifiedChannel message. Does not implicitly {@link ibc.core.channel.v1.IdentifiedChannel.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.IdentifiedChannel + * @static + * @param {ibc.core.channel.v1.IIdentifiedChannel} message IdentifiedChannel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentifiedChannel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.ordering != null && Object.hasOwnProperty.call(message, "ordering")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.ordering); + if (message.counterparty != null && Object.hasOwnProperty.call(message, "counterparty")) + $root.ibc.core.channel.v1.Counterparty.encode(message.counterparty, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.connectionHops != null && message.connectionHops.length) + for (let i = 0; i < message.connectionHops.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.connectionHops[i]); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.version); + if (message.portId != null && Object.hasOwnProperty.call(message, "portId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.portId); + if (message.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.channelId); + return writer; + }; + + /** + * Encodes the specified IdentifiedChannel message, length delimited. Does not implicitly {@link ibc.core.channel.v1.IdentifiedChannel.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.IdentifiedChannel + * @static + * @param {ibc.core.channel.v1.IIdentifiedChannel} message IdentifiedChannel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentifiedChannel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentifiedChannel message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.IdentifiedChannel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.IdentifiedChannel} IdentifiedChannel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentifiedChannel.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.IdentifiedChannel(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = reader.int32(); + break; + case 2: + message.ordering = reader.int32(); + break; + case 3: + message.counterparty = $root.ibc.core.channel.v1.Counterparty.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.connectionHops && message.connectionHops.length)) + message.connectionHops = []; + message.connectionHops.push(reader.string()); + break; + case 5: + message.version = reader.string(); + break; + case 6: + message.portId = reader.string(); + break; + case 7: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentifiedChannel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.IdentifiedChannel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.IdentifiedChannel} IdentifiedChannel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentifiedChannel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentifiedChannel message. + * @function verify + * @memberof ibc.core.channel.v1.IdentifiedChannel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentifiedChannel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.ordering != null && message.hasOwnProperty("ordering")) + switch (message.ordering) { + default: + return "ordering: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.counterparty != null && message.hasOwnProperty("counterparty")) { + let error = $root.ibc.core.channel.v1.Counterparty.verify(message.counterparty); + if (error) + return "counterparty." + error; + } + if (message.connectionHops != null && message.hasOwnProperty("connectionHops")) { + if (!Array.isArray(message.connectionHops)) + return "connectionHops: array expected"; + for (let i = 0; i < message.connectionHops.length; ++i) + if (!$util.isString(message.connectionHops[i])) + return "connectionHops: string[] expected"; + } + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.portId != null && message.hasOwnProperty("portId")) + if (!$util.isString(message.portId)) + return "portId: string expected"; + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + return null; + }; + + /** + * Creates an IdentifiedChannel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.IdentifiedChannel + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.IdentifiedChannel} IdentifiedChannel + */ + IdentifiedChannel.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.IdentifiedChannel) + return object; + let message = new $root.ibc.core.channel.v1.IdentifiedChannel(); + switch (object.state) { + case "STATE_UNINITIALIZED_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "STATE_INIT": + case 1: + message.state = 1; + break; + case "STATE_TRYOPEN": + case 2: + message.state = 2; + break; + case "STATE_OPEN": + case 3: + message.state = 3; + break; + case "STATE_CLOSED": + case 4: + message.state = 4; + break; + } + switch (object.ordering) { + case "ORDER_NONE_UNSPECIFIED": + case 0: + message.ordering = 0; + break; + case "ORDER_UNORDERED": + case 1: + message.ordering = 1; + break; + case "ORDER_ORDERED": + case 2: + message.ordering = 2; + break; + } + if (object.counterparty != null) { + if (typeof object.counterparty !== "object") + throw TypeError(".ibc.core.channel.v1.IdentifiedChannel.counterparty: object expected"); + message.counterparty = $root.ibc.core.channel.v1.Counterparty.fromObject(object.counterparty); + } + if (object.connectionHops) { + if (!Array.isArray(object.connectionHops)) + throw TypeError(".ibc.core.channel.v1.IdentifiedChannel.connectionHops: array expected"); + message.connectionHops = []; + for (let i = 0; i < object.connectionHops.length; ++i) + message.connectionHops[i] = String(object.connectionHops[i]); + } + if (object.version != null) + message.version = String(object.version); + if (object.portId != null) + message.portId = String(object.portId); + if (object.channelId != null) + message.channelId = String(object.channelId); + return message; + }; + + /** + * Creates a plain object from an IdentifiedChannel message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.IdentifiedChannel + * @static + * @param {ibc.core.channel.v1.IdentifiedChannel} message IdentifiedChannel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentifiedChannel.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.connectionHops = []; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNINITIALIZED_UNSPECIFIED" : 0; + object.ordering = options.enums === String ? "ORDER_NONE_UNSPECIFIED" : 0; + object.counterparty = null; + object.version = ""; + object.portId = ""; + object.channelId = ""; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.ibc.core.channel.v1.State[message.state] : message.state; + if (message.ordering != null && message.hasOwnProperty("ordering")) + object.ordering = options.enums === String ? $root.ibc.core.channel.v1.Order[message.ordering] : message.ordering; + if (message.counterparty != null && message.hasOwnProperty("counterparty")) + object.counterparty = $root.ibc.core.channel.v1.Counterparty.toObject(message.counterparty, options); + if (message.connectionHops && message.connectionHops.length) { + object.connectionHops = []; + for (let j = 0; j < message.connectionHops.length; ++j) + object.connectionHops[j] = message.connectionHops[j]; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.portId != null && message.hasOwnProperty("portId")) + object.portId = message.portId; + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + return object; + }; + + /** + * Converts this IdentifiedChannel to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.IdentifiedChannel + * @instance + * @returns {Object.} JSON object + */ + IdentifiedChannel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentifiedChannel; + })(v1.IdentifiedChannel || {}); + + /** + * State enum. + * @name ibc.core.channel.v1.State + * @enum {string} + * @property {number} STATE_UNINITIALIZED_UNSPECIFIED=0 STATE_UNINITIALIZED_UNSPECIFIED value + * @property {number} STATE_INIT=1 STATE_INIT value + * @property {number} STATE_TRYOPEN=2 STATE_TRYOPEN value + * @property {number} STATE_OPEN=3 STATE_OPEN value + * @property {number} STATE_CLOSED=4 STATE_CLOSED value + */ + v1.State = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNINITIALIZED_UNSPECIFIED"] = 0; + values[valuesById[1] = "STATE_INIT"] = 1; + values[valuesById[2] = "STATE_TRYOPEN"] = 2; + values[valuesById[3] = "STATE_OPEN"] = 3; + values[valuesById[4] = "STATE_CLOSED"] = 4; + return values; + })(); + + /** + * Order enum. + * @name ibc.core.channel.v1.Order + * @enum {string} + * @property {number} ORDER_NONE_UNSPECIFIED=0 ORDER_NONE_UNSPECIFIED value + * @property {number} ORDER_UNORDERED=1 ORDER_UNORDERED value + * @property {number} ORDER_ORDERED=2 ORDER_ORDERED value + */ + v1.Order = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ORDER_NONE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORDER_UNORDERED"] = 1; + values[valuesById[2] = "ORDER_ORDERED"] = 2; + return values; + })(); + + v1.Counterparty = (function(Counterparty) { + + /** + * Properties of a Counterparty. + * @memberof ibc.core.channel.v1 + * @interface ICounterparty + * @property {string|null} [portId] Counterparty portId + * @property {string|null} [channelId] Counterparty channelId + */ + + /** + * Constructs a new Counterparty. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a Counterparty. + * @implements ICounterparty + * @constructor + * @param {ibc.core.channel.v1.ICounterparty=} [properties] Properties to set + */ + function Counterparty(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Counterparty portId. + * @member {string} portId + * @memberof ibc.core.channel.v1.Counterparty + * @instance + */ + Counterparty.prototype.portId = ""; + + /** + * Counterparty channelId. + * @member {string} channelId + * @memberof ibc.core.channel.v1.Counterparty + * @instance + */ + Counterparty.prototype.channelId = ""; + + /** + * Creates a new Counterparty instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.Counterparty + * @static + * @param {ibc.core.channel.v1.ICounterparty=} [properties] Properties to set + * @returns {ibc.core.channel.v1.Counterparty} Counterparty instance + */ + Counterparty.create = function create(properties) { + return new Counterparty(properties); + }; + + /** + * Encodes the specified Counterparty message. Does not implicitly {@link ibc.core.channel.v1.Counterparty.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.Counterparty + * @static + * @param {ibc.core.channel.v1.ICounterparty} message Counterparty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Counterparty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.portId != null && Object.hasOwnProperty.call(message, "portId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.portId); + if (message.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.channelId); + return writer; + }; + + /** + * Encodes the specified Counterparty message, length delimited. Does not implicitly {@link ibc.core.channel.v1.Counterparty.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.Counterparty + * @static + * @param {ibc.core.channel.v1.ICounterparty} message Counterparty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Counterparty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Counterparty message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.Counterparty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.Counterparty} Counterparty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Counterparty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.Counterparty(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Counterparty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.Counterparty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.Counterparty} Counterparty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Counterparty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Counterparty message. + * @function verify + * @memberof ibc.core.channel.v1.Counterparty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Counterparty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.portId != null && message.hasOwnProperty("portId")) + if (!$util.isString(message.portId)) + return "portId: string expected"; + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + return null; + }; + + /** + * Creates a Counterparty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.Counterparty + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.Counterparty} Counterparty + */ + Counterparty.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.Counterparty) + return object; + let message = new $root.ibc.core.channel.v1.Counterparty(); + if (object.portId != null) + message.portId = String(object.portId); + if (object.channelId != null) + message.channelId = String(object.channelId); + return message; + }; + + /** + * Creates a plain object from a Counterparty message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.Counterparty + * @static + * @param {ibc.core.channel.v1.Counterparty} message Counterparty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Counterparty.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.portId = ""; + object.channelId = ""; + } + if (message.portId != null && message.hasOwnProperty("portId")) + object.portId = message.portId; + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + return object; + }; + + /** + * Converts this Counterparty to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.Counterparty + * @instance + * @returns {Object.} JSON object + */ + Counterparty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Counterparty; + })(v1.Counterparty || {}); + + v1.Packet = (function(Packet) { + + /** + * Properties of a Packet. + * @memberof ibc.core.channel.v1 + * @interface IPacket + * @property {number|Long|null} [sequence] Packet sequence + * @property {string|null} [sourcePort] Packet sourcePort + * @property {string|null} [sourceChannel] Packet sourceChannel + * @property {string|null} [destinationPort] Packet destinationPort + * @property {string|null} [destinationChannel] Packet destinationChannel + * @property {Uint8Array|null} [data] Packet data + * @property {ibc.core.client.v1.IHeight|null} [timeoutHeight] Packet timeoutHeight + * @property {number|Long|null} [timeoutTimestamp] Packet timeoutTimestamp + */ + + /** + * Constructs a new Packet. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a Packet. + * @implements IPacket + * @constructor + * @param {ibc.core.channel.v1.IPacket=} [properties] Properties to set + */ + function Packet(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Packet sequence. + * @member {number|Long} sequence + * @memberof ibc.core.channel.v1.Packet + * @instance + */ + Packet.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Packet sourcePort. + * @member {string} sourcePort + * @memberof ibc.core.channel.v1.Packet + * @instance + */ + Packet.prototype.sourcePort = ""; + + /** + * Packet sourceChannel. + * @member {string} sourceChannel + * @memberof ibc.core.channel.v1.Packet + * @instance + */ + Packet.prototype.sourceChannel = ""; + + /** + * Packet destinationPort. + * @member {string} destinationPort + * @memberof ibc.core.channel.v1.Packet + * @instance + */ + Packet.prototype.destinationPort = ""; + + /** + * Packet destinationChannel. + * @member {string} destinationChannel + * @memberof ibc.core.channel.v1.Packet + * @instance + */ + Packet.prototype.destinationChannel = ""; + + /** + * Packet data. + * @member {Uint8Array} data + * @memberof ibc.core.channel.v1.Packet + * @instance + */ + Packet.prototype.data = $util.newBuffer([]); + + /** + * Packet timeoutHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} timeoutHeight + * @memberof ibc.core.channel.v1.Packet + * @instance + */ + Packet.prototype.timeoutHeight = null; + + /** + * Packet timeoutTimestamp. + * @member {number|Long} timeoutTimestamp + * @memberof ibc.core.channel.v1.Packet + * @instance + */ + Packet.prototype.timeoutTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new Packet instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.Packet + * @static + * @param {ibc.core.channel.v1.IPacket=} [properties] Properties to set + * @returns {ibc.core.channel.v1.Packet} Packet instance + */ + Packet.create = function create(properties) { + return new Packet(properties); + }; + + /** + * Encodes the specified Packet message. Does not implicitly {@link ibc.core.channel.v1.Packet.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.Packet + * @static + * @param {ibc.core.channel.v1.IPacket} message Packet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Packet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.sequence); + if (message.sourcePort != null && Object.hasOwnProperty.call(message, "sourcePort")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourcePort); + if (message.sourceChannel != null && Object.hasOwnProperty.call(message, "sourceChannel")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sourceChannel); + if (message.destinationPort != null && Object.hasOwnProperty.call(message, "destinationPort")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.destinationPort); + if (message.destinationChannel != null && Object.hasOwnProperty.call(message, "destinationChannel")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.destinationChannel); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.data); + if (message.timeoutHeight != null && Object.hasOwnProperty.call(message, "timeoutHeight")) + $root.ibc.core.client.v1.Height.encode(message.timeoutHeight, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.timeoutTimestamp != null && Object.hasOwnProperty.call(message, "timeoutTimestamp")) + writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.timeoutTimestamp); + return writer; + }; + + /** + * Encodes the specified Packet message, length delimited. Does not implicitly {@link ibc.core.channel.v1.Packet.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.Packet + * @static + * @param {ibc.core.channel.v1.IPacket} message Packet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Packet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Packet message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.Packet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.Packet} Packet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Packet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.Packet(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequence = reader.uint64(); + break; + case 2: + message.sourcePort = reader.string(); + break; + case 3: + message.sourceChannel = reader.string(); + break; + case 4: + message.destinationPort = reader.string(); + break; + case 5: + message.destinationChannel = reader.string(); + break; + case 6: + message.data = reader.bytes(); + break; + case 7: + message.timeoutHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + case 8: + message.timeoutTimestamp = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Packet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.Packet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.Packet} Packet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Packet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Packet message. + * @function verify + * @memberof ibc.core.channel.v1.Packet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Packet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sequence != null && message.hasOwnProperty("sequence")) + if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) + return "sequence: integer|Long expected"; + if (message.sourcePort != null && message.hasOwnProperty("sourcePort")) + if (!$util.isString(message.sourcePort)) + return "sourcePort: string expected"; + if (message.sourceChannel != null && message.hasOwnProperty("sourceChannel")) + if (!$util.isString(message.sourceChannel)) + return "sourceChannel: string expected"; + if (message.destinationPort != null && message.hasOwnProperty("destinationPort")) + if (!$util.isString(message.destinationPort)) + return "destinationPort: string expected"; + if (message.destinationChannel != null && message.hasOwnProperty("destinationChannel")) + if (!$util.isString(message.destinationChannel)) + return "destinationChannel: string expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + if (message.timeoutHeight != null && message.hasOwnProperty("timeoutHeight")) { + let error = $root.ibc.core.client.v1.Height.verify(message.timeoutHeight); + if (error) + return "timeoutHeight." + error; + } + if (message.timeoutTimestamp != null && message.hasOwnProperty("timeoutTimestamp")) + if (!$util.isInteger(message.timeoutTimestamp) && !(message.timeoutTimestamp && $util.isInteger(message.timeoutTimestamp.low) && $util.isInteger(message.timeoutTimestamp.high))) + return "timeoutTimestamp: integer|Long expected"; + return null; + }; + + /** + * Creates a Packet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.Packet + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.Packet} Packet + */ + Packet.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.Packet) + return object; + let message = new $root.ibc.core.channel.v1.Packet(); + if (object.sequence != null) + if ($util.Long) + (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; + else if (typeof object.sequence === "string") + message.sequence = parseInt(object.sequence, 10); + else if (typeof object.sequence === "number") + message.sequence = object.sequence; + else if (typeof object.sequence === "object") + message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); + if (object.sourcePort != null) + message.sourcePort = String(object.sourcePort); + if (object.sourceChannel != null) + message.sourceChannel = String(object.sourceChannel); + if (object.destinationPort != null) + message.destinationPort = String(object.destinationPort); + if (object.destinationChannel != null) + message.destinationChannel = String(object.destinationChannel); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length) + message.data = object.data; + if (object.timeoutHeight != null) { + if (typeof object.timeoutHeight !== "object") + throw TypeError(".ibc.core.channel.v1.Packet.timeoutHeight: object expected"); + message.timeoutHeight = $root.ibc.core.client.v1.Height.fromObject(object.timeoutHeight); + } + if (object.timeoutTimestamp != null) + if ($util.Long) + (message.timeoutTimestamp = $util.Long.fromValue(object.timeoutTimestamp)).unsigned = true; + else if (typeof object.timeoutTimestamp === "string") + message.timeoutTimestamp = parseInt(object.timeoutTimestamp, 10); + else if (typeof object.timeoutTimestamp === "number") + message.timeoutTimestamp = object.timeoutTimestamp; + else if (typeof object.timeoutTimestamp === "object") + message.timeoutTimestamp = new $util.LongBits(object.timeoutTimestamp.low >>> 0, object.timeoutTimestamp.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a Packet message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.Packet + * @static + * @param {ibc.core.channel.v1.Packet} message Packet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Packet.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sequence = options.longs === String ? "0" : 0; + object.sourcePort = ""; + object.sourceChannel = ""; + object.destinationPort = ""; + object.destinationChannel = ""; + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + object.timeoutHeight = null; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.timeoutTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timeoutTimestamp = options.longs === String ? "0" : 0; + } + if (message.sequence != null && message.hasOwnProperty("sequence")) + if (typeof message.sequence === "number") + object.sequence = options.longs === String ? String(message.sequence) : message.sequence; + else + object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; + if (message.sourcePort != null && message.hasOwnProperty("sourcePort")) + object.sourcePort = message.sourcePort; + if (message.sourceChannel != null && message.hasOwnProperty("sourceChannel")) + object.sourceChannel = message.sourceChannel; + if (message.destinationPort != null && message.hasOwnProperty("destinationPort")) + object.destinationPort = message.destinationPort; + if (message.destinationChannel != null && message.hasOwnProperty("destinationChannel")) + object.destinationChannel = message.destinationChannel; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + if (message.timeoutHeight != null && message.hasOwnProperty("timeoutHeight")) + object.timeoutHeight = $root.ibc.core.client.v1.Height.toObject(message.timeoutHeight, options); + if (message.timeoutTimestamp != null && message.hasOwnProperty("timeoutTimestamp")) + if (typeof message.timeoutTimestamp === "number") + object.timeoutTimestamp = options.longs === String ? String(message.timeoutTimestamp) : message.timeoutTimestamp; + else + object.timeoutTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timeoutTimestamp) : options.longs === Number ? new $util.LongBits(message.timeoutTimestamp.low >>> 0, message.timeoutTimestamp.high >>> 0).toNumber(true) : message.timeoutTimestamp; + return object; + }; + + /** + * Converts this Packet to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.Packet + * @instance + * @returns {Object.} JSON object + */ + Packet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Packet; + })(v1.Packet || {}); + + v1.PacketState = (function(PacketState) { + + /** + * Properties of a PacketState. + * @memberof ibc.core.channel.v1 + * @interface IPacketState + * @property {string|null} [portId] PacketState portId + * @property {string|null} [channelId] PacketState channelId + * @property {number|Long|null} [sequence] PacketState sequence + * @property {Uint8Array|null} [data] PacketState data + */ + + /** + * Constructs a new PacketState. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a PacketState. + * @implements IPacketState + * @constructor + * @param {ibc.core.channel.v1.IPacketState=} [properties] Properties to set + */ + function PacketState(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PacketState portId. + * @member {string} portId + * @memberof ibc.core.channel.v1.PacketState + * @instance + */ + PacketState.prototype.portId = ""; + + /** + * PacketState channelId. + * @member {string} channelId + * @memberof ibc.core.channel.v1.PacketState + * @instance + */ + PacketState.prototype.channelId = ""; + + /** + * PacketState sequence. + * @member {number|Long} sequence + * @memberof ibc.core.channel.v1.PacketState + * @instance + */ + PacketState.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * PacketState data. + * @member {Uint8Array} data + * @memberof ibc.core.channel.v1.PacketState + * @instance + */ + PacketState.prototype.data = $util.newBuffer([]); + + /** + * Creates a new PacketState instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.PacketState + * @static + * @param {ibc.core.channel.v1.IPacketState=} [properties] Properties to set + * @returns {ibc.core.channel.v1.PacketState} PacketState instance + */ + PacketState.create = function create(properties) { + return new PacketState(properties); + }; + + /** + * Encodes the specified PacketState message. Does not implicitly {@link ibc.core.channel.v1.PacketState.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.PacketState + * @static + * @param {ibc.core.channel.v1.IPacketState} message PacketState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PacketState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.portId != null && Object.hasOwnProperty.call(message, "portId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.portId); + if (message.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.channelId); + if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.sequence); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.data); + return writer; + }; + + /** + * Encodes the specified PacketState message, length delimited. Does not implicitly {@link ibc.core.channel.v1.PacketState.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.PacketState + * @static + * @param {ibc.core.channel.v1.IPacketState} message PacketState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PacketState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PacketState message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.PacketState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.PacketState} PacketState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PacketState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.PacketState(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.sequence = reader.uint64(); + break; + case 4: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PacketState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.PacketState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.PacketState} PacketState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PacketState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PacketState message. + * @function verify + * @memberof ibc.core.channel.v1.PacketState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PacketState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.portId != null && message.hasOwnProperty("portId")) + if (!$util.isString(message.portId)) + return "portId: string expected"; + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + if (message.sequence != null && message.hasOwnProperty("sequence")) + if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) + return "sequence: integer|Long expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + return null; + }; + + /** + * Creates a PacketState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.PacketState + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.PacketState} PacketState + */ + PacketState.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.PacketState) + return object; + let message = new $root.ibc.core.channel.v1.PacketState(); + if (object.portId != null) + message.portId = String(object.portId); + if (object.channelId != null) + message.channelId = String(object.channelId); + if (object.sequence != null) + if ($util.Long) + (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; + else if (typeof object.sequence === "string") + message.sequence = parseInt(object.sequence, 10); + else if (typeof object.sequence === "number") + message.sequence = object.sequence; + else if (typeof object.sequence === "object") + message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length) + message.data = object.data; + return message; + }; + + /** + * Creates a plain object from a PacketState message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.PacketState + * @static + * @param {ibc.core.channel.v1.PacketState} message PacketState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PacketState.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.portId = ""; + object.channelId = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sequence = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + } + if (message.portId != null && message.hasOwnProperty("portId")) + object.portId = message.portId; + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + if (message.sequence != null && message.hasOwnProperty("sequence")) + if (typeof message.sequence === "number") + object.sequence = options.longs === String ? String(message.sequence) : message.sequence; + else + object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + return object; + }; + + /** + * Converts this PacketState to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.PacketState + * @instance + * @returns {Object.} JSON object + */ + PacketState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PacketState; + })(v1.PacketState || {}); + + v1.Acknowledgement = (function(Acknowledgement) { + + /** + * Properties of an Acknowledgement. + * @memberof ibc.core.channel.v1 + * @interface IAcknowledgement + * @property {Uint8Array|null} [result] Acknowledgement result + * @property {string|null} [error] Acknowledgement error + */ + + /** + * Constructs a new Acknowledgement. + * @memberof ibc.core.channel.v1 + * @classdesc Represents an Acknowledgement. + * @implements IAcknowledgement + * @constructor + * @param {ibc.core.channel.v1.IAcknowledgement=} [properties] Properties to set + */ + function Acknowledgement(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Acknowledgement result. + * @member {Uint8Array} result + * @memberof ibc.core.channel.v1.Acknowledgement + * @instance + */ + Acknowledgement.prototype.result = $util.newBuffer([]); + + /** + * Acknowledgement error. + * @member {string} error + * @memberof ibc.core.channel.v1.Acknowledgement + * @instance + */ + Acknowledgement.prototype.error = ""; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Acknowledgement response. + * @member {"result"|"error"|undefined} response + * @memberof ibc.core.channel.v1.Acknowledgement + * @instance + */ + Object.defineProperty(Acknowledgement.prototype, "response", { + get: $util.oneOfGetter($oneOfFields = ["result", "error"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Acknowledgement instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.Acknowledgement + * @static + * @param {ibc.core.channel.v1.IAcknowledgement=} [properties] Properties to set + * @returns {ibc.core.channel.v1.Acknowledgement} Acknowledgement instance + */ + Acknowledgement.create = function create(properties) { + return new Acknowledgement(properties); + }; + + /** + * Encodes the specified Acknowledgement message. Does not implicitly {@link ibc.core.channel.v1.Acknowledgement.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.Acknowledgement + * @static + * @param {ibc.core.channel.v1.IAcknowledgement} message Acknowledgement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Acknowledgement.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.result != null && Object.hasOwnProperty.call(message, "result")) + writer.uint32(/* id 21, wireType 2 =*/170).bytes(message.result); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + writer.uint32(/* id 22, wireType 2 =*/178).string(message.error); + return writer; + }; + + /** + * Encodes the specified Acknowledgement message, length delimited. Does not implicitly {@link ibc.core.channel.v1.Acknowledgement.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.Acknowledgement + * @static + * @param {ibc.core.channel.v1.IAcknowledgement} message Acknowledgement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Acknowledgement.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Acknowledgement message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.Acknowledgement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.Acknowledgement} Acknowledgement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Acknowledgement.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.Acknowledgement(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 21: + message.result = reader.bytes(); + break; + case 22: + message.error = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Acknowledgement message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.Acknowledgement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.Acknowledgement} Acknowledgement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Acknowledgement.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Acknowledgement message. + * @function verify + * @memberof ibc.core.channel.v1.Acknowledgement + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Acknowledgement.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + let properties = {}; + if (message.result != null && message.hasOwnProperty("result")) { + properties.response = 1; + if (!(message.result && typeof message.result.length === "number" || $util.isString(message.result))) + return "result: buffer expected"; + } + if (message.error != null && message.hasOwnProperty("error")) { + if (properties.response === 1) + return "response: multiple values"; + properties.response = 1; + if (!$util.isString(message.error)) + return "error: string expected"; + } + return null; + }; + + /** + * Creates an Acknowledgement message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.Acknowledgement + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.Acknowledgement} Acknowledgement + */ + Acknowledgement.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.Acknowledgement) + return object; + let message = new $root.ibc.core.channel.v1.Acknowledgement(); + if (object.result != null) + if (typeof object.result === "string") + $util.base64.decode(object.result, message.result = $util.newBuffer($util.base64.length(object.result)), 0); + else if (object.result.length) + message.result = object.result; + if (object.error != null) + message.error = String(object.error); + return message; + }; + + /** + * Creates a plain object from an Acknowledgement message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.Acknowledgement + * @static + * @param {ibc.core.channel.v1.Acknowledgement} message Acknowledgement + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Acknowledgement.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.result != null && message.hasOwnProperty("result")) { + object.result = options.bytes === String ? $util.base64.encode(message.result, 0, message.result.length) : options.bytes === Array ? Array.prototype.slice.call(message.result) : message.result; + if (options.oneofs) + object.response = "result"; + } + if (message.error != null && message.hasOwnProperty("error")) { + object.error = message.error; + if (options.oneofs) + object.response = "error"; + } + return object; + }; + + /** + * Converts this Acknowledgement to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.Acknowledgement + * @instance + * @returns {Object.} JSON object + */ + Acknowledgement.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Acknowledgement; + })(v1.Acknowledgement || {}); + + v1.GenesisState = (function(GenesisState) { + + /** + * Properties of a GenesisState. + * @memberof ibc.core.channel.v1 + * @interface IGenesisState + * @property {Array.|null} [channels] GenesisState channels + * @property {Array.|null} [acknowledgements] GenesisState acknowledgements + * @property {Array.|null} [commitments] GenesisState commitments + * @property {Array.|null} [receipts] GenesisState receipts + * @property {Array.|null} [sendSequences] GenesisState sendSequences + * @property {Array.|null} [recvSequences] GenesisState recvSequences + * @property {Array.|null} [ackSequences] GenesisState ackSequences + * @property {number|Long|null} [nextChannelSequence] GenesisState nextChannelSequence + */ + + /** + * Constructs a new GenesisState. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a GenesisState. + * @implements IGenesisState + * @constructor + * @param {ibc.core.channel.v1.IGenesisState=} [properties] Properties to set + */ + function GenesisState(properties) { + this.channels = []; + this.acknowledgements = []; + this.commitments = []; + this.receipts = []; + this.sendSequences = []; + this.recvSequences = []; + this.ackSequences = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenesisState channels. + * @member {Array.} channels + * @memberof ibc.core.channel.v1.GenesisState + * @instance + */ + GenesisState.prototype.channels = $util.emptyArray; + + /** + * GenesisState acknowledgements. + * @member {Array.} acknowledgements + * @memberof ibc.core.channel.v1.GenesisState + * @instance + */ + GenesisState.prototype.acknowledgements = $util.emptyArray; + + /** + * GenesisState commitments. + * @member {Array.} commitments + * @memberof ibc.core.channel.v1.GenesisState + * @instance + */ + GenesisState.prototype.commitments = $util.emptyArray; + + /** + * GenesisState receipts. + * @member {Array.} receipts + * @memberof ibc.core.channel.v1.GenesisState + * @instance + */ + GenesisState.prototype.receipts = $util.emptyArray; + + /** + * GenesisState sendSequences. + * @member {Array.} sendSequences + * @memberof ibc.core.channel.v1.GenesisState + * @instance + */ + GenesisState.prototype.sendSequences = $util.emptyArray; + + /** + * GenesisState recvSequences. + * @member {Array.} recvSequences + * @memberof ibc.core.channel.v1.GenesisState + * @instance + */ + GenesisState.prototype.recvSequences = $util.emptyArray; + + /** + * GenesisState ackSequences. + * @member {Array.} ackSequences + * @memberof ibc.core.channel.v1.GenesisState + * @instance + */ + GenesisState.prototype.ackSequences = $util.emptyArray; + + /** + * GenesisState nextChannelSequence. + * @member {number|Long} nextChannelSequence + * @memberof ibc.core.channel.v1.GenesisState + * @instance + */ + GenesisState.prototype.nextChannelSequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new GenesisState instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.GenesisState + * @static + * @param {ibc.core.channel.v1.IGenesisState=} [properties] Properties to set + * @returns {ibc.core.channel.v1.GenesisState} GenesisState instance + */ + GenesisState.create = function create(properties) { + return new GenesisState(properties); + }; + + /** + * Encodes the specified GenesisState message. Does not implicitly {@link ibc.core.channel.v1.GenesisState.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.GenesisState + * @static + * @param {ibc.core.channel.v1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.channels != null && message.channels.length) + for (let i = 0; i < message.channels.length; ++i) + $root.ibc.core.channel.v1.IdentifiedChannel.encode(message.channels[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.acknowledgements != null && message.acknowledgements.length) + for (let i = 0; i < message.acknowledgements.length; ++i) + $root.ibc.core.channel.v1.PacketState.encode(message.acknowledgements[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.commitments != null && message.commitments.length) + for (let i = 0; i < message.commitments.length; ++i) + $root.ibc.core.channel.v1.PacketState.encode(message.commitments[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.receipts != null && message.receipts.length) + for (let i = 0; i < message.receipts.length; ++i) + $root.ibc.core.channel.v1.PacketState.encode(message.receipts[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.sendSequences != null && message.sendSequences.length) + for (let i = 0; i < message.sendSequences.length; ++i) + $root.ibc.core.channel.v1.PacketSequence.encode(message.sendSequences[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.recvSequences != null && message.recvSequences.length) + for (let i = 0; i < message.recvSequences.length; ++i) + $root.ibc.core.channel.v1.PacketSequence.encode(message.recvSequences[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.ackSequences != null && message.ackSequences.length) + for (let i = 0; i < message.ackSequences.length; ++i) + $root.ibc.core.channel.v1.PacketSequence.encode(message.ackSequences[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.nextChannelSequence != null && Object.hasOwnProperty.call(message, "nextChannelSequence")) + writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.nextChannelSequence); + return writer; + }; + + /** + * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link ibc.core.channel.v1.GenesisState.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.GenesisState + * @static + * @param {ibc.core.channel.v1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.GenesisState(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.channels && message.channels.length)) + message.channels = []; + message.channels.push($root.ibc.core.channel.v1.IdentifiedChannel.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.acknowledgements && message.acknowledgements.length)) + message.acknowledgements = []; + message.acknowledgements.push($root.ibc.core.channel.v1.PacketState.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.commitments && message.commitments.length)) + message.commitments = []; + message.commitments.push($root.ibc.core.channel.v1.PacketState.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.receipts && message.receipts.length)) + message.receipts = []; + message.receipts.push($root.ibc.core.channel.v1.PacketState.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.sendSequences && message.sendSequences.length)) + message.sendSequences = []; + message.sendSequences.push($root.ibc.core.channel.v1.PacketSequence.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.recvSequences && message.recvSequences.length)) + message.recvSequences = []; + message.recvSequences.push($root.ibc.core.channel.v1.PacketSequence.decode(reader, reader.uint32())); + break; + case 7: + if (!(message.ackSequences && message.ackSequences.length)) + message.ackSequences = []; + message.ackSequences.push($root.ibc.core.channel.v1.PacketSequence.decode(reader, reader.uint32())); + break; + case 8: + message.nextChannelSequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenesisState message. + * @function verify + * @memberof ibc.core.channel.v1.GenesisState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenesisState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.channels != null && message.hasOwnProperty("channels")) { + if (!Array.isArray(message.channels)) + return "channels: array expected"; + for (let i = 0; i < message.channels.length; ++i) { + let error = $root.ibc.core.channel.v1.IdentifiedChannel.verify(message.channels[i]); + if (error) + return "channels." + error; + } + } + if (message.acknowledgements != null && message.hasOwnProperty("acknowledgements")) { + if (!Array.isArray(message.acknowledgements)) + return "acknowledgements: array expected"; + for (let i = 0; i < message.acknowledgements.length; ++i) { + let error = $root.ibc.core.channel.v1.PacketState.verify(message.acknowledgements[i]); + if (error) + return "acknowledgements." + error; + } + } + if (message.commitments != null && message.hasOwnProperty("commitments")) { + if (!Array.isArray(message.commitments)) + return "commitments: array expected"; + for (let i = 0; i < message.commitments.length; ++i) { + let error = $root.ibc.core.channel.v1.PacketState.verify(message.commitments[i]); + if (error) + return "commitments." + error; + } + } + if (message.receipts != null && message.hasOwnProperty("receipts")) { + if (!Array.isArray(message.receipts)) + return "receipts: array expected"; + for (let i = 0; i < message.receipts.length; ++i) { + let error = $root.ibc.core.channel.v1.PacketState.verify(message.receipts[i]); + if (error) + return "receipts." + error; + } + } + if (message.sendSequences != null && message.hasOwnProperty("sendSequences")) { + if (!Array.isArray(message.sendSequences)) + return "sendSequences: array expected"; + for (let i = 0; i < message.sendSequences.length; ++i) { + let error = $root.ibc.core.channel.v1.PacketSequence.verify(message.sendSequences[i]); + if (error) + return "sendSequences." + error; + } + } + if (message.recvSequences != null && message.hasOwnProperty("recvSequences")) { + if (!Array.isArray(message.recvSequences)) + return "recvSequences: array expected"; + for (let i = 0; i < message.recvSequences.length; ++i) { + let error = $root.ibc.core.channel.v1.PacketSequence.verify(message.recvSequences[i]); + if (error) + return "recvSequences." + error; + } + } + if (message.ackSequences != null && message.hasOwnProperty("ackSequences")) { + if (!Array.isArray(message.ackSequences)) + return "ackSequences: array expected"; + for (let i = 0; i < message.ackSequences.length; ++i) { + let error = $root.ibc.core.channel.v1.PacketSequence.verify(message.ackSequences[i]); + if (error) + return "ackSequences." + error; + } + } + if (message.nextChannelSequence != null && message.hasOwnProperty("nextChannelSequence")) + if (!$util.isInteger(message.nextChannelSequence) && !(message.nextChannelSequence && $util.isInteger(message.nextChannelSequence.low) && $util.isInteger(message.nextChannelSequence.high))) + return "nextChannelSequence: integer|Long expected"; + return null; + }; + + /** + * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.GenesisState + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.GenesisState} GenesisState + */ + GenesisState.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.GenesisState) + return object; + let message = new $root.ibc.core.channel.v1.GenesisState(); + if (object.channels) { + if (!Array.isArray(object.channels)) + throw TypeError(".ibc.core.channel.v1.GenesisState.channels: array expected"); + message.channels = []; + for (let i = 0; i < object.channels.length; ++i) { + if (typeof object.channels[i] !== "object") + throw TypeError(".ibc.core.channel.v1.GenesisState.channels: object expected"); + message.channels[i] = $root.ibc.core.channel.v1.IdentifiedChannel.fromObject(object.channels[i]); + } + } + if (object.acknowledgements) { + if (!Array.isArray(object.acknowledgements)) + throw TypeError(".ibc.core.channel.v1.GenesisState.acknowledgements: array expected"); + message.acknowledgements = []; + for (let i = 0; i < object.acknowledgements.length; ++i) { + if (typeof object.acknowledgements[i] !== "object") + throw TypeError(".ibc.core.channel.v1.GenesisState.acknowledgements: object expected"); + message.acknowledgements[i] = $root.ibc.core.channel.v1.PacketState.fromObject(object.acknowledgements[i]); + } + } + if (object.commitments) { + if (!Array.isArray(object.commitments)) + throw TypeError(".ibc.core.channel.v1.GenesisState.commitments: array expected"); + message.commitments = []; + for (let i = 0; i < object.commitments.length; ++i) { + if (typeof object.commitments[i] !== "object") + throw TypeError(".ibc.core.channel.v1.GenesisState.commitments: object expected"); + message.commitments[i] = $root.ibc.core.channel.v1.PacketState.fromObject(object.commitments[i]); + } + } + if (object.receipts) { + if (!Array.isArray(object.receipts)) + throw TypeError(".ibc.core.channel.v1.GenesisState.receipts: array expected"); + message.receipts = []; + for (let i = 0; i < object.receipts.length; ++i) { + if (typeof object.receipts[i] !== "object") + throw TypeError(".ibc.core.channel.v1.GenesisState.receipts: object expected"); + message.receipts[i] = $root.ibc.core.channel.v1.PacketState.fromObject(object.receipts[i]); + } + } + if (object.sendSequences) { + if (!Array.isArray(object.sendSequences)) + throw TypeError(".ibc.core.channel.v1.GenesisState.sendSequences: array expected"); + message.sendSequences = []; + for (let i = 0; i < object.sendSequences.length; ++i) { + if (typeof object.sendSequences[i] !== "object") + throw TypeError(".ibc.core.channel.v1.GenesisState.sendSequences: object expected"); + message.sendSequences[i] = $root.ibc.core.channel.v1.PacketSequence.fromObject(object.sendSequences[i]); + } + } + if (object.recvSequences) { + if (!Array.isArray(object.recvSequences)) + throw TypeError(".ibc.core.channel.v1.GenesisState.recvSequences: array expected"); + message.recvSequences = []; + for (let i = 0; i < object.recvSequences.length; ++i) { + if (typeof object.recvSequences[i] !== "object") + throw TypeError(".ibc.core.channel.v1.GenesisState.recvSequences: object expected"); + message.recvSequences[i] = $root.ibc.core.channel.v1.PacketSequence.fromObject(object.recvSequences[i]); + } + } + if (object.ackSequences) { + if (!Array.isArray(object.ackSequences)) + throw TypeError(".ibc.core.channel.v1.GenesisState.ackSequences: array expected"); + message.ackSequences = []; + for (let i = 0; i < object.ackSequences.length; ++i) { + if (typeof object.ackSequences[i] !== "object") + throw TypeError(".ibc.core.channel.v1.GenesisState.ackSequences: object expected"); + message.ackSequences[i] = $root.ibc.core.channel.v1.PacketSequence.fromObject(object.ackSequences[i]); + } + } + if (object.nextChannelSequence != null) + if ($util.Long) + (message.nextChannelSequence = $util.Long.fromValue(object.nextChannelSequence)).unsigned = true; + else if (typeof object.nextChannelSequence === "string") + message.nextChannelSequence = parseInt(object.nextChannelSequence, 10); + else if (typeof object.nextChannelSequence === "number") + message.nextChannelSequence = object.nextChannelSequence; + else if (typeof object.nextChannelSequence === "object") + message.nextChannelSequence = new $util.LongBits(object.nextChannelSequence.low >>> 0, object.nextChannelSequence.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a GenesisState message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.GenesisState + * @static + * @param {ibc.core.channel.v1.GenesisState} message GenesisState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenesisState.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) { + object.channels = []; + object.acknowledgements = []; + object.commitments = []; + object.receipts = []; + object.sendSequences = []; + object.recvSequences = []; + object.ackSequences = []; + } + if (options.defaults) + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.nextChannelSequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nextChannelSequence = options.longs === String ? "0" : 0; + if (message.channels && message.channels.length) { + object.channels = []; + for (let j = 0; j < message.channels.length; ++j) + object.channels[j] = $root.ibc.core.channel.v1.IdentifiedChannel.toObject(message.channels[j], options); + } + if (message.acknowledgements && message.acknowledgements.length) { + object.acknowledgements = []; + for (let j = 0; j < message.acknowledgements.length; ++j) + object.acknowledgements[j] = $root.ibc.core.channel.v1.PacketState.toObject(message.acknowledgements[j], options); + } + if (message.commitments && message.commitments.length) { + object.commitments = []; + for (let j = 0; j < message.commitments.length; ++j) + object.commitments[j] = $root.ibc.core.channel.v1.PacketState.toObject(message.commitments[j], options); + } + if (message.receipts && message.receipts.length) { + object.receipts = []; + for (let j = 0; j < message.receipts.length; ++j) + object.receipts[j] = $root.ibc.core.channel.v1.PacketState.toObject(message.receipts[j], options); + } + if (message.sendSequences && message.sendSequences.length) { + object.sendSequences = []; + for (let j = 0; j < message.sendSequences.length; ++j) + object.sendSequences[j] = $root.ibc.core.channel.v1.PacketSequence.toObject(message.sendSequences[j], options); + } + if (message.recvSequences && message.recvSequences.length) { + object.recvSequences = []; + for (let j = 0; j < message.recvSequences.length; ++j) + object.recvSequences[j] = $root.ibc.core.channel.v1.PacketSequence.toObject(message.recvSequences[j], options); + } + if (message.ackSequences && message.ackSequences.length) { + object.ackSequences = []; + for (let j = 0; j < message.ackSequences.length; ++j) + object.ackSequences[j] = $root.ibc.core.channel.v1.PacketSequence.toObject(message.ackSequences[j], options); + } + if (message.nextChannelSequence != null && message.hasOwnProperty("nextChannelSequence")) + if (typeof message.nextChannelSequence === "number") + object.nextChannelSequence = options.longs === String ? String(message.nextChannelSequence) : message.nextChannelSequence; + else + object.nextChannelSequence = options.longs === String ? $util.Long.prototype.toString.call(message.nextChannelSequence) : options.longs === Number ? new $util.LongBits(message.nextChannelSequence.low >>> 0, message.nextChannelSequence.high >>> 0).toNumber(true) : message.nextChannelSequence; + return object; + }; + + /** + * Converts this GenesisState to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.GenesisState + * @instance + * @returns {Object.} JSON object + */ + GenesisState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GenesisState; + })(v1.GenesisState || {}); + + v1.PacketSequence = (function(PacketSequence) { + + /** + * Properties of a PacketSequence. + * @memberof ibc.core.channel.v1 + * @interface IPacketSequence + * @property {string|null} [portId] PacketSequence portId + * @property {string|null} [channelId] PacketSequence channelId + * @property {number|Long|null} [sequence] PacketSequence sequence + */ + + /** + * Constructs a new PacketSequence. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a PacketSequence. + * @implements IPacketSequence + * @constructor + * @param {ibc.core.channel.v1.IPacketSequence=} [properties] Properties to set + */ + function PacketSequence(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PacketSequence portId. + * @member {string} portId + * @memberof ibc.core.channel.v1.PacketSequence + * @instance + */ + PacketSequence.prototype.portId = ""; + + /** + * PacketSequence channelId. + * @member {string} channelId + * @memberof ibc.core.channel.v1.PacketSequence + * @instance + */ + PacketSequence.prototype.channelId = ""; + + /** + * PacketSequence sequence. + * @member {number|Long} sequence + * @memberof ibc.core.channel.v1.PacketSequence + * @instance + */ + PacketSequence.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PacketSequence instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.PacketSequence + * @static + * @param {ibc.core.channel.v1.IPacketSequence=} [properties] Properties to set + * @returns {ibc.core.channel.v1.PacketSequence} PacketSequence instance + */ + PacketSequence.create = function create(properties) { + return new PacketSequence(properties); + }; + + /** + * Encodes the specified PacketSequence message. Does not implicitly {@link ibc.core.channel.v1.PacketSequence.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.PacketSequence + * @static + * @param {ibc.core.channel.v1.IPacketSequence} message PacketSequence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PacketSequence.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.portId != null && Object.hasOwnProperty.call(message, "portId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.portId); + if (message.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.channelId); + if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.sequence); + return writer; + }; + + /** + * Encodes the specified PacketSequence message, length delimited. Does not implicitly {@link ibc.core.channel.v1.PacketSequence.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.PacketSequence + * @static + * @param {ibc.core.channel.v1.IPacketSequence} message PacketSequence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PacketSequence.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PacketSequence message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.PacketSequence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.PacketSequence} PacketSequence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PacketSequence.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.PacketSequence(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.sequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PacketSequence message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.PacketSequence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.PacketSequence} PacketSequence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PacketSequence.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PacketSequence message. + * @function verify + * @memberof ibc.core.channel.v1.PacketSequence + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PacketSequence.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.portId != null && message.hasOwnProperty("portId")) + if (!$util.isString(message.portId)) + return "portId: string expected"; + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + if (message.sequence != null && message.hasOwnProperty("sequence")) + if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) + return "sequence: integer|Long expected"; + return null; + }; + + /** + * Creates a PacketSequence message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.PacketSequence + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.PacketSequence} PacketSequence + */ + PacketSequence.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.PacketSequence) + return object; + let message = new $root.ibc.core.channel.v1.PacketSequence(); + if (object.portId != null) + message.portId = String(object.portId); + if (object.channelId != null) + message.channelId = String(object.channelId); + if (object.sequence != null) + if ($util.Long) + (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; + else if (typeof object.sequence === "string") + message.sequence = parseInt(object.sequence, 10); + else if (typeof object.sequence === "number") + message.sequence = object.sequence; + else if (typeof object.sequence === "object") + message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a PacketSequence message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.PacketSequence + * @static + * @param {ibc.core.channel.v1.PacketSequence} message PacketSequence + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PacketSequence.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.portId = ""; + object.channelId = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sequence = options.longs === String ? "0" : 0; + } + if (message.portId != null && message.hasOwnProperty("portId")) + object.portId = message.portId; + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + if (message.sequence != null && message.hasOwnProperty("sequence")) + if (typeof message.sequence === "number") + object.sequence = options.longs === String ? String(message.sequence) : message.sequence; + else + object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; + return object; + }; + + /** + * Converts this PacketSequence to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.PacketSequence + * @instance + * @returns {Object.} JSON object + */ + PacketSequence.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PacketSequence; + })(v1.PacketSequence || {}); + + v1.Query = (function(Query) { + + /** + * Constructs a new Query service. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a Query + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Query(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; + + /** + * Creates new Query service using the specified rpc implementation. + * @function create + * @memberof ibc.core.channel.v1.Query + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Query} RPC service. Useful where requests and/or responses are streamed. + */ + Query.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link ibc.core.channel.v1.Query#channel}. + * @memberof ibc.core.channel.v1.Query + * @typedef ChannelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.channel.v1.IQueryChannelResponse} [response] QueryChannelResponse + */ + + /** + * Calls Channel. + * @function channel + * @memberof ibc.core.channel.v1.Query + * @instance + * @param {ibc.core.channel.v1.IQueryChannelRequest} request QueryChannelRequest message or plain object + * @param {ibc.core.channel.v1.Query.ChannelCallback} callback Node-style callback called with the error, if any, and QueryChannelResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.channel = function channel(request, callback) { + return this.rpcCall(channel, $root.ibc.core.channel.v1.QueryChannelRequest, $root.ibc.core.channel.v1.QueryChannelResponse, request, callback); + }, "name", { value: "Channel" }); + + /** + * Calls Channel. + * @function channel + * @memberof ibc.core.channel.v1.Query + * @instance + * @param {ibc.core.channel.v1.IQueryChannelRequest} request QueryChannelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.channel.v1.Query#channels}. + * @memberof ibc.core.channel.v1.Query + * @typedef ChannelsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.channel.v1.IQueryChannelsResponse} [response] QueryChannelsResponse + */ + + /** + * Calls Channels. + * @function channels + * @memberof ibc.core.channel.v1.Query + * @instance + * @param {ibc.core.channel.v1.IQueryChannelsRequest} request QueryChannelsRequest message or plain object + * @param {ibc.core.channel.v1.Query.ChannelsCallback} callback Node-style callback called with the error, if any, and QueryChannelsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.channels = function channels(request, callback) { + return this.rpcCall(channels, $root.ibc.core.channel.v1.QueryChannelsRequest, $root.ibc.core.channel.v1.QueryChannelsResponse, request, callback); + }, "name", { value: "Channels" }); + + /** + * Calls Channels. + * @function channels + * @memberof ibc.core.channel.v1.Query + * @instance + * @param {ibc.core.channel.v1.IQueryChannelsRequest} request QueryChannelsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.channel.v1.Query#connectionChannels}. + * @memberof ibc.core.channel.v1.Query + * @typedef ConnectionChannelsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.channel.v1.IQueryConnectionChannelsResponse} [response] QueryConnectionChannelsResponse + */ + + /** + * Calls ConnectionChannels. + * @function connectionChannels + * @memberof ibc.core.channel.v1.Query + * @instance + * @param {ibc.core.channel.v1.IQueryConnectionChannelsRequest} request QueryConnectionChannelsRequest message or plain object + * @param {ibc.core.channel.v1.Query.ConnectionChannelsCallback} callback Node-style callback called with the error, if any, and QueryConnectionChannelsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.connectionChannels = function connectionChannels(request, callback) { + return this.rpcCall(connectionChannels, $root.ibc.core.channel.v1.QueryConnectionChannelsRequest, $root.ibc.core.channel.v1.QueryConnectionChannelsResponse, request, callback); + }, "name", { value: "ConnectionChannels" }); + + /** + * Calls ConnectionChannels. + * @function connectionChannels + * @memberof ibc.core.channel.v1.Query + * @instance + * @param {ibc.core.channel.v1.IQueryConnectionChannelsRequest} request QueryConnectionChannelsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.channel.v1.Query#channelClientState}. + * @memberof ibc.core.channel.v1.Query + * @typedef ChannelClientStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.channel.v1.IQueryChannelClientStateResponse} [response] QueryChannelClientStateResponse + */ + + /** + * Calls ChannelClientState. + * @function channelClientState + * @memberof ibc.core.channel.v1.Query + * @instance + * @param {ibc.core.channel.v1.IQueryChannelClientStateRequest} request QueryChannelClientStateRequest message or plain object + * @param {ibc.core.channel.v1.Query.ChannelClientStateCallback} callback Node-style callback called with the error, if any, and QueryChannelClientStateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.channelClientState = function channelClientState(request, callback) { + return this.rpcCall(channelClientState, $root.ibc.core.channel.v1.QueryChannelClientStateRequest, $root.ibc.core.channel.v1.QueryChannelClientStateResponse, request, callback); + }, "name", { value: "ChannelClientState" }); + + /** + * Calls ChannelClientState. + * @function channelClientState + * @memberof ibc.core.channel.v1.Query + * @instance + * @param {ibc.core.channel.v1.IQueryChannelClientStateRequest} request QueryChannelClientStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.channel.v1.Query#channelConsensusState}. + * @memberof ibc.core.channel.v1.Query + * @typedef ChannelConsensusStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.channel.v1.IQueryChannelConsensusStateResponse} [response] QueryChannelConsensusStateResponse + */ + + /** + * Calls ChannelConsensusState. + * @function channelConsensusState + * @memberof ibc.core.channel.v1.Query + * @instance + * @param {ibc.core.channel.v1.IQueryChannelConsensusStateRequest} request QueryChannelConsensusStateRequest message or plain object + * @param {ibc.core.channel.v1.Query.ChannelConsensusStateCallback} callback Node-style callback called with the error, if any, and QueryChannelConsensusStateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.channelConsensusState = function channelConsensusState(request, callback) { + return this.rpcCall(channelConsensusState, $root.ibc.core.channel.v1.QueryChannelConsensusStateRequest, $root.ibc.core.channel.v1.QueryChannelConsensusStateResponse, request, callback); + }, "name", { value: "ChannelConsensusState" }); + + /** + * Calls ChannelConsensusState. + * @function channelConsensusState + * @memberof ibc.core.channel.v1.Query + * @instance + * @param {ibc.core.channel.v1.IQueryChannelConsensusStateRequest} request QueryChannelConsensusStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.channel.v1.Query#packetCommitment}. + * @memberof ibc.core.channel.v1.Query + * @typedef PacketCommitmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.channel.v1.IQueryPacketCommitmentResponse} [response] QueryPacketCommitmentResponse + */ + + /** + * Calls PacketCommitment. + * @function packetCommitment + * @memberof ibc.core.channel.v1.Query + * @instance + * @param {ibc.core.channel.v1.IQueryPacketCommitmentRequest} request QueryPacketCommitmentRequest message or plain object + * @param {ibc.core.channel.v1.Query.PacketCommitmentCallback} callback Node-style callback called with the error, if any, and QueryPacketCommitmentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.packetCommitment = function packetCommitment(request, callback) { + return this.rpcCall(packetCommitment, $root.ibc.core.channel.v1.QueryPacketCommitmentRequest, $root.ibc.core.channel.v1.QueryPacketCommitmentResponse, request, callback); + }, "name", { value: "PacketCommitment" }); + + /** + * Calls PacketCommitment. + * @function packetCommitment + * @memberof ibc.core.channel.v1.Query + * @instance + * @param {ibc.core.channel.v1.IQueryPacketCommitmentRequest} request QueryPacketCommitmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.channel.v1.Query#packetCommitments}. + * @memberof ibc.core.channel.v1.Query + * @typedef PacketCommitmentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.channel.v1.IQueryPacketCommitmentsResponse} [response] QueryPacketCommitmentsResponse + */ + + /** + * Calls PacketCommitments. + * @function packetCommitments + * @memberof ibc.core.channel.v1.Query + * @instance + * @param {ibc.core.channel.v1.IQueryPacketCommitmentsRequest} request QueryPacketCommitmentsRequest message or plain object + * @param {ibc.core.channel.v1.Query.PacketCommitmentsCallback} callback Node-style callback called with the error, if any, and QueryPacketCommitmentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.packetCommitments = function packetCommitments(request, callback) { + return this.rpcCall(packetCommitments, $root.ibc.core.channel.v1.QueryPacketCommitmentsRequest, $root.ibc.core.channel.v1.QueryPacketCommitmentsResponse, request, callback); + }, "name", { value: "PacketCommitments" }); + + /** + * Calls PacketCommitments. + * @function packetCommitments + * @memberof ibc.core.channel.v1.Query + * @instance + * @param {ibc.core.channel.v1.IQueryPacketCommitmentsRequest} request QueryPacketCommitmentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.channel.v1.Query#packetReceipt}. + * @memberof ibc.core.channel.v1.Query + * @typedef PacketReceiptCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.channel.v1.IQueryPacketReceiptResponse} [response] QueryPacketReceiptResponse + */ + + /** + * Calls PacketReceipt. + * @function packetReceipt + * @memberof ibc.core.channel.v1.Query + * @instance + * @param {ibc.core.channel.v1.IQueryPacketReceiptRequest} request QueryPacketReceiptRequest message or plain object + * @param {ibc.core.channel.v1.Query.PacketReceiptCallback} callback Node-style callback called with the error, if any, and QueryPacketReceiptResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.packetReceipt = function packetReceipt(request, callback) { + return this.rpcCall(packetReceipt, $root.ibc.core.channel.v1.QueryPacketReceiptRequest, $root.ibc.core.channel.v1.QueryPacketReceiptResponse, request, callback); + }, "name", { value: "PacketReceipt" }); + + /** + * Calls PacketReceipt. + * @function packetReceipt + * @memberof ibc.core.channel.v1.Query + * @instance + * @param {ibc.core.channel.v1.IQueryPacketReceiptRequest} request QueryPacketReceiptRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.channel.v1.Query#packetAcknowledgement}. + * @memberof ibc.core.channel.v1.Query + * @typedef PacketAcknowledgementCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementResponse} [response] QueryPacketAcknowledgementResponse + */ + + /** + * Calls PacketAcknowledgement. + * @function packetAcknowledgement + * @memberof ibc.core.channel.v1.Query + * @instance + * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementRequest} request QueryPacketAcknowledgementRequest message or plain object + * @param {ibc.core.channel.v1.Query.PacketAcknowledgementCallback} callback Node-style callback called with the error, if any, and QueryPacketAcknowledgementResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.packetAcknowledgement = function packetAcknowledgement(request, callback) { + return this.rpcCall(packetAcknowledgement, $root.ibc.core.channel.v1.QueryPacketAcknowledgementRequest, $root.ibc.core.channel.v1.QueryPacketAcknowledgementResponse, request, callback); + }, "name", { value: "PacketAcknowledgement" }); + + /** + * Calls PacketAcknowledgement. + * @function packetAcknowledgement + * @memberof ibc.core.channel.v1.Query + * @instance + * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementRequest} request QueryPacketAcknowledgementRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.channel.v1.Query#packetAcknowledgements}. + * @memberof ibc.core.channel.v1.Query + * @typedef PacketAcknowledgementsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementsResponse} [response] QueryPacketAcknowledgementsResponse + */ + + /** + * Calls PacketAcknowledgements. + * @function packetAcknowledgements + * @memberof ibc.core.channel.v1.Query + * @instance + * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementsRequest} request QueryPacketAcknowledgementsRequest message or plain object + * @param {ibc.core.channel.v1.Query.PacketAcknowledgementsCallback} callback Node-style callback called with the error, if any, and QueryPacketAcknowledgementsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.packetAcknowledgements = function packetAcknowledgements(request, callback) { + return this.rpcCall(packetAcknowledgements, $root.ibc.core.channel.v1.QueryPacketAcknowledgementsRequest, $root.ibc.core.channel.v1.QueryPacketAcknowledgementsResponse, request, callback); + }, "name", { value: "PacketAcknowledgements" }); + + /** + * Calls PacketAcknowledgements. + * @function packetAcknowledgements + * @memberof ibc.core.channel.v1.Query + * @instance + * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementsRequest} request QueryPacketAcknowledgementsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.channel.v1.Query#unreceivedPackets}. + * @memberof ibc.core.channel.v1.Query + * @typedef UnreceivedPacketsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.channel.v1.IQueryUnreceivedPacketsResponse} [response] QueryUnreceivedPacketsResponse + */ + + /** + * Calls UnreceivedPackets. + * @function unreceivedPackets + * @memberof ibc.core.channel.v1.Query + * @instance + * @param {ibc.core.channel.v1.IQueryUnreceivedPacketsRequest} request QueryUnreceivedPacketsRequest message or plain object + * @param {ibc.core.channel.v1.Query.UnreceivedPacketsCallback} callback Node-style callback called with the error, if any, and QueryUnreceivedPacketsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.unreceivedPackets = function unreceivedPackets(request, callback) { + return this.rpcCall(unreceivedPackets, $root.ibc.core.channel.v1.QueryUnreceivedPacketsRequest, $root.ibc.core.channel.v1.QueryUnreceivedPacketsResponse, request, callback); + }, "name", { value: "UnreceivedPackets" }); + + /** + * Calls UnreceivedPackets. + * @function unreceivedPackets + * @memberof ibc.core.channel.v1.Query + * @instance + * @param {ibc.core.channel.v1.IQueryUnreceivedPacketsRequest} request QueryUnreceivedPacketsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.channel.v1.Query#unreceivedAcks}. + * @memberof ibc.core.channel.v1.Query + * @typedef UnreceivedAcksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.channel.v1.IQueryUnreceivedAcksResponse} [response] QueryUnreceivedAcksResponse + */ + + /** + * Calls UnreceivedAcks. + * @function unreceivedAcks + * @memberof ibc.core.channel.v1.Query + * @instance + * @param {ibc.core.channel.v1.IQueryUnreceivedAcksRequest} request QueryUnreceivedAcksRequest message or plain object + * @param {ibc.core.channel.v1.Query.UnreceivedAcksCallback} callback Node-style callback called with the error, if any, and QueryUnreceivedAcksResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.unreceivedAcks = function unreceivedAcks(request, callback) { + return this.rpcCall(unreceivedAcks, $root.ibc.core.channel.v1.QueryUnreceivedAcksRequest, $root.ibc.core.channel.v1.QueryUnreceivedAcksResponse, request, callback); + }, "name", { value: "UnreceivedAcks" }); + + /** + * Calls UnreceivedAcks. + * @function unreceivedAcks + * @memberof ibc.core.channel.v1.Query + * @instance + * @param {ibc.core.channel.v1.IQueryUnreceivedAcksRequest} request QueryUnreceivedAcksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.channel.v1.Query#nextSequenceReceive}. + * @memberof ibc.core.channel.v1.Query + * @typedef NextSequenceReceiveCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.channel.v1.IQueryNextSequenceReceiveResponse} [response] QueryNextSequenceReceiveResponse + */ + + /** + * Calls NextSequenceReceive. + * @function nextSequenceReceive + * @memberof ibc.core.channel.v1.Query + * @instance + * @param {ibc.core.channel.v1.IQueryNextSequenceReceiveRequest} request QueryNextSequenceReceiveRequest message or plain object + * @param {ibc.core.channel.v1.Query.NextSequenceReceiveCallback} callback Node-style callback called with the error, if any, and QueryNextSequenceReceiveResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.nextSequenceReceive = function nextSequenceReceive(request, callback) { + return this.rpcCall(nextSequenceReceive, $root.ibc.core.channel.v1.QueryNextSequenceReceiveRequest, $root.ibc.core.channel.v1.QueryNextSequenceReceiveResponse, request, callback); + }, "name", { value: "NextSequenceReceive" }); + + /** + * Calls NextSequenceReceive. + * @function nextSequenceReceive + * @memberof ibc.core.channel.v1.Query + * @instance + * @param {ibc.core.channel.v1.IQueryNextSequenceReceiveRequest} request QueryNextSequenceReceiveRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Query; + })(v1.Query || {}); + + v1.QueryChannelRequest = (function(QueryChannelRequest) { + + /** + * Properties of a QueryChannelRequest. + * @memberof ibc.core.channel.v1 + * @interface IQueryChannelRequest + * @property {string|null} [portId] QueryChannelRequest portId + * @property {string|null} [channelId] QueryChannelRequest channelId + */ + + /** + * Constructs a new QueryChannelRequest. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a QueryChannelRequest. + * @implements IQueryChannelRequest + * @constructor + * @param {ibc.core.channel.v1.IQueryChannelRequest=} [properties] Properties to set + */ + function QueryChannelRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryChannelRequest portId. + * @member {string} portId + * @memberof ibc.core.channel.v1.QueryChannelRequest + * @instance + */ + QueryChannelRequest.prototype.portId = ""; + + /** + * QueryChannelRequest channelId. + * @member {string} channelId + * @memberof ibc.core.channel.v1.QueryChannelRequest + * @instance + */ + QueryChannelRequest.prototype.channelId = ""; + + /** + * Creates a new QueryChannelRequest instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.QueryChannelRequest + * @static + * @param {ibc.core.channel.v1.IQueryChannelRequest=} [properties] Properties to set + * @returns {ibc.core.channel.v1.QueryChannelRequest} QueryChannelRequest instance + */ + QueryChannelRequest.create = function create(properties) { + return new QueryChannelRequest(properties); + }; + + /** + * Encodes the specified QueryChannelRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.QueryChannelRequest + * @static + * @param {ibc.core.channel.v1.IQueryChannelRequest} message QueryChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryChannelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.portId != null && Object.hasOwnProperty.call(message, "portId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.portId); + if (message.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.channelId); + return writer; + }; + + /** + * Encodes the specified QueryChannelRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryChannelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.QueryChannelRequest + * @static + * @param {ibc.core.channel.v1.IQueryChannelRequest} message QueryChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryChannelRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.QueryChannelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.QueryChannelRequest} QueryChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryChannelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryChannelRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryChannelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.QueryChannelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.QueryChannelRequest} QueryChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryChannelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryChannelRequest message. + * @function verify + * @memberof ibc.core.channel.v1.QueryChannelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryChannelRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.portId != null && message.hasOwnProperty("portId")) + if (!$util.isString(message.portId)) + return "portId: string expected"; + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + return null; + }; + + /** + * Creates a QueryChannelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.QueryChannelRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.QueryChannelRequest} QueryChannelRequest + */ + QueryChannelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.QueryChannelRequest) + return object; + let message = new $root.ibc.core.channel.v1.QueryChannelRequest(); + if (object.portId != null) + message.portId = String(object.portId); + if (object.channelId != null) + message.channelId = String(object.channelId); + return message; + }; + + /** + * Creates a plain object from a QueryChannelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.QueryChannelRequest + * @static + * @param {ibc.core.channel.v1.QueryChannelRequest} message QueryChannelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryChannelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.portId = ""; + object.channelId = ""; + } + if (message.portId != null && message.hasOwnProperty("portId")) + object.portId = message.portId; + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + return object; + }; + + /** + * Converts this QueryChannelRequest to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.QueryChannelRequest + * @instance + * @returns {Object.} JSON object + */ + QueryChannelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryChannelRequest; + })(v1.QueryChannelRequest || {}); + + v1.QueryChannelResponse = (function(QueryChannelResponse) { + + /** + * Properties of a QueryChannelResponse. + * @memberof ibc.core.channel.v1 + * @interface IQueryChannelResponse + * @property {ibc.core.channel.v1.IChannel|null} [channel] QueryChannelResponse channel + * @property {Uint8Array|null} [proof] QueryChannelResponse proof + * @property {ibc.core.client.v1.IHeight|null} [proofHeight] QueryChannelResponse proofHeight + */ + + /** + * Constructs a new QueryChannelResponse. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a QueryChannelResponse. + * @implements IQueryChannelResponse + * @constructor + * @param {ibc.core.channel.v1.IQueryChannelResponse=} [properties] Properties to set + */ + function QueryChannelResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryChannelResponse channel. + * @member {ibc.core.channel.v1.IChannel|null|undefined} channel + * @memberof ibc.core.channel.v1.QueryChannelResponse + * @instance + */ + QueryChannelResponse.prototype.channel = null; + + /** + * QueryChannelResponse proof. + * @member {Uint8Array} proof + * @memberof ibc.core.channel.v1.QueryChannelResponse + * @instance + */ + QueryChannelResponse.prototype.proof = $util.newBuffer([]); + + /** + * QueryChannelResponse proofHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} proofHeight + * @memberof ibc.core.channel.v1.QueryChannelResponse + * @instance + */ + QueryChannelResponse.prototype.proofHeight = null; + + /** + * Creates a new QueryChannelResponse instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.QueryChannelResponse + * @static + * @param {ibc.core.channel.v1.IQueryChannelResponse=} [properties] Properties to set + * @returns {ibc.core.channel.v1.QueryChannelResponse} QueryChannelResponse instance + */ + QueryChannelResponse.create = function create(properties) { + return new QueryChannelResponse(properties); + }; + + /** + * Encodes the specified QueryChannelResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.QueryChannelResponse + * @static + * @param {ibc.core.channel.v1.IQueryChannelResponse} message QueryChannelResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryChannelResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.channel != null && Object.hasOwnProperty.call(message, "channel")) + $root.ibc.core.channel.v1.Channel.encode(message.channel, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); + if (message.proofHeight != null && Object.hasOwnProperty.call(message, "proofHeight")) + $root.ibc.core.client.v1.Height.encode(message.proofHeight, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryChannelResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryChannelResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.QueryChannelResponse + * @static + * @param {ibc.core.channel.v1.IQueryChannelResponse} message QueryChannelResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryChannelResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryChannelResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.QueryChannelResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.QueryChannelResponse} QueryChannelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryChannelResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryChannelResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channel = $root.ibc.core.channel.v1.Channel.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryChannelResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.QueryChannelResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.QueryChannelResponse} QueryChannelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryChannelResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryChannelResponse message. + * @function verify + * @memberof ibc.core.channel.v1.QueryChannelResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryChannelResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.channel != null && message.hasOwnProperty("channel")) { + let error = $root.ibc.core.channel.v1.Channel.verify(message.channel); + if (error) + return "channel." + error; + } + if (message.proof != null && message.hasOwnProperty("proof")) + if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) + return "proof: buffer expected"; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) { + let error = $root.ibc.core.client.v1.Height.verify(message.proofHeight); + if (error) + return "proofHeight." + error; + } + return null; + }; + + /** + * Creates a QueryChannelResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.QueryChannelResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.QueryChannelResponse} QueryChannelResponse + */ + QueryChannelResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.QueryChannelResponse) + return object; + let message = new $root.ibc.core.channel.v1.QueryChannelResponse(); + if (object.channel != null) { + if (typeof object.channel !== "object") + throw TypeError(".ibc.core.channel.v1.QueryChannelResponse.channel: object expected"); + message.channel = $root.ibc.core.channel.v1.Channel.fromObject(object.channel); + } + if (object.proof != null) + if (typeof object.proof === "string") + $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); + else if (object.proof.length) + message.proof = object.proof; + if (object.proofHeight != null) { + if (typeof object.proofHeight !== "object") + throw TypeError(".ibc.core.channel.v1.QueryChannelResponse.proofHeight: object expected"); + message.proofHeight = $root.ibc.core.client.v1.Height.fromObject(object.proofHeight); + } + return message; + }; + + /** + * Creates a plain object from a QueryChannelResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.QueryChannelResponse + * @static + * @param {ibc.core.channel.v1.QueryChannelResponse} message QueryChannelResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryChannelResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.channel = null; + if (options.bytes === String) + object.proof = ""; + else { + object.proof = []; + if (options.bytes !== Array) + object.proof = $util.newBuffer(object.proof); + } + object.proofHeight = null; + } + if (message.channel != null && message.hasOwnProperty("channel")) + object.channel = $root.ibc.core.channel.v1.Channel.toObject(message.channel, options); + if (message.proof != null && message.hasOwnProperty("proof")) + object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) + object.proofHeight = $root.ibc.core.client.v1.Height.toObject(message.proofHeight, options); + return object; + }; + + /** + * Converts this QueryChannelResponse to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.QueryChannelResponse + * @instance + * @returns {Object.} JSON object + */ + QueryChannelResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryChannelResponse; + })(v1.QueryChannelResponse || {}); + + v1.QueryChannelsRequest = (function(QueryChannelsRequest) { + + /** + * Properties of a QueryChannelsRequest. + * @memberof ibc.core.channel.v1 + * @interface IQueryChannelsRequest + * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryChannelsRequest pagination + */ + + /** + * Constructs a new QueryChannelsRequest. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a QueryChannelsRequest. + * @implements IQueryChannelsRequest + * @constructor + * @param {ibc.core.channel.v1.IQueryChannelsRequest=} [properties] Properties to set + */ + function QueryChannelsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryChannelsRequest pagination. + * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination + * @memberof ibc.core.channel.v1.QueryChannelsRequest + * @instance + */ + QueryChannelsRequest.prototype.pagination = null; + + /** + * Creates a new QueryChannelsRequest instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.QueryChannelsRequest + * @static + * @param {ibc.core.channel.v1.IQueryChannelsRequest=} [properties] Properties to set + * @returns {ibc.core.channel.v1.QueryChannelsRequest} QueryChannelsRequest instance + */ + QueryChannelsRequest.create = function create(properties) { + return new QueryChannelsRequest(properties); + }; + + /** + * Encodes the specified QueryChannelsRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelsRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.QueryChannelsRequest + * @static + * @param {ibc.core.channel.v1.IQueryChannelsRequest} message QueryChannelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryChannelsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryChannelsRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryChannelsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.QueryChannelsRequest + * @static + * @param {ibc.core.channel.v1.IQueryChannelsRequest} message QueryChannelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryChannelsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryChannelsRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.QueryChannelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.QueryChannelsRequest} QueryChannelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryChannelsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryChannelsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryChannelsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.QueryChannelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.QueryChannelsRequest} QueryChannelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryChannelsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryChannelsRequest message. + * @function verify + * @memberof ibc.core.channel.v1.QueryChannelsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryChannelsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryChannelsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.QueryChannelsRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.QueryChannelsRequest} QueryChannelsRequest + */ + QueryChannelsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.QueryChannelsRequest) + return object; + let message = new $root.ibc.core.channel.v1.QueryChannelsRequest(); + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".ibc.core.channel.v1.QueryChannelsRequest.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryChannelsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.QueryChannelsRequest + * @static + * @param {ibc.core.channel.v1.QueryChannelsRequest} message QueryChannelsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryChannelsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.pagination = null; + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryChannelsRequest to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.QueryChannelsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryChannelsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryChannelsRequest; + })(v1.QueryChannelsRequest || {}); + + v1.QueryChannelsResponse = (function(QueryChannelsResponse) { + + /** + * Properties of a QueryChannelsResponse. + * @memberof ibc.core.channel.v1 + * @interface IQueryChannelsResponse + * @property {Array.|null} [channels] QueryChannelsResponse channels + * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryChannelsResponse pagination + * @property {ibc.core.client.v1.IHeight|null} [height] QueryChannelsResponse height + */ + + /** + * Constructs a new QueryChannelsResponse. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a QueryChannelsResponse. + * @implements IQueryChannelsResponse + * @constructor + * @param {ibc.core.channel.v1.IQueryChannelsResponse=} [properties] Properties to set + */ + function QueryChannelsResponse(properties) { + this.channels = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryChannelsResponse channels. + * @member {Array.} channels + * @memberof ibc.core.channel.v1.QueryChannelsResponse + * @instance + */ + QueryChannelsResponse.prototype.channels = $util.emptyArray; + + /** + * QueryChannelsResponse pagination. + * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination + * @memberof ibc.core.channel.v1.QueryChannelsResponse + * @instance + */ + QueryChannelsResponse.prototype.pagination = null; + + /** + * QueryChannelsResponse height. + * @member {ibc.core.client.v1.IHeight|null|undefined} height + * @memberof ibc.core.channel.v1.QueryChannelsResponse + * @instance + */ + QueryChannelsResponse.prototype.height = null; + + /** + * Creates a new QueryChannelsResponse instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.QueryChannelsResponse + * @static + * @param {ibc.core.channel.v1.IQueryChannelsResponse=} [properties] Properties to set + * @returns {ibc.core.channel.v1.QueryChannelsResponse} QueryChannelsResponse instance + */ + QueryChannelsResponse.create = function create(properties) { + return new QueryChannelsResponse(properties); + }; + + /** + * Encodes the specified QueryChannelsResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelsResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.QueryChannelsResponse + * @static + * @param {ibc.core.channel.v1.IQueryChannelsResponse} message QueryChannelsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryChannelsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.channels != null && message.channels.length) + for (let i = 0; i < message.channels.length; ++i) + $root.ibc.core.channel.v1.IdentifiedChannel.encode(message.channels[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + $root.ibc.core.client.v1.Height.encode(message.height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryChannelsResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryChannelsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.QueryChannelsResponse + * @static + * @param {ibc.core.channel.v1.IQueryChannelsResponse} message QueryChannelsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryChannelsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryChannelsResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.QueryChannelsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.QueryChannelsResponse} QueryChannelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryChannelsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryChannelsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.channels && message.channels.length)) + message.channels = []; + message.channels.push($root.ibc.core.channel.v1.IdentifiedChannel.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); + break; + case 3: + message.height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryChannelsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.QueryChannelsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.QueryChannelsResponse} QueryChannelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryChannelsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryChannelsResponse message. + * @function verify + * @memberof ibc.core.channel.v1.QueryChannelsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryChannelsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.channels != null && message.hasOwnProperty("channels")) { + if (!Array.isArray(message.channels)) + return "channels: array expected"; + for (let i = 0; i < message.channels.length; ++i) { + let error = $root.ibc.core.channel.v1.IdentifiedChannel.verify(message.channels[i]); + if (error) + return "channels." + error; + } + } + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); + if (error) + return "pagination." + error; + } + if (message.height != null && message.hasOwnProperty("height")) { + let error = $root.ibc.core.client.v1.Height.verify(message.height); + if (error) + return "height." + error; + } + return null; + }; + + /** + * Creates a QueryChannelsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.QueryChannelsResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.QueryChannelsResponse} QueryChannelsResponse + */ + QueryChannelsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.QueryChannelsResponse) + return object; + let message = new $root.ibc.core.channel.v1.QueryChannelsResponse(); + if (object.channels) { + if (!Array.isArray(object.channels)) + throw TypeError(".ibc.core.channel.v1.QueryChannelsResponse.channels: array expected"); + message.channels = []; + for (let i = 0; i < object.channels.length; ++i) { + if (typeof object.channels[i] !== "object") + throw TypeError(".ibc.core.channel.v1.QueryChannelsResponse.channels: object expected"); + message.channels[i] = $root.ibc.core.channel.v1.IdentifiedChannel.fromObject(object.channels[i]); + } + } + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".ibc.core.channel.v1.QueryChannelsResponse.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); + } + if (object.height != null) { + if (typeof object.height !== "object") + throw TypeError(".ibc.core.channel.v1.QueryChannelsResponse.height: object expected"); + message.height = $root.ibc.core.client.v1.Height.fromObject(object.height); + } + return message; + }; + + /** + * Creates a plain object from a QueryChannelsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.QueryChannelsResponse + * @static + * @param {ibc.core.channel.v1.QueryChannelsResponse} message QueryChannelsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryChannelsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.channels = []; + if (options.defaults) { + object.pagination = null; + object.height = null; + } + if (message.channels && message.channels.length) { + object.channels = []; + for (let j = 0; j < message.channels.length; ++j) + object.channels[j] = $root.ibc.core.channel.v1.IdentifiedChannel.toObject(message.channels[j], options); + } + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); + if (message.height != null && message.hasOwnProperty("height")) + object.height = $root.ibc.core.client.v1.Height.toObject(message.height, options); + return object; + }; + + /** + * Converts this QueryChannelsResponse to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.QueryChannelsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryChannelsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryChannelsResponse; + })(v1.QueryChannelsResponse || {}); + + v1.QueryConnectionChannelsRequest = (function(QueryConnectionChannelsRequest) { + + /** + * Properties of a QueryConnectionChannelsRequest. + * @memberof ibc.core.channel.v1 + * @interface IQueryConnectionChannelsRequest + * @property {string|null} [connection] QueryConnectionChannelsRequest connection + * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryConnectionChannelsRequest pagination + */ + + /** + * Constructs a new QueryConnectionChannelsRequest. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a QueryConnectionChannelsRequest. + * @implements IQueryConnectionChannelsRequest + * @constructor + * @param {ibc.core.channel.v1.IQueryConnectionChannelsRequest=} [properties] Properties to set + */ + function QueryConnectionChannelsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryConnectionChannelsRequest connection. + * @member {string} connection + * @memberof ibc.core.channel.v1.QueryConnectionChannelsRequest + * @instance + */ + QueryConnectionChannelsRequest.prototype.connection = ""; + + /** + * QueryConnectionChannelsRequest pagination. + * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination + * @memberof ibc.core.channel.v1.QueryConnectionChannelsRequest + * @instance + */ + QueryConnectionChannelsRequest.prototype.pagination = null; + + /** + * Creates a new QueryConnectionChannelsRequest instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.QueryConnectionChannelsRequest + * @static + * @param {ibc.core.channel.v1.IQueryConnectionChannelsRequest=} [properties] Properties to set + * @returns {ibc.core.channel.v1.QueryConnectionChannelsRequest} QueryConnectionChannelsRequest instance + */ + QueryConnectionChannelsRequest.create = function create(properties) { + return new QueryConnectionChannelsRequest(properties); + }; + + /** + * Encodes the specified QueryConnectionChannelsRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryConnectionChannelsRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.QueryConnectionChannelsRequest + * @static + * @param {ibc.core.channel.v1.IQueryConnectionChannelsRequest} message QueryConnectionChannelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConnectionChannelsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.connection); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryConnectionChannelsRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryConnectionChannelsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.QueryConnectionChannelsRequest + * @static + * @param {ibc.core.channel.v1.IQueryConnectionChannelsRequest} message QueryConnectionChannelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConnectionChannelsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryConnectionChannelsRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.QueryConnectionChannelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.QueryConnectionChannelsRequest} QueryConnectionChannelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConnectionChannelsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryConnectionChannelsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connection = reader.string(); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryConnectionChannelsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.QueryConnectionChannelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.QueryConnectionChannelsRequest} QueryConnectionChannelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConnectionChannelsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryConnectionChannelsRequest message. + * @function verify + * @memberof ibc.core.channel.v1.QueryConnectionChannelsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryConnectionChannelsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.connection != null && message.hasOwnProperty("connection")) + if (!$util.isString(message.connection)) + return "connection: string expected"; + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryConnectionChannelsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.QueryConnectionChannelsRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.QueryConnectionChannelsRequest} QueryConnectionChannelsRequest + */ + QueryConnectionChannelsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.QueryConnectionChannelsRequest) + return object; + let message = new $root.ibc.core.channel.v1.QueryConnectionChannelsRequest(); + if (object.connection != null) + message.connection = String(object.connection); + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".ibc.core.channel.v1.QueryConnectionChannelsRequest.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryConnectionChannelsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.QueryConnectionChannelsRequest + * @static + * @param {ibc.core.channel.v1.QueryConnectionChannelsRequest} message QueryConnectionChannelsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryConnectionChannelsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.connection = ""; + object.pagination = null; + } + if (message.connection != null && message.hasOwnProperty("connection")) + object.connection = message.connection; + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryConnectionChannelsRequest to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.QueryConnectionChannelsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryConnectionChannelsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryConnectionChannelsRequest; + })(v1.QueryConnectionChannelsRequest || {}); + + v1.QueryConnectionChannelsResponse = (function(QueryConnectionChannelsResponse) { + + /** + * Properties of a QueryConnectionChannelsResponse. + * @memberof ibc.core.channel.v1 + * @interface IQueryConnectionChannelsResponse + * @property {Array.|null} [channels] QueryConnectionChannelsResponse channels + * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryConnectionChannelsResponse pagination + * @property {ibc.core.client.v1.IHeight|null} [height] QueryConnectionChannelsResponse height + */ + + /** + * Constructs a new QueryConnectionChannelsResponse. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a QueryConnectionChannelsResponse. + * @implements IQueryConnectionChannelsResponse + * @constructor + * @param {ibc.core.channel.v1.IQueryConnectionChannelsResponse=} [properties] Properties to set + */ + function QueryConnectionChannelsResponse(properties) { + this.channels = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryConnectionChannelsResponse channels. + * @member {Array.} channels + * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse + * @instance + */ + QueryConnectionChannelsResponse.prototype.channels = $util.emptyArray; + + /** + * QueryConnectionChannelsResponse pagination. + * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination + * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse + * @instance + */ + QueryConnectionChannelsResponse.prototype.pagination = null; + + /** + * QueryConnectionChannelsResponse height. + * @member {ibc.core.client.v1.IHeight|null|undefined} height + * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse + * @instance + */ + QueryConnectionChannelsResponse.prototype.height = null; + + /** + * Creates a new QueryConnectionChannelsResponse instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse + * @static + * @param {ibc.core.channel.v1.IQueryConnectionChannelsResponse=} [properties] Properties to set + * @returns {ibc.core.channel.v1.QueryConnectionChannelsResponse} QueryConnectionChannelsResponse instance + */ + QueryConnectionChannelsResponse.create = function create(properties) { + return new QueryConnectionChannelsResponse(properties); + }; + + /** + * Encodes the specified QueryConnectionChannelsResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryConnectionChannelsResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse + * @static + * @param {ibc.core.channel.v1.IQueryConnectionChannelsResponse} message QueryConnectionChannelsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConnectionChannelsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.channels != null && message.channels.length) + for (let i = 0; i < message.channels.length; ++i) + $root.ibc.core.channel.v1.IdentifiedChannel.encode(message.channels[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + $root.ibc.core.client.v1.Height.encode(message.height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryConnectionChannelsResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryConnectionChannelsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse + * @static + * @param {ibc.core.channel.v1.IQueryConnectionChannelsResponse} message QueryConnectionChannelsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConnectionChannelsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryConnectionChannelsResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.QueryConnectionChannelsResponse} QueryConnectionChannelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConnectionChannelsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryConnectionChannelsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.channels && message.channels.length)) + message.channels = []; + message.channels.push($root.ibc.core.channel.v1.IdentifiedChannel.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); + break; + case 3: + message.height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryConnectionChannelsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.QueryConnectionChannelsResponse} QueryConnectionChannelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConnectionChannelsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryConnectionChannelsResponse message. + * @function verify + * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryConnectionChannelsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.channels != null && message.hasOwnProperty("channels")) { + if (!Array.isArray(message.channels)) + return "channels: array expected"; + for (let i = 0; i < message.channels.length; ++i) { + let error = $root.ibc.core.channel.v1.IdentifiedChannel.verify(message.channels[i]); + if (error) + return "channels." + error; + } + } + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); + if (error) + return "pagination." + error; + } + if (message.height != null && message.hasOwnProperty("height")) { + let error = $root.ibc.core.client.v1.Height.verify(message.height); + if (error) + return "height." + error; + } + return null; + }; + + /** + * Creates a QueryConnectionChannelsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.QueryConnectionChannelsResponse} QueryConnectionChannelsResponse + */ + QueryConnectionChannelsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.QueryConnectionChannelsResponse) + return object; + let message = new $root.ibc.core.channel.v1.QueryConnectionChannelsResponse(); + if (object.channels) { + if (!Array.isArray(object.channels)) + throw TypeError(".ibc.core.channel.v1.QueryConnectionChannelsResponse.channels: array expected"); + message.channels = []; + for (let i = 0; i < object.channels.length; ++i) { + if (typeof object.channels[i] !== "object") + throw TypeError(".ibc.core.channel.v1.QueryConnectionChannelsResponse.channels: object expected"); + message.channels[i] = $root.ibc.core.channel.v1.IdentifiedChannel.fromObject(object.channels[i]); + } + } + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".ibc.core.channel.v1.QueryConnectionChannelsResponse.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); + } + if (object.height != null) { + if (typeof object.height !== "object") + throw TypeError(".ibc.core.channel.v1.QueryConnectionChannelsResponse.height: object expected"); + message.height = $root.ibc.core.client.v1.Height.fromObject(object.height); + } + return message; + }; + + /** + * Creates a plain object from a QueryConnectionChannelsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse + * @static + * @param {ibc.core.channel.v1.QueryConnectionChannelsResponse} message QueryConnectionChannelsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryConnectionChannelsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.channels = []; + if (options.defaults) { + object.pagination = null; + object.height = null; + } + if (message.channels && message.channels.length) { + object.channels = []; + for (let j = 0; j < message.channels.length; ++j) + object.channels[j] = $root.ibc.core.channel.v1.IdentifiedChannel.toObject(message.channels[j], options); + } + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); + if (message.height != null && message.hasOwnProperty("height")) + object.height = $root.ibc.core.client.v1.Height.toObject(message.height, options); + return object; + }; + + /** + * Converts this QueryConnectionChannelsResponse to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryConnectionChannelsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryConnectionChannelsResponse; + })(v1.QueryConnectionChannelsResponse || {}); + + v1.QueryChannelClientStateRequest = (function(QueryChannelClientStateRequest) { + + /** + * Properties of a QueryChannelClientStateRequest. + * @memberof ibc.core.channel.v1 + * @interface IQueryChannelClientStateRequest + * @property {string|null} [portId] QueryChannelClientStateRequest portId + * @property {string|null} [channelId] QueryChannelClientStateRequest channelId + */ + + /** + * Constructs a new QueryChannelClientStateRequest. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a QueryChannelClientStateRequest. + * @implements IQueryChannelClientStateRequest + * @constructor + * @param {ibc.core.channel.v1.IQueryChannelClientStateRequest=} [properties] Properties to set + */ + function QueryChannelClientStateRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryChannelClientStateRequest portId. + * @member {string} portId + * @memberof ibc.core.channel.v1.QueryChannelClientStateRequest + * @instance + */ + QueryChannelClientStateRequest.prototype.portId = ""; + + /** + * QueryChannelClientStateRequest channelId. + * @member {string} channelId + * @memberof ibc.core.channel.v1.QueryChannelClientStateRequest + * @instance + */ + QueryChannelClientStateRequest.prototype.channelId = ""; + + /** + * Creates a new QueryChannelClientStateRequest instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.QueryChannelClientStateRequest + * @static + * @param {ibc.core.channel.v1.IQueryChannelClientStateRequest=} [properties] Properties to set + * @returns {ibc.core.channel.v1.QueryChannelClientStateRequest} QueryChannelClientStateRequest instance + */ + QueryChannelClientStateRequest.create = function create(properties) { + return new QueryChannelClientStateRequest(properties); + }; + + /** + * Encodes the specified QueryChannelClientStateRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelClientStateRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.QueryChannelClientStateRequest + * @static + * @param {ibc.core.channel.v1.IQueryChannelClientStateRequest} message QueryChannelClientStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryChannelClientStateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.portId != null && Object.hasOwnProperty.call(message, "portId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.portId); + if (message.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.channelId); + return writer; + }; + + /** + * Encodes the specified QueryChannelClientStateRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryChannelClientStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.QueryChannelClientStateRequest + * @static + * @param {ibc.core.channel.v1.IQueryChannelClientStateRequest} message QueryChannelClientStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryChannelClientStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryChannelClientStateRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.QueryChannelClientStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.QueryChannelClientStateRequest} QueryChannelClientStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryChannelClientStateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryChannelClientStateRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryChannelClientStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.QueryChannelClientStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.QueryChannelClientStateRequest} QueryChannelClientStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryChannelClientStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryChannelClientStateRequest message. + * @function verify + * @memberof ibc.core.channel.v1.QueryChannelClientStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryChannelClientStateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.portId != null && message.hasOwnProperty("portId")) + if (!$util.isString(message.portId)) + return "portId: string expected"; + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + return null; + }; + + /** + * Creates a QueryChannelClientStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.QueryChannelClientStateRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.QueryChannelClientStateRequest} QueryChannelClientStateRequest + */ + QueryChannelClientStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.QueryChannelClientStateRequest) + return object; + let message = new $root.ibc.core.channel.v1.QueryChannelClientStateRequest(); + if (object.portId != null) + message.portId = String(object.portId); + if (object.channelId != null) + message.channelId = String(object.channelId); + return message; + }; + + /** + * Creates a plain object from a QueryChannelClientStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.QueryChannelClientStateRequest + * @static + * @param {ibc.core.channel.v1.QueryChannelClientStateRequest} message QueryChannelClientStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryChannelClientStateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.portId = ""; + object.channelId = ""; + } + if (message.portId != null && message.hasOwnProperty("portId")) + object.portId = message.portId; + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + return object; + }; + + /** + * Converts this QueryChannelClientStateRequest to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.QueryChannelClientStateRequest + * @instance + * @returns {Object.} JSON object + */ + QueryChannelClientStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryChannelClientStateRequest; + })(v1.QueryChannelClientStateRequest || {}); + + v1.QueryChannelClientStateResponse = (function(QueryChannelClientStateResponse) { + + /** + * Properties of a QueryChannelClientStateResponse. + * @memberof ibc.core.channel.v1 + * @interface IQueryChannelClientStateResponse + * @property {ibc.core.client.v1.IIdentifiedClientState|null} [identifiedClientState] QueryChannelClientStateResponse identifiedClientState + * @property {Uint8Array|null} [proof] QueryChannelClientStateResponse proof + * @property {ibc.core.client.v1.IHeight|null} [proofHeight] QueryChannelClientStateResponse proofHeight + */ + + /** + * Constructs a new QueryChannelClientStateResponse. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a QueryChannelClientStateResponse. + * @implements IQueryChannelClientStateResponse + * @constructor + * @param {ibc.core.channel.v1.IQueryChannelClientStateResponse=} [properties] Properties to set + */ + function QueryChannelClientStateResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryChannelClientStateResponse identifiedClientState. + * @member {ibc.core.client.v1.IIdentifiedClientState|null|undefined} identifiedClientState + * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse + * @instance + */ + QueryChannelClientStateResponse.prototype.identifiedClientState = null; + + /** + * QueryChannelClientStateResponse proof. + * @member {Uint8Array} proof + * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse + * @instance + */ + QueryChannelClientStateResponse.prototype.proof = $util.newBuffer([]); + + /** + * QueryChannelClientStateResponse proofHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} proofHeight + * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse + * @instance + */ + QueryChannelClientStateResponse.prototype.proofHeight = null; + + /** + * Creates a new QueryChannelClientStateResponse instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse + * @static + * @param {ibc.core.channel.v1.IQueryChannelClientStateResponse=} [properties] Properties to set + * @returns {ibc.core.channel.v1.QueryChannelClientStateResponse} QueryChannelClientStateResponse instance + */ + QueryChannelClientStateResponse.create = function create(properties) { + return new QueryChannelClientStateResponse(properties); + }; + + /** + * Encodes the specified QueryChannelClientStateResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelClientStateResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse + * @static + * @param {ibc.core.channel.v1.IQueryChannelClientStateResponse} message QueryChannelClientStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryChannelClientStateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identifiedClientState != null && Object.hasOwnProperty.call(message, "identifiedClientState")) + $root.ibc.core.client.v1.IdentifiedClientState.encode(message.identifiedClientState, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); + if (message.proofHeight != null && Object.hasOwnProperty.call(message, "proofHeight")) + $root.ibc.core.client.v1.Height.encode(message.proofHeight, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryChannelClientStateResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryChannelClientStateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse + * @static + * @param {ibc.core.channel.v1.IQueryChannelClientStateResponse} message QueryChannelClientStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryChannelClientStateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryChannelClientStateResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.QueryChannelClientStateResponse} QueryChannelClientStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryChannelClientStateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryChannelClientStateResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identifiedClientState = $root.ibc.core.client.v1.IdentifiedClientState.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryChannelClientStateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.QueryChannelClientStateResponse} QueryChannelClientStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryChannelClientStateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryChannelClientStateResponse message. + * @function verify + * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryChannelClientStateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identifiedClientState != null && message.hasOwnProperty("identifiedClientState")) { + let error = $root.ibc.core.client.v1.IdentifiedClientState.verify(message.identifiedClientState); + if (error) + return "identifiedClientState." + error; + } + if (message.proof != null && message.hasOwnProperty("proof")) + if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) + return "proof: buffer expected"; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) { + let error = $root.ibc.core.client.v1.Height.verify(message.proofHeight); + if (error) + return "proofHeight." + error; + } + return null; + }; + + /** + * Creates a QueryChannelClientStateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.QueryChannelClientStateResponse} QueryChannelClientStateResponse + */ + QueryChannelClientStateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.QueryChannelClientStateResponse) + return object; + let message = new $root.ibc.core.channel.v1.QueryChannelClientStateResponse(); + if (object.identifiedClientState != null) { + if (typeof object.identifiedClientState !== "object") + throw TypeError(".ibc.core.channel.v1.QueryChannelClientStateResponse.identifiedClientState: object expected"); + message.identifiedClientState = $root.ibc.core.client.v1.IdentifiedClientState.fromObject(object.identifiedClientState); + } + if (object.proof != null) + if (typeof object.proof === "string") + $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); + else if (object.proof.length) + message.proof = object.proof; + if (object.proofHeight != null) { + if (typeof object.proofHeight !== "object") + throw TypeError(".ibc.core.channel.v1.QueryChannelClientStateResponse.proofHeight: object expected"); + message.proofHeight = $root.ibc.core.client.v1.Height.fromObject(object.proofHeight); + } + return message; + }; + + /** + * Creates a plain object from a QueryChannelClientStateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse + * @static + * @param {ibc.core.channel.v1.QueryChannelClientStateResponse} message QueryChannelClientStateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryChannelClientStateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.identifiedClientState = null; + if (options.bytes === String) + object.proof = ""; + else { + object.proof = []; + if (options.bytes !== Array) + object.proof = $util.newBuffer(object.proof); + } + object.proofHeight = null; + } + if (message.identifiedClientState != null && message.hasOwnProperty("identifiedClientState")) + object.identifiedClientState = $root.ibc.core.client.v1.IdentifiedClientState.toObject(message.identifiedClientState, options); + if (message.proof != null && message.hasOwnProperty("proof")) + object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) + object.proofHeight = $root.ibc.core.client.v1.Height.toObject(message.proofHeight, options); + return object; + }; + + /** + * Converts this QueryChannelClientStateResponse to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse + * @instance + * @returns {Object.} JSON object + */ + QueryChannelClientStateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryChannelClientStateResponse; + })(v1.QueryChannelClientStateResponse || {}); + + v1.QueryChannelConsensusStateRequest = (function(QueryChannelConsensusStateRequest) { + + /** + * Properties of a QueryChannelConsensusStateRequest. + * @memberof ibc.core.channel.v1 + * @interface IQueryChannelConsensusStateRequest + * @property {string|null} [portId] QueryChannelConsensusStateRequest portId + * @property {string|null} [channelId] QueryChannelConsensusStateRequest channelId + * @property {number|Long|null} [revisionNumber] QueryChannelConsensusStateRequest revisionNumber + * @property {number|Long|null} [revisionHeight] QueryChannelConsensusStateRequest revisionHeight + */ + + /** + * Constructs a new QueryChannelConsensusStateRequest. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a QueryChannelConsensusStateRequest. + * @implements IQueryChannelConsensusStateRequest + * @constructor + * @param {ibc.core.channel.v1.IQueryChannelConsensusStateRequest=} [properties] Properties to set + */ + function QueryChannelConsensusStateRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryChannelConsensusStateRequest portId. + * @member {string} portId + * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest + * @instance + */ + QueryChannelConsensusStateRequest.prototype.portId = ""; + + /** + * QueryChannelConsensusStateRequest channelId. + * @member {string} channelId + * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest + * @instance + */ + QueryChannelConsensusStateRequest.prototype.channelId = ""; + + /** + * QueryChannelConsensusStateRequest revisionNumber. + * @member {number|Long} revisionNumber + * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest + * @instance + */ + QueryChannelConsensusStateRequest.prototype.revisionNumber = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * QueryChannelConsensusStateRequest revisionHeight. + * @member {number|Long} revisionHeight + * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest + * @instance + */ + QueryChannelConsensusStateRequest.prototype.revisionHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new QueryChannelConsensusStateRequest instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest + * @static + * @param {ibc.core.channel.v1.IQueryChannelConsensusStateRequest=} [properties] Properties to set + * @returns {ibc.core.channel.v1.QueryChannelConsensusStateRequest} QueryChannelConsensusStateRequest instance + */ + QueryChannelConsensusStateRequest.create = function create(properties) { + return new QueryChannelConsensusStateRequest(properties); + }; + + /** + * Encodes the specified QueryChannelConsensusStateRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelConsensusStateRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest + * @static + * @param {ibc.core.channel.v1.IQueryChannelConsensusStateRequest} message QueryChannelConsensusStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryChannelConsensusStateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.portId != null && Object.hasOwnProperty.call(message, "portId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.portId); + if (message.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.channelId); + if (message.revisionNumber != null && Object.hasOwnProperty.call(message, "revisionNumber")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.revisionNumber); + if (message.revisionHeight != null && Object.hasOwnProperty.call(message, "revisionHeight")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.revisionHeight); + return writer; + }; + + /** + * Encodes the specified QueryChannelConsensusStateRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryChannelConsensusStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest + * @static + * @param {ibc.core.channel.v1.IQueryChannelConsensusStateRequest} message QueryChannelConsensusStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryChannelConsensusStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryChannelConsensusStateRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.QueryChannelConsensusStateRequest} QueryChannelConsensusStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryChannelConsensusStateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryChannelConsensusStateRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.revisionNumber = reader.uint64(); + break; + case 4: + message.revisionHeight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryChannelConsensusStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.QueryChannelConsensusStateRequest} QueryChannelConsensusStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryChannelConsensusStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryChannelConsensusStateRequest message. + * @function verify + * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryChannelConsensusStateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.portId != null && message.hasOwnProperty("portId")) + if (!$util.isString(message.portId)) + return "portId: string expected"; + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) + if (!$util.isInteger(message.revisionNumber) && !(message.revisionNumber && $util.isInteger(message.revisionNumber.low) && $util.isInteger(message.revisionNumber.high))) + return "revisionNumber: integer|Long expected"; + if (message.revisionHeight != null && message.hasOwnProperty("revisionHeight")) + if (!$util.isInteger(message.revisionHeight) && !(message.revisionHeight && $util.isInteger(message.revisionHeight.low) && $util.isInteger(message.revisionHeight.high))) + return "revisionHeight: integer|Long expected"; + return null; + }; + + /** + * Creates a QueryChannelConsensusStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.QueryChannelConsensusStateRequest} QueryChannelConsensusStateRequest + */ + QueryChannelConsensusStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.QueryChannelConsensusStateRequest) + return object; + let message = new $root.ibc.core.channel.v1.QueryChannelConsensusStateRequest(); + if (object.portId != null) + message.portId = String(object.portId); + if (object.channelId != null) + message.channelId = String(object.channelId); + if (object.revisionNumber != null) + if ($util.Long) + (message.revisionNumber = $util.Long.fromValue(object.revisionNumber)).unsigned = true; + else if (typeof object.revisionNumber === "string") + message.revisionNumber = parseInt(object.revisionNumber, 10); + else if (typeof object.revisionNumber === "number") + message.revisionNumber = object.revisionNumber; + else if (typeof object.revisionNumber === "object") + message.revisionNumber = new $util.LongBits(object.revisionNumber.low >>> 0, object.revisionNumber.high >>> 0).toNumber(true); + if (object.revisionHeight != null) + if ($util.Long) + (message.revisionHeight = $util.Long.fromValue(object.revisionHeight)).unsigned = true; + else if (typeof object.revisionHeight === "string") + message.revisionHeight = parseInt(object.revisionHeight, 10); + else if (typeof object.revisionHeight === "number") + message.revisionHeight = object.revisionHeight; + else if (typeof object.revisionHeight === "object") + message.revisionHeight = new $util.LongBits(object.revisionHeight.low >>> 0, object.revisionHeight.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a QueryChannelConsensusStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest + * @static + * @param {ibc.core.channel.v1.QueryChannelConsensusStateRequest} message QueryChannelConsensusStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryChannelConsensusStateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.portId = ""; + object.channelId = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.revisionNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.revisionNumber = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.revisionHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.revisionHeight = options.longs === String ? "0" : 0; + } + if (message.portId != null && message.hasOwnProperty("portId")) + object.portId = message.portId; + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) + if (typeof message.revisionNumber === "number") + object.revisionNumber = options.longs === String ? String(message.revisionNumber) : message.revisionNumber; + else + object.revisionNumber = options.longs === String ? $util.Long.prototype.toString.call(message.revisionNumber) : options.longs === Number ? new $util.LongBits(message.revisionNumber.low >>> 0, message.revisionNumber.high >>> 0).toNumber(true) : message.revisionNumber; + if (message.revisionHeight != null && message.hasOwnProperty("revisionHeight")) + if (typeof message.revisionHeight === "number") + object.revisionHeight = options.longs === String ? String(message.revisionHeight) : message.revisionHeight; + else + object.revisionHeight = options.longs === String ? $util.Long.prototype.toString.call(message.revisionHeight) : options.longs === Number ? new $util.LongBits(message.revisionHeight.low >>> 0, message.revisionHeight.high >>> 0).toNumber(true) : message.revisionHeight; + return object; + }; + + /** + * Converts this QueryChannelConsensusStateRequest to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest + * @instance + * @returns {Object.} JSON object + */ + QueryChannelConsensusStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryChannelConsensusStateRequest; + })(v1.QueryChannelConsensusStateRequest || {}); + + v1.QueryChannelConsensusStateResponse = (function(QueryChannelConsensusStateResponse) { + + /** + * Properties of a QueryChannelConsensusStateResponse. + * @memberof ibc.core.channel.v1 + * @interface IQueryChannelConsensusStateResponse + * @property {google.protobuf.IAny|null} [consensusState] QueryChannelConsensusStateResponse consensusState + * @property {string|null} [clientId] QueryChannelConsensusStateResponse clientId + * @property {Uint8Array|null} [proof] QueryChannelConsensusStateResponse proof + * @property {ibc.core.client.v1.IHeight|null} [proofHeight] QueryChannelConsensusStateResponse proofHeight + */ + + /** + * Constructs a new QueryChannelConsensusStateResponse. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a QueryChannelConsensusStateResponse. + * @implements IQueryChannelConsensusStateResponse + * @constructor + * @param {ibc.core.channel.v1.IQueryChannelConsensusStateResponse=} [properties] Properties to set + */ + function QueryChannelConsensusStateResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryChannelConsensusStateResponse consensusState. + * @member {google.protobuf.IAny|null|undefined} consensusState + * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse + * @instance + */ + QueryChannelConsensusStateResponse.prototype.consensusState = null; + + /** + * QueryChannelConsensusStateResponse clientId. + * @member {string} clientId + * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse + * @instance + */ + QueryChannelConsensusStateResponse.prototype.clientId = ""; + + /** + * QueryChannelConsensusStateResponse proof. + * @member {Uint8Array} proof + * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse + * @instance + */ + QueryChannelConsensusStateResponse.prototype.proof = $util.newBuffer([]); + + /** + * QueryChannelConsensusStateResponse proofHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} proofHeight + * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse + * @instance + */ + QueryChannelConsensusStateResponse.prototype.proofHeight = null; + + /** + * Creates a new QueryChannelConsensusStateResponse instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse + * @static + * @param {ibc.core.channel.v1.IQueryChannelConsensusStateResponse=} [properties] Properties to set + * @returns {ibc.core.channel.v1.QueryChannelConsensusStateResponse} QueryChannelConsensusStateResponse instance + */ + QueryChannelConsensusStateResponse.create = function create(properties) { + return new QueryChannelConsensusStateResponse(properties); + }; + + /** + * Encodes the specified QueryChannelConsensusStateResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelConsensusStateResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse + * @static + * @param {ibc.core.channel.v1.IQueryChannelConsensusStateResponse} message QueryChannelConsensusStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryChannelConsensusStateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.consensusState != null && Object.hasOwnProperty.call(message, "consensusState")) + $root.google.protobuf.Any.encode(message.consensusState, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clientId); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.proof); + if (message.proofHeight != null && Object.hasOwnProperty.call(message, "proofHeight")) + $root.ibc.core.client.v1.Height.encode(message.proofHeight, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryChannelConsensusStateResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryChannelConsensusStateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse + * @static + * @param {ibc.core.channel.v1.IQueryChannelConsensusStateResponse} message QueryChannelConsensusStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryChannelConsensusStateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryChannelConsensusStateResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.QueryChannelConsensusStateResponse} QueryChannelConsensusStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryChannelConsensusStateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryChannelConsensusStateResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consensusState = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 2: + message.clientId = reader.string(); + break; + case 3: + message.proof = reader.bytes(); + break; + case 4: + message.proofHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryChannelConsensusStateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.QueryChannelConsensusStateResponse} QueryChannelConsensusStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryChannelConsensusStateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryChannelConsensusStateResponse message. + * @function verify + * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryChannelConsensusStateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.consensusState != null && message.hasOwnProperty("consensusState")) { + let error = $root.google.protobuf.Any.verify(message.consensusState); + if (error) + return "consensusState." + error; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.proof != null && message.hasOwnProperty("proof")) + if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) + return "proof: buffer expected"; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) { + let error = $root.ibc.core.client.v1.Height.verify(message.proofHeight); + if (error) + return "proofHeight." + error; + } + return null; + }; + + /** + * Creates a QueryChannelConsensusStateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.QueryChannelConsensusStateResponse} QueryChannelConsensusStateResponse + */ + QueryChannelConsensusStateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.QueryChannelConsensusStateResponse) + return object; + let message = new $root.ibc.core.channel.v1.QueryChannelConsensusStateResponse(); + if (object.consensusState != null) { + if (typeof object.consensusState !== "object") + throw TypeError(".ibc.core.channel.v1.QueryChannelConsensusStateResponse.consensusState: object expected"); + message.consensusState = $root.google.protobuf.Any.fromObject(object.consensusState); + } + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.proof != null) + if (typeof object.proof === "string") + $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); + else if (object.proof.length) + message.proof = object.proof; + if (object.proofHeight != null) { + if (typeof object.proofHeight !== "object") + throw TypeError(".ibc.core.channel.v1.QueryChannelConsensusStateResponse.proofHeight: object expected"); + message.proofHeight = $root.ibc.core.client.v1.Height.fromObject(object.proofHeight); + } + return message; + }; + + /** + * Creates a plain object from a QueryChannelConsensusStateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse + * @static + * @param {ibc.core.channel.v1.QueryChannelConsensusStateResponse} message QueryChannelConsensusStateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryChannelConsensusStateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.consensusState = null; + object.clientId = ""; + if (options.bytes === String) + object.proof = ""; + else { + object.proof = []; + if (options.bytes !== Array) + object.proof = $util.newBuffer(object.proof); + } + object.proofHeight = null; + } + if (message.consensusState != null && message.hasOwnProperty("consensusState")) + object.consensusState = $root.google.protobuf.Any.toObject(message.consensusState, options); + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.proof != null && message.hasOwnProperty("proof")) + object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) + object.proofHeight = $root.ibc.core.client.v1.Height.toObject(message.proofHeight, options); + return object; + }; + + /** + * Converts this QueryChannelConsensusStateResponse to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse + * @instance + * @returns {Object.} JSON object + */ + QueryChannelConsensusStateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryChannelConsensusStateResponse; + })(v1.QueryChannelConsensusStateResponse || {}); + + v1.QueryPacketCommitmentRequest = (function(QueryPacketCommitmentRequest) { + + /** + * Properties of a QueryPacketCommitmentRequest. + * @memberof ibc.core.channel.v1 + * @interface IQueryPacketCommitmentRequest + * @property {string|null} [portId] QueryPacketCommitmentRequest portId + * @property {string|null} [channelId] QueryPacketCommitmentRequest channelId + * @property {number|Long|null} [sequence] QueryPacketCommitmentRequest sequence + */ + + /** + * Constructs a new QueryPacketCommitmentRequest. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a QueryPacketCommitmentRequest. + * @implements IQueryPacketCommitmentRequest + * @constructor + * @param {ibc.core.channel.v1.IQueryPacketCommitmentRequest=} [properties] Properties to set + */ + function QueryPacketCommitmentRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryPacketCommitmentRequest portId. + * @member {string} portId + * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest + * @instance + */ + QueryPacketCommitmentRequest.prototype.portId = ""; + + /** + * QueryPacketCommitmentRequest channelId. + * @member {string} channelId + * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest + * @instance + */ + QueryPacketCommitmentRequest.prototype.channelId = ""; + + /** + * QueryPacketCommitmentRequest sequence. + * @member {number|Long} sequence + * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest + * @instance + */ + QueryPacketCommitmentRequest.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new QueryPacketCommitmentRequest instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest + * @static + * @param {ibc.core.channel.v1.IQueryPacketCommitmentRequest=} [properties] Properties to set + * @returns {ibc.core.channel.v1.QueryPacketCommitmentRequest} QueryPacketCommitmentRequest instance + */ + QueryPacketCommitmentRequest.create = function create(properties) { + return new QueryPacketCommitmentRequest(properties); + }; + + /** + * Encodes the specified QueryPacketCommitmentRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest + * @static + * @param {ibc.core.channel.v1.IQueryPacketCommitmentRequest} message QueryPacketCommitmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryPacketCommitmentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.portId != null && Object.hasOwnProperty.call(message, "portId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.portId); + if (message.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.channelId); + if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.sequence); + return writer; + }; + + /** + * Encodes the specified QueryPacketCommitmentRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest + * @static + * @param {ibc.core.channel.v1.IQueryPacketCommitmentRequest} message QueryPacketCommitmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryPacketCommitmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryPacketCommitmentRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.QueryPacketCommitmentRequest} QueryPacketCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryPacketCommitmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryPacketCommitmentRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.sequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryPacketCommitmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.QueryPacketCommitmentRequest} QueryPacketCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryPacketCommitmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryPacketCommitmentRequest message. + * @function verify + * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryPacketCommitmentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.portId != null && message.hasOwnProperty("portId")) + if (!$util.isString(message.portId)) + return "portId: string expected"; + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + if (message.sequence != null && message.hasOwnProperty("sequence")) + if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) + return "sequence: integer|Long expected"; + return null; + }; + + /** + * Creates a QueryPacketCommitmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.QueryPacketCommitmentRequest} QueryPacketCommitmentRequest + */ + QueryPacketCommitmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.QueryPacketCommitmentRequest) + return object; + let message = new $root.ibc.core.channel.v1.QueryPacketCommitmentRequest(); + if (object.portId != null) + message.portId = String(object.portId); + if (object.channelId != null) + message.channelId = String(object.channelId); + if (object.sequence != null) + if ($util.Long) + (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; + else if (typeof object.sequence === "string") + message.sequence = parseInt(object.sequence, 10); + else if (typeof object.sequence === "number") + message.sequence = object.sequence; + else if (typeof object.sequence === "object") + message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a QueryPacketCommitmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest + * @static + * @param {ibc.core.channel.v1.QueryPacketCommitmentRequest} message QueryPacketCommitmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryPacketCommitmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.portId = ""; + object.channelId = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sequence = options.longs === String ? "0" : 0; + } + if (message.portId != null && message.hasOwnProperty("portId")) + object.portId = message.portId; + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + if (message.sequence != null && message.hasOwnProperty("sequence")) + if (typeof message.sequence === "number") + object.sequence = options.longs === String ? String(message.sequence) : message.sequence; + else + object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; + return object; + }; + + /** + * Converts this QueryPacketCommitmentRequest to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest + * @instance + * @returns {Object.} JSON object + */ + QueryPacketCommitmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryPacketCommitmentRequest; + })(v1.QueryPacketCommitmentRequest || {}); + + v1.QueryPacketCommitmentResponse = (function(QueryPacketCommitmentResponse) { + + /** + * Properties of a QueryPacketCommitmentResponse. + * @memberof ibc.core.channel.v1 + * @interface IQueryPacketCommitmentResponse + * @property {Uint8Array|null} [commitment] QueryPacketCommitmentResponse commitment + * @property {Uint8Array|null} [proof] QueryPacketCommitmentResponse proof + * @property {ibc.core.client.v1.IHeight|null} [proofHeight] QueryPacketCommitmentResponse proofHeight + */ + + /** + * Constructs a new QueryPacketCommitmentResponse. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a QueryPacketCommitmentResponse. + * @implements IQueryPacketCommitmentResponse + * @constructor + * @param {ibc.core.channel.v1.IQueryPacketCommitmentResponse=} [properties] Properties to set + */ + function QueryPacketCommitmentResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryPacketCommitmentResponse commitment. + * @member {Uint8Array} commitment + * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse + * @instance + */ + QueryPacketCommitmentResponse.prototype.commitment = $util.newBuffer([]); + + /** + * QueryPacketCommitmentResponse proof. + * @member {Uint8Array} proof + * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse + * @instance + */ + QueryPacketCommitmentResponse.prototype.proof = $util.newBuffer([]); + + /** + * QueryPacketCommitmentResponse proofHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} proofHeight + * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse + * @instance + */ + QueryPacketCommitmentResponse.prototype.proofHeight = null; + + /** + * Creates a new QueryPacketCommitmentResponse instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse + * @static + * @param {ibc.core.channel.v1.IQueryPacketCommitmentResponse=} [properties] Properties to set + * @returns {ibc.core.channel.v1.QueryPacketCommitmentResponse} QueryPacketCommitmentResponse instance + */ + QueryPacketCommitmentResponse.create = function create(properties) { + return new QueryPacketCommitmentResponse(properties); + }; + + /** + * Encodes the specified QueryPacketCommitmentResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse + * @static + * @param {ibc.core.channel.v1.IQueryPacketCommitmentResponse} message QueryPacketCommitmentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryPacketCommitmentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commitment != null && Object.hasOwnProperty.call(message, "commitment")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.commitment); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); + if (message.proofHeight != null && Object.hasOwnProperty.call(message, "proofHeight")) + $root.ibc.core.client.v1.Height.encode(message.proofHeight, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryPacketCommitmentResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse + * @static + * @param {ibc.core.channel.v1.IQueryPacketCommitmentResponse} message QueryPacketCommitmentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryPacketCommitmentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryPacketCommitmentResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.QueryPacketCommitmentResponse} QueryPacketCommitmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryPacketCommitmentResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryPacketCommitmentResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.commitment = reader.bytes(); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryPacketCommitmentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.QueryPacketCommitmentResponse} QueryPacketCommitmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryPacketCommitmentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryPacketCommitmentResponse message. + * @function verify + * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryPacketCommitmentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commitment != null && message.hasOwnProperty("commitment")) + if (!(message.commitment && typeof message.commitment.length === "number" || $util.isString(message.commitment))) + return "commitment: buffer expected"; + if (message.proof != null && message.hasOwnProperty("proof")) + if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) + return "proof: buffer expected"; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) { + let error = $root.ibc.core.client.v1.Height.verify(message.proofHeight); + if (error) + return "proofHeight." + error; + } + return null; + }; + + /** + * Creates a QueryPacketCommitmentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.QueryPacketCommitmentResponse} QueryPacketCommitmentResponse + */ + QueryPacketCommitmentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.QueryPacketCommitmentResponse) + return object; + let message = new $root.ibc.core.channel.v1.QueryPacketCommitmentResponse(); + if (object.commitment != null) + if (typeof object.commitment === "string") + $util.base64.decode(object.commitment, message.commitment = $util.newBuffer($util.base64.length(object.commitment)), 0); + else if (object.commitment.length) + message.commitment = object.commitment; + if (object.proof != null) + if (typeof object.proof === "string") + $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); + else if (object.proof.length) + message.proof = object.proof; + if (object.proofHeight != null) { + if (typeof object.proofHeight !== "object") + throw TypeError(".ibc.core.channel.v1.QueryPacketCommitmentResponse.proofHeight: object expected"); + message.proofHeight = $root.ibc.core.client.v1.Height.fromObject(object.proofHeight); + } + return message; + }; + + /** + * Creates a plain object from a QueryPacketCommitmentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse + * @static + * @param {ibc.core.channel.v1.QueryPacketCommitmentResponse} message QueryPacketCommitmentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryPacketCommitmentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if (options.bytes === String) + object.commitment = ""; + else { + object.commitment = []; + if (options.bytes !== Array) + object.commitment = $util.newBuffer(object.commitment); + } + if (options.bytes === String) + object.proof = ""; + else { + object.proof = []; + if (options.bytes !== Array) + object.proof = $util.newBuffer(object.proof); + } + object.proofHeight = null; + } + if (message.commitment != null && message.hasOwnProperty("commitment")) + object.commitment = options.bytes === String ? $util.base64.encode(message.commitment, 0, message.commitment.length) : options.bytes === Array ? Array.prototype.slice.call(message.commitment) : message.commitment; + if (message.proof != null && message.hasOwnProperty("proof")) + object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) + object.proofHeight = $root.ibc.core.client.v1.Height.toObject(message.proofHeight, options); + return object; + }; + + /** + * Converts this QueryPacketCommitmentResponse to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse + * @instance + * @returns {Object.} JSON object + */ + QueryPacketCommitmentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryPacketCommitmentResponse; + })(v1.QueryPacketCommitmentResponse || {}); + + v1.QueryPacketCommitmentsRequest = (function(QueryPacketCommitmentsRequest) { + + /** + * Properties of a QueryPacketCommitmentsRequest. + * @memberof ibc.core.channel.v1 + * @interface IQueryPacketCommitmentsRequest + * @property {string|null} [portId] QueryPacketCommitmentsRequest portId + * @property {string|null} [channelId] QueryPacketCommitmentsRequest channelId + * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryPacketCommitmentsRequest pagination + */ + + /** + * Constructs a new QueryPacketCommitmentsRequest. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a QueryPacketCommitmentsRequest. + * @implements IQueryPacketCommitmentsRequest + * @constructor + * @param {ibc.core.channel.v1.IQueryPacketCommitmentsRequest=} [properties] Properties to set + */ + function QueryPacketCommitmentsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryPacketCommitmentsRequest portId. + * @member {string} portId + * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest + * @instance + */ + QueryPacketCommitmentsRequest.prototype.portId = ""; + + /** + * QueryPacketCommitmentsRequest channelId. + * @member {string} channelId + * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest + * @instance + */ + QueryPacketCommitmentsRequest.prototype.channelId = ""; + + /** + * QueryPacketCommitmentsRequest pagination. + * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination + * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest + * @instance + */ + QueryPacketCommitmentsRequest.prototype.pagination = null; + + /** + * Creates a new QueryPacketCommitmentsRequest instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest + * @static + * @param {ibc.core.channel.v1.IQueryPacketCommitmentsRequest=} [properties] Properties to set + * @returns {ibc.core.channel.v1.QueryPacketCommitmentsRequest} QueryPacketCommitmentsRequest instance + */ + QueryPacketCommitmentsRequest.create = function create(properties) { + return new QueryPacketCommitmentsRequest(properties); + }; + + /** + * Encodes the specified QueryPacketCommitmentsRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentsRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest + * @static + * @param {ibc.core.channel.v1.IQueryPacketCommitmentsRequest} message QueryPacketCommitmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryPacketCommitmentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.portId != null && Object.hasOwnProperty.call(message, "portId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.portId); + if (message.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.channelId); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryPacketCommitmentsRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest + * @static + * @param {ibc.core.channel.v1.IQueryPacketCommitmentsRequest} message QueryPacketCommitmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryPacketCommitmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryPacketCommitmentsRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.QueryPacketCommitmentsRequest} QueryPacketCommitmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryPacketCommitmentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryPacketCommitmentsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryPacketCommitmentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.QueryPacketCommitmentsRequest} QueryPacketCommitmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryPacketCommitmentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryPacketCommitmentsRequest message. + * @function verify + * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryPacketCommitmentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.portId != null && message.hasOwnProperty("portId")) + if (!$util.isString(message.portId)) + return "portId: string expected"; + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryPacketCommitmentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.QueryPacketCommitmentsRequest} QueryPacketCommitmentsRequest + */ + QueryPacketCommitmentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.QueryPacketCommitmentsRequest) + return object; + let message = new $root.ibc.core.channel.v1.QueryPacketCommitmentsRequest(); + if (object.portId != null) + message.portId = String(object.portId); + if (object.channelId != null) + message.channelId = String(object.channelId); + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".ibc.core.channel.v1.QueryPacketCommitmentsRequest.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryPacketCommitmentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest + * @static + * @param {ibc.core.channel.v1.QueryPacketCommitmentsRequest} message QueryPacketCommitmentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryPacketCommitmentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.portId = ""; + object.channelId = ""; + object.pagination = null; + } + if (message.portId != null && message.hasOwnProperty("portId")) + object.portId = message.portId; + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryPacketCommitmentsRequest to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryPacketCommitmentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryPacketCommitmentsRequest; + })(v1.QueryPacketCommitmentsRequest || {}); + + v1.QueryPacketCommitmentsResponse = (function(QueryPacketCommitmentsResponse) { + + /** + * Properties of a QueryPacketCommitmentsResponse. + * @memberof ibc.core.channel.v1 + * @interface IQueryPacketCommitmentsResponse + * @property {Array.|null} [commitments] QueryPacketCommitmentsResponse commitments + * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryPacketCommitmentsResponse pagination + * @property {ibc.core.client.v1.IHeight|null} [height] QueryPacketCommitmentsResponse height + */ + + /** + * Constructs a new QueryPacketCommitmentsResponse. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a QueryPacketCommitmentsResponse. + * @implements IQueryPacketCommitmentsResponse + * @constructor + * @param {ibc.core.channel.v1.IQueryPacketCommitmentsResponse=} [properties] Properties to set + */ + function QueryPacketCommitmentsResponse(properties) { + this.commitments = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryPacketCommitmentsResponse commitments. + * @member {Array.} commitments + * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse + * @instance + */ + QueryPacketCommitmentsResponse.prototype.commitments = $util.emptyArray; + + /** + * QueryPacketCommitmentsResponse pagination. + * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination + * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse + * @instance + */ + QueryPacketCommitmentsResponse.prototype.pagination = null; + + /** + * QueryPacketCommitmentsResponse height. + * @member {ibc.core.client.v1.IHeight|null|undefined} height + * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse + * @instance + */ + QueryPacketCommitmentsResponse.prototype.height = null; + + /** + * Creates a new QueryPacketCommitmentsResponse instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse + * @static + * @param {ibc.core.channel.v1.IQueryPacketCommitmentsResponse=} [properties] Properties to set + * @returns {ibc.core.channel.v1.QueryPacketCommitmentsResponse} QueryPacketCommitmentsResponse instance + */ + QueryPacketCommitmentsResponse.create = function create(properties) { + return new QueryPacketCommitmentsResponse(properties); + }; + + /** + * Encodes the specified QueryPacketCommitmentsResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentsResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse + * @static + * @param {ibc.core.channel.v1.IQueryPacketCommitmentsResponse} message QueryPacketCommitmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryPacketCommitmentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commitments != null && message.commitments.length) + for (let i = 0; i < message.commitments.length; ++i) + $root.ibc.core.channel.v1.PacketState.encode(message.commitments[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + $root.ibc.core.client.v1.Height.encode(message.height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryPacketCommitmentsResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse + * @static + * @param {ibc.core.channel.v1.IQueryPacketCommitmentsResponse} message QueryPacketCommitmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryPacketCommitmentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryPacketCommitmentsResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.QueryPacketCommitmentsResponse} QueryPacketCommitmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryPacketCommitmentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryPacketCommitmentsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.commitments && message.commitments.length)) + message.commitments = []; + message.commitments.push($root.ibc.core.channel.v1.PacketState.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); + break; + case 3: + message.height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryPacketCommitmentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.QueryPacketCommitmentsResponse} QueryPacketCommitmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryPacketCommitmentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryPacketCommitmentsResponse message. + * @function verify + * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryPacketCommitmentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commitments != null && message.hasOwnProperty("commitments")) { + if (!Array.isArray(message.commitments)) + return "commitments: array expected"; + for (let i = 0; i < message.commitments.length; ++i) { + let error = $root.ibc.core.channel.v1.PacketState.verify(message.commitments[i]); + if (error) + return "commitments." + error; + } + } + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); + if (error) + return "pagination." + error; + } + if (message.height != null && message.hasOwnProperty("height")) { + let error = $root.ibc.core.client.v1.Height.verify(message.height); + if (error) + return "height." + error; + } + return null; + }; + + /** + * Creates a QueryPacketCommitmentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.QueryPacketCommitmentsResponse} QueryPacketCommitmentsResponse + */ + QueryPacketCommitmentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.QueryPacketCommitmentsResponse) + return object; + let message = new $root.ibc.core.channel.v1.QueryPacketCommitmentsResponse(); + if (object.commitments) { + if (!Array.isArray(object.commitments)) + throw TypeError(".ibc.core.channel.v1.QueryPacketCommitmentsResponse.commitments: array expected"); + message.commitments = []; + for (let i = 0; i < object.commitments.length; ++i) { + if (typeof object.commitments[i] !== "object") + throw TypeError(".ibc.core.channel.v1.QueryPacketCommitmentsResponse.commitments: object expected"); + message.commitments[i] = $root.ibc.core.channel.v1.PacketState.fromObject(object.commitments[i]); + } + } + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".ibc.core.channel.v1.QueryPacketCommitmentsResponse.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); + } + if (object.height != null) { + if (typeof object.height !== "object") + throw TypeError(".ibc.core.channel.v1.QueryPacketCommitmentsResponse.height: object expected"); + message.height = $root.ibc.core.client.v1.Height.fromObject(object.height); + } + return message; + }; + + /** + * Creates a plain object from a QueryPacketCommitmentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse + * @static + * @param {ibc.core.channel.v1.QueryPacketCommitmentsResponse} message QueryPacketCommitmentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryPacketCommitmentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.commitments = []; + if (options.defaults) { + object.pagination = null; + object.height = null; + } + if (message.commitments && message.commitments.length) { + object.commitments = []; + for (let j = 0; j < message.commitments.length; ++j) + object.commitments[j] = $root.ibc.core.channel.v1.PacketState.toObject(message.commitments[j], options); + } + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); + if (message.height != null && message.hasOwnProperty("height")) + object.height = $root.ibc.core.client.v1.Height.toObject(message.height, options); + return object; + }; + + /** + * Converts this QueryPacketCommitmentsResponse to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryPacketCommitmentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryPacketCommitmentsResponse; + })(v1.QueryPacketCommitmentsResponse || {}); + + v1.QueryPacketReceiptRequest = (function(QueryPacketReceiptRequest) { + + /** + * Properties of a QueryPacketReceiptRequest. + * @memberof ibc.core.channel.v1 + * @interface IQueryPacketReceiptRequest + * @property {string|null} [portId] QueryPacketReceiptRequest portId + * @property {string|null} [channelId] QueryPacketReceiptRequest channelId + * @property {number|Long|null} [sequence] QueryPacketReceiptRequest sequence + */ + + /** + * Constructs a new QueryPacketReceiptRequest. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a QueryPacketReceiptRequest. + * @implements IQueryPacketReceiptRequest + * @constructor + * @param {ibc.core.channel.v1.IQueryPacketReceiptRequest=} [properties] Properties to set + */ + function QueryPacketReceiptRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryPacketReceiptRequest portId. + * @member {string} portId + * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest + * @instance + */ + QueryPacketReceiptRequest.prototype.portId = ""; + + /** + * QueryPacketReceiptRequest channelId. + * @member {string} channelId + * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest + * @instance + */ + QueryPacketReceiptRequest.prototype.channelId = ""; + + /** + * QueryPacketReceiptRequest sequence. + * @member {number|Long} sequence + * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest + * @instance + */ + QueryPacketReceiptRequest.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new QueryPacketReceiptRequest instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest + * @static + * @param {ibc.core.channel.v1.IQueryPacketReceiptRequest=} [properties] Properties to set + * @returns {ibc.core.channel.v1.QueryPacketReceiptRequest} QueryPacketReceiptRequest instance + */ + QueryPacketReceiptRequest.create = function create(properties) { + return new QueryPacketReceiptRequest(properties); + }; + + /** + * Encodes the specified QueryPacketReceiptRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketReceiptRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest + * @static + * @param {ibc.core.channel.v1.IQueryPacketReceiptRequest} message QueryPacketReceiptRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryPacketReceiptRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.portId != null && Object.hasOwnProperty.call(message, "portId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.portId); + if (message.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.channelId); + if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.sequence); + return writer; + }; + + /** + * Encodes the specified QueryPacketReceiptRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketReceiptRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest + * @static + * @param {ibc.core.channel.v1.IQueryPacketReceiptRequest} message QueryPacketReceiptRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryPacketReceiptRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryPacketReceiptRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.QueryPacketReceiptRequest} QueryPacketReceiptRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryPacketReceiptRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryPacketReceiptRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.sequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryPacketReceiptRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.QueryPacketReceiptRequest} QueryPacketReceiptRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryPacketReceiptRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryPacketReceiptRequest message. + * @function verify + * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryPacketReceiptRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.portId != null && message.hasOwnProperty("portId")) + if (!$util.isString(message.portId)) + return "portId: string expected"; + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + if (message.sequence != null && message.hasOwnProperty("sequence")) + if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) + return "sequence: integer|Long expected"; + return null; + }; + + /** + * Creates a QueryPacketReceiptRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.QueryPacketReceiptRequest} QueryPacketReceiptRequest + */ + QueryPacketReceiptRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.QueryPacketReceiptRequest) + return object; + let message = new $root.ibc.core.channel.v1.QueryPacketReceiptRequest(); + if (object.portId != null) + message.portId = String(object.portId); + if (object.channelId != null) + message.channelId = String(object.channelId); + if (object.sequence != null) + if ($util.Long) + (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; + else if (typeof object.sequence === "string") + message.sequence = parseInt(object.sequence, 10); + else if (typeof object.sequence === "number") + message.sequence = object.sequence; + else if (typeof object.sequence === "object") + message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a QueryPacketReceiptRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest + * @static + * @param {ibc.core.channel.v1.QueryPacketReceiptRequest} message QueryPacketReceiptRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryPacketReceiptRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.portId = ""; + object.channelId = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sequence = options.longs === String ? "0" : 0; + } + if (message.portId != null && message.hasOwnProperty("portId")) + object.portId = message.portId; + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + if (message.sequence != null && message.hasOwnProperty("sequence")) + if (typeof message.sequence === "number") + object.sequence = options.longs === String ? String(message.sequence) : message.sequence; + else + object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; + return object; + }; + + /** + * Converts this QueryPacketReceiptRequest to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest + * @instance + * @returns {Object.} JSON object + */ + QueryPacketReceiptRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryPacketReceiptRequest; + })(v1.QueryPacketReceiptRequest || {}); + + v1.QueryPacketReceiptResponse = (function(QueryPacketReceiptResponse) { + + /** + * Properties of a QueryPacketReceiptResponse. + * @memberof ibc.core.channel.v1 + * @interface IQueryPacketReceiptResponse + * @property {boolean|null} [received] QueryPacketReceiptResponse received + * @property {Uint8Array|null} [proof] QueryPacketReceiptResponse proof + * @property {ibc.core.client.v1.IHeight|null} [proofHeight] QueryPacketReceiptResponse proofHeight + */ + + /** + * Constructs a new QueryPacketReceiptResponse. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a QueryPacketReceiptResponse. + * @implements IQueryPacketReceiptResponse + * @constructor + * @param {ibc.core.channel.v1.IQueryPacketReceiptResponse=} [properties] Properties to set + */ + function QueryPacketReceiptResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryPacketReceiptResponse received. + * @member {boolean} received + * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse + * @instance + */ + QueryPacketReceiptResponse.prototype.received = false; + + /** + * QueryPacketReceiptResponse proof. + * @member {Uint8Array} proof + * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse + * @instance + */ + QueryPacketReceiptResponse.prototype.proof = $util.newBuffer([]); + + /** + * QueryPacketReceiptResponse proofHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} proofHeight + * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse + * @instance + */ + QueryPacketReceiptResponse.prototype.proofHeight = null; + + /** + * Creates a new QueryPacketReceiptResponse instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse + * @static + * @param {ibc.core.channel.v1.IQueryPacketReceiptResponse=} [properties] Properties to set + * @returns {ibc.core.channel.v1.QueryPacketReceiptResponse} QueryPacketReceiptResponse instance + */ + QueryPacketReceiptResponse.create = function create(properties) { + return new QueryPacketReceiptResponse(properties); + }; + + /** + * Encodes the specified QueryPacketReceiptResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketReceiptResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse + * @static + * @param {ibc.core.channel.v1.IQueryPacketReceiptResponse} message QueryPacketReceiptResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryPacketReceiptResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.received != null && Object.hasOwnProperty.call(message, "received")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.received); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.proof); + if (message.proofHeight != null && Object.hasOwnProperty.call(message, "proofHeight")) + $root.ibc.core.client.v1.Height.encode(message.proofHeight, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryPacketReceiptResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketReceiptResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse + * @static + * @param {ibc.core.channel.v1.IQueryPacketReceiptResponse} message QueryPacketReceiptResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryPacketReceiptResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryPacketReceiptResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.QueryPacketReceiptResponse} QueryPacketReceiptResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryPacketReceiptResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryPacketReceiptResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.received = reader.bool(); + break; + case 3: + message.proof = reader.bytes(); + break; + case 4: + message.proofHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryPacketReceiptResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.QueryPacketReceiptResponse} QueryPacketReceiptResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryPacketReceiptResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryPacketReceiptResponse message. + * @function verify + * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryPacketReceiptResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.received != null && message.hasOwnProperty("received")) + if (typeof message.received !== "boolean") + return "received: boolean expected"; + if (message.proof != null && message.hasOwnProperty("proof")) + if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) + return "proof: buffer expected"; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) { + let error = $root.ibc.core.client.v1.Height.verify(message.proofHeight); + if (error) + return "proofHeight." + error; + } + return null; + }; + + /** + * Creates a QueryPacketReceiptResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.QueryPacketReceiptResponse} QueryPacketReceiptResponse + */ + QueryPacketReceiptResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.QueryPacketReceiptResponse) + return object; + let message = new $root.ibc.core.channel.v1.QueryPacketReceiptResponse(); + if (object.received != null) + message.received = Boolean(object.received); + if (object.proof != null) + if (typeof object.proof === "string") + $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); + else if (object.proof.length) + message.proof = object.proof; + if (object.proofHeight != null) { + if (typeof object.proofHeight !== "object") + throw TypeError(".ibc.core.channel.v1.QueryPacketReceiptResponse.proofHeight: object expected"); + message.proofHeight = $root.ibc.core.client.v1.Height.fromObject(object.proofHeight); + } + return message; + }; + + /** + * Creates a plain object from a QueryPacketReceiptResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse + * @static + * @param {ibc.core.channel.v1.QueryPacketReceiptResponse} message QueryPacketReceiptResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryPacketReceiptResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.received = false; + if (options.bytes === String) + object.proof = ""; + else { + object.proof = []; + if (options.bytes !== Array) + object.proof = $util.newBuffer(object.proof); + } + object.proofHeight = null; + } + if (message.received != null && message.hasOwnProperty("received")) + object.received = message.received; + if (message.proof != null && message.hasOwnProperty("proof")) + object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) + object.proofHeight = $root.ibc.core.client.v1.Height.toObject(message.proofHeight, options); + return object; + }; + + /** + * Converts this QueryPacketReceiptResponse to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse + * @instance + * @returns {Object.} JSON object + */ + QueryPacketReceiptResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryPacketReceiptResponse; + })(v1.QueryPacketReceiptResponse || {}); + + v1.QueryPacketAcknowledgementRequest = (function(QueryPacketAcknowledgementRequest) { + + /** + * Properties of a QueryPacketAcknowledgementRequest. + * @memberof ibc.core.channel.v1 + * @interface IQueryPacketAcknowledgementRequest + * @property {string|null} [portId] QueryPacketAcknowledgementRequest portId + * @property {string|null} [channelId] QueryPacketAcknowledgementRequest channelId + * @property {number|Long|null} [sequence] QueryPacketAcknowledgementRequest sequence + */ + + /** + * Constructs a new QueryPacketAcknowledgementRequest. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a QueryPacketAcknowledgementRequest. + * @implements IQueryPacketAcknowledgementRequest + * @constructor + * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementRequest=} [properties] Properties to set + */ + function QueryPacketAcknowledgementRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryPacketAcknowledgementRequest portId. + * @member {string} portId + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest + * @instance + */ + QueryPacketAcknowledgementRequest.prototype.portId = ""; + + /** + * QueryPacketAcknowledgementRequest channelId. + * @member {string} channelId + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest + * @instance + */ + QueryPacketAcknowledgementRequest.prototype.channelId = ""; + + /** + * QueryPacketAcknowledgementRequest sequence. + * @member {number|Long} sequence + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest + * @instance + */ + QueryPacketAcknowledgementRequest.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new QueryPacketAcknowledgementRequest instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest + * @static + * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementRequest=} [properties] Properties to set + * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementRequest} QueryPacketAcknowledgementRequest instance + */ + QueryPacketAcknowledgementRequest.create = function create(properties) { + return new QueryPacketAcknowledgementRequest(properties); + }; + + /** + * Encodes the specified QueryPacketAcknowledgementRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest + * @static + * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementRequest} message QueryPacketAcknowledgementRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryPacketAcknowledgementRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.portId != null && Object.hasOwnProperty.call(message, "portId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.portId); + if (message.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.channelId); + if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.sequence); + return writer; + }; + + /** + * Encodes the specified QueryPacketAcknowledgementRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest + * @static + * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementRequest} message QueryPacketAcknowledgementRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryPacketAcknowledgementRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryPacketAcknowledgementRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementRequest} QueryPacketAcknowledgementRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryPacketAcknowledgementRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryPacketAcknowledgementRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.sequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryPacketAcknowledgementRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementRequest} QueryPacketAcknowledgementRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryPacketAcknowledgementRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryPacketAcknowledgementRequest message. + * @function verify + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryPacketAcknowledgementRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.portId != null && message.hasOwnProperty("portId")) + if (!$util.isString(message.portId)) + return "portId: string expected"; + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + if (message.sequence != null && message.hasOwnProperty("sequence")) + if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) + return "sequence: integer|Long expected"; + return null; + }; + + /** + * Creates a QueryPacketAcknowledgementRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementRequest} QueryPacketAcknowledgementRequest + */ + QueryPacketAcknowledgementRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.QueryPacketAcknowledgementRequest) + return object; + let message = new $root.ibc.core.channel.v1.QueryPacketAcknowledgementRequest(); + if (object.portId != null) + message.portId = String(object.portId); + if (object.channelId != null) + message.channelId = String(object.channelId); + if (object.sequence != null) + if ($util.Long) + (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; + else if (typeof object.sequence === "string") + message.sequence = parseInt(object.sequence, 10); + else if (typeof object.sequence === "number") + message.sequence = object.sequence; + else if (typeof object.sequence === "object") + message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a QueryPacketAcknowledgementRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest + * @static + * @param {ibc.core.channel.v1.QueryPacketAcknowledgementRequest} message QueryPacketAcknowledgementRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryPacketAcknowledgementRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.portId = ""; + object.channelId = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sequence = options.longs === String ? "0" : 0; + } + if (message.portId != null && message.hasOwnProperty("portId")) + object.portId = message.portId; + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + if (message.sequence != null && message.hasOwnProperty("sequence")) + if (typeof message.sequence === "number") + object.sequence = options.longs === String ? String(message.sequence) : message.sequence; + else + object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; + return object; + }; + + /** + * Converts this QueryPacketAcknowledgementRequest to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest + * @instance + * @returns {Object.} JSON object + */ + QueryPacketAcknowledgementRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryPacketAcknowledgementRequest; + })(v1.QueryPacketAcknowledgementRequest || {}); + + v1.QueryPacketAcknowledgementResponse = (function(QueryPacketAcknowledgementResponse) { + + /** + * Properties of a QueryPacketAcknowledgementResponse. + * @memberof ibc.core.channel.v1 + * @interface IQueryPacketAcknowledgementResponse + * @property {Uint8Array|null} [acknowledgement] QueryPacketAcknowledgementResponse acknowledgement + * @property {Uint8Array|null} [proof] QueryPacketAcknowledgementResponse proof + * @property {ibc.core.client.v1.IHeight|null} [proofHeight] QueryPacketAcknowledgementResponse proofHeight + */ + + /** + * Constructs a new QueryPacketAcknowledgementResponse. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a QueryPacketAcknowledgementResponse. + * @implements IQueryPacketAcknowledgementResponse + * @constructor + * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementResponse=} [properties] Properties to set + */ + function QueryPacketAcknowledgementResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryPacketAcknowledgementResponse acknowledgement. + * @member {Uint8Array} acknowledgement + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse + * @instance + */ + QueryPacketAcknowledgementResponse.prototype.acknowledgement = $util.newBuffer([]); + + /** + * QueryPacketAcknowledgementResponse proof. + * @member {Uint8Array} proof + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse + * @instance + */ + QueryPacketAcknowledgementResponse.prototype.proof = $util.newBuffer([]); + + /** + * QueryPacketAcknowledgementResponse proofHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} proofHeight + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse + * @instance + */ + QueryPacketAcknowledgementResponse.prototype.proofHeight = null; + + /** + * Creates a new QueryPacketAcknowledgementResponse instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse + * @static + * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementResponse=} [properties] Properties to set + * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementResponse} QueryPacketAcknowledgementResponse instance + */ + QueryPacketAcknowledgementResponse.create = function create(properties) { + return new QueryPacketAcknowledgementResponse(properties); + }; + + /** + * Encodes the specified QueryPacketAcknowledgementResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse + * @static + * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementResponse} message QueryPacketAcknowledgementResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryPacketAcknowledgementResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.acknowledgement != null && Object.hasOwnProperty.call(message, "acknowledgement")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.acknowledgement); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); + if (message.proofHeight != null && Object.hasOwnProperty.call(message, "proofHeight")) + $root.ibc.core.client.v1.Height.encode(message.proofHeight, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryPacketAcknowledgementResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse + * @static + * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementResponse} message QueryPacketAcknowledgementResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryPacketAcknowledgementResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryPacketAcknowledgementResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementResponse} QueryPacketAcknowledgementResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryPacketAcknowledgementResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryPacketAcknowledgementResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.acknowledgement = reader.bytes(); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryPacketAcknowledgementResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementResponse} QueryPacketAcknowledgementResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryPacketAcknowledgementResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryPacketAcknowledgementResponse message. + * @function verify + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryPacketAcknowledgementResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.acknowledgement != null && message.hasOwnProperty("acknowledgement")) + if (!(message.acknowledgement && typeof message.acknowledgement.length === "number" || $util.isString(message.acknowledgement))) + return "acknowledgement: buffer expected"; + if (message.proof != null && message.hasOwnProperty("proof")) + if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) + return "proof: buffer expected"; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) { + let error = $root.ibc.core.client.v1.Height.verify(message.proofHeight); + if (error) + return "proofHeight." + error; + } + return null; + }; + + /** + * Creates a QueryPacketAcknowledgementResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementResponse} QueryPacketAcknowledgementResponse + */ + QueryPacketAcknowledgementResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.QueryPacketAcknowledgementResponse) + return object; + let message = new $root.ibc.core.channel.v1.QueryPacketAcknowledgementResponse(); + if (object.acknowledgement != null) + if (typeof object.acknowledgement === "string") + $util.base64.decode(object.acknowledgement, message.acknowledgement = $util.newBuffer($util.base64.length(object.acknowledgement)), 0); + else if (object.acknowledgement.length) + message.acknowledgement = object.acknowledgement; + if (object.proof != null) + if (typeof object.proof === "string") + $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); + else if (object.proof.length) + message.proof = object.proof; + if (object.proofHeight != null) { + if (typeof object.proofHeight !== "object") + throw TypeError(".ibc.core.channel.v1.QueryPacketAcknowledgementResponse.proofHeight: object expected"); + message.proofHeight = $root.ibc.core.client.v1.Height.fromObject(object.proofHeight); + } + return message; + }; + + /** + * Creates a plain object from a QueryPacketAcknowledgementResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse + * @static + * @param {ibc.core.channel.v1.QueryPacketAcknowledgementResponse} message QueryPacketAcknowledgementResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryPacketAcknowledgementResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if (options.bytes === String) + object.acknowledgement = ""; + else { + object.acknowledgement = []; + if (options.bytes !== Array) + object.acknowledgement = $util.newBuffer(object.acknowledgement); + } + if (options.bytes === String) + object.proof = ""; + else { + object.proof = []; + if (options.bytes !== Array) + object.proof = $util.newBuffer(object.proof); + } + object.proofHeight = null; + } + if (message.acknowledgement != null && message.hasOwnProperty("acknowledgement")) + object.acknowledgement = options.bytes === String ? $util.base64.encode(message.acknowledgement, 0, message.acknowledgement.length) : options.bytes === Array ? Array.prototype.slice.call(message.acknowledgement) : message.acknowledgement; + if (message.proof != null && message.hasOwnProperty("proof")) + object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) + object.proofHeight = $root.ibc.core.client.v1.Height.toObject(message.proofHeight, options); + return object; + }; + + /** + * Converts this QueryPacketAcknowledgementResponse to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse + * @instance + * @returns {Object.} JSON object + */ + QueryPacketAcknowledgementResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryPacketAcknowledgementResponse; + })(v1.QueryPacketAcknowledgementResponse || {}); + + v1.QueryPacketAcknowledgementsRequest = (function(QueryPacketAcknowledgementsRequest) { + + /** + * Properties of a QueryPacketAcknowledgementsRequest. + * @memberof ibc.core.channel.v1 + * @interface IQueryPacketAcknowledgementsRequest + * @property {string|null} [portId] QueryPacketAcknowledgementsRequest portId + * @property {string|null} [channelId] QueryPacketAcknowledgementsRequest channelId + * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryPacketAcknowledgementsRequest pagination + */ + + /** + * Constructs a new QueryPacketAcknowledgementsRequest. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a QueryPacketAcknowledgementsRequest. + * @implements IQueryPacketAcknowledgementsRequest + * @constructor + * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementsRequest=} [properties] Properties to set + */ + function QueryPacketAcknowledgementsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryPacketAcknowledgementsRequest portId. + * @member {string} portId + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest + * @instance + */ + QueryPacketAcknowledgementsRequest.prototype.portId = ""; + + /** + * QueryPacketAcknowledgementsRequest channelId. + * @member {string} channelId + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest + * @instance + */ + QueryPacketAcknowledgementsRequest.prototype.channelId = ""; + + /** + * QueryPacketAcknowledgementsRequest pagination. + * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest + * @instance + */ + QueryPacketAcknowledgementsRequest.prototype.pagination = null; + + /** + * Creates a new QueryPacketAcknowledgementsRequest instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest + * @static + * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementsRequest=} [properties] Properties to set + * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementsRequest} QueryPacketAcknowledgementsRequest instance + */ + QueryPacketAcknowledgementsRequest.create = function create(properties) { + return new QueryPacketAcknowledgementsRequest(properties); + }; + + /** + * Encodes the specified QueryPacketAcknowledgementsRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementsRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest + * @static + * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementsRequest} message QueryPacketAcknowledgementsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryPacketAcknowledgementsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.portId != null && Object.hasOwnProperty.call(message, "portId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.portId); + if (message.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.channelId); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryPacketAcknowledgementsRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest + * @static + * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementsRequest} message QueryPacketAcknowledgementsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryPacketAcknowledgementsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryPacketAcknowledgementsRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementsRequest} QueryPacketAcknowledgementsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryPacketAcknowledgementsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryPacketAcknowledgementsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryPacketAcknowledgementsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementsRequest} QueryPacketAcknowledgementsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryPacketAcknowledgementsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryPacketAcknowledgementsRequest message. + * @function verify + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryPacketAcknowledgementsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.portId != null && message.hasOwnProperty("portId")) + if (!$util.isString(message.portId)) + return "portId: string expected"; + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryPacketAcknowledgementsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementsRequest} QueryPacketAcknowledgementsRequest + */ + QueryPacketAcknowledgementsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.QueryPacketAcknowledgementsRequest) + return object; + let message = new $root.ibc.core.channel.v1.QueryPacketAcknowledgementsRequest(); + if (object.portId != null) + message.portId = String(object.portId); + if (object.channelId != null) + message.channelId = String(object.channelId); + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".ibc.core.channel.v1.QueryPacketAcknowledgementsRequest.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryPacketAcknowledgementsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest + * @static + * @param {ibc.core.channel.v1.QueryPacketAcknowledgementsRequest} message QueryPacketAcknowledgementsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryPacketAcknowledgementsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.portId = ""; + object.channelId = ""; + object.pagination = null; + } + if (message.portId != null && message.hasOwnProperty("portId")) + object.portId = message.portId; + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryPacketAcknowledgementsRequest to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryPacketAcknowledgementsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryPacketAcknowledgementsRequest; + })(v1.QueryPacketAcknowledgementsRequest || {}); + + v1.QueryPacketAcknowledgementsResponse = (function(QueryPacketAcknowledgementsResponse) { + + /** + * Properties of a QueryPacketAcknowledgementsResponse. + * @memberof ibc.core.channel.v1 + * @interface IQueryPacketAcknowledgementsResponse + * @property {Array.|null} [acknowledgements] QueryPacketAcknowledgementsResponse acknowledgements + * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryPacketAcknowledgementsResponse pagination + * @property {ibc.core.client.v1.IHeight|null} [height] QueryPacketAcknowledgementsResponse height + */ + + /** + * Constructs a new QueryPacketAcknowledgementsResponse. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a QueryPacketAcknowledgementsResponse. + * @implements IQueryPacketAcknowledgementsResponse + * @constructor + * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementsResponse=} [properties] Properties to set + */ + function QueryPacketAcknowledgementsResponse(properties) { + this.acknowledgements = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryPacketAcknowledgementsResponse acknowledgements. + * @member {Array.} acknowledgements + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse + * @instance + */ + QueryPacketAcknowledgementsResponse.prototype.acknowledgements = $util.emptyArray; + + /** + * QueryPacketAcknowledgementsResponse pagination. + * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse + * @instance + */ + QueryPacketAcknowledgementsResponse.prototype.pagination = null; + + /** + * QueryPacketAcknowledgementsResponse height. + * @member {ibc.core.client.v1.IHeight|null|undefined} height + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse + * @instance + */ + QueryPacketAcknowledgementsResponse.prototype.height = null; + + /** + * Creates a new QueryPacketAcknowledgementsResponse instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse + * @static + * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementsResponse=} [properties] Properties to set + * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementsResponse} QueryPacketAcknowledgementsResponse instance + */ + QueryPacketAcknowledgementsResponse.create = function create(properties) { + return new QueryPacketAcknowledgementsResponse(properties); + }; + + /** + * Encodes the specified QueryPacketAcknowledgementsResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementsResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse + * @static + * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementsResponse} message QueryPacketAcknowledgementsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryPacketAcknowledgementsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.acknowledgements != null && message.acknowledgements.length) + for (let i = 0; i < message.acknowledgements.length; ++i) + $root.ibc.core.channel.v1.PacketState.encode(message.acknowledgements[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + $root.ibc.core.client.v1.Height.encode(message.height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryPacketAcknowledgementsResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse + * @static + * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementsResponse} message QueryPacketAcknowledgementsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryPacketAcknowledgementsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryPacketAcknowledgementsResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementsResponse} QueryPacketAcknowledgementsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryPacketAcknowledgementsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryPacketAcknowledgementsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.acknowledgements && message.acknowledgements.length)) + message.acknowledgements = []; + message.acknowledgements.push($root.ibc.core.channel.v1.PacketState.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); + break; + case 3: + message.height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryPacketAcknowledgementsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementsResponse} QueryPacketAcknowledgementsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryPacketAcknowledgementsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryPacketAcknowledgementsResponse message. + * @function verify + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryPacketAcknowledgementsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.acknowledgements != null && message.hasOwnProperty("acknowledgements")) { + if (!Array.isArray(message.acknowledgements)) + return "acknowledgements: array expected"; + for (let i = 0; i < message.acknowledgements.length; ++i) { + let error = $root.ibc.core.channel.v1.PacketState.verify(message.acknowledgements[i]); + if (error) + return "acknowledgements." + error; + } + } + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); + if (error) + return "pagination." + error; + } + if (message.height != null && message.hasOwnProperty("height")) { + let error = $root.ibc.core.client.v1.Height.verify(message.height); + if (error) + return "height." + error; + } + return null; + }; + + /** + * Creates a QueryPacketAcknowledgementsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementsResponse} QueryPacketAcknowledgementsResponse + */ + QueryPacketAcknowledgementsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.QueryPacketAcknowledgementsResponse) + return object; + let message = new $root.ibc.core.channel.v1.QueryPacketAcknowledgementsResponse(); + if (object.acknowledgements) { + if (!Array.isArray(object.acknowledgements)) + throw TypeError(".ibc.core.channel.v1.QueryPacketAcknowledgementsResponse.acknowledgements: array expected"); + message.acknowledgements = []; + for (let i = 0; i < object.acknowledgements.length; ++i) { + if (typeof object.acknowledgements[i] !== "object") + throw TypeError(".ibc.core.channel.v1.QueryPacketAcknowledgementsResponse.acknowledgements: object expected"); + message.acknowledgements[i] = $root.ibc.core.channel.v1.PacketState.fromObject(object.acknowledgements[i]); + } + } + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".ibc.core.channel.v1.QueryPacketAcknowledgementsResponse.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); + } + if (object.height != null) { + if (typeof object.height !== "object") + throw TypeError(".ibc.core.channel.v1.QueryPacketAcknowledgementsResponse.height: object expected"); + message.height = $root.ibc.core.client.v1.Height.fromObject(object.height); + } + return message; + }; + + /** + * Creates a plain object from a QueryPacketAcknowledgementsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse + * @static + * @param {ibc.core.channel.v1.QueryPacketAcknowledgementsResponse} message QueryPacketAcknowledgementsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryPacketAcknowledgementsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.acknowledgements = []; + if (options.defaults) { + object.pagination = null; + object.height = null; + } + if (message.acknowledgements && message.acknowledgements.length) { + object.acknowledgements = []; + for (let j = 0; j < message.acknowledgements.length; ++j) + object.acknowledgements[j] = $root.ibc.core.channel.v1.PacketState.toObject(message.acknowledgements[j], options); + } + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); + if (message.height != null && message.hasOwnProperty("height")) + object.height = $root.ibc.core.client.v1.Height.toObject(message.height, options); + return object; + }; + + /** + * Converts this QueryPacketAcknowledgementsResponse to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryPacketAcknowledgementsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryPacketAcknowledgementsResponse; + })(v1.QueryPacketAcknowledgementsResponse || {}); + + v1.QueryUnreceivedPacketsRequest = (function(QueryUnreceivedPacketsRequest) { + + /** + * Properties of a QueryUnreceivedPacketsRequest. + * @memberof ibc.core.channel.v1 + * @interface IQueryUnreceivedPacketsRequest + * @property {string|null} [portId] QueryUnreceivedPacketsRequest portId + * @property {string|null} [channelId] QueryUnreceivedPacketsRequest channelId + * @property {Array.|null} [packetCommitmentSequences] QueryUnreceivedPacketsRequest packetCommitmentSequences + */ + + /** + * Constructs a new QueryUnreceivedPacketsRequest. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a QueryUnreceivedPacketsRequest. + * @implements IQueryUnreceivedPacketsRequest + * @constructor + * @param {ibc.core.channel.v1.IQueryUnreceivedPacketsRequest=} [properties] Properties to set + */ + function QueryUnreceivedPacketsRequest(properties) { + this.packetCommitmentSequences = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryUnreceivedPacketsRequest portId. + * @member {string} portId + * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest + * @instance + */ + QueryUnreceivedPacketsRequest.prototype.portId = ""; + + /** + * QueryUnreceivedPacketsRequest channelId. + * @member {string} channelId + * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest + * @instance + */ + QueryUnreceivedPacketsRequest.prototype.channelId = ""; + + /** + * QueryUnreceivedPacketsRequest packetCommitmentSequences. + * @member {Array.} packetCommitmentSequences + * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest + * @instance + */ + QueryUnreceivedPacketsRequest.prototype.packetCommitmentSequences = $util.emptyArray; + + /** + * Creates a new QueryUnreceivedPacketsRequest instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest + * @static + * @param {ibc.core.channel.v1.IQueryUnreceivedPacketsRequest=} [properties] Properties to set + * @returns {ibc.core.channel.v1.QueryUnreceivedPacketsRequest} QueryUnreceivedPacketsRequest instance + */ + QueryUnreceivedPacketsRequest.create = function create(properties) { + return new QueryUnreceivedPacketsRequest(properties); + }; + + /** + * Encodes the specified QueryUnreceivedPacketsRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedPacketsRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest + * @static + * @param {ibc.core.channel.v1.IQueryUnreceivedPacketsRequest} message QueryUnreceivedPacketsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryUnreceivedPacketsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.portId != null && Object.hasOwnProperty.call(message, "portId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.portId); + if (message.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.channelId); + if (message.packetCommitmentSequences != null && message.packetCommitmentSequences.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (let i = 0; i < message.packetCommitmentSequences.length; ++i) + writer.uint64(message.packetCommitmentSequences[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified QueryUnreceivedPacketsRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedPacketsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest + * @static + * @param {ibc.core.channel.v1.IQueryUnreceivedPacketsRequest} message QueryUnreceivedPacketsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryUnreceivedPacketsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryUnreceivedPacketsRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.QueryUnreceivedPacketsRequest} QueryUnreceivedPacketsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryUnreceivedPacketsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryUnreceivedPacketsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + if (!(message.packetCommitmentSequences && message.packetCommitmentSequences.length)) + message.packetCommitmentSequences = []; + if ((tag & 7) === 2) { + let end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.packetCommitmentSequences.push(reader.uint64()); + } else + message.packetCommitmentSequences.push(reader.uint64()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryUnreceivedPacketsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.QueryUnreceivedPacketsRequest} QueryUnreceivedPacketsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryUnreceivedPacketsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryUnreceivedPacketsRequest message. + * @function verify + * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryUnreceivedPacketsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.portId != null && message.hasOwnProperty("portId")) + if (!$util.isString(message.portId)) + return "portId: string expected"; + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + if (message.packetCommitmentSequences != null && message.hasOwnProperty("packetCommitmentSequences")) { + if (!Array.isArray(message.packetCommitmentSequences)) + return "packetCommitmentSequences: array expected"; + for (let i = 0; i < message.packetCommitmentSequences.length; ++i) + if (!$util.isInteger(message.packetCommitmentSequences[i]) && !(message.packetCommitmentSequences[i] && $util.isInteger(message.packetCommitmentSequences[i].low) && $util.isInteger(message.packetCommitmentSequences[i].high))) + return "packetCommitmentSequences: integer|Long[] expected"; + } + return null; + }; + + /** + * Creates a QueryUnreceivedPacketsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.QueryUnreceivedPacketsRequest} QueryUnreceivedPacketsRequest + */ + QueryUnreceivedPacketsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.QueryUnreceivedPacketsRequest) + return object; + let message = new $root.ibc.core.channel.v1.QueryUnreceivedPacketsRequest(); + if (object.portId != null) + message.portId = String(object.portId); + if (object.channelId != null) + message.channelId = String(object.channelId); + if (object.packetCommitmentSequences) { + if (!Array.isArray(object.packetCommitmentSequences)) + throw TypeError(".ibc.core.channel.v1.QueryUnreceivedPacketsRequest.packetCommitmentSequences: array expected"); + message.packetCommitmentSequences = []; + for (let i = 0; i < object.packetCommitmentSequences.length; ++i) + if ($util.Long) + (message.packetCommitmentSequences[i] = $util.Long.fromValue(object.packetCommitmentSequences[i])).unsigned = true; + else if (typeof object.packetCommitmentSequences[i] === "string") + message.packetCommitmentSequences[i] = parseInt(object.packetCommitmentSequences[i], 10); + else if (typeof object.packetCommitmentSequences[i] === "number") + message.packetCommitmentSequences[i] = object.packetCommitmentSequences[i]; + else if (typeof object.packetCommitmentSequences[i] === "object") + message.packetCommitmentSequences[i] = new $util.LongBits(object.packetCommitmentSequences[i].low >>> 0, object.packetCommitmentSequences[i].high >>> 0).toNumber(true); + } + return message; + }; + + /** + * Creates a plain object from a QueryUnreceivedPacketsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest + * @static + * @param {ibc.core.channel.v1.QueryUnreceivedPacketsRequest} message QueryUnreceivedPacketsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryUnreceivedPacketsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.packetCommitmentSequences = []; + if (options.defaults) { + object.portId = ""; + object.channelId = ""; + } + if (message.portId != null && message.hasOwnProperty("portId")) + object.portId = message.portId; + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + if (message.packetCommitmentSequences && message.packetCommitmentSequences.length) { + object.packetCommitmentSequences = []; + for (let j = 0; j < message.packetCommitmentSequences.length; ++j) + if (typeof message.packetCommitmentSequences[j] === "number") + object.packetCommitmentSequences[j] = options.longs === String ? String(message.packetCommitmentSequences[j]) : message.packetCommitmentSequences[j]; + else + object.packetCommitmentSequences[j] = options.longs === String ? $util.Long.prototype.toString.call(message.packetCommitmentSequences[j]) : options.longs === Number ? new $util.LongBits(message.packetCommitmentSequences[j].low >>> 0, message.packetCommitmentSequences[j].high >>> 0).toNumber(true) : message.packetCommitmentSequences[j]; + } + return object; + }; + + /** + * Converts this QueryUnreceivedPacketsRequest to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryUnreceivedPacketsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryUnreceivedPacketsRequest; + })(v1.QueryUnreceivedPacketsRequest || {}); + + v1.QueryUnreceivedPacketsResponse = (function(QueryUnreceivedPacketsResponse) { + + /** + * Properties of a QueryUnreceivedPacketsResponse. + * @memberof ibc.core.channel.v1 + * @interface IQueryUnreceivedPacketsResponse + * @property {Array.|null} [sequences] QueryUnreceivedPacketsResponse sequences + * @property {ibc.core.client.v1.IHeight|null} [height] QueryUnreceivedPacketsResponse height + */ + + /** + * Constructs a new QueryUnreceivedPacketsResponse. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a QueryUnreceivedPacketsResponse. + * @implements IQueryUnreceivedPacketsResponse + * @constructor + * @param {ibc.core.channel.v1.IQueryUnreceivedPacketsResponse=} [properties] Properties to set + */ + function QueryUnreceivedPacketsResponse(properties) { + this.sequences = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryUnreceivedPacketsResponse sequences. + * @member {Array.} sequences + * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsResponse + * @instance + */ + QueryUnreceivedPacketsResponse.prototype.sequences = $util.emptyArray; + + /** + * QueryUnreceivedPacketsResponse height. + * @member {ibc.core.client.v1.IHeight|null|undefined} height + * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsResponse + * @instance + */ + QueryUnreceivedPacketsResponse.prototype.height = null; + + /** + * Creates a new QueryUnreceivedPacketsResponse instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsResponse + * @static + * @param {ibc.core.channel.v1.IQueryUnreceivedPacketsResponse=} [properties] Properties to set + * @returns {ibc.core.channel.v1.QueryUnreceivedPacketsResponse} QueryUnreceivedPacketsResponse instance + */ + QueryUnreceivedPacketsResponse.create = function create(properties) { + return new QueryUnreceivedPacketsResponse(properties); + }; + + /** + * Encodes the specified QueryUnreceivedPacketsResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedPacketsResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsResponse + * @static + * @param {ibc.core.channel.v1.IQueryUnreceivedPacketsResponse} message QueryUnreceivedPacketsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryUnreceivedPacketsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sequences != null && message.sequences.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (let i = 0; i < message.sequences.length; ++i) + writer.uint64(message.sequences[i]); + writer.ldelim(); + } + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + $root.ibc.core.client.v1.Height.encode(message.height, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryUnreceivedPacketsResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedPacketsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsResponse + * @static + * @param {ibc.core.channel.v1.IQueryUnreceivedPacketsResponse} message QueryUnreceivedPacketsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryUnreceivedPacketsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryUnreceivedPacketsResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.QueryUnreceivedPacketsResponse} QueryUnreceivedPacketsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryUnreceivedPacketsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryUnreceivedPacketsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.sequences && message.sequences.length)) + message.sequences = []; + if ((tag & 7) === 2) { + let end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.sequences.push(reader.uint64()); + } else + message.sequences.push(reader.uint64()); + break; + case 2: + message.height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryUnreceivedPacketsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.QueryUnreceivedPacketsResponse} QueryUnreceivedPacketsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryUnreceivedPacketsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryUnreceivedPacketsResponse message. + * @function verify + * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryUnreceivedPacketsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sequences != null && message.hasOwnProperty("sequences")) { + if (!Array.isArray(message.sequences)) + return "sequences: array expected"; + for (let i = 0; i < message.sequences.length; ++i) + if (!$util.isInteger(message.sequences[i]) && !(message.sequences[i] && $util.isInteger(message.sequences[i].low) && $util.isInteger(message.sequences[i].high))) + return "sequences: integer|Long[] expected"; + } + if (message.height != null && message.hasOwnProperty("height")) { + let error = $root.ibc.core.client.v1.Height.verify(message.height); + if (error) + return "height." + error; + } + return null; + }; + + /** + * Creates a QueryUnreceivedPacketsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.QueryUnreceivedPacketsResponse} QueryUnreceivedPacketsResponse + */ + QueryUnreceivedPacketsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.QueryUnreceivedPacketsResponse) + return object; + let message = new $root.ibc.core.channel.v1.QueryUnreceivedPacketsResponse(); + if (object.sequences) { + if (!Array.isArray(object.sequences)) + throw TypeError(".ibc.core.channel.v1.QueryUnreceivedPacketsResponse.sequences: array expected"); + message.sequences = []; + for (let i = 0; i < object.sequences.length; ++i) + if ($util.Long) + (message.sequences[i] = $util.Long.fromValue(object.sequences[i])).unsigned = true; + else if (typeof object.sequences[i] === "string") + message.sequences[i] = parseInt(object.sequences[i], 10); + else if (typeof object.sequences[i] === "number") + message.sequences[i] = object.sequences[i]; + else if (typeof object.sequences[i] === "object") + message.sequences[i] = new $util.LongBits(object.sequences[i].low >>> 0, object.sequences[i].high >>> 0).toNumber(true); + } + if (object.height != null) { + if (typeof object.height !== "object") + throw TypeError(".ibc.core.channel.v1.QueryUnreceivedPacketsResponse.height: object expected"); + message.height = $root.ibc.core.client.v1.Height.fromObject(object.height); + } + return message; + }; + + /** + * Creates a plain object from a QueryUnreceivedPacketsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsResponse + * @static + * @param {ibc.core.channel.v1.QueryUnreceivedPacketsResponse} message QueryUnreceivedPacketsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryUnreceivedPacketsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.sequences = []; + if (options.defaults) + object.height = null; + if (message.sequences && message.sequences.length) { + object.sequences = []; + for (let j = 0; j < message.sequences.length; ++j) + if (typeof message.sequences[j] === "number") + object.sequences[j] = options.longs === String ? String(message.sequences[j]) : message.sequences[j]; + else + object.sequences[j] = options.longs === String ? $util.Long.prototype.toString.call(message.sequences[j]) : options.longs === Number ? new $util.LongBits(message.sequences[j].low >>> 0, message.sequences[j].high >>> 0).toNumber(true) : message.sequences[j]; + } + if (message.height != null && message.hasOwnProperty("height")) + object.height = $root.ibc.core.client.v1.Height.toObject(message.height, options); + return object; + }; + + /** + * Converts this QueryUnreceivedPacketsResponse to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryUnreceivedPacketsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryUnreceivedPacketsResponse; + })(v1.QueryUnreceivedPacketsResponse || {}); + + v1.QueryUnreceivedAcksRequest = (function(QueryUnreceivedAcksRequest) { + + /** + * Properties of a QueryUnreceivedAcksRequest. + * @memberof ibc.core.channel.v1 + * @interface IQueryUnreceivedAcksRequest + * @property {string|null} [portId] QueryUnreceivedAcksRequest portId + * @property {string|null} [channelId] QueryUnreceivedAcksRequest channelId + * @property {Array.|null} [packetAckSequences] QueryUnreceivedAcksRequest packetAckSequences + */ + + /** + * Constructs a new QueryUnreceivedAcksRequest. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a QueryUnreceivedAcksRequest. + * @implements IQueryUnreceivedAcksRequest + * @constructor + * @param {ibc.core.channel.v1.IQueryUnreceivedAcksRequest=} [properties] Properties to set + */ + function QueryUnreceivedAcksRequest(properties) { + this.packetAckSequences = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryUnreceivedAcksRequest portId. + * @member {string} portId + * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest + * @instance + */ + QueryUnreceivedAcksRequest.prototype.portId = ""; + + /** + * QueryUnreceivedAcksRequest channelId. + * @member {string} channelId + * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest + * @instance + */ + QueryUnreceivedAcksRequest.prototype.channelId = ""; + + /** + * QueryUnreceivedAcksRequest packetAckSequences. + * @member {Array.} packetAckSequences + * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest + * @instance + */ + QueryUnreceivedAcksRequest.prototype.packetAckSequences = $util.emptyArray; + + /** + * Creates a new QueryUnreceivedAcksRequest instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest + * @static + * @param {ibc.core.channel.v1.IQueryUnreceivedAcksRequest=} [properties] Properties to set + * @returns {ibc.core.channel.v1.QueryUnreceivedAcksRequest} QueryUnreceivedAcksRequest instance + */ + QueryUnreceivedAcksRequest.create = function create(properties) { + return new QueryUnreceivedAcksRequest(properties); + }; + + /** + * Encodes the specified QueryUnreceivedAcksRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedAcksRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest + * @static + * @param {ibc.core.channel.v1.IQueryUnreceivedAcksRequest} message QueryUnreceivedAcksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryUnreceivedAcksRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.portId != null && Object.hasOwnProperty.call(message, "portId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.portId); + if (message.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.channelId); + if (message.packetAckSequences != null && message.packetAckSequences.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (let i = 0; i < message.packetAckSequences.length; ++i) + writer.uint64(message.packetAckSequences[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified QueryUnreceivedAcksRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedAcksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest + * @static + * @param {ibc.core.channel.v1.IQueryUnreceivedAcksRequest} message QueryUnreceivedAcksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryUnreceivedAcksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryUnreceivedAcksRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.QueryUnreceivedAcksRequest} QueryUnreceivedAcksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryUnreceivedAcksRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryUnreceivedAcksRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + if (!(message.packetAckSequences && message.packetAckSequences.length)) + message.packetAckSequences = []; + if ((tag & 7) === 2) { + let end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.packetAckSequences.push(reader.uint64()); + } else + message.packetAckSequences.push(reader.uint64()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryUnreceivedAcksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.QueryUnreceivedAcksRequest} QueryUnreceivedAcksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryUnreceivedAcksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryUnreceivedAcksRequest message. + * @function verify + * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryUnreceivedAcksRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.portId != null && message.hasOwnProperty("portId")) + if (!$util.isString(message.portId)) + return "portId: string expected"; + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + if (message.packetAckSequences != null && message.hasOwnProperty("packetAckSequences")) { + if (!Array.isArray(message.packetAckSequences)) + return "packetAckSequences: array expected"; + for (let i = 0; i < message.packetAckSequences.length; ++i) + if (!$util.isInteger(message.packetAckSequences[i]) && !(message.packetAckSequences[i] && $util.isInteger(message.packetAckSequences[i].low) && $util.isInteger(message.packetAckSequences[i].high))) + return "packetAckSequences: integer|Long[] expected"; + } + return null; + }; + + /** + * Creates a QueryUnreceivedAcksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.QueryUnreceivedAcksRequest} QueryUnreceivedAcksRequest + */ + QueryUnreceivedAcksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.QueryUnreceivedAcksRequest) + return object; + let message = new $root.ibc.core.channel.v1.QueryUnreceivedAcksRequest(); + if (object.portId != null) + message.portId = String(object.portId); + if (object.channelId != null) + message.channelId = String(object.channelId); + if (object.packetAckSequences) { + if (!Array.isArray(object.packetAckSequences)) + throw TypeError(".ibc.core.channel.v1.QueryUnreceivedAcksRequest.packetAckSequences: array expected"); + message.packetAckSequences = []; + for (let i = 0; i < object.packetAckSequences.length; ++i) + if ($util.Long) + (message.packetAckSequences[i] = $util.Long.fromValue(object.packetAckSequences[i])).unsigned = true; + else if (typeof object.packetAckSequences[i] === "string") + message.packetAckSequences[i] = parseInt(object.packetAckSequences[i], 10); + else if (typeof object.packetAckSequences[i] === "number") + message.packetAckSequences[i] = object.packetAckSequences[i]; + else if (typeof object.packetAckSequences[i] === "object") + message.packetAckSequences[i] = new $util.LongBits(object.packetAckSequences[i].low >>> 0, object.packetAckSequences[i].high >>> 0).toNumber(true); + } + return message; + }; + + /** + * Creates a plain object from a QueryUnreceivedAcksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest + * @static + * @param {ibc.core.channel.v1.QueryUnreceivedAcksRequest} message QueryUnreceivedAcksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryUnreceivedAcksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.packetAckSequences = []; + if (options.defaults) { + object.portId = ""; + object.channelId = ""; + } + if (message.portId != null && message.hasOwnProperty("portId")) + object.portId = message.portId; + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + if (message.packetAckSequences && message.packetAckSequences.length) { + object.packetAckSequences = []; + for (let j = 0; j < message.packetAckSequences.length; ++j) + if (typeof message.packetAckSequences[j] === "number") + object.packetAckSequences[j] = options.longs === String ? String(message.packetAckSequences[j]) : message.packetAckSequences[j]; + else + object.packetAckSequences[j] = options.longs === String ? $util.Long.prototype.toString.call(message.packetAckSequences[j]) : options.longs === Number ? new $util.LongBits(message.packetAckSequences[j].low >>> 0, message.packetAckSequences[j].high >>> 0).toNumber(true) : message.packetAckSequences[j]; + } + return object; + }; + + /** + * Converts this QueryUnreceivedAcksRequest to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest + * @instance + * @returns {Object.} JSON object + */ + QueryUnreceivedAcksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryUnreceivedAcksRequest; + })(v1.QueryUnreceivedAcksRequest || {}); + + v1.QueryUnreceivedAcksResponse = (function(QueryUnreceivedAcksResponse) { + + /** + * Properties of a QueryUnreceivedAcksResponse. + * @memberof ibc.core.channel.v1 + * @interface IQueryUnreceivedAcksResponse + * @property {Array.|null} [sequences] QueryUnreceivedAcksResponse sequences + * @property {ibc.core.client.v1.IHeight|null} [height] QueryUnreceivedAcksResponse height + */ + + /** + * Constructs a new QueryUnreceivedAcksResponse. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a QueryUnreceivedAcksResponse. + * @implements IQueryUnreceivedAcksResponse + * @constructor + * @param {ibc.core.channel.v1.IQueryUnreceivedAcksResponse=} [properties] Properties to set + */ + function QueryUnreceivedAcksResponse(properties) { + this.sequences = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryUnreceivedAcksResponse sequences. + * @member {Array.} sequences + * @memberof ibc.core.channel.v1.QueryUnreceivedAcksResponse + * @instance + */ + QueryUnreceivedAcksResponse.prototype.sequences = $util.emptyArray; + + /** + * QueryUnreceivedAcksResponse height. + * @member {ibc.core.client.v1.IHeight|null|undefined} height + * @memberof ibc.core.channel.v1.QueryUnreceivedAcksResponse + * @instance + */ + QueryUnreceivedAcksResponse.prototype.height = null; + + /** + * Creates a new QueryUnreceivedAcksResponse instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.QueryUnreceivedAcksResponse + * @static + * @param {ibc.core.channel.v1.IQueryUnreceivedAcksResponse=} [properties] Properties to set + * @returns {ibc.core.channel.v1.QueryUnreceivedAcksResponse} QueryUnreceivedAcksResponse instance + */ + QueryUnreceivedAcksResponse.create = function create(properties) { + return new QueryUnreceivedAcksResponse(properties); + }; + + /** + * Encodes the specified QueryUnreceivedAcksResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedAcksResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.QueryUnreceivedAcksResponse + * @static + * @param {ibc.core.channel.v1.IQueryUnreceivedAcksResponse} message QueryUnreceivedAcksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryUnreceivedAcksResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sequences != null && message.sequences.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (let i = 0; i < message.sequences.length; ++i) + writer.uint64(message.sequences[i]); + writer.ldelim(); + } + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + $root.ibc.core.client.v1.Height.encode(message.height, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryUnreceivedAcksResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedAcksResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.QueryUnreceivedAcksResponse + * @static + * @param {ibc.core.channel.v1.IQueryUnreceivedAcksResponse} message QueryUnreceivedAcksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryUnreceivedAcksResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryUnreceivedAcksResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.QueryUnreceivedAcksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.QueryUnreceivedAcksResponse} QueryUnreceivedAcksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryUnreceivedAcksResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryUnreceivedAcksResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.sequences && message.sequences.length)) + message.sequences = []; + if ((tag & 7) === 2) { + let end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.sequences.push(reader.uint64()); + } else + message.sequences.push(reader.uint64()); + break; + case 2: + message.height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryUnreceivedAcksResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.QueryUnreceivedAcksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.QueryUnreceivedAcksResponse} QueryUnreceivedAcksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryUnreceivedAcksResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryUnreceivedAcksResponse message. + * @function verify + * @memberof ibc.core.channel.v1.QueryUnreceivedAcksResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryUnreceivedAcksResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sequences != null && message.hasOwnProperty("sequences")) { + if (!Array.isArray(message.sequences)) + return "sequences: array expected"; + for (let i = 0; i < message.sequences.length; ++i) + if (!$util.isInteger(message.sequences[i]) && !(message.sequences[i] && $util.isInteger(message.sequences[i].low) && $util.isInteger(message.sequences[i].high))) + return "sequences: integer|Long[] expected"; + } + if (message.height != null && message.hasOwnProperty("height")) { + let error = $root.ibc.core.client.v1.Height.verify(message.height); + if (error) + return "height." + error; + } + return null; + }; + + /** + * Creates a QueryUnreceivedAcksResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.QueryUnreceivedAcksResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.QueryUnreceivedAcksResponse} QueryUnreceivedAcksResponse + */ + QueryUnreceivedAcksResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.QueryUnreceivedAcksResponse) + return object; + let message = new $root.ibc.core.channel.v1.QueryUnreceivedAcksResponse(); + if (object.sequences) { + if (!Array.isArray(object.sequences)) + throw TypeError(".ibc.core.channel.v1.QueryUnreceivedAcksResponse.sequences: array expected"); + message.sequences = []; + for (let i = 0; i < object.sequences.length; ++i) + if ($util.Long) + (message.sequences[i] = $util.Long.fromValue(object.sequences[i])).unsigned = true; + else if (typeof object.sequences[i] === "string") + message.sequences[i] = parseInt(object.sequences[i], 10); + else if (typeof object.sequences[i] === "number") + message.sequences[i] = object.sequences[i]; + else if (typeof object.sequences[i] === "object") + message.sequences[i] = new $util.LongBits(object.sequences[i].low >>> 0, object.sequences[i].high >>> 0).toNumber(true); + } + if (object.height != null) { + if (typeof object.height !== "object") + throw TypeError(".ibc.core.channel.v1.QueryUnreceivedAcksResponse.height: object expected"); + message.height = $root.ibc.core.client.v1.Height.fromObject(object.height); + } + return message; + }; + + /** + * Creates a plain object from a QueryUnreceivedAcksResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.QueryUnreceivedAcksResponse + * @static + * @param {ibc.core.channel.v1.QueryUnreceivedAcksResponse} message QueryUnreceivedAcksResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryUnreceivedAcksResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.sequences = []; + if (options.defaults) + object.height = null; + if (message.sequences && message.sequences.length) { + object.sequences = []; + for (let j = 0; j < message.sequences.length; ++j) + if (typeof message.sequences[j] === "number") + object.sequences[j] = options.longs === String ? String(message.sequences[j]) : message.sequences[j]; + else + object.sequences[j] = options.longs === String ? $util.Long.prototype.toString.call(message.sequences[j]) : options.longs === Number ? new $util.LongBits(message.sequences[j].low >>> 0, message.sequences[j].high >>> 0).toNumber(true) : message.sequences[j]; + } + if (message.height != null && message.hasOwnProperty("height")) + object.height = $root.ibc.core.client.v1.Height.toObject(message.height, options); + return object; + }; + + /** + * Converts this QueryUnreceivedAcksResponse to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.QueryUnreceivedAcksResponse + * @instance + * @returns {Object.} JSON object + */ + QueryUnreceivedAcksResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryUnreceivedAcksResponse; + })(v1.QueryUnreceivedAcksResponse || {}); + + v1.QueryNextSequenceReceiveRequest = (function(QueryNextSequenceReceiveRequest) { + + /** + * Properties of a QueryNextSequenceReceiveRequest. + * @memberof ibc.core.channel.v1 + * @interface IQueryNextSequenceReceiveRequest + * @property {string|null} [portId] QueryNextSequenceReceiveRequest portId + * @property {string|null} [channelId] QueryNextSequenceReceiveRequest channelId + */ + + /** + * Constructs a new QueryNextSequenceReceiveRequest. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a QueryNextSequenceReceiveRequest. + * @implements IQueryNextSequenceReceiveRequest + * @constructor + * @param {ibc.core.channel.v1.IQueryNextSequenceReceiveRequest=} [properties] Properties to set + */ + function QueryNextSequenceReceiveRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryNextSequenceReceiveRequest portId. + * @member {string} portId + * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveRequest + * @instance + */ + QueryNextSequenceReceiveRequest.prototype.portId = ""; + + /** + * QueryNextSequenceReceiveRequest channelId. + * @member {string} channelId + * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveRequest + * @instance + */ + QueryNextSequenceReceiveRequest.prototype.channelId = ""; + + /** + * Creates a new QueryNextSequenceReceiveRequest instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveRequest + * @static + * @param {ibc.core.channel.v1.IQueryNextSequenceReceiveRequest=} [properties] Properties to set + * @returns {ibc.core.channel.v1.QueryNextSequenceReceiveRequest} QueryNextSequenceReceiveRequest instance + */ + QueryNextSequenceReceiveRequest.create = function create(properties) { + return new QueryNextSequenceReceiveRequest(properties); + }; + + /** + * Encodes the specified QueryNextSequenceReceiveRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryNextSequenceReceiveRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveRequest + * @static + * @param {ibc.core.channel.v1.IQueryNextSequenceReceiveRequest} message QueryNextSequenceReceiveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryNextSequenceReceiveRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.portId != null && Object.hasOwnProperty.call(message, "portId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.portId); + if (message.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.channelId); + return writer; + }; + + /** + * Encodes the specified QueryNextSequenceReceiveRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryNextSequenceReceiveRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveRequest + * @static + * @param {ibc.core.channel.v1.IQueryNextSequenceReceiveRequest} message QueryNextSequenceReceiveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryNextSequenceReceiveRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryNextSequenceReceiveRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.QueryNextSequenceReceiveRequest} QueryNextSequenceReceiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryNextSequenceReceiveRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryNextSequenceReceiveRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryNextSequenceReceiveRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.QueryNextSequenceReceiveRequest} QueryNextSequenceReceiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryNextSequenceReceiveRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryNextSequenceReceiveRequest message. + * @function verify + * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryNextSequenceReceiveRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.portId != null && message.hasOwnProperty("portId")) + if (!$util.isString(message.portId)) + return "portId: string expected"; + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + return null; + }; + + /** + * Creates a QueryNextSequenceReceiveRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.QueryNextSequenceReceiveRequest} QueryNextSequenceReceiveRequest + */ + QueryNextSequenceReceiveRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.QueryNextSequenceReceiveRequest) + return object; + let message = new $root.ibc.core.channel.v1.QueryNextSequenceReceiveRequest(); + if (object.portId != null) + message.portId = String(object.portId); + if (object.channelId != null) + message.channelId = String(object.channelId); + return message; + }; + + /** + * Creates a plain object from a QueryNextSequenceReceiveRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveRequest + * @static + * @param {ibc.core.channel.v1.QueryNextSequenceReceiveRequest} message QueryNextSequenceReceiveRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryNextSequenceReceiveRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.portId = ""; + object.channelId = ""; + } + if (message.portId != null && message.hasOwnProperty("portId")) + object.portId = message.portId; + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + return object; + }; + + /** + * Converts this QueryNextSequenceReceiveRequest to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveRequest + * @instance + * @returns {Object.} JSON object + */ + QueryNextSequenceReceiveRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryNextSequenceReceiveRequest; + })(v1.QueryNextSequenceReceiveRequest || {}); + + v1.QueryNextSequenceReceiveResponse = (function(QueryNextSequenceReceiveResponse) { + + /** + * Properties of a QueryNextSequenceReceiveResponse. + * @memberof ibc.core.channel.v1 + * @interface IQueryNextSequenceReceiveResponse + * @property {number|Long|null} [nextSequenceReceive] QueryNextSequenceReceiveResponse nextSequenceReceive + * @property {Uint8Array|null} [proof] QueryNextSequenceReceiveResponse proof + * @property {ibc.core.client.v1.IHeight|null} [proofHeight] QueryNextSequenceReceiveResponse proofHeight + */ + + /** + * Constructs a new QueryNextSequenceReceiveResponse. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a QueryNextSequenceReceiveResponse. + * @implements IQueryNextSequenceReceiveResponse + * @constructor + * @param {ibc.core.channel.v1.IQueryNextSequenceReceiveResponse=} [properties] Properties to set + */ + function QueryNextSequenceReceiveResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryNextSequenceReceiveResponse nextSequenceReceive. + * @member {number|Long} nextSequenceReceive + * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse + * @instance + */ + QueryNextSequenceReceiveResponse.prototype.nextSequenceReceive = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * QueryNextSequenceReceiveResponse proof. + * @member {Uint8Array} proof + * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse + * @instance + */ + QueryNextSequenceReceiveResponse.prototype.proof = $util.newBuffer([]); + + /** + * QueryNextSequenceReceiveResponse proofHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} proofHeight + * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse + * @instance + */ + QueryNextSequenceReceiveResponse.prototype.proofHeight = null; + + /** + * Creates a new QueryNextSequenceReceiveResponse instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse + * @static + * @param {ibc.core.channel.v1.IQueryNextSequenceReceiveResponse=} [properties] Properties to set + * @returns {ibc.core.channel.v1.QueryNextSequenceReceiveResponse} QueryNextSequenceReceiveResponse instance + */ + QueryNextSequenceReceiveResponse.create = function create(properties) { + return new QueryNextSequenceReceiveResponse(properties); + }; + + /** + * Encodes the specified QueryNextSequenceReceiveResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryNextSequenceReceiveResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse + * @static + * @param {ibc.core.channel.v1.IQueryNextSequenceReceiveResponse} message QueryNextSequenceReceiveResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryNextSequenceReceiveResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nextSequenceReceive != null && Object.hasOwnProperty.call(message, "nextSequenceReceive")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.nextSequenceReceive); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); + if (message.proofHeight != null && Object.hasOwnProperty.call(message, "proofHeight")) + $root.ibc.core.client.v1.Height.encode(message.proofHeight, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryNextSequenceReceiveResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryNextSequenceReceiveResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse + * @static + * @param {ibc.core.channel.v1.IQueryNextSequenceReceiveResponse} message QueryNextSequenceReceiveResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryNextSequenceReceiveResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryNextSequenceReceiveResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.QueryNextSequenceReceiveResponse} QueryNextSequenceReceiveResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryNextSequenceReceiveResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryNextSequenceReceiveResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nextSequenceReceive = reader.uint64(); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryNextSequenceReceiveResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.QueryNextSequenceReceiveResponse} QueryNextSequenceReceiveResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryNextSequenceReceiveResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryNextSequenceReceiveResponse message. + * @function verify + * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryNextSequenceReceiveResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nextSequenceReceive != null && message.hasOwnProperty("nextSequenceReceive")) + if (!$util.isInteger(message.nextSequenceReceive) && !(message.nextSequenceReceive && $util.isInteger(message.nextSequenceReceive.low) && $util.isInteger(message.nextSequenceReceive.high))) + return "nextSequenceReceive: integer|Long expected"; + if (message.proof != null && message.hasOwnProperty("proof")) + if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) + return "proof: buffer expected"; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) { + let error = $root.ibc.core.client.v1.Height.verify(message.proofHeight); + if (error) + return "proofHeight." + error; + } + return null; + }; + + /** + * Creates a QueryNextSequenceReceiveResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.QueryNextSequenceReceiveResponse} QueryNextSequenceReceiveResponse + */ + QueryNextSequenceReceiveResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.QueryNextSequenceReceiveResponse) + return object; + let message = new $root.ibc.core.channel.v1.QueryNextSequenceReceiveResponse(); + if (object.nextSequenceReceive != null) + if ($util.Long) + (message.nextSequenceReceive = $util.Long.fromValue(object.nextSequenceReceive)).unsigned = true; + else if (typeof object.nextSequenceReceive === "string") + message.nextSequenceReceive = parseInt(object.nextSequenceReceive, 10); + else if (typeof object.nextSequenceReceive === "number") + message.nextSequenceReceive = object.nextSequenceReceive; + else if (typeof object.nextSequenceReceive === "object") + message.nextSequenceReceive = new $util.LongBits(object.nextSequenceReceive.low >>> 0, object.nextSequenceReceive.high >>> 0).toNumber(true); + if (object.proof != null) + if (typeof object.proof === "string") + $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); + else if (object.proof.length) + message.proof = object.proof; + if (object.proofHeight != null) { + if (typeof object.proofHeight !== "object") + throw TypeError(".ibc.core.channel.v1.QueryNextSequenceReceiveResponse.proofHeight: object expected"); + message.proofHeight = $root.ibc.core.client.v1.Height.fromObject(object.proofHeight); + } + return message; + }; + + /** + * Creates a plain object from a QueryNextSequenceReceiveResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse + * @static + * @param {ibc.core.channel.v1.QueryNextSequenceReceiveResponse} message QueryNextSequenceReceiveResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryNextSequenceReceiveResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.nextSequenceReceive = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nextSequenceReceive = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.proof = ""; + else { + object.proof = []; + if (options.bytes !== Array) + object.proof = $util.newBuffer(object.proof); + } + object.proofHeight = null; + } + if (message.nextSequenceReceive != null && message.hasOwnProperty("nextSequenceReceive")) + if (typeof message.nextSequenceReceive === "number") + object.nextSequenceReceive = options.longs === String ? String(message.nextSequenceReceive) : message.nextSequenceReceive; + else + object.nextSequenceReceive = options.longs === String ? $util.Long.prototype.toString.call(message.nextSequenceReceive) : options.longs === Number ? new $util.LongBits(message.nextSequenceReceive.low >>> 0, message.nextSequenceReceive.high >>> 0).toNumber(true) : message.nextSequenceReceive; + if (message.proof != null && message.hasOwnProperty("proof")) + object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) + object.proofHeight = $root.ibc.core.client.v1.Height.toObject(message.proofHeight, options); + return object; + }; + + /** + * Converts this QueryNextSequenceReceiveResponse to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse + * @instance + * @returns {Object.} JSON object + */ + QueryNextSequenceReceiveResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryNextSequenceReceiveResponse; + })(v1.QueryNextSequenceReceiveResponse || {}); + + v1.Msg = (function(Msg) { + + /** + * Constructs a new Msg service. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a Msg + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Msg(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; + + /** + * Creates new Msg service using the specified rpc implementation. + * @function create + * @memberof ibc.core.channel.v1.Msg + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Msg} RPC service. Useful where requests and/or responses are streamed. + */ + Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link ibc.core.channel.v1.Msg#channelOpenInit}. + * @memberof ibc.core.channel.v1.Msg + * @typedef ChannelOpenInitCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.channel.v1.IMsgChannelOpenInitResponse} [response] MsgChannelOpenInitResponse + */ + + /** + * Calls ChannelOpenInit. + * @function channelOpenInit + * @memberof ibc.core.channel.v1.Msg + * @instance + * @param {ibc.core.channel.v1.IMsgChannelOpenInit} request MsgChannelOpenInit message or plain object + * @param {ibc.core.channel.v1.Msg.ChannelOpenInitCallback} callback Node-style callback called with the error, if any, and MsgChannelOpenInitResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.channelOpenInit = function channelOpenInit(request, callback) { + return this.rpcCall(channelOpenInit, $root.ibc.core.channel.v1.MsgChannelOpenInit, $root.ibc.core.channel.v1.MsgChannelOpenInitResponse, request, callback); + }, "name", { value: "ChannelOpenInit" }); + + /** + * Calls ChannelOpenInit. + * @function channelOpenInit + * @memberof ibc.core.channel.v1.Msg + * @instance + * @param {ibc.core.channel.v1.IMsgChannelOpenInit} request MsgChannelOpenInit message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.channel.v1.Msg#channelOpenTry}. + * @memberof ibc.core.channel.v1.Msg + * @typedef ChannelOpenTryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.channel.v1.IMsgChannelOpenTryResponse} [response] MsgChannelOpenTryResponse + */ + + /** + * Calls ChannelOpenTry. + * @function channelOpenTry + * @memberof ibc.core.channel.v1.Msg + * @instance + * @param {ibc.core.channel.v1.IMsgChannelOpenTry} request MsgChannelOpenTry message or plain object + * @param {ibc.core.channel.v1.Msg.ChannelOpenTryCallback} callback Node-style callback called with the error, if any, and MsgChannelOpenTryResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.channelOpenTry = function channelOpenTry(request, callback) { + return this.rpcCall(channelOpenTry, $root.ibc.core.channel.v1.MsgChannelOpenTry, $root.ibc.core.channel.v1.MsgChannelOpenTryResponse, request, callback); + }, "name", { value: "ChannelOpenTry" }); + + /** + * Calls ChannelOpenTry. + * @function channelOpenTry + * @memberof ibc.core.channel.v1.Msg + * @instance + * @param {ibc.core.channel.v1.IMsgChannelOpenTry} request MsgChannelOpenTry message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.channel.v1.Msg#channelOpenAck}. + * @memberof ibc.core.channel.v1.Msg + * @typedef ChannelOpenAckCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.channel.v1.IMsgChannelOpenAckResponse} [response] MsgChannelOpenAckResponse + */ + + /** + * Calls ChannelOpenAck. + * @function channelOpenAck + * @memberof ibc.core.channel.v1.Msg + * @instance + * @param {ibc.core.channel.v1.IMsgChannelOpenAck} request MsgChannelOpenAck message or plain object + * @param {ibc.core.channel.v1.Msg.ChannelOpenAckCallback} callback Node-style callback called with the error, if any, and MsgChannelOpenAckResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.channelOpenAck = function channelOpenAck(request, callback) { + return this.rpcCall(channelOpenAck, $root.ibc.core.channel.v1.MsgChannelOpenAck, $root.ibc.core.channel.v1.MsgChannelOpenAckResponse, request, callback); + }, "name", { value: "ChannelOpenAck" }); + + /** + * Calls ChannelOpenAck. + * @function channelOpenAck + * @memberof ibc.core.channel.v1.Msg + * @instance + * @param {ibc.core.channel.v1.IMsgChannelOpenAck} request MsgChannelOpenAck message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.channel.v1.Msg#channelOpenConfirm}. + * @memberof ibc.core.channel.v1.Msg + * @typedef ChannelOpenConfirmCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.channel.v1.IMsgChannelOpenConfirmResponse} [response] MsgChannelOpenConfirmResponse + */ + + /** + * Calls ChannelOpenConfirm. + * @function channelOpenConfirm + * @memberof ibc.core.channel.v1.Msg + * @instance + * @param {ibc.core.channel.v1.IMsgChannelOpenConfirm} request MsgChannelOpenConfirm message or plain object + * @param {ibc.core.channel.v1.Msg.ChannelOpenConfirmCallback} callback Node-style callback called with the error, if any, and MsgChannelOpenConfirmResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.channelOpenConfirm = function channelOpenConfirm(request, callback) { + return this.rpcCall(channelOpenConfirm, $root.ibc.core.channel.v1.MsgChannelOpenConfirm, $root.ibc.core.channel.v1.MsgChannelOpenConfirmResponse, request, callback); + }, "name", { value: "ChannelOpenConfirm" }); + + /** + * Calls ChannelOpenConfirm. + * @function channelOpenConfirm + * @memberof ibc.core.channel.v1.Msg + * @instance + * @param {ibc.core.channel.v1.IMsgChannelOpenConfirm} request MsgChannelOpenConfirm message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.channel.v1.Msg#channelCloseInit}. + * @memberof ibc.core.channel.v1.Msg + * @typedef ChannelCloseInitCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.channel.v1.IMsgChannelCloseInitResponse} [response] MsgChannelCloseInitResponse + */ + + /** + * Calls ChannelCloseInit. + * @function channelCloseInit + * @memberof ibc.core.channel.v1.Msg + * @instance + * @param {ibc.core.channel.v1.IMsgChannelCloseInit} request MsgChannelCloseInit message or plain object + * @param {ibc.core.channel.v1.Msg.ChannelCloseInitCallback} callback Node-style callback called with the error, if any, and MsgChannelCloseInitResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.channelCloseInit = function channelCloseInit(request, callback) { + return this.rpcCall(channelCloseInit, $root.ibc.core.channel.v1.MsgChannelCloseInit, $root.ibc.core.channel.v1.MsgChannelCloseInitResponse, request, callback); + }, "name", { value: "ChannelCloseInit" }); + + /** + * Calls ChannelCloseInit. + * @function channelCloseInit + * @memberof ibc.core.channel.v1.Msg + * @instance + * @param {ibc.core.channel.v1.IMsgChannelCloseInit} request MsgChannelCloseInit message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.channel.v1.Msg#channelCloseConfirm}. + * @memberof ibc.core.channel.v1.Msg + * @typedef ChannelCloseConfirmCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.channel.v1.IMsgChannelCloseConfirmResponse} [response] MsgChannelCloseConfirmResponse + */ + + /** + * Calls ChannelCloseConfirm. + * @function channelCloseConfirm + * @memberof ibc.core.channel.v1.Msg + * @instance + * @param {ibc.core.channel.v1.IMsgChannelCloseConfirm} request MsgChannelCloseConfirm message or plain object + * @param {ibc.core.channel.v1.Msg.ChannelCloseConfirmCallback} callback Node-style callback called with the error, if any, and MsgChannelCloseConfirmResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.channelCloseConfirm = function channelCloseConfirm(request, callback) { + return this.rpcCall(channelCloseConfirm, $root.ibc.core.channel.v1.MsgChannelCloseConfirm, $root.ibc.core.channel.v1.MsgChannelCloseConfirmResponse, request, callback); + }, "name", { value: "ChannelCloseConfirm" }); + + /** + * Calls ChannelCloseConfirm. + * @function channelCloseConfirm + * @memberof ibc.core.channel.v1.Msg + * @instance + * @param {ibc.core.channel.v1.IMsgChannelCloseConfirm} request MsgChannelCloseConfirm message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.channel.v1.Msg#recvPacket}. + * @memberof ibc.core.channel.v1.Msg + * @typedef RecvPacketCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.channel.v1.IMsgRecvPacketResponse} [response] MsgRecvPacketResponse + */ + + /** + * Calls RecvPacket. + * @function recvPacket + * @memberof ibc.core.channel.v1.Msg + * @instance + * @param {ibc.core.channel.v1.IMsgRecvPacket} request MsgRecvPacket message or plain object + * @param {ibc.core.channel.v1.Msg.RecvPacketCallback} callback Node-style callback called with the error, if any, and MsgRecvPacketResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.recvPacket = function recvPacket(request, callback) { + return this.rpcCall(recvPacket, $root.ibc.core.channel.v1.MsgRecvPacket, $root.ibc.core.channel.v1.MsgRecvPacketResponse, request, callback); + }, "name", { value: "RecvPacket" }); + + /** + * Calls RecvPacket. + * @function recvPacket + * @memberof ibc.core.channel.v1.Msg + * @instance + * @param {ibc.core.channel.v1.IMsgRecvPacket} request MsgRecvPacket message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.channel.v1.Msg#timeout}. + * @memberof ibc.core.channel.v1.Msg + * @typedef TimeoutCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.channel.v1.IMsgTimeoutResponse} [response] MsgTimeoutResponse + */ + + /** + * Calls Timeout. + * @function timeout + * @memberof ibc.core.channel.v1.Msg + * @instance + * @param {ibc.core.channel.v1.IMsgTimeout} request MsgTimeout message or plain object + * @param {ibc.core.channel.v1.Msg.TimeoutCallback} callback Node-style callback called with the error, if any, and MsgTimeoutResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.timeout = function timeout(request, callback) { + return this.rpcCall(timeout, $root.ibc.core.channel.v1.MsgTimeout, $root.ibc.core.channel.v1.MsgTimeoutResponse, request, callback); + }, "name", { value: "Timeout" }); + + /** + * Calls Timeout. + * @function timeout + * @memberof ibc.core.channel.v1.Msg + * @instance + * @param {ibc.core.channel.v1.IMsgTimeout} request MsgTimeout message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.channel.v1.Msg#timeoutOnClose}. + * @memberof ibc.core.channel.v1.Msg + * @typedef TimeoutOnCloseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.channel.v1.IMsgTimeoutOnCloseResponse} [response] MsgTimeoutOnCloseResponse + */ + + /** + * Calls TimeoutOnClose. + * @function timeoutOnClose + * @memberof ibc.core.channel.v1.Msg + * @instance + * @param {ibc.core.channel.v1.IMsgTimeoutOnClose} request MsgTimeoutOnClose message or plain object + * @param {ibc.core.channel.v1.Msg.TimeoutOnCloseCallback} callback Node-style callback called with the error, if any, and MsgTimeoutOnCloseResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.timeoutOnClose = function timeoutOnClose(request, callback) { + return this.rpcCall(timeoutOnClose, $root.ibc.core.channel.v1.MsgTimeoutOnClose, $root.ibc.core.channel.v1.MsgTimeoutOnCloseResponse, request, callback); + }, "name", { value: "TimeoutOnClose" }); + + /** + * Calls TimeoutOnClose. + * @function timeoutOnClose + * @memberof ibc.core.channel.v1.Msg + * @instance + * @param {ibc.core.channel.v1.IMsgTimeoutOnClose} request MsgTimeoutOnClose message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.channel.v1.Msg#acknowledgement}. + * @memberof ibc.core.channel.v1.Msg + * @typedef AcknowledgementCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.channel.v1.IMsgAcknowledgementResponse} [response] MsgAcknowledgementResponse + */ + + /** + * Calls Acknowledgement. + * @function acknowledgement + * @memberof ibc.core.channel.v1.Msg + * @instance + * @param {ibc.core.channel.v1.IMsgAcknowledgement} request MsgAcknowledgement message or plain object + * @param {ibc.core.channel.v1.Msg.AcknowledgementCallback} callback Node-style callback called with the error, if any, and MsgAcknowledgementResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.acknowledgement = function acknowledgement(request, callback) { + return this.rpcCall(acknowledgement, $root.ibc.core.channel.v1.MsgAcknowledgement, $root.ibc.core.channel.v1.MsgAcknowledgementResponse, request, callback); + }, "name", { value: "Acknowledgement" }); + + /** + * Calls Acknowledgement. + * @function acknowledgement + * @memberof ibc.core.channel.v1.Msg + * @instance + * @param {ibc.core.channel.v1.IMsgAcknowledgement} request MsgAcknowledgement message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Msg; + })(v1.Msg || {}); + + v1.MsgChannelOpenInit = (function(MsgChannelOpenInit) { + + /** + * Properties of a MsgChannelOpenInit. + * @memberof ibc.core.channel.v1 + * @interface IMsgChannelOpenInit + * @property {string|null} [portId] MsgChannelOpenInit portId + * @property {ibc.core.channel.v1.IChannel|null} [channel] MsgChannelOpenInit channel + * @property {string|null} [signer] MsgChannelOpenInit signer + */ + + /** + * Constructs a new MsgChannelOpenInit. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a MsgChannelOpenInit. + * @implements IMsgChannelOpenInit + * @constructor + * @param {ibc.core.channel.v1.IMsgChannelOpenInit=} [properties] Properties to set + */ + function MsgChannelOpenInit(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgChannelOpenInit portId. + * @member {string} portId + * @memberof ibc.core.channel.v1.MsgChannelOpenInit + * @instance + */ + MsgChannelOpenInit.prototype.portId = ""; + + /** + * MsgChannelOpenInit channel. + * @member {ibc.core.channel.v1.IChannel|null|undefined} channel + * @memberof ibc.core.channel.v1.MsgChannelOpenInit + * @instance + */ + MsgChannelOpenInit.prototype.channel = null; + + /** + * MsgChannelOpenInit signer. + * @member {string} signer + * @memberof ibc.core.channel.v1.MsgChannelOpenInit + * @instance + */ + MsgChannelOpenInit.prototype.signer = ""; + + /** + * Creates a new MsgChannelOpenInit instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.MsgChannelOpenInit + * @static + * @param {ibc.core.channel.v1.IMsgChannelOpenInit=} [properties] Properties to set + * @returns {ibc.core.channel.v1.MsgChannelOpenInit} MsgChannelOpenInit instance + */ + MsgChannelOpenInit.create = function create(properties) { + return new MsgChannelOpenInit(properties); + }; + + /** + * Encodes the specified MsgChannelOpenInit message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenInit.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.MsgChannelOpenInit + * @static + * @param {ibc.core.channel.v1.IMsgChannelOpenInit} message MsgChannelOpenInit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgChannelOpenInit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.portId != null && Object.hasOwnProperty.call(message, "portId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.portId); + if (message.channel != null && Object.hasOwnProperty.call(message, "channel")) + $root.ibc.core.channel.v1.Channel.encode(message.channel, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.signer); + return writer; + }; + + /** + * Encodes the specified MsgChannelOpenInit message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenInit.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.MsgChannelOpenInit + * @static + * @param {ibc.core.channel.v1.IMsgChannelOpenInit} message MsgChannelOpenInit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgChannelOpenInit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgChannelOpenInit message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.MsgChannelOpenInit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.MsgChannelOpenInit} MsgChannelOpenInit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgChannelOpenInit.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelOpenInit(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channel = $root.ibc.core.channel.v1.Channel.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgChannelOpenInit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.MsgChannelOpenInit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.MsgChannelOpenInit} MsgChannelOpenInit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgChannelOpenInit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgChannelOpenInit message. + * @function verify + * @memberof ibc.core.channel.v1.MsgChannelOpenInit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgChannelOpenInit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.portId != null && message.hasOwnProperty("portId")) + if (!$util.isString(message.portId)) + return "portId: string expected"; + if (message.channel != null && message.hasOwnProperty("channel")) { + let error = $root.ibc.core.channel.v1.Channel.verify(message.channel); + if (error) + return "channel." + error; + } + if (message.signer != null && message.hasOwnProperty("signer")) + if (!$util.isString(message.signer)) + return "signer: string expected"; + return null; + }; + + /** + * Creates a MsgChannelOpenInit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.MsgChannelOpenInit + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.MsgChannelOpenInit} MsgChannelOpenInit + */ + MsgChannelOpenInit.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.MsgChannelOpenInit) + return object; + let message = new $root.ibc.core.channel.v1.MsgChannelOpenInit(); + if (object.portId != null) + message.portId = String(object.portId); + if (object.channel != null) { + if (typeof object.channel !== "object") + throw TypeError(".ibc.core.channel.v1.MsgChannelOpenInit.channel: object expected"); + message.channel = $root.ibc.core.channel.v1.Channel.fromObject(object.channel); + } + if (object.signer != null) + message.signer = String(object.signer); + return message; + }; + + /** + * Creates a plain object from a MsgChannelOpenInit message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.MsgChannelOpenInit + * @static + * @param {ibc.core.channel.v1.MsgChannelOpenInit} message MsgChannelOpenInit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgChannelOpenInit.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.portId = ""; + object.channel = null; + object.signer = ""; + } + if (message.portId != null && message.hasOwnProperty("portId")) + object.portId = message.portId; + if (message.channel != null && message.hasOwnProperty("channel")) + object.channel = $root.ibc.core.channel.v1.Channel.toObject(message.channel, options); + if (message.signer != null && message.hasOwnProperty("signer")) + object.signer = message.signer; + return object; + }; + + /** + * Converts this MsgChannelOpenInit to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.MsgChannelOpenInit + * @instance + * @returns {Object.} JSON object + */ + MsgChannelOpenInit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgChannelOpenInit; + })(v1.MsgChannelOpenInit || {}); + + v1.MsgChannelOpenInitResponse = (function(MsgChannelOpenInitResponse) { + + /** + * Properties of a MsgChannelOpenInitResponse. + * @memberof ibc.core.channel.v1 + * @interface IMsgChannelOpenInitResponse + */ + + /** + * Constructs a new MsgChannelOpenInitResponse. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a MsgChannelOpenInitResponse. + * @implements IMsgChannelOpenInitResponse + * @constructor + * @param {ibc.core.channel.v1.IMsgChannelOpenInitResponse=} [properties] Properties to set + */ + function MsgChannelOpenInitResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgChannelOpenInitResponse instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.MsgChannelOpenInitResponse + * @static + * @param {ibc.core.channel.v1.IMsgChannelOpenInitResponse=} [properties] Properties to set + * @returns {ibc.core.channel.v1.MsgChannelOpenInitResponse} MsgChannelOpenInitResponse instance + */ + MsgChannelOpenInitResponse.create = function create(properties) { + return new MsgChannelOpenInitResponse(properties); + }; + + /** + * Encodes the specified MsgChannelOpenInitResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenInitResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.MsgChannelOpenInitResponse + * @static + * @param {ibc.core.channel.v1.IMsgChannelOpenInitResponse} message MsgChannelOpenInitResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgChannelOpenInitResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgChannelOpenInitResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenInitResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.MsgChannelOpenInitResponse + * @static + * @param {ibc.core.channel.v1.IMsgChannelOpenInitResponse} message MsgChannelOpenInitResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgChannelOpenInitResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgChannelOpenInitResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.MsgChannelOpenInitResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.MsgChannelOpenInitResponse} MsgChannelOpenInitResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgChannelOpenInitResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelOpenInitResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgChannelOpenInitResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.MsgChannelOpenInitResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.MsgChannelOpenInitResponse} MsgChannelOpenInitResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgChannelOpenInitResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgChannelOpenInitResponse message. + * @function verify + * @memberof ibc.core.channel.v1.MsgChannelOpenInitResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgChannelOpenInitResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgChannelOpenInitResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.MsgChannelOpenInitResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.MsgChannelOpenInitResponse} MsgChannelOpenInitResponse + */ + MsgChannelOpenInitResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.MsgChannelOpenInitResponse) + return object; + return new $root.ibc.core.channel.v1.MsgChannelOpenInitResponse(); + }; + + /** + * Creates a plain object from a MsgChannelOpenInitResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.MsgChannelOpenInitResponse + * @static + * @param {ibc.core.channel.v1.MsgChannelOpenInitResponse} message MsgChannelOpenInitResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgChannelOpenInitResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgChannelOpenInitResponse to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.MsgChannelOpenInitResponse + * @instance + * @returns {Object.} JSON object + */ + MsgChannelOpenInitResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgChannelOpenInitResponse; + })(v1.MsgChannelOpenInitResponse || {}); + + v1.MsgChannelOpenTry = (function(MsgChannelOpenTry) { + + /** + * Properties of a MsgChannelOpenTry. + * @memberof ibc.core.channel.v1 + * @interface IMsgChannelOpenTry + * @property {string|null} [portId] MsgChannelOpenTry portId + * @property {string|null} [previousChannelId] MsgChannelOpenTry previousChannelId + * @property {ibc.core.channel.v1.IChannel|null} [channel] MsgChannelOpenTry channel + * @property {string|null} [counterpartyVersion] MsgChannelOpenTry counterpartyVersion + * @property {Uint8Array|null} [proofInit] MsgChannelOpenTry proofInit + * @property {ibc.core.client.v1.IHeight|null} [proofHeight] MsgChannelOpenTry proofHeight + * @property {string|null} [signer] MsgChannelOpenTry signer + */ + + /** + * Constructs a new MsgChannelOpenTry. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a MsgChannelOpenTry. + * @implements IMsgChannelOpenTry + * @constructor + * @param {ibc.core.channel.v1.IMsgChannelOpenTry=} [properties] Properties to set + */ + function MsgChannelOpenTry(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgChannelOpenTry portId. + * @member {string} portId + * @memberof ibc.core.channel.v1.MsgChannelOpenTry + * @instance + */ + MsgChannelOpenTry.prototype.portId = ""; + + /** + * MsgChannelOpenTry previousChannelId. + * @member {string} previousChannelId + * @memberof ibc.core.channel.v1.MsgChannelOpenTry + * @instance + */ + MsgChannelOpenTry.prototype.previousChannelId = ""; + + /** + * MsgChannelOpenTry channel. + * @member {ibc.core.channel.v1.IChannel|null|undefined} channel + * @memberof ibc.core.channel.v1.MsgChannelOpenTry + * @instance + */ + MsgChannelOpenTry.prototype.channel = null; + + /** + * MsgChannelOpenTry counterpartyVersion. + * @member {string} counterpartyVersion + * @memberof ibc.core.channel.v1.MsgChannelOpenTry + * @instance + */ + MsgChannelOpenTry.prototype.counterpartyVersion = ""; + + /** + * MsgChannelOpenTry proofInit. + * @member {Uint8Array} proofInit + * @memberof ibc.core.channel.v1.MsgChannelOpenTry + * @instance + */ + MsgChannelOpenTry.prototype.proofInit = $util.newBuffer([]); + + /** + * MsgChannelOpenTry proofHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} proofHeight + * @memberof ibc.core.channel.v1.MsgChannelOpenTry + * @instance + */ + MsgChannelOpenTry.prototype.proofHeight = null; + + /** + * MsgChannelOpenTry signer. + * @member {string} signer + * @memberof ibc.core.channel.v1.MsgChannelOpenTry + * @instance + */ + MsgChannelOpenTry.prototype.signer = ""; + + /** + * Creates a new MsgChannelOpenTry instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.MsgChannelOpenTry + * @static + * @param {ibc.core.channel.v1.IMsgChannelOpenTry=} [properties] Properties to set + * @returns {ibc.core.channel.v1.MsgChannelOpenTry} MsgChannelOpenTry instance + */ + MsgChannelOpenTry.create = function create(properties) { + return new MsgChannelOpenTry(properties); + }; + + /** + * Encodes the specified MsgChannelOpenTry message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenTry.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.MsgChannelOpenTry + * @static + * @param {ibc.core.channel.v1.IMsgChannelOpenTry} message MsgChannelOpenTry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgChannelOpenTry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.portId != null && Object.hasOwnProperty.call(message, "portId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.portId); + if (message.previousChannelId != null && Object.hasOwnProperty.call(message, "previousChannelId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.previousChannelId); + if (message.channel != null && Object.hasOwnProperty.call(message, "channel")) + $root.ibc.core.channel.v1.Channel.encode(message.channel, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.counterpartyVersion != null && Object.hasOwnProperty.call(message, "counterpartyVersion")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.counterpartyVersion); + if (message.proofInit != null && Object.hasOwnProperty.call(message, "proofInit")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.proofInit); + if (message.proofHeight != null && Object.hasOwnProperty.call(message, "proofHeight")) + $root.ibc.core.client.v1.Height.encode(message.proofHeight, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.signer); + return writer; + }; + + /** + * Encodes the specified MsgChannelOpenTry message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenTry.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.MsgChannelOpenTry + * @static + * @param {ibc.core.channel.v1.IMsgChannelOpenTry} message MsgChannelOpenTry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgChannelOpenTry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgChannelOpenTry message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.MsgChannelOpenTry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.MsgChannelOpenTry} MsgChannelOpenTry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgChannelOpenTry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelOpenTry(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.previousChannelId = reader.string(); + break; + case 3: + message.channel = $root.ibc.core.channel.v1.Channel.decode(reader, reader.uint32()); + break; + case 4: + message.counterpartyVersion = reader.string(); + break; + case 5: + message.proofInit = reader.bytes(); + break; + case 6: + message.proofHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + case 7: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgChannelOpenTry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.MsgChannelOpenTry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.MsgChannelOpenTry} MsgChannelOpenTry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgChannelOpenTry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgChannelOpenTry message. + * @function verify + * @memberof ibc.core.channel.v1.MsgChannelOpenTry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgChannelOpenTry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.portId != null && message.hasOwnProperty("portId")) + if (!$util.isString(message.portId)) + return "portId: string expected"; + if (message.previousChannelId != null && message.hasOwnProperty("previousChannelId")) + if (!$util.isString(message.previousChannelId)) + return "previousChannelId: string expected"; + if (message.channel != null && message.hasOwnProperty("channel")) { + let error = $root.ibc.core.channel.v1.Channel.verify(message.channel); + if (error) + return "channel." + error; + } + if (message.counterpartyVersion != null && message.hasOwnProperty("counterpartyVersion")) + if (!$util.isString(message.counterpartyVersion)) + return "counterpartyVersion: string expected"; + if (message.proofInit != null && message.hasOwnProperty("proofInit")) + if (!(message.proofInit && typeof message.proofInit.length === "number" || $util.isString(message.proofInit))) + return "proofInit: buffer expected"; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) { + let error = $root.ibc.core.client.v1.Height.verify(message.proofHeight); + if (error) + return "proofHeight." + error; + } + if (message.signer != null && message.hasOwnProperty("signer")) + if (!$util.isString(message.signer)) + return "signer: string expected"; + return null; + }; + + /** + * Creates a MsgChannelOpenTry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.MsgChannelOpenTry + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.MsgChannelOpenTry} MsgChannelOpenTry + */ + MsgChannelOpenTry.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.MsgChannelOpenTry) + return object; + let message = new $root.ibc.core.channel.v1.MsgChannelOpenTry(); + if (object.portId != null) + message.portId = String(object.portId); + if (object.previousChannelId != null) + message.previousChannelId = String(object.previousChannelId); + if (object.channel != null) { + if (typeof object.channel !== "object") + throw TypeError(".ibc.core.channel.v1.MsgChannelOpenTry.channel: object expected"); + message.channel = $root.ibc.core.channel.v1.Channel.fromObject(object.channel); + } + if (object.counterpartyVersion != null) + message.counterpartyVersion = String(object.counterpartyVersion); + if (object.proofInit != null) + if (typeof object.proofInit === "string") + $util.base64.decode(object.proofInit, message.proofInit = $util.newBuffer($util.base64.length(object.proofInit)), 0); + else if (object.proofInit.length) + message.proofInit = object.proofInit; + if (object.proofHeight != null) { + if (typeof object.proofHeight !== "object") + throw TypeError(".ibc.core.channel.v1.MsgChannelOpenTry.proofHeight: object expected"); + message.proofHeight = $root.ibc.core.client.v1.Height.fromObject(object.proofHeight); + } + if (object.signer != null) + message.signer = String(object.signer); + return message; + }; + + /** + * Creates a plain object from a MsgChannelOpenTry message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.MsgChannelOpenTry + * @static + * @param {ibc.core.channel.v1.MsgChannelOpenTry} message MsgChannelOpenTry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgChannelOpenTry.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.portId = ""; + object.previousChannelId = ""; + object.channel = null; + object.counterpartyVersion = ""; + if (options.bytes === String) + object.proofInit = ""; + else { + object.proofInit = []; + if (options.bytes !== Array) + object.proofInit = $util.newBuffer(object.proofInit); + } + object.proofHeight = null; + object.signer = ""; + } + if (message.portId != null && message.hasOwnProperty("portId")) + object.portId = message.portId; + if (message.previousChannelId != null && message.hasOwnProperty("previousChannelId")) + object.previousChannelId = message.previousChannelId; + if (message.channel != null && message.hasOwnProperty("channel")) + object.channel = $root.ibc.core.channel.v1.Channel.toObject(message.channel, options); + if (message.counterpartyVersion != null && message.hasOwnProperty("counterpartyVersion")) + object.counterpartyVersion = message.counterpartyVersion; + if (message.proofInit != null && message.hasOwnProperty("proofInit")) + object.proofInit = options.bytes === String ? $util.base64.encode(message.proofInit, 0, message.proofInit.length) : options.bytes === Array ? Array.prototype.slice.call(message.proofInit) : message.proofInit; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) + object.proofHeight = $root.ibc.core.client.v1.Height.toObject(message.proofHeight, options); + if (message.signer != null && message.hasOwnProperty("signer")) + object.signer = message.signer; + return object; + }; + + /** + * Converts this MsgChannelOpenTry to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.MsgChannelOpenTry + * @instance + * @returns {Object.} JSON object + */ + MsgChannelOpenTry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgChannelOpenTry; + })(v1.MsgChannelOpenTry || {}); + + v1.MsgChannelOpenTryResponse = (function(MsgChannelOpenTryResponse) { + + /** + * Properties of a MsgChannelOpenTryResponse. + * @memberof ibc.core.channel.v1 + * @interface IMsgChannelOpenTryResponse + */ + + /** + * Constructs a new MsgChannelOpenTryResponse. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a MsgChannelOpenTryResponse. + * @implements IMsgChannelOpenTryResponse + * @constructor + * @param {ibc.core.channel.v1.IMsgChannelOpenTryResponse=} [properties] Properties to set + */ + function MsgChannelOpenTryResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgChannelOpenTryResponse instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.MsgChannelOpenTryResponse + * @static + * @param {ibc.core.channel.v1.IMsgChannelOpenTryResponse=} [properties] Properties to set + * @returns {ibc.core.channel.v1.MsgChannelOpenTryResponse} MsgChannelOpenTryResponse instance + */ + MsgChannelOpenTryResponse.create = function create(properties) { + return new MsgChannelOpenTryResponse(properties); + }; + + /** + * Encodes the specified MsgChannelOpenTryResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenTryResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.MsgChannelOpenTryResponse + * @static + * @param {ibc.core.channel.v1.IMsgChannelOpenTryResponse} message MsgChannelOpenTryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgChannelOpenTryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgChannelOpenTryResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenTryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.MsgChannelOpenTryResponse + * @static + * @param {ibc.core.channel.v1.IMsgChannelOpenTryResponse} message MsgChannelOpenTryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgChannelOpenTryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgChannelOpenTryResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.MsgChannelOpenTryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.MsgChannelOpenTryResponse} MsgChannelOpenTryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgChannelOpenTryResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelOpenTryResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgChannelOpenTryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.MsgChannelOpenTryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.MsgChannelOpenTryResponse} MsgChannelOpenTryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgChannelOpenTryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgChannelOpenTryResponse message. + * @function verify + * @memberof ibc.core.channel.v1.MsgChannelOpenTryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgChannelOpenTryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgChannelOpenTryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.MsgChannelOpenTryResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.MsgChannelOpenTryResponse} MsgChannelOpenTryResponse + */ + MsgChannelOpenTryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.MsgChannelOpenTryResponse) + return object; + return new $root.ibc.core.channel.v1.MsgChannelOpenTryResponse(); + }; + + /** + * Creates a plain object from a MsgChannelOpenTryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.MsgChannelOpenTryResponse + * @static + * @param {ibc.core.channel.v1.MsgChannelOpenTryResponse} message MsgChannelOpenTryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgChannelOpenTryResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgChannelOpenTryResponse to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.MsgChannelOpenTryResponse + * @instance + * @returns {Object.} JSON object + */ + MsgChannelOpenTryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgChannelOpenTryResponse; + })(v1.MsgChannelOpenTryResponse || {}); + + v1.MsgChannelOpenAck = (function(MsgChannelOpenAck) { + + /** + * Properties of a MsgChannelOpenAck. + * @memberof ibc.core.channel.v1 + * @interface IMsgChannelOpenAck + * @property {string|null} [portId] MsgChannelOpenAck portId + * @property {string|null} [channelId] MsgChannelOpenAck channelId + * @property {string|null} [counterpartyChannelId] MsgChannelOpenAck counterpartyChannelId + * @property {string|null} [counterpartyVersion] MsgChannelOpenAck counterpartyVersion + * @property {Uint8Array|null} [proofTry] MsgChannelOpenAck proofTry + * @property {ibc.core.client.v1.IHeight|null} [proofHeight] MsgChannelOpenAck proofHeight + * @property {string|null} [signer] MsgChannelOpenAck signer + */ + + /** + * Constructs a new MsgChannelOpenAck. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a MsgChannelOpenAck. + * @implements IMsgChannelOpenAck + * @constructor + * @param {ibc.core.channel.v1.IMsgChannelOpenAck=} [properties] Properties to set + */ + function MsgChannelOpenAck(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgChannelOpenAck portId. + * @member {string} portId + * @memberof ibc.core.channel.v1.MsgChannelOpenAck + * @instance + */ + MsgChannelOpenAck.prototype.portId = ""; + + /** + * MsgChannelOpenAck channelId. + * @member {string} channelId + * @memberof ibc.core.channel.v1.MsgChannelOpenAck + * @instance + */ + MsgChannelOpenAck.prototype.channelId = ""; + + /** + * MsgChannelOpenAck counterpartyChannelId. + * @member {string} counterpartyChannelId + * @memberof ibc.core.channel.v1.MsgChannelOpenAck + * @instance + */ + MsgChannelOpenAck.prototype.counterpartyChannelId = ""; + + /** + * MsgChannelOpenAck counterpartyVersion. + * @member {string} counterpartyVersion + * @memberof ibc.core.channel.v1.MsgChannelOpenAck + * @instance + */ + MsgChannelOpenAck.prototype.counterpartyVersion = ""; + + /** + * MsgChannelOpenAck proofTry. + * @member {Uint8Array} proofTry + * @memberof ibc.core.channel.v1.MsgChannelOpenAck + * @instance + */ + MsgChannelOpenAck.prototype.proofTry = $util.newBuffer([]); + + /** + * MsgChannelOpenAck proofHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} proofHeight + * @memberof ibc.core.channel.v1.MsgChannelOpenAck + * @instance + */ + MsgChannelOpenAck.prototype.proofHeight = null; + + /** + * MsgChannelOpenAck signer. + * @member {string} signer + * @memberof ibc.core.channel.v1.MsgChannelOpenAck + * @instance + */ + MsgChannelOpenAck.prototype.signer = ""; + + /** + * Creates a new MsgChannelOpenAck instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.MsgChannelOpenAck + * @static + * @param {ibc.core.channel.v1.IMsgChannelOpenAck=} [properties] Properties to set + * @returns {ibc.core.channel.v1.MsgChannelOpenAck} MsgChannelOpenAck instance + */ + MsgChannelOpenAck.create = function create(properties) { + return new MsgChannelOpenAck(properties); + }; + + /** + * Encodes the specified MsgChannelOpenAck message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenAck.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.MsgChannelOpenAck + * @static + * @param {ibc.core.channel.v1.IMsgChannelOpenAck} message MsgChannelOpenAck message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgChannelOpenAck.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.portId != null && Object.hasOwnProperty.call(message, "portId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.portId); + if (message.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.channelId); + if (message.counterpartyChannelId != null && Object.hasOwnProperty.call(message, "counterpartyChannelId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.counterpartyChannelId); + if (message.counterpartyVersion != null && Object.hasOwnProperty.call(message, "counterpartyVersion")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.counterpartyVersion); + if (message.proofTry != null && Object.hasOwnProperty.call(message, "proofTry")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.proofTry); + if (message.proofHeight != null && Object.hasOwnProperty.call(message, "proofHeight")) + $root.ibc.core.client.v1.Height.encode(message.proofHeight, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.signer); + return writer; + }; + + /** + * Encodes the specified MsgChannelOpenAck message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenAck.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.MsgChannelOpenAck + * @static + * @param {ibc.core.channel.v1.IMsgChannelOpenAck} message MsgChannelOpenAck message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgChannelOpenAck.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgChannelOpenAck message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.MsgChannelOpenAck + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.MsgChannelOpenAck} MsgChannelOpenAck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgChannelOpenAck.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelOpenAck(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.counterpartyChannelId = reader.string(); + break; + case 4: + message.counterpartyVersion = reader.string(); + break; + case 5: + message.proofTry = reader.bytes(); + break; + case 6: + message.proofHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + case 7: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgChannelOpenAck message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.MsgChannelOpenAck + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.MsgChannelOpenAck} MsgChannelOpenAck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgChannelOpenAck.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgChannelOpenAck message. + * @function verify + * @memberof ibc.core.channel.v1.MsgChannelOpenAck + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgChannelOpenAck.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.portId != null && message.hasOwnProperty("portId")) + if (!$util.isString(message.portId)) + return "portId: string expected"; + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + if (message.counterpartyChannelId != null && message.hasOwnProperty("counterpartyChannelId")) + if (!$util.isString(message.counterpartyChannelId)) + return "counterpartyChannelId: string expected"; + if (message.counterpartyVersion != null && message.hasOwnProperty("counterpartyVersion")) + if (!$util.isString(message.counterpartyVersion)) + return "counterpartyVersion: string expected"; + if (message.proofTry != null && message.hasOwnProperty("proofTry")) + if (!(message.proofTry && typeof message.proofTry.length === "number" || $util.isString(message.proofTry))) + return "proofTry: buffer expected"; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) { + let error = $root.ibc.core.client.v1.Height.verify(message.proofHeight); + if (error) + return "proofHeight." + error; + } + if (message.signer != null && message.hasOwnProperty("signer")) + if (!$util.isString(message.signer)) + return "signer: string expected"; + return null; + }; + + /** + * Creates a MsgChannelOpenAck message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.MsgChannelOpenAck + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.MsgChannelOpenAck} MsgChannelOpenAck + */ + MsgChannelOpenAck.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.MsgChannelOpenAck) + return object; + let message = new $root.ibc.core.channel.v1.MsgChannelOpenAck(); + if (object.portId != null) + message.portId = String(object.portId); + if (object.channelId != null) + message.channelId = String(object.channelId); + if (object.counterpartyChannelId != null) + message.counterpartyChannelId = String(object.counterpartyChannelId); + if (object.counterpartyVersion != null) + message.counterpartyVersion = String(object.counterpartyVersion); + if (object.proofTry != null) + if (typeof object.proofTry === "string") + $util.base64.decode(object.proofTry, message.proofTry = $util.newBuffer($util.base64.length(object.proofTry)), 0); + else if (object.proofTry.length) + message.proofTry = object.proofTry; + if (object.proofHeight != null) { + if (typeof object.proofHeight !== "object") + throw TypeError(".ibc.core.channel.v1.MsgChannelOpenAck.proofHeight: object expected"); + message.proofHeight = $root.ibc.core.client.v1.Height.fromObject(object.proofHeight); + } + if (object.signer != null) + message.signer = String(object.signer); + return message; + }; + + /** + * Creates a plain object from a MsgChannelOpenAck message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.MsgChannelOpenAck + * @static + * @param {ibc.core.channel.v1.MsgChannelOpenAck} message MsgChannelOpenAck + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgChannelOpenAck.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.portId = ""; + object.channelId = ""; + object.counterpartyChannelId = ""; + object.counterpartyVersion = ""; + if (options.bytes === String) + object.proofTry = ""; + else { + object.proofTry = []; + if (options.bytes !== Array) + object.proofTry = $util.newBuffer(object.proofTry); + } + object.proofHeight = null; + object.signer = ""; + } + if (message.portId != null && message.hasOwnProperty("portId")) + object.portId = message.portId; + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + if (message.counterpartyChannelId != null && message.hasOwnProperty("counterpartyChannelId")) + object.counterpartyChannelId = message.counterpartyChannelId; + if (message.counterpartyVersion != null && message.hasOwnProperty("counterpartyVersion")) + object.counterpartyVersion = message.counterpartyVersion; + if (message.proofTry != null && message.hasOwnProperty("proofTry")) + object.proofTry = options.bytes === String ? $util.base64.encode(message.proofTry, 0, message.proofTry.length) : options.bytes === Array ? Array.prototype.slice.call(message.proofTry) : message.proofTry; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) + object.proofHeight = $root.ibc.core.client.v1.Height.toObject(message.proofHeight, options); + if (message.signer != null && message.hasOwnProperty("signer")) + object.signer = message.signer; + return object; + }; + + /** + * Converts this MsgChannelOpenAck to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.MsgChannelOpenAck + * @instance + * @returns {Object.} JSON object + */ + MsgChannelOpenAck.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgChannelOpenAck; + })(v1.MsgChannelOpenAck || {}); + + v1.MsgChannelOpenAckResponse = (function(MsgChannelOpenAckResponse) { + + /** + * Properties of a MsgChannelOpenAckResponse. + * @memberof ibc.core.channel.v1 + * @interface IMsgChannelOpenAckResponse + */ + + /** + * Constructs a new MsgChannelOpenAckResponse. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a MsgChannelOpenAckResponse. + * @implements IMsgChannelOpenAckResponse + * @constructor + * @param {ibc.core.channel.v1.IMsgChannelOpenAckResponse=} [properties] Properties to set + */ + function MsgChannelOpenAckResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgChannelOpenAckResponse instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.MsgChannelOpenAckResponse + * @static + * @param {ibc.core.channel.v1.IMsgChannelOpenAckResponse=} [properties] Properties to set + * @returns {ibc.core.channel.v1.MsgChannelOpenAckResponse} MsgChannelOpenAckResponse instance + */ + MsgChannelOpenAckResponse.create = function create(properties) { + return new MsgChannelOpenAckResponse(properties); + }; + + /** + * Encodes the specified MsgChannelOpenAckResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenAckResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.MsgChannelOpenAckResponse + * @static + * @param {ibc.core.channel.v1.IMsgChannelOpenAckResponse} message MsgChannelOpenAckResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgChannelOpenAckResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgChannelOpenAckResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenAckResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.MsgChannelOpenAckResponse + * @static + * @param {ibc.core.channel.v1.IMsgChannelOpenAckResponse} message MsgChannelOpenAckResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgChannelOpenAckResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgChannelOpenAckResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.MsgChannelOpenAckResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.MsgChannelOpenAckResponse} MsgChannelOpenAckResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgChannelOpenAckResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelOpenAckResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgChannelOpenAckResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.MsgChannelOpenAckResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.MsgChannelOpenAckResponse} MsgChannelOpenAckResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgChannelOpenAckResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgChannelOpenAckResponse message. + * @function verify + * @memberof ibc.core.channel.v1.MsgChannelOpenAckResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgChannelOpenAckResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgChannelOpenAckResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.MsgChannelOpenAckResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.MsgChannelOpenAckResponse} MsgChannelOpenAckResponse + */ + MsgChannelOpenAckResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.MsgChannelOpenAckResponse) + return object; + return new $root.ibc.core.channel.v1.MsgChannelOpenAckResponse(); + }; + + /** + * Creates a plain object from a MsgChannelOpenAckResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.MsgChannelOpenAckResponse + * @static + * @param {ibc.core.channel.v1.MsgChannelOpenAckResponse} message MsgChannelOpenAckResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgChannelOpenAckResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgChannelOpenAckResponse to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.MsgChannelOpenAckResponse + * @instance + * @returns {Object.} JSON object + */ + MsgChannelOpenAckResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgChannelOpenAckResponse; + })(v1.MsgChannelOpenAckResponse || {}); + + v1.MsgChannelOpenConfirm = (function(MsgChannelOpenConfirm) { + + /** + * Properties of a MsgChannelOpenConfirm. + * @memberof ibc.core.channel.v1 + * @interface IMsgChannelOpenConfirm + * @property {string|null} [portId] MsgChannelOpenConfirm portId + * @property {string|null} [channelId] MsgChannelOpenConfirm channelId + * @property {Uint8Array|null} [proofAck] MsgChannelOpenConfirm proofAck + * @property {ibc.core.client.v1.IHeight|null} [proofHeight] MsgChannelOpenConfirm proofHeight + * @property {string|null} [signer] MsgChannelOpenConfirm signer + */ + + /** + * Constructs a new MsgChannelOpenConfirm. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a MsgChannelOpenConfirm. + * @implements IMsgChannelOpenConfirm + * @constructor + * @param {ibc.core.channel.v1.IMsgChannelOpenConfirm=} [properties] Properties to set + */ + function MsgChannelOpenConfirm(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgChannelOpenConfirm portId. + * @member {string} portId + * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm + * @instance + */ + MsgChannelOpenConfirm.prototype.portId = ""; + + /** + * MsgChannelOpenConfirm channelId. + * @member {string} channelId + * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm + * @instance + */ + MsgChannelOpenConfirm.prototype.channelId = ""; + + /** + * MsgChannelOpenConfirm proofAck. + * @member {Uint8Array} proofAck + * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm + * @instance + */ + MsgChannelOpenConfirm.prototype.proofAck = $util.newBuffer([]); + + /** + * MsgChannelOpenConfirm proofHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} proofHeight + * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm + * @instance + */ + MsgChannelOpenConfirm.prototype.proofHeight = null; + + /** + * MsgChannelOpenConfirm signer. + * @member {string} signer + * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm + * @instance + */ + MsgChannelOpenConfirm.prototype.signer = ""; + + /** + * Creates a new MsgChannelOpenConfirm instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm + * @static + * @param {ibc.core.channel.v1.IMsgChannelOpenConfirm=} [properties] Properties to set + * @returns {ibc.core.channel.v1.MsgChannelOpenConfirm} MsgChannelOpenConfirm instance + */ + MsgChannelOpenConfirm.create = function create(properties) { + return new MsgChannelOpenConfirm(properties); + }; + + /** + * Encodes the specified MsgChannelOpenConfirm message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenConfirm.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm + * @static + * @param {ibc.core.channel.v1.IMsgChannelOpenConfirm} message MsgChannelOpenConfirm message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgChannelOpenConfirm.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.portId != null && Object.hasOwnProperty.call(message, "portId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.portId); + if (message.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.channelId); + if (message.proofAck != null && Object.hasOwnProperty.call(message, "proofAck")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.proofAck); + if (message.proofHeight != null && Object.hasOwnProperty.call(message, "proofHeight")) + $root.ibc.core.client.v1.Height.encode(message.proofHeight, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.signer); + return writer; + }; + + /** + * Encodes the specified MsgChannelOpenConfirm message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenConfirm.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm + * @static + * @param {ibc.core.channel.v1.IMsgChannelOpenConfirm} message MsgChannelOpenConfirm message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgChannelOpenConfirm.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgChannelOpenConfirm message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.MsgChannelOpenConfirm} MsgChannelOpenConfirm + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgChannelOpenConfirm.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelOpenConfirm(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.proofAck = reader.bytes(); + break; + case 4: + message.proofHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + case 5: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgChannelOpenConfirm message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.MsgChannelOpenConfirm} MsgChannelOpenConfirm + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgChannelOpenConfirm.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgChannelOpenConfirm message. + * @function verify + * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgChannelOpenConfirm.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.portId != null && message.hasOwnProperty("portId")) + if (!$util.isString(message.portId)) + return "portId: string expected"; + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + if (message.proofAck != null && message.hasOwnProperty("proofAck")) + if (!(message.proofAck && typeof message.proofAck.length === "number" || $util.isString(message.proofAck))) + return "proofAck: buffer expected"; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) { + let error = $root.ibc.core.client.v1.Height.verify(message.proofHeight); + if (error) + return "proofHeight." + error; + } + if (message.signer != null && message.hasOwnProperty("signer")) + if (!$util.isString(message.signer)) + return "signer: string expected"; + return null; + }; + + /** + * Creates a MsgChannelOpenConfirm message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.MsgChannelOpenConfirm} MsgChannelOpenConfirm + */ + MsgChannelOpenConfirm.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.MsgChannelOpenConfirm) + return object; + let message = new $root.ibc.core.channel.v1.MsgChannelOpenConfirm(); + if (object.portId != null) + message.portId = String(object.portId); + if (object.channelId != null) + message.channelId = String(object.channelId); + if (object.proofAck != null) + if (typeof object.proofAck === "string") + $util.base64.decode(object.proofAck, message.proofAck = $util.newBuffer($util.base64.length(object.proofAck)), 0); + else if (object.proofAck.length) + message.proofAck = object.proofAck; + if (object.proofHeight != null) { + if (typeof object.proofHeight !== "object") + throw TypeError(".ibc.core.channel.v1.MsgChannelOpenConfirm.proofHeight: object expected"); + message.proofHeight = $root.ibc.core.client.v1.Height.fromObject(object.proofHeight); + } + if (object.signer != null) + message.signer = String(object.signer); + return message; + }; + + /** + * Creates a plain object from a MsgChannelOpenConfirm message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm + * @static + * @param {ibc.core.channel.v1.MsgChannelOpenConfirm} message MsgChannelOpenConfirm + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgChannelOpenConfirm.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.portId = ""; + object.channelId = ""; + if (options.bytes === String) + object.proofAck = ""; + else { + object.proofAck = []; + if (options.bytes !== Array) + object.proofAck = $util.newBuffer(object.proofAck); + } + object.proofHeight = null; + object.signer = ""; + } + if (message.portId != null && message.hasOwnProperty("portId")) + object.portId = message.portId; + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + if (message.proofAck != null && message.hasOwnProperty("proofAck")) + object.proofAck = options.bytes === String ? $util.base64.encode(message.proofAck, 0, message.proofAck.length) : options.bytes === Array ? Array.prototype.slice.call(message.proofAck) : message.proofAck; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) + object.proofHeight = $root.ibc.core.client.v1.Height.toObject(message.proofHeight, options); + if (message.signer != null && message.hasOwnProperty("signer")) + object.signer = message.signer; + return object; + }; + + /** + * Converts this MsgChannelOpenConfirm to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm + * @instance + * @returns {Object.} JSON object + */ + MsgChannelOpenConfirm.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgChannelOpenConfirm; + })(v1.MsgChannelOpenConfirm || {}); + + v1.MsgChannelOpenConfirmResponse = (function(MsgChannelOpenConfirmResponse) { + + /** + * Properties of a MsgChannelOpenConfirmResponse. + * @memberof ibc.core.channel.v1 + * @interface IMsgChannelOpenConfirmResponse + */ + + /** + * Constructs a new MsgChannelOpenConfirmResponse. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a MsgChannelOpenConfirmResponse. + * @implements IMsgChannelOpenConfirmResponse + * @constructor + * @param {ibc.core.channel.v1.IMsgChannelOpenConfirmResponse=} [properties] Properties to set + */ + function MsgChannelOpenConfirmResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgChannelOpenConfirmResponse instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.MsgChannelOpenConfirmResponse + * @static + * @param {ibc.core.channel.v1.IMsgChannelOpenConfirmResponse=} [properties] Properties to set + * @returns {ibc.core.channel.v1.MsgChannelOpenConfirmResponse} MsgChannelOpenConfirmResponse instance + */ + MsgChannelOpenConfirmResponse.create = function create(properties) { + return new MsgChannelOpenConfirmResponse(properties); + }; + + /** + * Encodes the specified MsgChannelOpenConfirmResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenConfirmResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.MsgChannelOpenConfirmResponse + * @static + * @param {ibc.core.channel.v1.IMsgChannelOpenConfirmResponse} message MsgChannelOpenConfirmResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgChannelOpenConfirmResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgChannelOpenConfirmResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenConfirmResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.MsgChannelOpenConfirmResponse + * @static + * @param {ibc.core.channel.v1.IMsgChannelOpenConfirmResponse} message MsgChannelOpenConfirmResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgChannelOpenConfirmResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgChannelOpenConfirmResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.MsgChannelOpenConfirmResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.MsgChannelOpenConfirmResponse} MsgChannelOpenConfirmResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgChannelOpenConfirmResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelOpenConfirmResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgChannelOpenConfirmResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.MsgChannelOpenConfirmResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.MsgChannelOpenConfirmResponse} MsgChannelOpenConfirmResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgChannelOpenConfirmResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgChannelOpenConfirmResponse message. + * @function verify + * @memberof ibc.core.channel.v1.MsgChannelOpenConfirmResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgChannelOpenConfirmResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgChannelOpenConfirmResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.MsgChannelOpenConfirmResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.MsgChannelOpenConfirmResponse} MsgChannelOpenConfirmResponse + */ + MsgChannelOpenConfirmResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.MsgChannelOpenConfirmResponse) + return object; + return new $root.ibc.core.channel.v1.MsgChannelOpenConfirmResponse(); + }; + + /** + * Creates a plain object from a MsgChannelOpenConfirmResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.MsgChannelOpenConfirmResponse + * @static + * @param {ibc.core.channel.v1.MsgChannelOpenConfirmResponse} message MsgChannelOpenConfirmResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgChannelOpenConfirmResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgChannelOpenConfirmResponse to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.MsgChannelOpenConfirmResponse + * @instance + * @returns {Object.} JSON object + */ + MsgChannelOpenConfirmResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgChannelOpenConfirmResponse; + })(v1.MsgChannelOpenConfirmResponse || {}); + + v1.MsgChannelCloseInit = (function(MsgChannelCloseInit) { + + /** + * Properties of a MsgChannelCloseInit. + * @memberof ibc.core.channel.v1 + * @interface IMsgChannelCloseInit + * @property {string|null} [portId] MsgChannelCloseInit portId + * @property {string|null} [channelId] MsgChannelCloseInit channelId + * @property {string|null} [signer] MsgChannelCloseInit signer + */ + + /** + * Constructs a new MsgChannelCloseInit. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a MsgChannelCloseInit. + * @implements IMsgChannelCloseInit + * @constructor + * @param {ibc.core.channel.v1.IMsgChannelCloseInit=} [properties] Properties to set + */ + function MsgChannelCloseInit(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgChannelCloseInit portId. + * @member {string} portId + * @memberof ibc.core.channel.v1.MsgChannelCloseInit + * @instance + */ + MsgChannelCloseInit.prototype.portId = ""; + + /** + * MsgChannelCloseInit channelId. + * @member {string} channelId + * @memberof ibc.core.channel.v1.MsgChannelCloseInit + * @instance + */ + MsgChannelCloseInit.prototype.channelId = ""; + + /** + * MsgChannelCloseInit signer. + * @member {string} signer + * @memberof ibc.core.channel.v1.MsgChannelCloseInit + * @instance + */ + MsgChannelCloseInit.prototype.signer = ""; + + /** + * Creates a new MsgChannelCloseInit instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.MsgChannelCloseInit + * @static + * @param {ibc.core.channel.v1.IMsgChannelCloseInit=} [properties] Properties to set + * @returns {ibc.core.channel.v1.MsgChannelCloseInit} MsgChannelCloseInit instance + */ + MsgChannelCloseInit.create = function create(properties) { + return new MsgChannelCloseInit(properties); + }; + + /** + * Encodes the specified MsgChannelCloseInit message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelCloseInit.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.MsgChannelCloseInit + * @static + * @param {ibc.core.channel.v1.IMsgChannelCloseInit} message MsgChannelCloseInit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgChannelCloseInit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.portId != null && Object.hasOwnProperty.call(message, "portId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.portId); + if (message.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.channelId); + if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.signer); + return writer; + }; + + /** + * Encodes the specified MsgChannelCloseInit message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelCloseInit.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.MsgChannelCloseInit + * @static + * @param {ibc.core.channel.v1.IMsgChannelCloseInit} message MsgChannelCloseInit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgChannelCloseInit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgChannelCloseInit message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.MsgChannelCloseInit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.MsgChannelCloseInit} MsgChannelCloseInit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgChannelCloseInit.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelCloseInit(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgChannelCloseInit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.MsgChannelCloseInit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.MsgChannelCloseInit} MsgChannelCloseInit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgChannelCloseInit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgChannelCloseInit message. + * @function verify + * @memberof ibc.core.channel.v1.MsgChannelCloseInit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgChannelCloseInit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.portId != null && message.hasOwnProperty("portId")) + if (!$util.isString(message.portId)) + return "portId: string expected"; + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + if (message.signer != null && message.hasOwnProperty("signer")) + if (!$util.isString(message.signer)) + return "signer: string expected"; + return null; + }; + + /** + * Creates a MsgChannelCloseInit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.MsgChannelCloseInit + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.MsgChannelCloseInit} MsgChannelCloseInit + */ + MsgChannelCloseInit.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.MsgChannelCloseInit) + return object; + let message = new $root.ibc.core.channel.v1.MsgChannelCloseInit(); + if (object.portId != null) + message.portId = String(object.portId); + if (object.channelId != null) + message.channelId = String(object.channelId); + if (object.signer != null) + message.signer = String(object.signer); + return message; + }; + + /** + * Creates a plain object from a MsgChannelCloseInit message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.MsgChannelCloseInit + * @static + * @param {ibc.core.channel.v1.MsgChannelCloseInit} message MsgChannelCloseInit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgChannelCloseInit.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.portId = ""; + object.channelId = ""; + object.signer = ""; + } + if (message.portId != null && message.hasOwnProperty("portId")) + object.portId = message.portId; + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + if (message.signer != null && message.hasOwnProperty("signer")) + object.signer = message.signer; + return object; + }; + + /** + * Converts this MsgChannelCloseInit to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.MsgChannelCloseInit + * @instance + * @returns {Object.} JSON object + */ + MsgChannelCloseInit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgChannelCloseInit; + })(v1.MsgChannelCloseInit || {}); + + v1.MsgChannelCloseInitResponse = (function(MsgChannelCloseInitResponse) { + + /** + * Properties of a MsgChannelCloseInitResponse. + * @memberof ibc.core.channel.v1 + * @interface IMsgChannelCloseInitResponse + */ + + /** + * Constructs a new MsgChannelCloseInitResponse. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a MsgChannelCloseInitResponse. + * @implements IMsgChannelCloseInitResponse + * @constructor + * @param {ibc.core.channel.v1.IMsgChannelCloseInitResponse=} [properties] Properties to set + */ + function MsgChannelCloseInitResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgChannelCloseInitResponse instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.MsgChannelCloseInitResponse + * @static + * @param {ibc.core.channel.v1.IMsgChannelCloseInitResponse=} [properties] Properties to set + * @returns {ibc.core.channel.v1.MsgChannelCloseInitResponse} MsgChannelCloseInitResponse instance + */ + MsgChannelCloseInitResponse.create = function create(properties) { + return new MsgChannelCloseInitResponse(properties); + }; + + /** + * Encodes the specified MsgChannelCloseInitResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelCloseInitResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.MsgChannelCloseInitResponse + * @static + * @param {ibc.core.channel.v1.IMsgChannelCloseInitResponse} message MsgChannelCloseInitResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgChannelCloseInitResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgChannelCloseInitResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelCloseInitResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.MsgChannelCloseInitResponse + * @static + * @param {ibc.core.channel.v1.IMsgChannelCloseInitResponse} message MsgChannelCloseInitResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgChannelCloseInitResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgChannelCloseInitResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.MsgChannelCloseInitResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.MsgChannelCloseInitResponse} MsgChannelCloseInitResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgChannelCloseInitResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelCloseInitResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgChannelCloseInitResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.MsgChannelCloseInitResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.MsgChannelCloseInitResponse} MsgChannelCloseInitResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgChannelCloseInitResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgChannelCloseInitResponse message. + * @function verify + * @memberof ibc.core.channel.v1.MsgChannelCloseInitResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgChannelCloseInitResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgChannelCloseInitResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.MsgChannelCloseInitResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.MsgChannelCloseInitResponse} MsgChannelCloseInitResponse + */ + MsgChannelCloseInitResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.MsgChannelCloseInitResponse) + return object; + return new $root.ibc.core.channel.v1.MsgChannelCloseInitResponse(); + }; + + /** + * Creates a plain object from a MsgChannelCloseInitResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.MsgChannelCloseInitResponse + * @static + * @param {ibc.core.channel.v1.MsgChannelCloseInitResponse} message MsgChannelCloseInitResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgChannelCloseInitResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgChannelCloseInitResponse to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.MsgChannelCloseInitResponse + * @instance + * @returns {Object.} JSON object + */ + MsgChannelCloseInitResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgChannelCloseInitResponse; + })(v1.MsgChannelCloseInitResponse || {}); + + v1.MsgChannelCloseConfirm = (function(MsgChannelCloseConfirm) { + + /** + * Properties of a MsgChannelCloseConfirm. + * @memberof ibc.core.channel.v1 + * @interface IMsgChannelCloseConfirm + * @property {string|null} [portId] MsgChannelCloseConfirm portId + * @property {string|null} [channelId] MsgChannelCloseConfirm channelId + * @property {Uint8Array|null} [proofInit] MsgChannelCloseConfirm proofInit + * @property {ibc.core.client.v1.IHeight|null} [proofHeight] MsgChannelCloseConfirm proofHeight + * @property {string|null} [signer] MsgChannelCloseConfirm signer + */ + + /** + * Constructs a new MsgChannelCloseConfirm. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a MsgChannelCloseConfirm. + * @implements IMsgChannelCloseConfirm + * @constructor + * @param {ibc.core.channel.v1.IMsgChannelCloseConfirm=} [properties] Properties to set + */ + function MsgChannelCloseConfirm(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgChannelCloseConfirm portId. + * @member {string} portId + * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm + * @instance + */ + MsgChannelCloseConfirm.prototype.portId = ""; + + /** + * MsgChannelCloseConfirm channelId. + * @member {string} channelId + * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm + * @instance + */ + MsgChannelCloseConfirm.prototype.channelId = ""; + + /** + * MsgChannelCloseConfirm proofInit. + * @member {Uint8Array} proofInit + * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm + * @instance + */ + MsgChannelCloseConfirm.prototype.proofInit = $util.newBuffer([]); + + /** + * MsgChannelCloseConfirm proofHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} proofHeight + * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm + * @instance + */ + MsgChannelCloseConfirm.prototype.proofHeight = null; + + /** + * MsgChannelCloseConfirm signer. + * @member {string} signer + * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm + * @instance + */ + MsgChannelCloseConfirm.prototype.signer = ""; + + /** + * Creates a new MsgChannelCloseConfirm instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm + * @static + * @param {ibc.core.channel.v1.IMsgChannelCloseConfirm=} [properties] Properties to set + * @returns {ibc.core.channel.v1.MsgChannelCloseConfirm} MsgChannelCloseConfirm instance + */ + MsgChannelCloseConfirm.create = function create(properties) { + return new MsgChannelCloseConfirm(properties); + }; + + /** + * Encodes the specified MsgChannelCloseConfirm message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelCloseConfirm.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm + * @static + * @param {ibc.core.channel.v1.IMsgChannelCloseConfirm} message MsgChannelCloseConfirm message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgChannelCloseConfirm.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.portId != null && Object.hasOwnProperty.call(message, "portId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.portId); + if (message.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.channelId); + if (message.proofInit != null && Object.hasOwnProperty.call(message, "proofInit")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.proofInit); + if (message.proofHeight != null && Object.hasOwnProperty.call(message, "proofHeight")) + $root.ibc.core.client.v1.Height.encode(message.proofHeight, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.signer); + return writer; + }; + + /** + * Encodes the specified MsgChannelCloseConfirm message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelCloseConfirm.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm + * @static + * @param {ibc.core.channel.v1.IMsgChannelCloseConfirm} message MsgChannelCloseConfirm message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgChannelCloseConfirm.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgChannelCloseConfirm message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.MsgChannelCloseConfirm} MsgChannelCloseConfirm + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgChannelCloseConfirm.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelCloseConfirm(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.proofInit = reader.bytes(); + break; + case 4: + message.proofHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + case 5: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgChannelCloseConfirm message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.MsgChannelCloseConfirm} MsgChannelCloseConfirm + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgChannelCloseConfirm.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgChannelCloseConfirm message. + * @function verify + * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgChannelCloseConfirm.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.portId != null && message.hasOwnProperty("portId")) + if (!$util.isString(message.portId)) + return "portId: string expected"; + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + if (message.proofInit != null && message.hasOwnProperty("proofInit")) + if (!(message.proofInit && typeof message.proofInit.length === "number" || $util.isString(message.proofInit))) + return "proofInit: buffer expected"; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) { + let error = $root.ibc.core.client.v1.Height.verify(message.proofHeight); + if (error) + return "proofHeight." + error; + } + if (message.signer != null && message.hasOwnProperty("signer")) + if (!$util.isString(message.signer)) + return "signer: string expected"; + return null; + }; + + /** + * Creates a MsgChannelCloseConfirm message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.MsgChannelCloseConfirm} MsgChannelCloseConfirm + */ + MsgChannelCloseConfirm.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.MsgChannelCloseConfirm) + return object; + let message = new $root.ibc.core.channel.v1.MsgChannelCloseConfirm(); + if (object.portId != null) + message.portId = String(object.portId); + if (object.channelId != null) + message.channelId = String(object.channelId); + if (object.proofInit != null) + if (typeof object.proofInit === "string") + $util.base64.decode(object.proofInit, message.proofInit = $util.newBuffer($util.base64.length(object.proofInit)), 0); + else if (object.proofInit.length) + message.proofInit = object.proofInit; + if (object.proofHeight != null) { + if (typeof object.proofHeight !== "object") + throw TypeError(".ibc.core.channel.v1.MsgChannelCloseConfirm.proofHeight: object expected"); + message.proofHeight = $root.ibc.core.client.v1.Height.fromObject(object.proofHeight); + } + if (object.signer != null) + message.signer = String(object.signer); + return message; + }; + + /** + * Creates a plain object from a MsgChannelCloseConfirm message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm + * @static + * @param {ibc.core.channel.v1.MsgChannelCloseConfirm} message MsgChannelCloseConfirm + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgChannelCloseConfirm.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.portId = ""; + object.channelId = ""; + if (options.bytes === String) + object.proofInit = ""; + else { + object.proofInit = []; + if (options.bytes !== Array) + object.proofInit = $util.newBuffer(object.proofInit); + } + object.proofHeight = null; + object.signer = ""; + } + if (message.portId != null && message.hasOwnProperty("portId")) + object.portId = message.portId; + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + if (message.proofInit != null && message.hasOwnProperty("proofInit")) + object.proofInit = options.bytes === String ? $util.base64.encode(message.proofInit, 0, message.proofInit.length) : options.bytes === Array ? Array.prototype.slice.call(message.proofInit) : message.proofInit; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) + object.proofHeight = $root.ibc.core.client.v1.Height.toObject(message.proofHeight, options); + if (message.signer != null && message.hasOwnProperty("signer")) + object.signer = message.signer; + return object; + }; + + /** + * Converts this MsgChannelCloseConfirm to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm + * @instance + * @returns {Object.} JSON object + */ + MsgChannelCloseConfirm.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgChannelCloseConfirm; + })(v1.MsgChannelCloseConfirm || {}); + + v1.MsgChannelCloseConfirmResponse = (function(MsgChannelCloseConfirmResponse) { + + /** + * Properties of a MsgChannelCloseConfirmResponse. + * @memberof ibc.core.channel.v1 + * @interface IMsgChannelCloseConfirmResponse + */ + + /** + * Constructs a new MsgChannelCloseConfirmResponse. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a MsgChannelCloseConfirmResponse. + * @implements IMsgChannelCloseConfirmResponse + * @constructor + * @param {ibc.core.channel.v1.IMsgChannelCloseConfirmResponse=} [properties] Properties to set + */ + function MsgChannelCloseConfirmResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgChannelCloseConfirmResponse instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.MsgChannelCloseConfirmResponse + * @static + * @param {ibc.core.channel.v1.IMsgChannelCloseConfirmResponse=} [properties] Properties to set + * @returns {ibc.core.channel.v1.MsgChannelCloseConfirmResponse} MsgChannelCloseConfirmResponse instance + */ + MsgChannelCloseConfirmResponse.create = function create(properties) { + return new MsgChannelCloseConfirmResponse(properties); + }; + + /** + * Encodes the specified MsgChannelCloseConfirmResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelCloseConfirmResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.MsgChannelCloseConfirmResponse + * @static + * @param {ibc.core.channel.v1.IMsgChannelCloseConfirmResponse} message MsgChannelCloseConfirmResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgChannelCloseConfirmResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgChannelCloseConfirmResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelCloseConfirmResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.MsgChannelCloseConfirmResponse + * @static + * @param {ibc.core.channel.v1.IMsgChannelCloseConfirmResponse} message MsgChannelCloseConfirmResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgChannelCloseConfirmResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgChannelCloseConfirmResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.MsgChannelCloseConfirmResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.MsgChannelCloseConfirmResponse} MsgChannelCloseConfirmResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgChannelCloseConfirmResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelCloseConfirmResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgChannelCloseConfirmResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.MsgChannelCloseConfirmResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.MsgChannelCloseConfirmResponse} MsgChannelCloseConfirmResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgChannelCloseConfirmResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgChannelCloseConfirmResponse message. + * @function verify + * @memberof ibc.core.channel.v1.MsgChannelCloseConfirmResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgChannelCloseConfirmResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgChannelCloseConfirmResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.MsgChannelCloseConfirmResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.MsgChannelCloseConfirmResponse} MsgChannelCloseConfirmResponse + */ + MsgChannelCloseConfirmResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.MsgChannelCloseConfirmResponse) + return object; + return new $root.ibc.core.channel.v1.MsgChannelCloseConfirmResponse(); + }; + + /** + * Creates a plain object from a MsgChannelCloseConfirmResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.MsgChannelCloseConfirmResponse + * @static + * @param {ibc.core.channel.v1.MsgChannelCloseConfirmResponse} message MsgChannelCloseConfirmResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgChannelCloseConfirmResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgChannelCloseConfirmResponse to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.MsgChannelCloseConfirmResponse + * @instance + * @returns {Object.} JSON object + */ + MsgChannelCloseConfirmResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgChannelCloseConfirmResponse; + })(v1.MsgChannelCloseConfirmResponse || {}); + + v1.MsgRecvPacket = (function(MsgRecvPacket) { + + /** + * Properties of a MsgRecvPacket. + * @memberof ibc.core.channel.v1 + * @interface IMsgRecvPacket + * @property {ibc.core.channel.v1.IPacket|null} [packet] MsgRecvPacket packet + * @property {Uint8Array|null} [proofCommitment] MsgRecvPacket proofCommitment + * @property {ibc.core.client.v1.IHeight|null} [proofHeight] MsgRecvPacket proofHeight + * @property {string|null} [signer] MsgRecvPacket signer + */ + + /** + * Constructs a new MsgRecvPacket. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a MsgRecvPacket. + * @implements IMsgRecvPacket + * @constructor + * @param {ibc.core.channel.v1.IMsgRecvPacket=} [properties] Properties to set + */ + function MsgRecvPacket(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgRecvPacket packet. + * @member {ibc.core.channel.v1.IPacket|null|undefined} packet + * @memberof ibc.core.channel.v1.MsgRecvPacket + * @instance + */ + MsgRecvPacket.prototype.packet = null; + + /** + * MsgRecvPacket proofCommitment. + * @member {Uint8Array} proofCommitment + * @memberof ibc.core.channel.v1.MsgRecvPacket + * @instance + */ + MsgRecvPacket.prototype.proofCommitment = $util.newBuffer([]); + + /** + * MsgRecvPacket proofHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} proofHeight + * @memberof ibc.core.channel.v1.MsgRecvPacket + * @instance + */ + MsgRecvPacket.prototype.proofHeight = null; + + /** + * MsgRecvPacket signer. + * @member {string} signer + * @memberof ibc.core.channel.v1.MsgRecvPacket + * @instance + */ + MsgRecvPacket.prototype.signer = ""; + + /** + * Creates a new MsgRecvPacket instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.MsgRecvPacket + * @static + * @param {ibc.core.channel.v1.IMsgRecvPacket=} [properties] Properties to set + * @returns {ibc.core.channel.v1.MsgRecvPacket} MsgRecvPacket instance + */ + MsgRecvPacket.create = function create(properties) { + return new MsgRecvPacket(properties); + }; + + /** + * Encodes the specified MsgRecvPacket message. Does not implicitly {@link ibc.core.channel.v1.MsgRecvPacket.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.MsgRecvPacket + * @static + * @param {ibc.core.channel.v1.IMsgRecvPacket} message MsgRecvPacket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgRecvPacket.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.packet != null && Object.hasOwnProperty.call(message, "packet")) + $root.ibc.core.channel.v1.Packet.encode(message.packet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proofCommitment != null && Object.hasOwnProperty.call(message, "proofCommitment")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proofCommitment); + if (message.proofHeight != null && Object.hasOwnProperty.call(message, "proofHeight")) + $root.ibc.core.client.v1.Height.encode(message.proofHeight, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.signer); + return writer; + }; + + /** + * Encodes the specified MsgRecvPacket message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgRecvPacket.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.MsgRecvPacket + * @static + * @param {ibc.core.channel.v1.IMsgRecvPacket} message MsgRecvPacket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgRecvPacket.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgRecvPacket message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.MsgRecvPacket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.MsgRecvPacket} MsgRecvPacket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgRecvPacket.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgRecvPacket(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.packet = $root.ibc.core.channel.v1.Packet.decode(reader, reader.uint32()); + break; + case 2: + message.proofCommitment = reader.bytes(); + break; + case 3: + message.proofHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + case 4: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgRecvPacket message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.MsgRecvPacket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.MsgRecvPacket} MsgRecvPacket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgRecvPacket.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgRecvPacket message. + * @function verify + * @memberof ibc.core.channel.v1.MsgRecvPacket + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgRecvPacket.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.packet != null && message.hasOwnProperty("packet")) { + let error = $root.ibc.core.channel.v1.Packet.verify(message.packet); + if (error) + return "packet." + error; + } + if (message.proofCommitment != null && message.hasOwnProperty("proofCommitment")) + if (!(message.proofCommitment && typeof message.proofCommitment.length === "number" || $util.isString(message.proofCommitment))) + return "proofCommitment: buffer expected"; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) { + let error = $root.ibc.core.client.v1.Height.verify(message.proofHeight); + if (error) + return "proofHeight." + error; + } + if (message.signer != null && message.hasOwnProperty("signer")) + if (!$util.isString(message.signer)) + return "signer: string expected"; + return null; + }; + + /** + * Creates a MsgRecvPacket message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.MsgRecvPacket + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.MsgRecvPacket} MsgRecvPacket + */ + MsgRecvPacket.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.MsgRecvPacket) + return object; + let message = new $root.ibc.core.channel.v1.MsgRecvPacket(); + if (object.packet != null) { + if (typeof object.packet !== "object") + throw TypeError(".ibc.core.channel.v1.MsgRecvPacket.packet: object expected"); + message.packet = $root.ibc.core.channel.v1.Packet.fromObject(object.packet); + } + if (object.proofCommitment != null) + if (typeof object.proofCommitment === "string") + $util.base64.decode(object.proofCommitment, message.proofCommitment = $util.newBuffer($util.base64.length(object.proofCommitment)), 0); + else if (object.proofCommitment.length) + message.proofCommitment = object.proofCommitment; + if (object.proofHeight != null) { + if (typeof object.proofHeight !== "object") + throw TypeError(".ibc.core.channel.v1.MsgRecvPacket.proofHeight: object expected"); + message.proofHeight = $root.ibc.core.client.v1.Height.fromObject(object.proofHeight); + } + if (object.signer != null) + message.signer = String(object.signer); + return message; + }; + + /** + * Creates a plain object from a MsgRecvPacket message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.MsgRecvPacket + * @static + * @param {ibc.core.channel.v1.MsgRecvPacket} message MsgRecvPacket + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgRecvPacket.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.packet = null; + if (options.bytes === String) + object.proofCommitment = ""; + else { + object.proofCommitment = []; + if (options.bytes !== Array) + object.proofCommitment = $util.newBuffer(object.proofCommitment); + } + object.proofHeight = null; + object.signer = ""; + } + if (message.packet != null && message.hasOwnProperty("packet")) + object.packet = $root.ibc.core.channel.v1.Packet.toObject(message.packet, options); + if (message.proofCommitment != null && message.hasOwnProperty("proofCommitment")) + object.proofCommitment = options.bytes === String ? $util.base64.encode(message.proofCommitment, 0, message.proofCommitment.length) : options.bytes === Array ? Array.prototype.slice.call(message.proofCommitment) : message.proofCommitment; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) + object.proofHeight = $root.ibc.core.client.v1.Height.toObject(message.proofHeight, options); + if (message.signer != null && message.hasOwnProperty("signer")) + object.signer = message.signer; + return object; + }; + + /** + * Converts this MsgRecvPacket to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.MsgRecvPacket + * @instance + * @returns {Object.} JSON object + */ + MsgRecvPacket.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgRecvPacket; + })(v1.MsgRecvPacket || {}); + + v1.MsgRecvPacketResponse = (function(MsgRecvPacketResponse) { + + /** + * Properties of a MsgRecvPacketResponse. + * @memberof ibc.core.channel.v1 + * @interface IMsgRecvPacketResponse + */ + + /** + * Constructs a new MsgRecvPacketResponse. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a MsgRecvPacketResponse. + * @implements IMsgRecvPacketResponse + * @constructor + * @param {ibc.core.channel.v1.IMsgRecvPacketResponse=} [properties] Properties to set + */ + function MsgRecvPacketResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgRecvPacketResponse instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.MsgRecvPacketResponse + * @static + * @param {ibc.core.channel.v1.IMsgRecvPacketResponse=} [properties] Properties to set + * @returns {ibc.core.channel.v1.MsgRecvPacketResponse} MsgRecvPacketResponse instance + */ + MsgRecvPacketResponse.create = function create(properties) { + return new MsgRecvPacketResponse(properties); + }; + + /** + * Encodes the specified MsgRecvPacketResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgRecvPacketResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.MsgRecvPacketResponse + * @static + * @param {ibc.core.channel.v1.IMsgRecvPacketResponse} message MsgRecvPacketResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgRecvPacketResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgRecvPacketResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgRecvPacketResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.MsgRecvPacketResponse + * @static + * @param {ibc.core.channel.v1.IMsgRecvPacketResponse} message MsgRecvPacketResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgRecvPacketResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgRecvPacketResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.MsgRecvPacketResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.MsgRecvPacketResponse} MsgRecvPacketResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgRecvPacketResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgRecvPacketResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgRecvPacketResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.MsgRecvPacketResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.MsgRecvPacketResponse} MsgRecvPacketResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgRecvPacketResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgRecvPacketResponse message. + * @function verify + * @memberof ibc.core.channel.v1.MsgRecvPacketResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgRecvPacketResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgRecvPacketResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.MsgRecvPacketResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.MsgRecvPacketResponse} MsgRecvPacketResponse + */ + MsgRecvPacketResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.MsgRecvPacketResponse) + return object; + return new $root.ibc.core.channel.v1.MsgRecvPacketResponse(); + }; + + /** + * Creates a plain object from a MsgRecvPacketResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.MsgRecvPacketResponse + * @static + * @param {ibc.core.channel.v1.MsgRecvPacketResponse} message MsgRecvPacketResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgRecvPacketResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgRecvPacketResponse to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.MsgRecvPacketResponse + * @instance + * @returns {Object.} JSON object + */ + MsgRecvPacketResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgRecvPacketResponse; + })(v1.MsgRecvPacketResponse || {}); + + v1.MsgTimeout = (function(MsgTimeout) { + + /** + * Properties of a MsgTimeout. + * @memberof ibc.core.channel.v1 + * @interface IMsgTimeout + * @property {ibc.core.channel.v1.IPacket|null} [packet] MsgTimeout packet + * @property {Uint8Array|null} [proofUnreceived] MsgTimeout proofUnreceived + * @property {ibc.core.client.v1.IHeight|null} [proofHeight] MsgTimeout proofHeight + * @property {number|Long|null} [nextSequenceRecv] MsgTimeout nextSequenceRecv + * @property {string|null} [signer] MsgTimeout signer + */ + + /** + * Constructs a new MsgTimeout. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a MsgTimeout. + * @implements IMsgTimeout + * @constructor + * @param {ibc.core.channel.v1.IMsgTimeout=} [properties] Properties to set + */ + function MsgTimeout(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgTimeout packet. + * @member {ibc.core.channel.v1.IPacket|null|undefined} packet + * @memberof ibc.core.channel.v1.MsgTimeout + * @instance + */ + MsgTimeout.prototype.packet = null; + + /** + * MsgTimeout proofUnreceived. + * @member {Uint8Array} proofUnreceived + * @memberof ibc.core.channel.v1.MsgTimeout + * @instance + */ + MsgTimeout.prototype.proofUnreceived = $util.newBuffer([]); + + /** + * MsgTimeout proofHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} proofHeight + * @memberof ibc.core.channel.v1.MsgTimeout + * @instance + */ + MsgTimeout.prototype.proofHeight = null; + + /** + * MsgTimeout nextSequenceRecv. + * @member {number|Long} nextSequenceRecv + * @memberof ibc.core.channel.v1.MsgTimeout + * @instance + */ + MsgTimeout.prototype.nextSequenceRecv = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * MsgTimeout signer. + * @member {string} signer + * @memberof ibc.core.channel.v1.MsgTimeout + * @instance + */ + MsgTimeout.prototype.signer = ""; + + /** + * Creates a new MsgTimeout instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.MsgTimeout + * @static + * @param {ibc.core.channel.v1.IMsgTimeout=} [properties] Properties to set + * @returns {ibc.core.channel.v1.MsgTimeout} MsgTimeout instance + */ + MsgTimeout.create = function create(properties) { + return new MsgTimeout(properties); + }; + + /** + * Encodes the specified MsgTimeout message. Does not implicitly {@link ibc.core.channel.v1.MsgTimeout.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.MsgTimeout + * @static + * @param {ibc.core.channel.v1.IMsgTimeout} message MsgTimeout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgTimeout.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.packet != null && Object.hasOwnProperty.call(message, "packet")) + $root.ibc.core.channel.v1.Packet.encode(message.packet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proofUnreceived != null && Object.hasOwnProperty.call(message, "proofUnreceived")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proofUnreceived); + if (message.proofHeight != null && Object.hasOwnProperty.call(message, "proofHeight")) + $root.ibc.core.client.v1.Height.encode(message.proofHeight, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.nextSequenceRecv != null && Object.hasOwnProperty.call(message, "nextSequenceRecv")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.nextSequenceRecv); + if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.signer); + return writer; + }; + + /** + * Encodes the specified MsgTimeout message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgTimeout.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.MsgTimeout + * @static + * @param {ibc.core.channel.v1.IMsgTimeout} message MsgTimeout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgTimeout.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgTimeout message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.MsgTimeout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.MsgTimeout} MsgTimeout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgTimeout.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgTimeout(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.packet = $root.ibc.core.channel.v1.Packet.decode(reader, reader.uint32()); + break; + case 2: + message.proofUnreceived = reader.bytes(); + break; + case 3: + message.proofHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + case 4: + message.nextSequenceRecv = reader.uint64(); + break; + case 5: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgTimeout message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.MsgTimeout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.MsgTimeout} MsgTimeout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgTimeout.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgTimeout message. + * @function verify + * @memberof ibc.core.channel.v1.MsgTimeout + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgTimeout.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.packet != null && message.hasOwnProperty("packet")) { + let error = $root.ibc.core.channel.v1.Packet.verify(message.packet); + if (error) + return "packet." + error; + } + if (message.proofUnreceived != null && message.hasOwnProperty("proofUnreceived")) + if (!(message.proofUnreceived && typeof message.proofUnreceived.length === "number" || $util.isString(message.proofUnreceived))) + return "proofUnreceived: buffer expected"; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) { + let error = $root.ibc.core.client.v1.Height.verify(message.proofHeight); + if (error) + return "proofHeight." + error; + } + if (message.nextSequenceRecv != null && message.hasOwnProperty("nextSequenceRecv")) + if (!$util.isInteger(message.nextSequenceRecv) && !(message.nextSequenceRecv && $util.isInteger(message.nextSequenceRecv.low) && $util.isInteger(message.nextSequenceRecv.high))) + return "nextSequenceRecv: integer|Long expected"; + if (message.signer != null && message.hasOwnProperty("signer")) + if (!$util.isString(message.signer)) + return "signer: string expected"; + return null; + }; + + /** + * Creates a MsgTimeout message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.MsgTimeout + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.MsgTimeout} MsgTimeout + */ + MsgTimeout.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.MsgTimeout) + return object; + let message = new $root.ibc.core.channel.v1.MsgTimeout(); + if (object.packet != null) { + if (typeof object.packet !== "object") + throw TypeError(".ibc.core.channel.v1.MsgTimeout.packet: object expected"); + message.packet = $root.ibc.core.channel.v1.Packet.fromObject(object.packet); + } + if (object.proofUnreceived != null) + if (typeof object.proofUnreceived === "string") + $util.base64.decode(object.proofUnreceived, message.proofUnreceived = $util.newBuffer($util.base64.length(object.proofUnreceived)), 0); + else if (object.proofUnreceived.length) + message.proofUnreceived = object.proofUnreceived; + if (object.proofHeight != null) { + if (typeof object.proofHeight !== "object") + throw TypeError(".ibc.core.channel.v1.MsgTimeout.proofHeight: object expected"); + message.proofHeight = $root.ibc.core.client.v1.Height.fromObject(object.proofHeight); + } + if (object.nextSequenceRecv != null) + if ($util.Long) + (message.nextSequenceRecv = $util.Long.fromValue(object.nextSequenceRecv)).unsigned = true; + else if (typeof object.nextSequenceRecv === "string") + message.nextSequenceRecv = parseInt(object.nextSequenceRecv, 10); + else if (typeof object.nextSequenceRecv === "number") + message.nextSequenceRecv = object.nextSequenceRecv; + else if (typeof object.nextSequenceRecv === "object") + message.nextSequenceRecv = new $util.LongBits(object.nextSequenceRecv.low >>> 0, object.nextSequenceRecv.high >>> 0).toNumber(true); + if (object.signer != null) + message.signer = String(object.signer); + return message; + }; + + /** + * Creates a plain object from a MsgTimeout message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.MsgTimeout + * @static + * @param {ibc.core.channel.v1.MsgTimeout} message MsgTimeout + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgTimeout.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.packet = null; + if (options.bytes === String) + object.proofUnreceived = ""; + else { + object.proofUnreceived = []; + if (options.bytes !== Array) + object.proofUnreceived = $util.newBuffer(object.proofUnreceived); + } + object.proofHeight = null; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.nextSequenceRecv = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nextSequenceRecv = options.longs === String ? "0" : 0; + object.signer = ""; + } + if (message.packet != null && message.hasOwnProperty("packet")) + object.packet = $root.ibc.core.channel.v1.Packet.toObject(message.packet, options); + if (message.proofUnreceived != null && message.hasOwnProperty("proofUnreceived")) + object.proofUnreceived = options.bytes === String ? $util.base64.encode(message.proofUnreceived, 0, message.proofUnreceived.length) : options.bytes === Array ? Array.prototype.slice.call(message.proofUnreceived) : message.proofUnreceived; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) + object.proofHeight = $root.ibc.core.client.v1.Height.toObject(message.proofHeight, options); + if (message.nextSequenceRecv != null && message.hasOwnProperty("nextSequenceRecv")) + if (typeof message.nextSequenceRecv === "number") + object.nextSequenceRecv = options.longs === String ? String(message.nextSequenceRecv) : message.nextSequenceRecv; + else + object.nextSequenceRecv = options.longs === String ? $util.Long.prototype.toString.call(message.nextSequenceRecv) : options.longs === Number ? new $util.LongBits(message.nextSequenceRecv.low >>> 0, message.nextSequenceRecv.high >>> 0).toNumber(true) : message.nextSequenceRecv; + if (message.signer != null && message.hasOwnProperty("signer")) + object.signer = message.signer; + return object; + }; + + /** + * Converts this MsgTimeout to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.MsgTimeout + * @instance + * @returns {Object.} JSON object + */ + MsgTimeout.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgTimeout; + })(v1.MsgTimeout || {}); + + v1.MsgTimeoutResponse = (function(MsgTimeoutResponse) { + + /** + * Properties of a MsgTimeoutResponse. + * @memberof ibc.core.channel.v1 + * @interface IMsgTimeoutResponse + */ + + /** + * Constructs a new MsgTimeoutResponse. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a MsgTimeoutResponse. + * @implements IMsgTimeoutResponse + * @constructor + * @param {ibc.core.channel.v1.IMsgTimeoutResponse=} [properties] Properties to set + */ + function MsgTimeoutResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgTimeoutResponse instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.MsgTimeoutResponse + * @static + * @param {ibc.core.channel.v1.IMsgTimeoutResponse=} [properties] Properties to set + * @returns {ibc.core.channel.v1.MsgTimeoutResponse} MsgTimeoutResponse instance + */ + MsgTimeoutResponse.create = function create(properties) { + return new MsgTimeoutResponse(properties); + }; + + /** + * Encodes the specified MsgTimeoutResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgTimeoutResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.MsgTimeoutResponse + * @static + * @param {ibc.core.channel.v1.IMsgTimeoutResponse} message MsgTimeoutResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgTimeoutResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgTimeoutResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgTimeoutResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.MsgTimeoutResponse + * @static + * @param {ibc.core.channel.v1.IMsgTimeoutResponse} message MsgTimeoutResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgTimeoutResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgTimeoutResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.MsgTimeoutResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.MsgTimeoutResponse} MsgTimeoutResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgTimeoutResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgTimeoutResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgTimeoutResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.MsgTimeoutResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.MsgTimeoutResponse} MsgTimeoutResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgTimeoutResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgTimeoutResponse message. + * @function verify + * @memberof ibc.core.channel.v1.MsgTimeoutResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgTimeoutResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgTimeoutResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.MsgTimeoutResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.MsgTimeoutResponse} MsgTimeoutResponse + */ + MsgTimeoutResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.MsgTimeoutResponse) + return object; + return new $root.ibc.core.channel.v1.MsgTimeoutResponse(); + }; + + /** + * Creates a plain object from a MsgTimeoutResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.MsgTimeoutResponse + * @static + * @param {ibc.core.channel.v1.MsgTimeoutResponse} message MsgTimeoutResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgTimeoutResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgTimeoutResponse to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.MsgTimeoutResponse + * @instance + * @returns {Object.} JSON object + */ + MsgTimeoutResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgTimeoutResponse; + })(v1.MsgTimeoutResponse || {}); + + v1.MsgTimeoutOnClose = (function(MsgTimeoutOnClose) { + + /** + * Properties of a MsgTimeoutOnClose. + * @memberof ibc.core.channel.v1 + * @interface IMsgTimeoutOnClose + * @property {ibc.core.channel.v1.IPacket|null} [packet] MsgTimeoutOnClose packet + * @property {Uint8Array|null} [proofUnreceived] MsgTimeoutOnClose proofUnreceived + * @property {Uint8Array|null} [proofClose] MsgTimeoutOnClose proofClose + * @property {ibc.core.client.v1.IHeight|null} [proofHeight] MsgTimeoutOnClose proofHeight + * @property {number|Long|null} [nextSequenceRecv] MsgTimeoutOnClose nextSequenceRecv + * @property {string|null} [signer] MsgTimeoutOnClose signer + */ + + /** + * Constructs a new MsgTimeoutOnClose. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a MsgTimeoutOnClose. + * @implements IMsgTimeoutOnClose + * @constructor + * @param {ibc.core.channel.v1.IMsgTimeoutOnClose=} [properties] Properties to set + */ + function MsgTimeoutOnClose(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgTimeoutOnClose packet. + * @member {ibc.core.channel.v1.IPacket|null|undefined} packet + * @memberof ibc.core.channel.v1.MsgTimeoutOnClose + * @instance + */ + MsgTimeoutOnClose.prototype.packet = null; + + /** + * MsgTimeoutOnClose proofUnreceived. + * @member {Uint8Array} proofUnreceived + * @memberof ibc.core.channel.v1.MsgTimeoutOnClose + * @instance + */ + MsgTimeoutOnClose.prototype.proofUnreceived = $util.newBuffer([]); + + /** + * MsgTimeoutOnClose proofClose. + * @member {Uint8Array} proofClose + * @memberof ibc.core.channel.v1.MsgTimeoutOnClose + * @instance + */ + MsgTimeoutOnClose.prototype.proofClose = $util.newBuffer([]); + + /** + * MsgTimeoutOnClose proofHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} proofHeight + * @memberof ibc.core.channel.v1.MsgTimeoutOnClose + * @instance + */ + MsgTimeoutOnClose.prototype.proofHeight = null; + + /** + * MsgTimeoutOnClose nextSequenceRecv. + * @member {number|Long} nextSequenceRecv + * @memberof ibc.core.channel.v1.MsgTimeoutOnClose + * @instance + */ + MsgTimeoutOnClose.prototype.nextSequenceRecv = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * MsgTimeoutOnClose signer. + * @member {string} signer + * @memberof ibc.core.channel.v1.MsgTimeoutOnClose + * @instance + */ + MsgTimeoutOnClose.prototype.signer = ""; + + /** + * Creates a new MsgTimeoutOnClose instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.MsgTimeoutOnClose + * @static + * @param {ibc.core.channel.v1.IMsgTimeoutOnClose=} [properties] Properties to set + * @returns {ibc.core.channel.v1.MsgTimeoutOnClose} MsgTimeoutOnClose instance + */ + MsgTimeoutOnClose.create = function create(properties) { + return new MsgTimeoutOnClose(properties); + }; + + /** + * Encodes the specified MsgTimeoutOnClose message. Does not implicitly {@link ibc.core.channel.v1.MsgTimeoutOnClose.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.MsgTimeoutOnClose + * @static + * @param {ibc.core.channel.v1.IMsgTimeoutOnClose} message MsgTimeoutOnClose message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgTimeoutOnClose.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.packet != null && Object.hasOwnProperty.call(message, "packet")) + $root.ibc.core.channel.v1.Packet.encode(message.packet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proofUnreceived != null && Object.hasOwnProperty.call(message, "proofUnreceived")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proofUnreceived); + if (message.proofClose != null && Object.hasOwnProperty.call(message, "proofClose")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.proofClose); + if (message.proofHeight != null && Object.hasOwnProperty.call(message, "proofHeight")) + $root.ibc.core.client.v1.Height.encode(message.proofHeight, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.nextSequenceRecv != null && Object.hasOwnProperty.call(message, "nextSequenceRecv")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.nextSequenceRecv); + if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.signer); + return writer; + }; + + /** + * Encodes the specified MsgTimeoutOnClose message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgTimeoutOnClose.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.MsgTimeoutOnClose + * @static + * @param {ibc.core.channel.v1.IMsgTimeoutOnClose} message MsgTimeoutOnClose message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgTimeoutOnClose.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgTimeoutOnClose message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.MsgTimeoutOnClose + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.MsgTimeoutOnClose} MsgTimeoutOnClose + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgTimeoutOnClose.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgTimeoutOnClose(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.packet = $root.ibc.core.channel.v1.Packet.decode(reader, reader.uint32()); + break; + case 2: + message.proofUnreceived = reader.bytes(); + break; + case 3: + message.proofClose = reader.bytes(); + break; + case 4: + message.proofHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + case 5: + message.nextSequenceRecv = reader.uint64(); + break; + case 6: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgTimeoutOnClose message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.MsgTimeoutOnClose + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.MsgTimeoutOnClose} MsgTimeoutOnClose + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgTimeoutOnClose.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgTimeoutOnClose message. + * @function verify + * @memberof ibc.core.channel.v1.MsgTimeoutOnClose + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgTimeoutOnClose.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.packet != null && message.hasOwnProperty("packet")) { + let error = $root.ibc.core.channel.v1.Packet.verify(message.packet); + if (error) + return "packet." + error; + } + if (message.proofUnreceived != null && message.hasOwnProperty("proofUnreceived")) + if (!(message.proofUnreceived && typeof message.proofUnreceived.length === "number" || $util.isString(message.proofUnreceived))) + return "proofUnreceived: buffer expected"; + if (message.proofClose != null && message.hasOwnProperty("proofClose")) + if (!(message.proofClose && typeof message.proofClose.length === "number" || $util.isString(message.proofClose))) + return "proofClose: buffer expected"; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) { + let error = $root.ibc.core.client.v1.Height.verify(message.proofHeight); + if (error) + return "proofHeight." + error; + } + if (message.nextSequenceRecv != null && message.hasOwnProperty("nextSequenceRecv")) + if (!$util.isInteger(message.nextSequenceRecv) && !(message.nextSequenceRecv && $util.isInteger(message.nextSequenceRecv.low) && $util.isInteger(message.nextSequenceRecv.high))) + return "nextSequenceRecv: integer|Long expected"; + if (message.signer != null && message.hasOwnProperty("signer")) + if (!$util.isString(message.signer)) + return "signer: string expected"; + return null; + }; + + /** + * Creates a MsgTimeoutOnClose message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.MsgTimeoutOnClose + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.MsgTimeoutOnClose} MsgTimeoutOnClose + */ + MsgTimeoutOnClose.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.MsgTimeoutOnClose) + return object; + let message = new $root.ibc.core.channel.v1.MsgTimeoutOnClose(); + if (object.packet != null) { + if (typeof object.packet !== "object") + throw TypeError(".ibc.core.channel.v1.MsgTimeoutOnClose.packet: object expected"); + message.packet = $root.ibc.core.channel.v1.Packet.fromObject(object.packet); + } + if (object.proofUnreceived != null) + if (typeof object.proofUnreceived === "string") + $util.base64.decode(object.proofUnreceived, message.proofUnreceived = $util.newBuffer($util.base64.length(object.proofUnreceived)), 0); + else if (object.proofUnreceived.length) + message.proofUnreceived = object.proofUnreceived; + if (object.proofClose != null) + if (typeof object.proofClose === "string") + $util.base64.decode(object.proofClose, message.proofClose = $util.newBuffer($util.base64.length(object.proofClose)), 0); + else if (object.proofClose.length) + message.proofClose = object.proofClose; + if (object.proofHeight != null) { + if (typeof object.proofHeight !== "object") + throw TypeError(".ibc.core.channel.v1.MsgTimeoutOnClose.proofHeight: object expected"); + message.proofHeight = $root.ibc.core.client.v1.Height.fromObject(object.proofHeight); + } + if (object.nextSequenceRecv != null) + if ($util.Long) + (message.nextSequenceRecv = $util.Long.fromValue(object.nextSequenceRecv)).unsigned = true; + else if (typeof object.nextSequenceRecv === "string") + message.nextSequenceRecv = parseInt(object.nextSequenceRecv, 10); + else if (typeof object.nextSequenceRecv === "number") + message.nextSequenceRecv = object.nextSequenceRecv; + else if (typeof object.nextSequenceRecv === "object") + message.nextSequenceRecv = new $util.LongBits(object.nextSequenceRecv.low >>> 0, object.nextSequenceRecv.high >>> 0).toNumber(true); + if (object.signer != null) + message.signer = String(object.signer); + return message; + }; + + /** + * Creates a plain object from a MsgTimeoutOnClose message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.MsgTimeoutOnClose + * @static + * @param {ibc.core.channel.v1.MsgTimeoutOnClose} message MsgTimeoutOnClose + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgTimeoutOnClose.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.packet = null; + if (options.bytes === String) + object.proofUnreceived = ""; + else { + object.proofUnreceived = []; + if (options.bytes !== Array) + object.proofUnreceived = $util.newBuffer(object.proofUnreceived); + } + if (options.bytes === String) + object.proofClose = ""; + else { + object.proofClose = []; + if (options.bytes !== Array) + object.proofClose = $util.newBuffer(object.proofClose); + } + object.proofHeight = null; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.nextSequenceRecv = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nextSequenceRecv = options.longs === String ? "0" : 0; + object.signer = ""; + } + if (message.packet != null && message.hasOwnProperty("packet")) + object.packet = $root.ibc.core.channel.v1.Packet.toObject(message.packet, options); + if (message.proofUnreceived != null && message.hasOwnProperty("proofUnreceived")) + object.proofUnreceived = options.bytes === String ? $util.base64.encode(message.proofUnreceived, 0, message.proofUnreceived.length) : options.bytes === Array ? Array.prototype.slice.call(message.proofUnreceived) : message.proofUnreceived; + if (message.proofClose != null && message.hasOwnProperty("proofClose")) + object.proofClose = options.bytes === String ? $util.base64.encode(message.proofClose, 0, message.proofClose.length) : options.bytes === Array ? Array.prototype.slice.call(message.proofClose) : message.proofClose; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) + object.proofHeight = $root.ibc.core.client.v1.Height.toObject(message.proofHeight, options); + if (message.nextSequenceRecv != null && message.hasOwnProperty("nextSequenceRecv")) + if (typeof message.nextSequenceRecv === "number") + object.nextSequenceRecv = options.longs === String ? String(message.nextSequenceRecv) : message.nextSequenceRecv; + else + object.nextSequenceRecv = options.longs === String ? $util.Long.prototype.toString.call(message.nextSequenceRecv) : options.longs === Number ? new $util.LongBits(message.nextSequenceRecv.low >>> 0, message.nextSequenceRecv.high >>> 0).toNumber(true) : message.nextSequenceRecv; + if (message.signer != null && message.hasOwnProperty("signer")) + object.signer = message.signer; + return object; + }; + + /** + * Converts this MsgTimeoutOnClose to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.MsgTimeoutOnClose + * @instance + * @returns {Object.} JSON object + */ + MsgTimeoutOnClose.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgTimeoutOnClose; + })(v1.MsgTimeoutOnClose || {}); + + v1.MsgTimeoutOnCloseResponse = (function(MsgTimeoutOnCloseResponse) { + + /** + * Properties of a MsgTimeoutOnCloseResponse. + * @memberof ibc.core.channel.v1 + * @interface IMsgTimeoutOnCloseResponse + */ + + /** + * Constructs a new MsgTimeoutOnCloseResponse. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a MsgTimeoutOnCloseResponse. + * @implements IMsgTimeoutOnCloseResponse + * @constructor + * @param {ibc.core.channel.v1.IMsgTimeoutOnCloseResponse=} [properties] Properties to set + */ + function MsgTimeoutOnCloseResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgTimeoutOnCloseResponse instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.MsgTimeoutOnCloseResponse + * @static + * @param {ibc.core.channel.v1.IMsgTimeoutOnCloseResponse=} [properties] Properties to set + * @returns {ibc.core.channel.v1.MsgTimeoutOnCloseResponse} MsgTimeoutOnCloseResponse instance + */ + MsgTimeoutOnCloseResponse.create = function create(properties) { + return new MsgTimeoutOnCloseResponse(properties); + }; + + /** + * Encodes the specified MsgTimeoutOnCloseResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgTimeoutOnCloseResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.MsgTimeoutOnCloseResponse + * @static + * @param {ibc.core.channel.v1.IMsgTimeoutOnCloseResponse} message MsgTimeoutOnCloseResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgTimeoutOnCloseResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgTimeoutOnCloseResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgTimeoutOnCloseResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.MsgTimeoutOnCloseResponse + * @static + * @param {ibc.core.channel.v1.IMsgTimeoutOnCloseResponse} message MsgTimeoutOnCloseResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgTimeoutOnCloseResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgTimeoutOnCloseResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.MsgTimeoutOnCloseResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.MsgTimeoutOnCloseResponse} MsgTimeoutOnCloseResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgTimeoutOnCloseResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgTimeoutOnCloseResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgTimeoutOnCloseResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.MsgTimeoutOnCloseResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.MsgTimeoutOnCloseResponse} MsgTimeoutOnCloseResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgTimeoutOnCloseResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgTimeoutOnCloseResponse message. + * @function verify + * @memberof ibc.core.channel.v1.MsgTimeoutOnCloseResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgTimeoutOnCloseResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgTimeoutOnCloseResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.MsgTimeoutOnCloseResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.MsgTimeoutOnCloseResponse} MsgTimeoutOnCloseResponse + */ + MsgTimeoutOnCloseResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.MsgTimeoutOnCloseResponse) + return object; + return new $root.ibc.core.channel.v1.MsgTimeoutOnCloseResponse(); + }; + + /** + * Creates a plain object from a MsgTimeoutOnCloseResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.MsgTimeoutOnCloseResponse + * @static + * @param {ibc.core.channel.v1.MsgTimeoutOnCloseResponse} message MsgTimeoutOnCloseResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgTimeoutOnCloseResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgTimeoutOnCloseResponse to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.MsgTimeoutOnCloseResponse + * @instance + * @returns {Object.} JSON object + */ + MsgTimeoutOnCloseResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgTimeoutOnCloseResponse; + })(v1.MsgTimeoutOnCloseResponse || {}); + + v1.MsgAcknowledgement = (function(MsgAcknowledgement) { + + /** + * Properties of a MsgAcknowledgement. + * @memberof ibc.core.channel.v1 + * @interface IMsgAcknowledgement + * @property {ibc.core.channel.v1.IPacket|null} [packet] MsgAcknowledgement packet + * @property {Uint8Array|null} [acknowledgement] MsgAcknowledgement acknowledgement + * @property {Uint8Array|null} [proofAcked] MsgAcknowledgement proofAcked + * @property {ibc.core.client.v1.IHeight|null} [proofHeight] MsgAcknowledgement proofHeight + * @property {string|null} [signer] MsgAcknowledgement signer + */ + + /** + * Constructs a new MsgAcknowledgement. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a MsgAcknowledgement. + * @implements IMsgAcknowledgement + * @constructor + * @param {ibc.core.channel.v1.IMsgAcknowledgement=} [properties] Properties to set + */ + function MsgAcknowledgement(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgAcknowledgement packet. + * @member {ibc.core.channel.v1.IPacket|null|undefined} packet + * @memberof ibc.core.channel.v1.MsgAcknowledgement + * @instance + */ + MsgAcknowledgement.prototype.packet = null; + + /** + * MsgAcknowledgement acknowledgement. + * @member {Uint8Array} acknowledgement + * @memberof ibc.core.channel.v1.MsgAcknowledgement + * @instance + */ + MsgAcknowledgement.prototype.acknowledgement = $util.newBuffer([]); + + /** + * MsgAcknowledgement proofAcked. + * @member {Uint8Array} proofAcked + * @memberof ibc.core.channel.v1.MsgAcknowledgement + * @instance + */ + MsgAcknowledgement.prototype.proofAcked = $util.newBuffer([]); + + /** + * MsgAcknowledgement proofHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} proofHeight + * @memberof ibc.core.channel.v1.MsgAcknowledgement + * @instance + */ + MsgAcknowledgement.prototype.proofHeight = null; + + /** + * MsgAcknowledgement signer. + * @member {string} signer + * @memberof ibc.core.channel.v1.MsgAcknowledgement + * @instance + */ + MsgAcknowledgement.prototype.signer = ""; + + /** + * Creates a new MsgAcknowledgement instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.MsgAcknowledgement + * @static + * @param {ibc.core.channel.v1.IMsgAcknowledgement=} [properties] Properties to set + * @returns {ibc.core.channel.v1.MsgAcknowledgement} MsgAcknowledgement instance + */ + MsgAcknowledgement.create = function create(properties) { + return new MsgAcknowledgement(properties); + }; + + /** + * Encodes the specified MsgAcknowledgement message. Does not implicitly {@link ibc.core.channel.v1.MsgAcknowledgement.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.MsgAcknowledgement + * @static + * @param {ibc.core.channel.v1.IMsgAcknowledgement} message MsgAcknowledgement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgAcknowledgement.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.packet != null && Object.hasOwnProperty.call(message, "packet")) + $root.ibc.core.channel.v1.Packet.encode(message.packet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.acknowledgement != null && Object.hasOwnProperty.call(message, "acknowledgement")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.acknowledgement); + if (message.proofAcked != null && Object.hasOwnProperty.call(message, "proofAcked")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.proofAcked); + if (message.proofHeight != null && Object.hasOwnProperty.call(message, "proofHeight")) + $root.ibc.core.client.v1.Height.encode(message.proofHeight, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.signer); + return writer; + }; + + /** + * Encodes the specified MsgAcknowledgement message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgAcknowledgement.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.MsgAcknowledgement + * @static + * @param {ibc.core.channel.v1.IMsgAcknowledgement} message MsgAcknowledgement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgAcknowledgement.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgAcknowledgement message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.MsgAcknowledgement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.MsgAcknowledgement} MsgAcknowledgement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgAcknowledgement.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgAcknowledgement(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.packet = $root.ibc.core.channel.v1.Packet.decode(reader, reader.uint32()); + break; + case 2: + message.acknowledgement = reader.bytes(); + break; + case 3: + message.proofAcked = reader.bytes(); + break; + case 4: + message.proofHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + case 5: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgAcknowledgement message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.MsgAcknowledgement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.MsgAcknowledgement} MsgAcknowledgement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgAcknowledgement.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgAcknowledgement message. + * @function verify + * @memberof ibc.core.channel.v1.MsgAcknowledgement + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgAcknowledgement.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.packet != null && message.hasOwnProperty("packet")) { + let error = $root.ibc.core.channel.v1.Packet.verify(message.packet); + if (error) + return "packet." + error; + } + if (message.acknowledgement != null && message.hasOwnProperty("acknowledgement")) + if (!(message.acknowledgement && typeof message.acknowledgement.length === "number" || $util.isString(message.acknowledgement))) + return "acknowledgement: buffer expected"; + if (message.proofAcked != null && message.hasOwnProperty("proofAcked")) + if (!(message.proofAcked && typeof message.proofAcked.length === "number" || $util.isString(message.proofAcked))) + return "proofAcked: buffer expected"; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) { + let error = $root.ibc.core.client.v1.Height.verify(message.proofHeight); + if (error) + return "proofHeight." + error; + } + if (message.signer != null && message.hasOwnProperty("signer")) + if (!$util.isString(message.signer)) + return "signer: string expected"; + return null; + }; + + /** + * Creates a MsgAcknowledgement message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.MsgAcknowledgement + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.MsgAcknowledgement} MsgAcknowledgement + */ + MsgAcknowledgement.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.MsgAcknowledgement) + return object; + let message = new $root.ibc.core.channel.v1.MsgAcknowledgement(); + if (object.packet != null) { + if (typeof object.packet !== "object") + throw TypeError(".ibc.core.channel.v1.MsgAcknowledgement.packet: object expected"); + message.packet = $root.ibc.core.channel.v1.Packet.fromObject(object.packet); + } + if (object.acknowledgement != null) + if (typeof object.acknowledgement === "string") + $util.base64.decode(object.acknowledgement, message.acknowledgement = $util.newBuffer($util.base64.length(object.acknowledgement)), 0); + else if (object.acknowledgement.length) + message.acknowledgement = object.acknowledgement; + if (object.proofAcked != null) + if (typeof object.proofAcked === "string") + $util.base64.decode(object.proofAcked, message.proofAcked = $util.newBuffer($util.base64.length(object.proofAcked)), 0); + else if (object.proofAcked.length) + message.proofAcked = object.proofAcked; + if (object.proofHeight != null) { + if (typeof object.proofHeight !== "object") + throw TypeError(".ibc.core.channel.v1.MsgAcknowledgement.proofHeight: object expected"); + message.proofHeight = $root.ibc.core.client.v1.Height.fromObject(object.proofHeight); + } + if (object.signer != null) + message.signer = String(object.signer); + return message; + }; + + /** + * Creates a plain object from a MsgAcknowledgement message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.MsgAcknowledgement + * @static + * @param {ibc.core.channel.v1.MsgAcknowledgement} message MsgAcknowledgement + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgAcknowledgement.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.packet = null; + if (options.bytes === String) + object.acknowledgement = ""; + else { + object.acknowledgement = []; + if (options.bytes !== Array) + object.acknowledgement = $util.newBuffer(object.acknowledgement); + } + if (options.bytes === String) + object.proofAcked = ""; + else { + object.proofAcked = []; + if (options.bytes !== Array) + object.proofAcked = $util.newBuffer(object.proofAcked); + } + object.proofHeight = null; + object.signer = ""; + } + if (message.packet != null && message.hasOwnProperty("packet")) + object.packet = $root.ibc.core.channel.v1.Packet.toObject(message.packet, options); + if (message.acknowledgement != null && message.hasOwnProperty("acknowledgement")) + object.acknowledgement = options.bytes === String ? $util.base64.encode(message.acknowledgement, 0, message.acknowledgement.length) : options.bytes === Array ? Array.prototype.slice.call(message.acknowledgement) : message.acknowledgement; + if (message.proofAcked != null && message.hasOwnProperty("proofAcked")) + object.proofAcked = options.bytes === String ? $util.base64.encode(message.proofAcked, 0, message.proofAcked.length) : options.bytes === Array ? Array.prototype.slice.call(message.proofAcked) : message.proofAcked; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) + object.proofHeight = $root.ibc.core.client.v1.Height.toObject(message.proofHeight, options); + if (message.signer != null && message.hasOwnProperty("signer")) + object.signer = message.signer; + return object; + }; + + /** + * Converts this MsgAcknowledgement to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.MsgAcknowledgement + * @instance + * @returns {Object.} JSON object + */ + MsgAcknowledgement.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgAcknowledgement; + })(v1.MsgAcknowledgement || {}); + + v1.MsgAcknowledgementResponse = (function(MsgAcknowledgementResponse) { + + /** + * Properties of a MsgAcknowledgementResponse. + * @memberof ibc.core.channel.v1 + * @interface IMsgAcknowledgementResponse + */ + + /** + * Constructs a new MsgAcknowledgementResponse. + * @memberof ibc.core.channel.v1 + * @classdesc Represents a MsgAcknowledgementResponse. + * @implements IMsgAcknowledgementResponse + * @constructor + * @param {ibc.core.channel.v1.IMsgAcknowledgementResponse=} [properties] Properties to set + */ + function MsgAcknowledgementResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgAcknowledgementResponse instance using the specified properties. + * @function create + * @memberof ibc.core.channel.v1.MsgAcknowledgementResponse + * @static + * @param {ibc.core.channel.v1.IMsgAcknowledgementResponse=} [properties] Properties to set + * @returns {ibc.core.channel.v1.MsgAcknowledgementResponse} MsgAcknowledgementResponse instance + */ + MsgAcknowledgementResponse.create = function create(properties) { + return new MsgAcknowledgementResponse(properties); + }; + + /** + * Encodes the specified MsgAcknowledgementResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgAcknowledgementResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.channel.v1.MsgAcknowledgementResponse + * @static + * @param {ibc.core.channel.v1.IMsgAcknowledgementResponse} message MsgAcknowledgementResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgAcknowledgementResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgAcknowledgementResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgAcknowledgementResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.channel.v1.MsgAcknowledgementResponse + * @static + * @param {ibc.core.channel.v1.IMsgAcknowledgementResponse} message MsgAcknowledgementResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgAcknowledgementResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgAcknowledgementResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.channel.v1.MsgAcknowledgementResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.channel.v1.MsgAcknowledgementResponse} MsgAcknowledgementResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgAcknowledgementResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgAcknowledgementResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgAcknowledgementResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.channel.v1.MsgAcknowledgementResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.channel.v1.MsgAcknowledgementResponse} MsgAcknowledgementResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgAcknowledgementResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgAcknowledgementResponse message. + * @function verify + * @memberof ibc.core.channel.v1.MsgAcknowledgementResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgAcknowledgementResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgAcknowledgementResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.channel.v1.MsgAcknowledgementResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.channel.v1.MsgAcknowledgementResponse} MsgAcknowledgementResponse + */ + MsgAcknowledgementResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.channel.v1.MsgAcknowledgementResponse) + return object; + return new $root.ibc.core.channel.v1.MsgAcknowledgementResponse(); + }; + + /** + * Creates a plain object from a MsgAcknowledgementResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.channel.v1.MsgAcknowledgementResponse + * @static + * @param {ibc.core.channel.v1.MsgAcknowledgementResponse} message MsgAcknowledgementResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgAcknowledgementResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgAcknowledgementResponse to JSON. + * @function toJSON + * @memberof ibc.core.channel.v1.MsgAcknowledgementResponse + * @instance + * @returns {Object.} JSON object + */ + MsgAcknowledgementResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgAcknowledgementResponse; + })(v1.MsgAcknowledgementResponse || {}); + + return v1; + })(channel.v1 || {}); + + return channel; + })(core.channel || {}); + + /** + * Namespace client. + * @memberof ibc.core + * @namespace + */ + + core.client = (function(client) { + + /** + * Namespace v1. + * @memberof ibc.core.client + * @namespace + */ + + client.v1 = (function(v1) { + + v1.IdentifiedClientState = (function(IdentifiedClientState) { + + /** + * Properties of an IdentifiedClientState. + * @memberof ibc.core.client.v1 + * @interface IIdentifiedClientState + * @property {string|null} [clientId] IdentifiedClientState clientId + * @property {google.protobuf.IAny|null} [clientState] IdentifiedClientState clientState + */ + + /** + * Constructs a new IdentifiedClientState. + * @memberof ibc.core.client.v1 + * @classdesc Represents an IdentifiedClientState. + * @implements IIdentifiedClientState + * @constructor + * @param {ibc.core.client.v1.IIdentifiedClientState=} [properties] Properties to set + */ + function IdentifiedClientState(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IdentifiedClientState clientId. + * @member {string} clientId + * @memberof ibc.core.client.v1.IdentifiedClientState + * @instance + */ + IdentifiedClientState.prototype.clientId = ""; + + /** + * IdentifiedClientState clientState. + * @member {google.protobuf.IAny|null|undefined} clientState + * @memberof ibc.core.client.v1.IdentifiedClientState + * @instance + */ + IdentifiedClientState.prototype.clientState = null; + + /** + * Creates a new IdentifiedClientState instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.IdentifiedClientState + * @static + * @param {ibc.core.client.v1.IIdentifiedClientState=} [properties] Properties to set + * @returns {ibc.core.client.v1.IdentifiedClientState} IdentifiedClientState instance + */ + IdentifiedClientState.create = function create(properties) { + return new IdentifiedClientState(properties); + }; + + /** + * Encodes the specified IdentifiedClientState message. Does not implicitly {@link ibc.core.client.v1.IdentifiedClientState.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.IdentifiedClientState + * @static + * @param {ibc.core.client.v1.IIdentifiedClientState} message IdentifiedClientState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentifiedClientState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.clientState != null && Object.hasOwnProperty.call(message, "clientState")) + $root.google.protobuf.Any.encode(message.clientState, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IdentifiedClientState message, length delimited. Does not implicitly {@link ibc.core.client.v1.IdentifiedClientState.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.IdentifiedClientState + * @static + * @param {ibc.core.client.v1.IIdentifiedClientState} message IdentifiedClientState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentifiedClientState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentifiedClientState message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.IdentifiedClientState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.IdentifiedClientState} IdentifiedClientState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentifiedClientState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.IdentifiedClientState(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.clientState = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentifiedClientState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.IdentifiedClientState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.IdentifiedClientState} IdentifiedClientState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentifiedClientState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentifiedClientState message. + * @function verify + * @memberof ibc.core.client.v1.IdentifiedClientState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentifiedClientState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.clientState != null && message.hasOwnProperty("clientState")) { + let error = $root.google.protobuf.Any.verify(message.clientState); + if (error) + return "clientState." + error; + } + return null; + }; + + /** + * Creates an IdentifiedClientState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.IdentifiedClientState + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.IdentifiedClientState} IdentifiedClientState + */ + IdentifiedClientState.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.IdentifiedClientState) + return object; + let message = new $root.ibc.core.client.v1.IdentifiedClientState(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.clientState != null) { + if (typeof object.clientState !== "object") + throw TypeError(".ibc.core.client.v1.IdentifiedClientState.clientState: object expected"); + message.clientState = $root.google.protobuf.Any.fromObject(object.clientState); + } + return message; + }; + + /** + * Creates a plain object from an IdentifiedClientState message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.IdentifiedClientState + * @static + * @param {ibc.core.client.v1.IdentifiedClientState} message IdentifiedClientState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentifiedClientState.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.clientId = ""; + object.clientState = null; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.clientState != null && message.hasOwnProperty("clientState")) + object.clientState = $root.google.protobuf.Any.toObject(message.clientState, options); + return object; + }; + + /** + * Converts this IdentifiedClientState to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.IdentifiedClientState + * @instance + * @returns {Object.} JSON object + */ + IdentifiedClientState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentifiedClientState; + })(v1.IdentifiedClientState || {}); + + v1.ConsensusStateWithHeight = (function(ConsensusStateWithHeight) { + + /** + * Properties of a ConsensusStateWithHeight. + * @memberof ibc.core.client.v1 + * @interface IConsensusStateWithHeight + * @property {ibc.core.client.v1.IHeight|null} [height] ConsensusStateWithHeight height + * @property {google.protobuf.IAny|null} [consensusState] ConsensusStateWithHeight consensusState + */ + + /** + * Constructs a new ConsensusStateWithHeight. + * @memberof ibc.core.client.v1 + * @classdesc Represents a ConsensusStateWithHeight. + * @implements IConsensusStateWithHeight + * @constructor + * @param {ibc.core.client.v1.IConsensusStateWithHeight=} [properties] Properties to set + */ + function ConsensusStateWithHeight(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConsensusStateWithHeight height. + * @member {ibc.core.client.v1.IHeight|null|undefined} height + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @instance + */ + ConsensusStateWithHeight.prototype.height = null; + + /** + * ConsensusStateWithHeight consensusState. + * @member {google.protobuf.IAny|null|undefined} consensusState + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @instance + */ + ConsensusStateWithHeight.prototype.consensusState = null; + + /** + * Creates a new ConsensusStateWithHeight instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @static + * @param {ibc.core.client.v1.IConsensusStateWithHeight=} [properties] Properties to set + * @returns {ibc.core.client.v1.ConsensusStateWithHeight} ConsensusStateWithHeight instance + */ + ConsensusStateWithHeight.create = function create(properties) { + return new ConsensusStateWithHeight(properties); + }; + + /** + * Encodes the specified ConsensusStateWithHeight message. Does not implicitly {@link ibc.core.client.v1.ConsensusStateWithHeight.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @static + * @param {ibc.core.client.v1.IConsensusStateWithHeight} message ConsensusStateWithHeight message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusStateWithHeight.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + $root.ibc.core.client.v1.Height.encode(message.height, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.consensusState != null && Object.hasOwnProperty.call(message, "consensusState")) + $root.google.protobuf.Any.encode(message.consensusState, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConsensusStateWithHeight message, length delimited. Does not implicitly {@link ibc.core.client.v1.ConsensusStateWithHeight.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @static + * @param {ibc.core.client.v1.IConsensusStateWithHeight} message ConsensusStateWithHeight message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusStateWithHeight.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConsensusStateWithHeight message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.ConsensusStateWithHeight} ConsensusStateWithHeight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusStateWithHeight.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.ConsensusStateWithHeight(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + case 2: + message.consensusState = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConsensusStateWithHeight message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.ConsensusStateWithHeight} ConsensusStateWithHeight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusStateWithHeight.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConsensusStateWithHeight message. + * @function verify + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConsensusStateWithHeight.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) { + let error = $root.ibc.core.client.v1.Height.verify(message.height); + if (error) + return "height." + error; + } + if (message.consensusState != null && message.hasOwnProperty("consensusState")) { + let error = $root.google.protobuf.Any.verify(message.consensusState); + if (error) + return "consensusState." + error; + } + return null; + }; + + /** + * Creates a ConsensusStateWithHeight message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.ConsensusStateWithHeight} ConsensusStateWithHeight + */ + ConsensusStateWithHeight.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.ConsensusStateWithHeight) + return object; + let message = new $root.ibc.core.client.v1.ConsensusStateWithHeight(); + if (object.height != null) { + if (typeof object.height !== "object") + throw TypeError(".ibc.core.client.v1.ConsensusStateWithHeight.height: object expected"); + message.height = $root.ibc.core.client.v1.Height.fromObject(object.height); + } + if (object.consensusState != null) { + if (typeof object.consensusState !== "object") + throw TypeError(".ibc.core.client.v1.ConsensusStateWithHeight.consensusState: object expected"); + message.consensusState = $root.google.protobuf.Any.fromObject(object.consensusState); + } + return message; + }; + + /** + * Creates a plain object from a ConsensusStateWithHeight message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @static + * @param {ibc.core.client.v1.ConsensusStateWithHeight} message ConsensusStateWithHeight + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConsensusStateWithHeight.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.height = null; + object.consensusState = null; + } + if (message.height != null && message.hasOwnProperty("height")) + object.height = $root.ibc.core.client.v1.Height.toObject(message.height, options); + if (message.consensusState != null && message.hasOwnProperty("consensusState")) + object.consensusState = $root.google.protobuf.Any.toObject(message.consensusState, options); + return object; + }; + + /** + * Converts this ConsensusStateWithHeight to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @instance + * @returns {Object.} JSON object + */ + ConsensusStateWithHeight.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ConsensusStateWithHeight; + })(v1.ConsensusStateWithHeight || {}); + + v1.ClientConsensusStates = (function(ClientConsensusStates) { + + /** + * Properties of a ClientConsensusStates. + * @memberof ibc.core.client.v1 + * @interface IClientConsensusStates + * @property {string|null} [clientId] ClientConsensusStates clientId + * @property {Array.|null} [consensusStates] ClientConsensusStates consensusStates + */ + + /** + * Constructs a new ClientConsensusStates. + * @memberof ibc.core.client.v1 + * @classdesc Represents a ClientConsensusStates. + * @implements IClientConsensusStates + * @constructor + * @param {ibc.core.client.v1.IClientConsensusStates=} [properties] Properties to set + */ + function ClientConsensusStates(properties) { + this.consensusStates = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientConsensusStates clientId. + * @member {string} clientId + * @memberof ibc.core.client.v1.ClientConsensusStates + * @instance + */ + ClientConsensusStates.prototype.clientId = ""; + + /** + * ClientConsensusStates consensusStates. + * @member {Array.} consensusStates + * @memberof ibc.core.client.v1.ClientConsensusStates + * @instance + */ + ClientConsensusStates.prototype.consensusStates = $util.emptyArray; + + /** + * Creates a new ClientConsensusStates instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.ClientConsensusStates + * @static + * @param {ibc.core.client.v1.IClientConsensusStates=} [properties] Properties to set + * @returns {ibc.core.client.v1.ClientConsensusStates} ClientConsensusStates instance + */ + ClientConsensusStates.create = function create(properties) { + return new ClientConsensusStates(properties); + }; + + /** + * Encodes the specified ClientConsensusStates message. Does not implicitly {@link ibc.core.client.v1.ClientConsensusStates.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.ClientConsensusStates + * @static + * @param {ibc.core.client.v1.IClientConsensusStates} message ClientConsensusStates message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientConsensusStates.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.consensusStates != null && message.consensusStates.length) + for (let i = 0; i < message.consensusStates.length; ++i) + $root.ibc.core.client.v1.ConsensusStateWithHeight.encode(message.consensusStates[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientConsensusStates message, length delimited. Does not implicitly {@link ibc.core.client.v1.ClientConsensusStates.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.ClientConsensusStates + * @static + * @param {ibc.core.client.v1.IClientConsensusStates} message ClientConsensusStates message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientConsensusStates.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientConsensusStates message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.ClientConsensusStates + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.ClientConsensusStates} ClientConsensusStates + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientConsensusStates.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.ClientConsensusStates(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + if (!(message.consensusStates && message.consensusStates.length)) + message.consensusStates = []; + message.consensusStates.push($root.ibc.core.client.v1.ConsensusStateWithHeight.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientConsensusStates message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.ClientConsensusStates + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.ClientConsensusStates} ClientConsensusStates + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientConsensusStates.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientConsensusStates message. + * @function verify + * @memberof ibc.core.client.v1.ClientConsensusStates + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientConsensusStates.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.consensusStates != null && message.hasOwnProperty("consensusStates")) { + if (!Array.isArray(message.consensusStates)) + return "consensusStates: array expected"; + for (let i = 0; i < message.consensusStates.length; ++i) { + let error = $root.ibc.core.client.v1.ConsensusStateWithHeight.verify(message.consensusStates[i]); + if (error) + return "consensusStates." + error; + } + } + return null; + }; + + /** + * Creates a ClientConsensusStates message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.ClientConsensusStates + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.ClientConsensusStates} ClientConsensusStates + */ + ClientConsensusStates.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.ClientConsensusStates) + return object; + let message = new $root.ibc.core.client.v1.ClientConsensusStates(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.consensusStates) { + if (!Array.isArray(object.consensusStates)) + throw TypeError(".ibc.core.client.v1.ClientConsensusStates.consensusStates: array expected"); + message.consensusStates = []; + for (let i = 0; i < object.consensusStates.length; ++i) { + if (typeof object.consensusStates[i] !== "object") + throw TypeError(".ibc.core.client.v1.ClientConsensusStates.consensusStates: object expected"); + message.consensusStates[i] = $root.ibc.core.client.v1.ConsensusStateWithHeight.fromObject(object.consensusStates[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ClientConsensusStates message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.ClientConsensusStates + * @static + * @param {ibc.core.client.v1.ClientConsensusStates} message ClientConsensusStates + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientConsensusStates.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.consensusStates = []; + if (options.defaults) + object.clientId = ""; + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.consensusStates && message.consensusStates.length) { + object.consensusStates = []; + for (let j = 0; j < message.consensusStates.length; ++j) + object.consensusStates[j] = $root.ibc.core.client.v1.ConsensusStateWithHeight.toObject(message.consensusStates[j], options); + } + return object; + }; + + /** + * Converts this ClientConsensusStates to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.ClientConsensusStates + * @instance + * @returns {Object.} JSON object + */ + ClientConsensusStates.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ClientConsensusStates; + })(v1.ClientConsensusStates || {}); + + v1.ClientUpdateProposal = (function(ClientUpdateProposal) { + + /** + * Properties of a ClientUpdateProposal. + * @memberof ibc.core.client.v1 + * @interface IClientUpdateProposal + * @property {string|null} [title] ClientUpdateProposal title + * @property {string|null} [description] ClientUpdateProposal description + * @property {string|null} [clientId] ClientUpdateProposal clientId + * @property {google.protobuf.IAny|null} [header] ClientUpdateProposal header + */ + + /** + * Constructs a new ClientUpdateProposal. + * @memberof ibc.core.client.v1 + * @classdesc Represents a ClientUpdateProposal. + * @implements IClientUpdateProposal + * @constructor + * @param {ibc.core.client.v1.IClientUpdateProposal=} [properties] Properties to set + */ + function ClientUpdateProposal(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientUpdateProposal title. + * @member {string} title + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @instance + */ + ClientUpdateProposal.prototype.title = ""; + + /** + * ClientUpdateProposal description. + * @member {string} description + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @instance + */ + ClientUpdateProposal.prototype.description = ""; + + /** + * ClientUpdateProposal clientId. + * @member {string} clientId + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @instance + */ + ClientUpdateProposal.prototype.clientId = ""; + + /** + * ClientUpdateProposal header. + * @member {google.protobuf.IAny|null|undefined} header + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @instance + */ + ClientUpdateProposal.prototype.header = null; + + /** + * Creates a new ClientUpdateProposal instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @static + * @param {ibc.core.client.v1.IClientUpdateProposal=} [properties] Properties to set + * @returns {ibc.core.client.v1.ClientUpdateProposal} ClientUpdateProposal instance + */ + ClientUpdateProposal.create = function create(properties) { + return new ClientUpdateProposal(properties); + }; + + /** + * Encodes the specified ClientUpdateProposal message. Does not implicitly {@link ibc.core.client.v1.ClientUpdateProposal.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @static + * @param {ibc.core.client.v1.IClientUpdateProposal} message ClientUpdateProposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientUpdateProposal.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.clientId); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + $root.google.protobuf.Any.encode(message.header, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientUpdateProposal message, length delimited. Does not implicitly {@link ibc.core.client.v1.ClientUpdateProposal.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @static + * @param {ibc.core.client.v1.IClientUpdateProposal} message ClientUpdateProposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientUpdateProposal.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientUpdateProposal message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.ClientUpdateProposal} ClientUpdateProposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientUpdateProposal.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.ClientUpdateProposal(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.clientId = reader.string(); + break; + case 4: + message.header = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientUpdateProposal message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.ClientUpdateProposal} ClientUpdateProposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientUpdateProposal.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientUpdateProposal message. + * @function verify + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientUpdateProposal.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.header != null && message.hasOwnProperty("header")) { + let error = $root.google.protobuf.Any.verify(message.header); + if (error) + return "header." + error; + } + return null; + }; + + /** + * Creates a ClientUpdateProposal message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.ClientUpdateProposal} ClientUpdateProposal + */ + ClientUpdateProposal.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.ClientUpdateProposal) + return object; + let message = new $root.ibc.core.client.v1.ClientUpdateProposal(); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.header != null) { + if (typeof object.header !== "object") + throw TypeError(".ibc.core.client.v1.ClientUpdateProposal.header: object expected"); + message.header = $root.google.protobuf.Any.fromObject(object.header); + } + return message; + }; + + /** + * Creates a plain object from a ClientUpdateProposal message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @static + * @param {ibc.core.client.v1.ClientUpdateProposal} message ClientUpdateProposal + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientUpdateProposal.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.title = ""; + object.description = ""; + object.clientId = ""; + object.header = null; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.header != null && message.hasOwnProperty("header")) + object.header = $root.google.protobuf.Any.toObject(message.header, options); + return object; + }; + + /** + * Converts this ClientUpdateProposal to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @instance + * @returns {Object.} JSON object + */ + ClientUpdateProposal.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ClientUpdateProposal; + })(v1.ClientUpdateProposal || {}); + + v1.Height = (function(Height) { + + /** + * Properties of an Height. + * @memberof ibc.core.client.v1 + * @interface IHeight + * @property {number|Long|null} [revisionNumber] Height revisionNumber + * @property {number|Long|null} [revisionHeight] Height revisionHeight + */ + + /** + * Constructs a new Height. + * @memberof ibc.core.client.v1 + * @classdesc Represents an Height. + * @implements IHeight + * @constructor + * @param {ibc.core.client.v1.IHeight=} [properties] Properties to set + */ + function Height(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Height revisionNumber. + * @member {number|Long} revisionNumber + * @memberof ibc.core.client.v1.Height + * @instance + */ + Height.prototype.revisionNumber = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Height revisionHeight. + * @member {number|Long} revisionHeight + * @memberof ibc.core.client.v1.Height + * @instance + */ + Height.prototype.revisionHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new Height instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.Height + * @static + * @param {ibc.core.client.v1.IHeight=} [properties] Properties to set + * @returns {ibc.core.client.v1.Height} Height instance + */ + Height.create = function create(properties) { + return new Height(properties); + }; + + /** + * Encodes the specified Height message. Does not implicitly {@link ibc.core.client.v1.Height.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.Height + * @static + * @param {ibc.core.client.v1.IHeight} message Height message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Height.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.revisionNumber != null && Object.hasOwnProperty.call(message, "revisionNumber")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.revisionNumber); + if (message.revisionHeight != null && Object.hasOwnProperty.call(message, "revisionHeight")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.revisionHeight); + return writer; + }; + + /** + * Encodes the specified Height message, length delimited. Does not implicitly {@link ibc.core.client.v1.Height.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.Height + * @static + * @param {ibc.core.client.v1.IHeight} message Height message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Height.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Height message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.Height + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.Height} Height + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Height.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.Height(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.revisionNumber = reader.uint64(); + break; + case 2: + message.revisionHeight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Height message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.Height + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.Height} Height + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Height.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Height message. + * @function verify + * @memberof ibc.core.client.v1.Height + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Height.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) + if (!$util.isInteger(message.revisionNumber) && !(message.revisionNumber && $util.isInteger(message.revisionNumber.low) && $util.isInteger(message.revisionNumber.high))) + return "revisionNumber: integer|Long expected"; + if (message.revisionHeight != null && message.hasOwnProperty("revisionHeight")) + if (!$util.isInteger(message.revisionHeight) && !(message.revisionHeight && $util.isInteger(message.revisionHeight.low) && $util.isInteger(message.revisionHeight.high))) + return "revisionHeight: integer|Long expected"; + return null; + }; + + /** + * Creates an Height message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.Height + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.Height} Height + */ + Height.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.Height) + return object; + let message = new $root.ibc.core.client.v1.Height(); + if (object.revisionNumber != null) + if ($util.Long) + (message.revisionNumber = $util.Long.fromValue(object.revisionNumber)).unsigned = true; + else if (typeof object.revisionNumber === "string") + message.revisionNumber = parseInt(object.revisionNumber, 10); + else if (typeof object.revisionNumber === "number") + message.revisionNumber = object.revisionNumber; + else if (typeof object.revisionNumber === "object") + message.revisionNumber = new $util.LongBits(object.revisionNumber.low >>> 0, object.revisionNumber.high >>> 0).toNumber(true); + if (object.revisionHeight != null) + if ($util.Long) + (message.revisionHeight = $util.Long.fromValue(object.revisionHeight)).unsigned = true; + else if (typeof object.revisionHeight === "string") + message.revisionHeight = parseInt(object.revisionHeight, 10); + else if (typeof object.revisionHeight === "number") + message.revisionHeight = object.revisionHeight; + else if (typeof object.revisionHeight === "object") + message.revisionHeight = new $util.LongBits(object.revisionHeight.low >>> 0, object.revisionHeight.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from an Height message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.Height + * @static + * @param {ibc.core.client.v1.Height} message Height + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Height.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.revisionNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.revisionNumber = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.revisionHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.revisionHeight = options.longs === String ? "0" : 0; + } + if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) + if (typeof message.revisionNumber === "number") + object.revisionNumber = options.longs === String ? String(message.revisionNumber) : message.revisionNumber; + else + object.revisionNumber = options.longs === String ? $util.Long.prototype.toString.call(message.revisionNumber) : options.longs === Number ? new $util.LongBits(message.revisionNumber.low >>> 0, message.revisionNumber.high >>> 0).toNumber(true) : message.revisionNumber; + if (message.revisionHeight != null && message.hasOwnProperty("revisionHeight")) + if (typeof message.revisionHeight === "number") + object.revisionHeight = options.longs === String ? String(message.revisionHeight) : message.revisionHeight; + else + object.revisionHeight = options.longs === String ? $util.Long.prototype.toString.call(message.revisionHeight) : options.longs === Number ? new $util.LongBits(message.revisionHeight.low >>> 0, message.revisionHeight.high >>> 0).toNumber(true) : message.revisionHeight; + return object; + }; + + /** + * Converts this Height to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.Height + * @instance + * @returns {Object.} JSON object + */ + Height.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Height; + })(v1.Height || {}); + + v1.Params = (function(Params) { + + /** + * Properties of a Params. + * @memberof ibc.core.client.v1 + * @interface IParams + * @property {Array.|null} [allowedClients] Params allowedClients + */ + + /** + * Constructs a new Params. + * @memberof ibc.core.client.v1 + * @classdesc Represents a Params. + * @implements IParams + * @constructor + * @param {ibc.core.client.v1.IParams=} [properties] Properties to set + */ + function Params(properties) { + this.allowedClients = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Params allowedClients. + * @member {Array.} allowedClients + * @memberof ibc.core.client.v1.Params + * @instance + */ + Params.prototype.allowedClients = $util.emptyArray; + + /** + * Creates a new Params instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.Params + * @static + * @param {ibc.core.client.v1.IParams=} [properties] Properties to set + * @returns {ibc.core.client.v1.Params} Params instance + */ + Params.create = function create(properties) { + return new Params(properties); + }; + + /** + * Encodes the specified Params message. Does not implicitly {@link ibc.core.client.v1.Params.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.Params + * @static + * @param {ibc.core.client.v1.IParams} message Params message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Params.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedClients != null && message.allowedClients.length) + for (let i = 0; i < message.allowedClients.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedClients[i]); + return writer; + }; + + /** + * Encodes the specified Params message, length delimited. Does not implicitly {@link ibc.core.client.v1.Params.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.Params + * @static + * @param {ibc.core.client.v1.IParams} message Params message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Params.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Params message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.Params + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.Params} Params + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Params.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.Params(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.allowedClients && message.allowedClients.length)) + message.allowedClients = []; + message.allowedClients.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Params message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.Params + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.Params} Params + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Params.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Params message. + * @function verify + * @memberof ibc.core.client.v1.Params + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Params.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedClients != null && message.hasOwnProperty("allowedClients")) { + if (!Array.isArray(message.allowedClients)) + return "allowedClients: array expected"; + for (let i = 0; i < message.allowedClients.length; ++i) + if (!$util.isString(message.allowedClients[i])) + return "allowedClients: string[] expected"; + } + return null; + }; + + /** + * Creates a Params message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.Params + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.Params} Params + */ + Params.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.Params) + return object; + let message = new $root.ibc.core.client.v1.Params(); + if (object.allowedClients) { + if (!Array.isArray(object.allowedClients)) + throw TypeError(".ibc.core.client.v1.Params.allowedClients: array expected"); + message.allowedClients = []; + for (let i = 0; i < object.allowedClients.length; ++i) + message.allowedClients[i] = String(object.allowedClients[i]); + } + return message; + }; + + /** + * Creates a plain object from a Params message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.Params + * @static + * @param {ibc.core.client.v1.Params} message Params + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Params.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.allowedClients = []; + if (message.allowedClients && message.allowedClients.length) { + object.allowedClients = []; + for (let j = 0; j < message.allowedClients.length; ++j) + object.allowedClients[j] = message.allowedClients[j]; + } + return object; + }; + + /** + * Converts this Params to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.Params + * @instance + * @returns {Object.} JSON object + */ + Params.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Params; + })(v1.Params || {}); + + v1.GenesisState = (function(GenesisState) { + + /** + * Properties of a GenesisState. + * @memberof ibc.core.client.v1 + * @interface IGenesisState + * @property {Array.|null} [clients] GenesisState clients + * @property {Array.|null} [clientsConsensus] GenesisState clientsConsensus + * @property {Array.|null} [clientsMetadata] GenesisState clientsMetadata + * @property {ibc.core.client.v1.IParams|null} [params] GenesisState params + * @property {boolean|null} [createLocalhost] GenesisState createLocalhost + * @property {number|Long|null} [nextClientSequence] GenesisState nextClientSequence + */ + + /** + * Constructs a new GenesisState. + * @memberof ibc.core.client.v1 + * @classdesc Represents a GenesisState. + * @implements IGenesisState + * @constructor + * @param {ibc.core.client.v1.IGenesisState=} [properties] Properties to set + */ + function GenesisState(properties) { + this.clients = []; + this.clientsConsensus = []; + this.clientsMetadata = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenesisState clients. + * @member {Array.} clients + * @memberof ibc.core.client.v1.GenesisState + * @instance + */ + GenesisState.prototype.clients = $util.emptyArray; + + /** + * GenesisState clientsConsensus. + * @member {Array.} clientsConsensus + * @memberof ibc.core.client.v1.GenesisState + * @instance + */ + GenesisState.prototype.clientsConsensus = $util.emptyArray; + + /** + * GenesisState clientsMetadata. + * @member {Array.} clientsMetadata + * @memberof ibc.core.client.v1.GenesisState + * @instance + */ + GenesisState.prototype.clientsMetadata = $util.emptyArray; + + /** + * GenesisState params. + * @member {ibc.core.client.v1.IParams|null|undefined} params + * @memberof ibc.core.client.v1.GenesisState + * @instance + */ + GenesisState.prototype.params = null; + + /** + * GenesisState createLocalhost. + * @member {boolean} createLocalhost + * @memberof ibc.core.client.v1.GenesisState + * @instance + */ + GenesisState.prototype.createLocalhost = false; + + /** + * GenesisState nextClientSequence. + * @member {number|Long} nextClientSequence + * @memberof ibc.core.client.v1.GenesisState + * @instance + */ + GenesisState.prototype.nextClientSequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new GenesisState instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.GenesisState + * @static + * @param {ibc.core.client.v1.IGenesisState=} [properties] Properties to set + * @returns {ibc.core.client.v1.GenesisState} GenesisState instance + */ + GenesisState.create = function create(properties) { + return new GenesisState(properties); + }; + + /** + * Encodes the specified GenesisState message. Does not implicitly {@link ibc.core.client.v1.GenesisState.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.GenesisState + * @static + * @param {ibc.core.client.v1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clients != null && message.clients.length) + for (let i = 0; i < message.clients.length; ++i) + $root.ibc.core.client.v1.IdentifiedClientState.encode(message.clients[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.clientsConsensus != null && message.clientsConsensus.length) + for (let i = 0; i < message.clientsConsensus.length; ++i) + $root.ibc.core.client.v1.ClientConsensusStates.encode(message.clientsConsensus[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.clientsMetadata != null && message.clientsMetadata.length) + for (let i = 0; i < message.clientsMetadata.length; ++i) + $root.ibc.core.client.v1.IdentifiedGenesisMetadata.encode(message.clientsMetadata[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.ibc.core.client.v1.Params.encode(message.params, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.createLocalhost != null && Object.hasOwnProperty.call(message, "createLocalhost")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.createLocalhost); + if (message.nextClientSequence != null && Object.hasOwnProperty.call(message, "nextClientSequence")) + writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.nextClientSequence); + return writer; + }; + + /** + * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link ibc.core.client.v1.GenesisState.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.GenesisState + * @static + * @param {ibc.core.client.v1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.GenesisState(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.clients && message.clients.length)) + message.clients = []; + message.clients.push($root.ibc.core.client.v1.IdentifiedClientState.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.clientsConsensus && message.clientsConsensus.length)) + message.clientsConsensus = []; + message.clientsConsensus.push($root.ibc.core.client.v1.ClientConsensusStates.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.clientsMetadata && message.clientsMetadata.length)) + message.clientsMetadata = []; + message.clientsMetadata.push($root.ibc.core.client.v1.IdentifiedGenesisMetadata.decode(reader, reader.uint32())); + break; + case 4: + message.params = $root.ibc.core.client.v1.Params.decode(reader, reader.uint32()); + break; + case 5: + message.createLocalhost = reader.bool(); + break; + case 6: + message.nextClientSequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenesisState message. + * @function verify + * @memberof ibc.core.client.v1.GenesisState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenesisState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clients != null && message.hasOwnProperty("clients")) { + if (!Array.isArray(message.clients)) + return "clients: array expected"; + for (let i = 0; i < message.clients.length; ++i) { + let error = $root.ibc.core.client.v1.IdentifiedClientState.verify(message.clients[i]); + if (error) + return "clients." + error; + } + } + if (message.clientsConsensus != null && message.hasOwnProperty("clientsConsensus")) { + if (!Array.isArray(message.clientsConsensus)) + return "clientsConsensus: array expected"; + for (let i = 0; i < message.clientsConsensus.length; ++i) { + let error = $root.ibc.core.client.v1.ClientConsensusStates.verify(message.clientsConsensus[i]); + if (error) + return "clientsConsensus." + error; + } + } + if (message.clientsMetadata != null && message.hasOwnProperty("clientsMetadata")) { + if (!Array.isArray(message.clientsMetadata)) + return "clientsMetadata: array expected"; + for (let i = 0; i < message.clientsMetadata.length; ++i) { + let error = $root.ibc.core.client.v1.IdentifiedGenesisMetadata.verify(message.clientsMetadata[i]); + if (error) + return "clientsMetadata." + error; + } + } + if (message.params != null && message.hasOwnProperty("params")) { + let error = $root.ibc.core.client.v1.Params.verify(message.params); + if (error) + return "params." + error; + } + if (message.createLocalhost != null && message.hasOwnProperty("createLocalhost")) + if (typeof message.createLocalhost !== "boolean") + return "createLocalhost: boolean expected"; + if (message.nextClientSequence != null && message.hasOwnProperty("nextClientSequence")) + if (!$util.isInteger(message.nextClientSequence) && !(message.nextClientSequence && $util.isInteger(message.nextClientSequence.low) && $util.isInteger(message.nextClientSequence.high))) + return "nextClientSequence: integer|Long expected"; + return null; + }; + + /** + * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.GenesisState + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.GenesisState} GenesisState + */ + GenesisState.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.GenesisState) + return object; + let message = new $root.ibc.core.client.v1.GenesisState(); + if (object.clients) { + if (!Array.isArray(object.clients)) + throw TypeError(".ibc.core.client.v1.GenesisState.clients: array expected"); + message.clients = []; + for (let i = 0; i < object.clients.length; ++i) { + if (typeof object.clients[i] !== "object") + throw TypeError(".ibc.core.client.v1.GenesisState.clients: object expected"); + message.clients[i] = $root.ibc.core.client.v1.IdentifiedClientState.fromObject(object.clients[i]); + } + } + if (object.clientsConsensus) { + if (!Array.isArray(object.clientsConsensus)) + throw TypeError(".ibc.core.client.v1.GenesisState.clientsConsensus: array expected"); + message.clientsConsensus = []; + for (let i = 0; i < object.clientsConsensus.length; ++i) { + if (typeof object.clientsConsensus[i] !== "object") + throw TypeError(".ibc.core.client.v1.GenesisState.clientsConsensus: object expected"); + message.clientsConsensus[i] = $root.ibc.core.client.v1.ClientConsensusStates.fromObject(object.clientsConsensus[i]); + } + } + if (object.clientsMetadata) { + if (!Array.isArray(object.clientsMetadata)) + throw TypeError(".ibc.core.client.v1.GenesisState.clientsMetadata: array expected"); + message.clientsMetadata = []; + for (let i = 0; i < object.clientsMetadata.length; ++i) { + if (typeof object.clientsMetadata[i] !== "object") + throw TypeError(".ibc.core.client.v1.GenesisState.clientsMetadata: object expected"); + message.clientsMetadata[i] = $root.ibc.core.client.v1.IdentifiedGenesisMetadata.fromObject(object.clientsMetadata[i]); + } + } + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".ibc.core.client.v1.GenesisState.params: object expected"); + message.params = $root.ibc.core.client.v1.Params.fromObject(object.params); + } + if (object.createLocalhost != null) + message.createLocalhost = Boolean(object.createLocalhost); + if (object.nextClientSequence != null) + if ($util.Long) + (message.nextClientSequence = $util.Long.fromValue(object.nextClientSequence)).unsigned = true; + else if (typeof object.nextClientSequence === "string") + message.nextClientSequence = parseInt(object.nextClientSequence, 10); + else if (typeof object.nextClientSequence === "number") + message.nextClientSequence = object.nextClientSequence; + else if (typeof object.nextClientSequence === "object") + message.nextClientSequence = new $util.LongBits(object.nextClientSequence.low >>> 0, object.nextClientSequence.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a GenesisState message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.GenesisState + * @static + * @param {ibc.core.client.v1.GenesisState} message GenesisState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenesisState.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) { + object.clients = []; + object.clientsConsensus = []; + object.clientsMetadata = []; + } + if (options.defaults) { + object.params = null; + object.createLocalhost = false; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.nextClientSequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nextClientSequence = options.longs === String ? "0" : 0; + } + if (message.clients && message.clients.length) { + object.clients = []; + for (let j = 0; j < message.clients.length; ++j) + object.clients[j] = $root.ibc.core.client.v1.IdentifiedClientState.toObject(message.clients[j], options); + } + if (message.clientsConsensus && message.clientsConsensus.length) { + object.clientsConsensus = []; + for (let j = 0; j < message.clientsConsensus.length; ++j) + object.clientsConsensus[j] = $root.ibc.core.client.v1.ClientConsensusStates.toObject(message.clientsConsensus[j], options); + } + if (message.clientsMetadata && message.clientsMetadata.length) { + object.clientsMetadata = []; + for (let j = 0; j < message.clientsMetadata.length; ++j) + object.clientsMetadata[j] = $root.ibc.core.client.v1.IdentifiedGenesisMetadata.toObject(message.clientsMetadata[j], options); + } + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.ibc.core.client.v1.Params.toObject(message.params, options); + if (message.createLocalhost != null && message.hasOwnProperty("createLocalhost")) + object.createLocalhost = message.createLocalhost; + if (message.nextClientSequence != null && message.hasOwnProperty("nextClientSequence")) + if (typeof message.nextClientSequence === "number") + object.nextClientSequence = options.longs === String ? String(message.nextClientSequence) : message.nextClientSequence; + else + object.nextClientSequence = options.longs === String ? $util.Long.prototype.toString.call(message.nextClientSequence) : options.longs === Number ? new $util.LongBits(message.nextClientSequence.low >>> 0, message.nextClientSequence.high >>> 0).toNumber(true) : message.nextClientSequence; + return object; + }; + + /** + * Converts this GenesisState to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.GenesisState + * @instance + * @returns {Object.} JSON object + */ + GenesisState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GenesisState; + })(v1.GenesisState || {}); + + v1.GenesisMetadata = (function(GenesisMetadata) { + + /** + * Properties of a GenesisMetadata. + * @memberof ibc.core.client.v1 + * @interface IGenesisMetadata + * @property {Uint8Array|null} [key] GenesisMetadata key + * @property {Uint8Array|null} [value] GenesisMetadata value + */ + + /** + * Constructs a new GenesisMetadata. + * @memberof ibc.core.client.v1 + * @classdesc Represents a GenesisMetadata. + * @implements IGenesisMetadata + * @constructor + * @param {ibc.core.client.v1.IGenesisMetadata=} [properties] Properties to set + */ + function GenesisMetadata(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenesisMetadata key. + * @member {Uint8Array} key + * @memberof ibc.core.client.v1.GenesisMetadata + * @instance + */ + GenesisMetadata.prototype.key = $util.newBuffer([]); + + /** + * GenesisMetadata value. + * @member {Uint8Array} value + * @memberof ibc.core.client.v1.GenesisMetadata + * @instance + */ + GenesisMetadata.prototype.value = $util.newBuffer([]); + + /** + * Creates a new GenesisMetadata instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.GenesisMetadata + * @static + * @param {ibc.core.client.v1.IGenesisMetadata=} [properties] Properties to set + * @returns {ibc.core.client.v1.GenesisMetadata} GenesisMetadata instance + */ + GenesisMetadata.create = function create(properties) { + return new GenesisMetadata(properties); + }; + + /** + * Encodes the specified GenesisMetadata message. Does not implicitly {@link ibc.core.client.v1.GenesisMetadata.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.GenesisMetadata + * @static + * @param {ibc.core.client.v1.IGenesisMetadata} message GenesisMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified GenesisMetadata message, length delimited. Does not implicitly {@link ibc.core.client.v1.GenesisMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.GenesisMetadata + * @static + * @param {ibc.core.client.v1.IGenesisMetadata} message GenesisMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenesisMetadata message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.GenesisMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.GenesisMetadata} GenesisMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.GenesisMetadata(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenesisMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.GenesisMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.GenesisMetadata} GenesisMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenesisMetadata message. + * @function verify + * @memberof ibc.core.client.v1.GenesisMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenesisMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a GenesisMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.GenesisMetadata + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.GenesisMetadata} GenesisMetadata + */ + GenesisMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.GenesisMetadata) + return object; + let message = new $root.ibc.core.client.v1.GenesisMetadata(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length) + message.key = object.key; + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a GenesisMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.GenesisMetadata + * @static + * @param {ibc.core.client.v1.GenesisMetadata} message GenesisMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenesisMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this GenesisMetadata to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.GenesisMetadata + * @instance + * @returns {Object.} JSON object + */ + GenesisMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GenesisMetadata; + })(v1.GenesisMetadata || {}); + + v1.IdentifiedGenesisMetadata = (function(IdentifiedGenesisMetadata) { + + /** + * Properties of an IdentifiedGenesisMetadata. + * @memberof ibc.core.client.v1 + * @interface IIdentifiedGenesisMetadata + * @property {string|null} [clientId] IdentifiedGenesisMetadata clientId + * @property {Array.|null} [clientMetadata] IdentifiedGenesisMetadata clientMetadata + */ + + /** + * Constructs a new IdentifiedGenesisMetadata. + * @memberof ibc.core.client.v1 + * @classdesc Represents an IdentifiedGenesisMetadata. + * @implements IIdentifiedGenesisMetadata + * @constructor + * @param {ibc.core.client.v1.IIdentifiedGenesisMetadata=} [properties] Properties to set + */ + function IdentifiedGenesisMetadata(properties) { + this.clientMetadata = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IdentifiedGenesisMetadata clientId. + * @member {string} clientId + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @instance + */ + IdentifiedGenesisMetadata.prototype.clientId = ""; + + /** + * IdentifiedGenesisMetadata clientMetadata. + * @member {Array.} clientMetadata + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @instance + */ + IdentifiedGenesisMetadata.prototype.clientMetadata = $util.emptyArray; + + /** + * Creates a new IdentifiedGenesisMetadata instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @static + * @param {ibc.core.client.v1.IIdentifiedGenesisMetadata=} [properties] Properties to set + * @returns {ibc.core.client.v1.IdentifiedGenesisMetadata} IdentifiedGenesisMetadata instance + */ + IdentifiedGenesisMetadata.create = function create(properties) { + return new IdentifiedGenesisMetadata(properties); + }; + + /** + * Encodes the specified IdentifiedGenesisMetadata message. Does not implicitly {@link ibc.core.client.v1.IdentifiedGenesisMetadata.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @static + * @param {ibc.core.client.v1.IIdentifiedGenesisMetadata} message IdentifiedGenesisMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentifiedGenesisMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.clientMetadata != null && message.clientMetadata.length) + for (let i = 0; i < message.clientMetadata.length; ++i) + $root.ibc.core.client.v1.GenesisMetadata.encode(message.clientMetadata[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IdentifiedGenesisMetadata message, length delimited. Does not implicitly {@link ibc.core.client.v1.IdentifiedGenesisMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @static + * @param {ibc.core.client.v1.IIdentifiedGenesisMetadata} message IdentifiedGenesisMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentifiedGenesisMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentifiedGenesisMetadata message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.IdentifiedGenesisMetadata} IdentifiedGenesisMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentifiedGenesisMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.IdentifiedGenesisMetadata(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + if (!(message.clientMetadata && message.clientMetadata.length)) + message.clientMetadata = []; + message.clientMetadata.push($root.ibc.core.client.v1.GenesisMetadata.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentifiedGenesisMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.IdentifiedGenesisMetadata} IdentifiedGenesisMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentifiedGenesisMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentifiedGenesisMetadata message. + * @function verify + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentifiedGenesisMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.clientMetadata != null && message.hasOwnProperty("clientMetadata")) { + if (!Array.isArray(message.clientMetadata)) + return "clientMetadata: array expected"; + for (let i = 0; i < message.clientMetadata.length; ++i) { + let error = $root.ibc.core.client.v1.GenesisMetadata.verify(message.clientMetadata[i]); + if (error) + return "clientMetadata." + error; + } + } + return null; + }; + + /** + * Creates an IdentifiedGenesisMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.IdentifiedGenesisMetadata} IdentifiedGenesisMetadata + */ + IdentifiedGenesisMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.IdentifiedGenesisMetadata) + return object; + let message = new $root.ibc.core.client.v1.IdentifiedGenesisMetadata(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.clientMetadata) { + if (!Array.isArray(object.clientMetadata)) + throw TypeError(".ibc.core.client.v1.IdentifiedGenesisMetadata.clientMetadata: array expected"); + message.clientMetadata = []; + for (let i = 0; i < object.clientMetadata.length; ++i) { + if (typeof object.clientMetadata[i] !== "object") + throw TypeError(".ibc.core.client.v1.IdentifiedGenesisMetadata.clientMetadata: object expected"); + message.clientMetadata[i] = $root.ibc.core.client.v1.GenesisMetadata.fromObject(object.clientMetadata[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an IdentifiedGenesisMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @static + * @param {ibc.core.client.v1.IdentifiedGenesisMetadata} message IdentifiedGenesisMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentifiedGenesisMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.clientMetadata = []; + if (options.defaults) + object.clientId = ""; + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.clientMetadata && message.clientMetadata.length) { + object.clientMetadata = []; + for (let j = 0; j < message.clientMetadata.length; ++j) + object.clientMetadata[j] = $root.ibc.core.client.v1.GenesisMetadata.toObject(message.clientMetadata[j], options); + } + return object; + }; + + /** + * Converts this IdentifiedGenesisMetadata to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @instance + * @returns {Object.} JSON object + */ + IdentifiedGenesisMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentifiedGenesisMetadata; + })(v1.IdentifiedGenesisMetadata || {}); + + v1.Query = (function(Query) { + + /** + * Constructs a new Query service. + * @memberof ibc.core.client.v1 + * @classdesc Represents a Query + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Query(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; + + /** + * Creates new Query service using the specified rpc implementation. + * @function create + * @memberof ibc.core.client.v1.Query + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Query} RPC service. Useful where requests and/or responses are streamed. + */ + Query.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link ibc.core.client.v1.Query#clientState}. + * @memberof ibc.core.client.v1.Query + * @typedef ClientStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.client.v1.IQueryClientStateResponse} [response] QueryClientStateResponse + */ + + /** + * Calls ClientState. + * @function clientState + * @memberof ibc.core.client.v1.Query + * @instance + * @param {ibc.core.client.v1.IQueryClientStateRequest} request QueryClientStateRequest message or plain object + * @param {ibc.core.client.v1.Query.ClientStateCallback} callback Node-style callback called with the error, if any, and QueryClientStateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.clientState = function clientState(request, callback) { + return this.rpcCall(clientState, $root.ibc.core.client.v1.QueryClientStateRequest, $root.ibc.core.client.v1.QueryClientStateResponse, request, callback); + }, "name", { value: "ClientState" }); + + /** + * Calls ClientState. + * @function clientState + * @memberof ibc.core.client.v1.Query + * @instance + * @param {ibc.core.client.v1.IQueryClientStateRequest} request QueryClientStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.client.v1.Query#clientStates}. + * @memberof ibc.core.client.v1.Query + * @typedef ClientStatesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.client.v1.IQueryClientStatesResponse} [response] QueryClientStatesResponse + */ + + /** + * Calls ClientStates. + * @function clientStates + * @memberof ibc.core.client.v1.Query + * @instance + * @param {ibc.core.client.v1.IQueryClientStatesRequest} request QueryClientStatesRequest message or plain object + * @param {ibc.core.client.v1.Query.ClientStatesCallback} callback Node-style callback called with the error, if any, and QueryClientStatesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.clientStates = function clientStates(request, callback) { + return this.rpcCall(clientStates, $root.ibc.core.client.v1.QueryClientStatesRequest, $root.ibc.core.client.v1.QueryClientStatesResponse, request, callback); + }, "name", { value: "ClientStates" }); + + /** + * Calls ClientStates. + * @function clientStates + * @memberof ibc.core.client.v1.Query + * @instance + * @param {ibc.core.client.v1.IQueryClientStatesRequest} request QueryClientStatesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.client.v1.Query#consensusState}. + * @memberof ibc.core.client.v1.Query + * @typedef ConsensusStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.client.v1.IQueryConsensusStateResponse} [response] QueryConsensusStateResponse + */ + + /** + * Calls ConsensusState. + * @function consensusState + * @memberof ibc.core.client.v1.Query + * @instance + * @param {ibc.core.client.v1.IQueryConsensusStateRequest} request QueryConsensusStateRequest message or plain object + * @param {ibc.core.client.v1.Query.ConsensusStateCallback} callback Node-style callback called with the error, if any, and QueryConsensusStateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.consensusState = function consensusState(request, callback) { + return this.rpcCall(consensusState, $root.ibc.core.client.v1.QueryConsensusStateRequest, $root.ibc.core.client.v1.QueryConsensusStateResponse, request, callback); + }, "name", { value: "ConsensusState" }); + + /** + * Calls ConsensusState. + * @function consensusState + * @memberof ibc.core.client.v1.Query + * @instance + * @param {ibc.core.client.v1.IQueryConsensusStateRequest} request QueryConsensusStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.client.v1.Query#consensusStates}. + * @memberof ibc.core.client.v1.Query + * @typedef ConsensusStatesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.client.v1.IQueryConsensusStatesResponse} [response] QueryConsensusStatesResponse + */ + + /** + * Calls ConsensusStates. + * @function consensusStates + * @memberof ibc.core.client.v1.Query + * @instance + * @param {ibc.core.client.v1.IQueryConsensusStatesRequest} request QueryConsensusStatesRequest message or plain object + * @param {ibc.core.client.v1.Query.ConsensusStatesCallback} callback Node-style callback called with the error, if any, and QueryConsensusStatesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.consensusStates = function consensusStates(request, callback) { + return this.rpcCall(consensusStates, $root.ibc.core.client.v1.QueryConsensusStatesRequest, $root.ibc.core.client.v1.QueryConsensusStatesResponse, request, callback); + }, "name", { value: "ConsensusStates" }); + + /** + * Calls ConsensusStates. + * @function consensusStates + * @memberof ibc.core.client.v1.Query + * @instance + * @param {ibc.core.client.v1.IQueryConsensusStatesRequest} request QueryConsensusStatesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.client.v1.Query#clientParams}. + * @memberof ibc.core.client.v1.Query + * @typedef ClientParamsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.client.v1.IQueryClientParamsResponse} [response] QueryClientParamsResponse + */ + + /** + * Calls ClientParams. + * @function clientParams + * @memberof ibc.core.client.v1.Query + * @instance + * @param {ibc.core.client.v1.IQueryClientParamsRequest} request QueryClientParamsRequest message or plain object + * @param {ibc.core.client.v1.Query.ClientParamsCallback} callback Node-style callback called with the error, if any, and QueryClientParamsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.clientParams = function clientParams(request, callback) { + return this.rpcCall(clientParams, $root.ibc.core.client.v1.QueryClientParamsRequest, $root.ibc.core.client.v1.QueryClientParamsResponse, request, callback); + }, "name", { value: "ClientParams" }); + + /** + * Calls ClientParams. + * @function clientParams + * @memberof ibc.core.client.v1.Query + * @instance + * @param {ibc.core.client.v1.IQueryClientParamsRequest} request QueryClientParamsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Query; + })(v1.Query || {}); + + v1.QueryClientStateRequest = (function(QueryClientStateRequest) { + + /** + * Properties of a QueryClientStateRequest. + * @memberof ibc.core.client.v1 + * @interface IQueryClientStateRequest + * @property {string|null} [clientId] QueryClientStateRequest clientId + */ + + /** + * Constructs a new QueryClientStateRequest. + * @memberof ibc.core.client.v1 + * @classdesc Represents a QueryClientStateRequest. + * @implements IQueryClientStateRequest + * @constructor + * @param {ibc.core.client.v1.IQueryClientStateRequest=} [properties] Properties to set + */ + function QueryClientStateRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryClientStateRequest clientId. + * @member {string} clientId + * @memberof ibc.core.client.v1.QueryClientStateRequest + * @instance + */ + QueryClientStateRequest.prototype.clientId = ""; + + /** + * Creates a new QueryClientStateRequest instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.QueryClientStateRequest + * @static + * @param {ibc.core.client.v1.IQueryClientStateRequest=} [properties] Properties to set + * @returns {ibc.core.client.v1.QueryClientStateRequest} QueryClientStateRequest instance + */ + QueryClientStateRequest.create = function create(properties) { + return new QueryClientStateRequest(properties); + }; + + /** + * Encodes the specified QueryClientStateRequest message. Does not implicitly {@link ibc.core.client.v1.QueryClientStateRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.QueryClientStateRequest + * @static + * @param {ibc.core.client.v1.IQueryClientStateRequest} message QueryClientStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientStateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + return writer; + }; + + /** + * Encodes the specified QueryClientStateRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.QueryClientStateRequest + * @static + * @param {ibc.core.client.v1.IQueryClientStateRequest} message QueryClientStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryClientStateRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.QueryClientStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.QueryClientStateRequest} QueryClientStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientStateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientStateRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryClientStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.QueryClientStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.QueryClientStateRequest} QueryClientStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryClientStateRequest message. + * @function verify + * @memberof ibc.core.client.v1.QueryClientStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryClientStateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + return null; + }; + + /** + * Creates a QueryClientStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.QueryClientStateRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.QueryClientStateRequest} QueryClientStateRequest + */ + QueryClientStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.QueryClientStateRequest) + return object; + let message = new $root.ibc.core.client.v1.QueryClientStateRequest(); + if (object.clientId != null) + message.clientId = String(object.clientId); + return message; + }; + + /** + * Creates a plain object from a QueryClientStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.QueryClientStateRequest + * @static + * @param {ibc.core.client.v1.QueryClientStateRequest} message QueryClientStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryClientStateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.clientId = ""; + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + return object; + }; + + /** + * Converts this QueryClientStateRequest to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.QueryClientStateRequest + * @instance + * @returns {Object.} JSON object + */ + QueryClientStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryClientStateRequest; + })(v1.QueryClientStateRequest || {}); + + v1.QueryClientStateResponse = (function(QueryClientStateResponse) { + + /** + * Properties of a QueryClientStateResponse. + * @memberof ibc.core.client.v1 + * @interface IQueryClientStateResponse + * @property {google.protobuf.IAny|null} [clientState] QueryClientStateResponse clientState + * @property {Uint8Array|null} [proof] QueryClientStateResponse proof + * @property {ibc.core.client.v1.IHeight|null} [proofHeight] QueryClientStateResponse proofHeight + */ + + /** + * Constructs a new QueryClientStateResponse. + * @memberof ibc.core.client.v1 + * @classdesc Represents a QueryClientStateResponse. + * @implements IQueryClientStateResponse + * @constructor + * @param {ibc.core.client.v1.IQueryClientStateResponse=} [properties] Properties to set + */ + function QueryClientStateResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryClientStateResponse clientState. + * @member {google.protobuf.IAny|null|undefined} clientState + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @instance + */ + QueryClientStateResponse.prototype.clientState = null; + + /** + * QueryClientStateResponse proof. + * @member {Uint8Array} proof + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @instance + */ + QueryClientStateResponse.prototype.proof = $util.newBuffer([]); + + /** + * QueryClientStateResponse proofHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} proofHeight + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @instance + */ + QueryClientStateResponse.prototype.proofHeight = null; + + /** + * Creates a new QueryClientStateResponse instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @static + * @param {ibc.core.client.v1.IQueryClientStateResponse=} [properties] Properties to set + * @returns {ibc.core.client.v1.QueryClientStateResponse} QueryClientStateResponse instance + */ + QueryClientStateResponse.create = function create(properties) { + return new QueryClientStateResponse(properties); + }; + + /** + * Encodes the specified QueryClientStateResponse message. Does not implicitly {@link ibc.core.client.v1.QueryClientStateResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @static + * @param {ibc.core.client.v1.IQueryClientStateResponse} message QueryClientStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientStateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientState != null && Object.hasOwnProperty.call(message, "clientState")) + $root.google.protobuf.Any.encode(message.clientState, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); + if (message.proofHeight != null && Object.hasOwnProperty.call(message, "proofHeight")) + $root.ibc.core.client.v1.Height.encode(message.proofHeight, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryClientStateResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientStateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @static + * @param {ibc.core.client.v1.IQueryClientStateResponse} message QueryClientStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientStateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryClientStateResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.QueryClientStateResponse} QueryClientStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientStateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientStateResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientState = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryClientStateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.QueryClientStateResponse} QueryClientStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientStateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryClientStateResponse message. + * @function verify + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryClientStateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientState != null && message.hasOwnProperty("clientState")) { + let error = $root.google.protobuf.Any.verify(message.clientState); + if (error) + return "clientState." + error; + } + if (message.proof != null && message.hasOwnProperty("proof")) + if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) + return "proof: buffer expected"; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) { + let error = $root.ibc.core.client.v1.Height.verify(message.proofHeight); + if (error) + return "proofHeight." + error; + } + return null; + }; + + /** + * Creates a QueryClientStateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.QueryClientStateResponse} QueryClientStateResponse + */ + QueryClientStateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.QueryClientStateResponse) + return object; + let message = new $root.ibc.core.client.v1.QueryClientStateResponse(); + if (object.clientState != null) { + if (typeof object.clientState !== "object") + throw TypeError(".ibc.core.client.v1.QueryClientStateResponse.clientState: object expected"); + message.clientState = $root.google.protobuf.Any.fromObject(object.clientState); + } + if (object.proof != null) + if (typeof object.proof === "string") + $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); + else if (object.proof.length) + message.proof = object.proof; + if (object.proofHeight != null) { + if (typeof object.proofHeight !== "object") + throw TypeError(".ibc.core.client.v1.QueryClientStateResponse.proofHeight: object expected"); + message.proofHeight = $root.ibc.core.client.v1.Height.fromObject(object.proofHeight); + } + return message; + }; + + /** + * Creates a plain object from a QueryClientStateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @static + * @param {ibc.core.client.v1.QueryClientStateResponse} message QueryClientStateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryClientStateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.clientState = null; + if (options.bytes === String) + object.proof = ""; + else { + object.proof = []; + if (options.bytes !== Array) + object.proof = $util.newBuffer(object.proof); + } + object.proofHeight = null; + } + if (message.clientState != null && message.hasOwnProperty("clientState")) + object.clientState = $root.google.protobuf.Any.toObject(message.clientState, options); + if (message.proof != null && message.hasOwnProperty("proof")) + object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) + object.proofHeight = $root.ibc.core.client.v1.Height.toObject(message.proofHeight, options); + return object; + }; + + /** + * Converts this QueryClientStateResponse to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @instance + * @returns {Object.} JSON object + */ + QueryClientStateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryClientStateResponse; + })(v1.QueryClientStateResponse || {}); + + v1.QueryClientStatesRequest = (function(QueryClientStatesRequest) { + + /** + * Properties of a QueryClientStatesRequest. + * @memberof ibc.core.client.v1 + * @interface IQueryClientStatesRequest + * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryClientStatesRequest pagination + */ + + /** + * Constructs a new QueryClientStatesRequest. + * @memberof ibc.core.client.v1 + * @classdesc Represents a QueryClientStatesRequest. + * @implements IQueryClientStatesRequest + * @constructor + * @param {ibc.core.client.v1.IQueryClientStatesRequest=} [properties] Properties to set + */ + function QueryClientStatesRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryClientStatesRequest pagination. + * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination + * @memberof ibc.core.client.v1.QueryClientStatesRequest + * @instance + */ + QueryClientStatesRequest.prototype.pagination = null; + + /** + * Creates a new QueryClientStatesRequest instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.QueryClientStatesRequest + * @static + * @param {ibc.core.client.v1.IQueryClientStatesRequest=} [properties] Properties to set + * @returns {ibc.core.client.v1.QueryClientStatesRequest} QueryClientStatesRequest instance + */ + QueryClientStatesRequest.create = function create(properties) { + return new QueryClientStatesRequest(properties); + }; + + /** + * Encodes the specified QueryClientStatesRequest message. Does not implicitly {@link ibc.core.client.v1.QueryClientStatesRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.QueryClientStatesRequest + * @static + * @param {ibc.core.client.v1.IQueryClientStatesRequest} message QueryClientStatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientStatesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryClientStatesRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientStatesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.QueryClientStatesRequest + * @static + * @param {ibc.core.client.v1.IQueryClientStatesRequest} message QueryClientStatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientStatesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryClientStatesRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.QueryClientStatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.QueryClientStatesRequest} QueryClientStatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientStatesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientStatesRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryClientStatesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.QueryClientStatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.QueryClientStatesRequest} QueryClientStatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientStatesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryClientStatesRequest message. + * @function verify + * @memberof ibc.core.client.v1.QueryClientStatesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryClientStatesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryClientStatesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.QueryClientStatesRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.QueryClientStatesRequest} QueryClientStatesRequest + */ + QueryClientStatesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.QueryClientStatesRequest) + return object; + let message = new $root.ibc.core.client.v1.QueryClientStatesRequest(); + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".ibc.core.client.v1.QueryClientStatesRequest.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryClientStatesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.QueryClientStatesRequest + * @static + * @param {ibc.core.client.v1.QueryClientStatesRequest} message QueryClientStatesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryClientStatesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.pagination = null; + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryClientStatesRequest to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.QueryClientStatesRequest + * @instance + * @returns {Object.} JSON object + */ + QueryClientStatesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryClientStatesRequest; + })(v1.QueryClientStatesRequest || {}); + + v1.QueryClientStatesResponse = (function(QueryClientStatesResponse) { + + /** + * Properties of a QueryClientStatesResponse. + * @memberof ibc.core.client.v1 + * @interface IQueryClientStatesResponse + * @property {Array.|null} [clientStates] QueryClientStatesResponse clientStates + * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryClientStatesResponse pagination + */ + + /** + * Constructs a new QueryClientStatesResponse. + * @memberof ibc.core.client.v1 + * @classdesc Represents a QueryClientStatesResponse. + * @implements IQueryClientStatesResponse + * @constructor + * @param {ibc.core.client.v1.IQueryClientStatesResponse=} [properties] Properties to set + */ + function QueryClientStatesResponse(properties) { + this.clientStates = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryClientStatesResponse clientStates. + * @member {Array.} clientStates + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @instance + */ + QueryClientStatesResponse.prototype.clientStates = $util.emptyArray; + + /** + * QueryClientStatesResponse pagination. + * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @instance + */ + QueryClientStatesResponse.prototype.pagination = null; + + /** + * Creates a new QueryClientStatesResponse instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @static + * @param {ibc.core.client.v1.IQueryClientStatesResponse=} [properties] Properties to set + * @returns {ibc.core.client.v1.QueryClientStatesResponse} QueryClientStatesResponse instance + */ + QueryClientStatesResponse.create = function create(properties) { + return new QueryClientStatesResponse(properties); + }; + + /** + * Encodes the specified QueryClientStatesResponse message. Does not implicitly {@link ibc.core.client.v1.QueryClientStatesResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @static + * @param {ibc.core.client.v1.IQueryClientStatesResponse} message QueryClientStatesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientStatesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientStates != null && message.clientStates.length) + for (let i = 0; i < message.clientStates.length; ++i) + $root.ibc.core.client.v1.IdentifiedClientState.encode(message.clientStates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryClientStatesResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientStatesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @static + * @param {ibc.core.client.v1.IQueryClientStatesResponse} message QueryClientStatesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientStatesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryClientStatesResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.QueryClientStatesResponse} QueryClientStatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientStatesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientStatesResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.clientStates && message.clientStates.length)) + message.clientStates = []; + message.clientStates.push($root.ibc.core.client.v1.IdentifiedClientState.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryClientStatesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.QueryClientStatesResponse} QueryClientStatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientStatesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryClientStatesResponse message. + * @function verify + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryClientStatesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientStates != null && message.hasOwnProperty("clientStates")) { + if (!Array.isArray(message.clientStates)) + return "clientStates: array expected"; + for (let i = 0; i < message.clientStates.length; ++i) { + let error = $root.ibc.core.client.v1.IdentifiedClientState.verify(message.clientStates[i]); + if (error) + return "clientStates." + error; + } + } + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryClientStatesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.QueryClientStatesResponse} QueryClientStatesResponse + */ + QueryClientStatesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.QueryClientStatesResponse) + return object; + let message = new $root.ibc.core.client.v1.QueryClientStatesResponse(); + if (object.clientStates) { + if (!Array.isArray(object.clientStates)) + throw TypeError(".ibc.core.client.v1.QueryClientStatesResponse.clientStates: array expected"); + message.clientStates = []; + for (let i = 0; i < object.clientStates.length; ++i) { + if (typeof object.clientStates[i] !== "object") + throw TypeError(".ibc.core.client.v1.QueryClientStatesResponse.clientStates: object expected"); + message.clientStates[i] = $root.ibc.core.client.v1.IdentifiedClientState.fromObject(object.clientStates[i]); + } + } + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".ibc.core.client.v1.QueryClientStatesResponse.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryClientStatesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @static + * @param {ibc.core.client.v1.QueryClientStatesResponse} message QueryClientStatesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryClientStatesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.clientStates = []; + if (options.defaults) + object.pagination = null; + if (message.clientStates && message.clientStates.length) { + object.clientStates = []; + for (let j = 0; j < message.clientStates.length; ++j) + object.clientStates[j] = $root.ibc.core.client.v1.IdentifiedClientState.toObject(message.clientStates[j], options); + } + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryClientStatesResponse to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @instance + * @returns {Object.} JSON object + */ + QueryClientStatesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryClientStatesResponse; + })(v1.QueryClientStatesResponse || {}); + + v1.QueryConsensusStateRequest = (function(QueryConsensusStateRequest) { + + /** + * Properties of a QueryConsensusStateRequest. + * @memberof ibc.core.client.v1 + * @interface IQueryConsensusStateRequest + * @property {string|null} [clientId] QueryConsensusStateRequest clientId + * @property {number|Long|null} [revisionNumber] QueryConsensusStateRequest revisionNumber + * @property {number|Long|null} [revisionHeight] QueryConsensusStateRequest revisionHeight + * @property {boolean|null} [latestHeight] QueryConsensusStateRequest latestHeight + */ + + /** + * Constructs a new QueryConsensusStateRequest. + * @memberof ibc.core.client.v1 + * @classdesc Represents a QueryConsensusStateRequest. + * @implements IQueryConsensusStateRequest + * @constructor + * @param {ibc.core.client.v1.IQueryConsensusStateRequest=} [properties] Properties to set + */ + function QueryConsensusStateRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryConsensusStateRequest clientId. + * @member {string} clientId + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @instance + */ + QueryConsensusStateRequest.prototype.clientId = ""; + + /** + * QueryConsensusStateRequest revisionNumber. + * @member {number|Long} revisionNumber + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @instance + */ + QueryConsensusStateRequest.prototype.revisionNumber = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * QueryConsensusStateRequest revisionHeight. + * @member {number|Long} revisionHeight + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @instance + */ + QueryConsensusStateRequest.prototype.revisionHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * QueryConsensusStateRequest latestHeight. + * @member {boolean} latestHeight + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @instance + */ + QueryConsensusStateRequest.prototype.latestHeight = false; + + /** + * Creates a new QueryConsensusStateRequest instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @static + * @param {ibc.core.client.v1.IQueryConsensusStateRequest=} [properties] Properties to set + * @returns {ibc.core.client.v1.QueryConsensusStateRequest} QueryConsensusStateRequest instance + */ + QueryConsensusStateRequest.create = function create(properties) { + return new QueryConsensusStateRequest(properties); + }; + + /** + * Encodes the specified QueryConsensusStateRequest message. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @static + * @param {ibc.core.client.v1.IQueryConsensusStateRequest} message QueryConsensusStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConsensusStateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.revisionNumber != null && Object.hasOwnProperty.call(message, "revisionNumber")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.revisionNumber); + if (message.revisionHeight != null && Object.hasOwnProperty.call(message, "revisionHeight")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.revisionHeight); + if (message.latestHeight != null && Object.hasOwnProperty.call(message, "latestHeight")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.latestHeight); + return writer; + }; + + /** + * Encodes the specified QueryConsensusStateRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @static + * @param {ibc.core.client.v1.IQueryConsensusStateRequest} message QueryConsensusStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConsensusStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryConsensusStateRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.QueryConsensusStateRequest} QueryConsensusStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConsensusStateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryConsensusStateRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.revisionNumber = reader.uint64(); + break; + case 3: + message.revisionHeight = reader.uint64(); + break; + case 4: + message.latestHeight = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryConsensusStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.QueryConsensusStateRequest} QueryConsensusStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConsensusStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryConsensusStateRequest message. + * @function verify + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryConsensusStateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) + if (!$util.isInteger(message.revisionNumber) && !(message.revisionNumber && $util.isInteger(message.revisionNumber.low) && $util.isInteger(message.revisionNumber.high))) + return "revisionNumber: integer|Long expected"; + if (message.revisionHeight != null && message.hasOwnProperty("revisionHeight")) + if (!$util.isInteger(message.revisionHeight) && !(message.revisionHeight && $util.isInteger(message.revisionHeight.low) && $util.isInteger(message.revisionHeight.high))) + return "revisionHeight: integer|Long expected"; + if (message.latestHeight != null && message.hasOwnProperty("latestHeight")) + if (typeof message.latestHeight !== "boolean") + return "latestHeight: boolean expected"; + return null; + }; + + /** + * Creates a QueryConsensusStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.QueryConsensusStateRequest} QueryConsensusStateRequest + */ + QueryConsensusStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.QueryConsensusStateRequest) + return object; + let message = new $root.ibc.core.client.v1.QueryConsensusStateRequest(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.revisionNumber != null) + if ($util.Long) + (message.revisionNumber = $util.Long.fromValue(object.revisionNumber)).unsigned = true; + else if (typeof object.revisionNumber === "string") + message.revisionNumber = parseInt(object.revisionNumber, 10); + else if (typeof object.revisionNumber === "number") + message.revisionNumber = object.revisionNumber; + else if (typeof object.revisionNumber === "object") + message.revisionNumber = new $util.LongBits(object.revisionNumber.low >>> 0, object.revisionNumber.high >>> 0).toNumber(true); + if (object.revisionHeight != null) + if ($util.Long) + (message.revisionHeight = $util.Long.fromValue(object.revisionHeight)).unsigned = true; + else if (typeof object.revisionHeight === "string") + message.revisionHeight = parseInt(object.revisionHeight, 10); + else if (typeof object.revisionHeight === "number") + message.revisionHeight = object.revisionHeight; + else if (typeof object.revisionHeight === "object") + message.revisionHeight = new $util.LongBits(object.revisionHeight.low >>> 0, object.revisionHeight.high >>> 0).toNumber(true); + if (object.latestHeight != null) + message.latestHeight = Boolean(object.latestHeight); + return message; + }; + + /** + * Creates a plain object from a QueryConsensusStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @static + * @param {ibc.core.client.v1.QueryConsensusStateRequest} message QueryConsensusStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryConsensusStateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.clientId = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.revisionNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.revisionNumber = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.revisionHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.revisionHeight = options.longs === String ? "0" : 0; + object.latestHeight = false; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) + if (typeof message.revisionNumber === "number") + object.revisionNumber = options.longs === String ? String(message.revisionNumber) : message.revisionNumber; + else + object.revisionNumber = options.longs === String ? $util.Long.prototype.toString.call(message.revisionNumber) : options.longs === Number ? new $util.LongBits(message.revisionNumber.low >>> 0, message.revisionNumber.high >>> 0).toNumber(true) : message.revisionNumber; + if (message.revisionHeight != null && message.hasOwnProperty("revisionHeight")) + if (typeof message.revisionHeight === "number") + object.revisionHeight = options.longs === String ? String(message.revisionHeight) : message.revisionHeight; + else + object.revisionHeight = options.longs === String ? $util.Long.prototype.toString.call(message.revisionHeight) : options.longs === Number ? new $util.LongBits(message.revisionHeight.low >>> 0, message.revisionHeight.high >>> 0).toNumber(true) : message.revisionHeight; + if (message.latestHeight != null && message.hasOwnProperty("latestHeight")) + object.latestHeight = message.latestHeight; + return object; + }; + + /** + * Converts this QueryConsensusStateRequest to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @instance + * @returns {Object.} JSON object + */ + QueryConsensusStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryConsensusStateRequest; + })(v1.QueryConsensusStateRequest || {}); + + v1.QueryConsensusStateResponse = (function(QueryConsensusStateResponse) { + + /** + * Properties of a QueryConsensusStateResponse. + * @memberof ibc.core.client.v1 + * @interface IQueryConsensusStateResponse + * @property {google.protobuf.IAny|null} [consensusState] QueryConsensusStateResponse consensusState + * @property {Uint8Array|null} [proof] QueryConsensusStateResponse proof + * @property {ibc.core.client.v1.IHeight|null} [proofHeight] QueryConsensusStateResponse proofHeight + */ + + /** + * Constructs a new QueryConsensusStateResponse. + * @memberof ibc.core.client.v1 + * @classdesc Represents a QueryConsensusStateResponse. + * @implements IQueryConsensusStateResponse + * @constructor + * @param {ibc.core.client.v1.IQueryConsensusStateResponse=} [properties] Properties to set + */ + function QueryConsensusStateResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryConsensusStateResponse consensusState. + * @member {google.protobuf.IAny|null|undefined} consensusState + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @instance + */ + QueryConsensusStateResponse.prototype.consensusState = null; + + /** + * QueryConsensusStateResponse proof. + * @member {Uint8Array} proof + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @instance + */ + QueryConsensusStateResponse.prototype.proof = $util.newBuffer([]); + + /** + * QueryConsensusStateResponse proofHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} proofHeight + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @instance + */ + QueryConsensusStateResponse.prototype.proofHeight = null; + + /** + * Creates a new QueryConsensusStateResponse instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @static + * @param {ibc.core.client.v1.IQueryConsensusStateResponse=} [properties] Properties to set + * @returns {ibc.core.client.v1.QueryConsensusStateResponse} QueryConsensusStateResponse instance + */ + QueryConsensusStateResponse.create = function create(properties) { + return new QueryConsensusStateResponse(properties); + }; + + /** + * Encodes the specified QueryConsensusStateResponse message. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @static + * @param {ibc.core.client.v1.IQueryConsensusStateResponse} message QueryConsensusStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConsensusStateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.consensusState != null && Object.hasOwnProperty.call(message, "consensusState")) + $root.google.protobuf.Any.encode(message.consensusState, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); + if (message.proofHeight != null && Object.hasOwnProperty.call(message, "proofHeight")) + $root.ibc.core.client.v1.Height.encode(message.proofHeight, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryConsensusStateResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @static + * @param {ibc.core.client.v1.IQueryConsensusStateResponse} message QueryConsensusStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConsensusStateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryConsensusStateResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.QueryConsensusStateResponse} QueryConsensusStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConsensusStateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryConsensusStateResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consensusState = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryConsensusStateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.QueryConsensusStateResponse} QueryConsensusStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConsensusStateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryConsensusStateResponse message. + * @function verify + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryConsensusStateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.consensusState != null && message.hasOwnProperty("consensusState")) { + let error = $root.google.protobuf.Any.verify(message.consensusState); + if (error) + return "consensusState." + error; + } + if (message.proof != null && message.hasOwnProperty("proof")) + if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) + return "proof: buffer expected"; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) { + let error = $root.ibc.core.client.v1.Height.verify(message.proofHeight); + if (error) + return "proofHeight." + error; + } + return null; + }; + + /** + * Creates a QueryConsensusStateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.QueryConsensusStateResponse} QueryConsensusStateResponse + */ + QueryConsensusStateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.QueryConsensusStateResponse) + return object; + let message = new $root.ibc.core.client.v1.QueryConsensusStateResponse(); + if (object.consensusState != null) { + if (typeof object.consensusState !== "object") + throw TypeError(".ibc.core.client.v1.QueryConsensusStateResponse.consensusState: object expected"); + message.consensusState = $root.google.protobuf.Any.fromObject(object.consensusState); + } + if (object.proof != null) + if (typeof object.proof === "string") + $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); + else if (object.proof.length) + message.proof = object.proof; + if (object.proofHeight != null) { + if (typeof object.proofHeight !== "object") + throw TypeError(".ibc.core.client.v1.QueryConsensusStateResponse.proofHeight: object expected"); + message.proofHeight = $root.ibc.core.client.v1.Height.fromObject(object.proofHeight); + } + return message; + }; + + /** + * Creates a plain object from a QueryConsensusStateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @static + * @param {ibc.core.client.v1.QueryConsensusStateResponse} message QueryConsensusStateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryConsensusStateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.consensusState = null; + if (options.bytes === String) + object.proof = ""; + else { + object.proof = []; + if (options.bytes !== Array) + object.proof = $util.newBuffer(object.proof); + } + object.proofHeight = null; + } + if (message.consensusState != null && message.hasOwnProperty("consensusState")) + object.consensusState = $root.google.protobuf.Any.toObject(message.consensusState, options); + if (message.proof != null && message.hasOwnProperty("proof")) + object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) + object.proofHeight = $root.ibc.core.client.v1.Height.toObject(message.proofHeight, options); + return object; + }; + + /** + * Converts this QueryConsensusStateResponse to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @instance + * @returns {Object.} JSON object + */ + QueryConsensusStateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryConsensusStateResponse; + })(v1.QueryConsensusStateResponse || {}); + + v1.QueryConsensusStatesRequest = (function(QueryConsensusStatesRequest) { + + /** + * Properties of a QueryConsensusStatesRequest. + * @memberof ibc.core.client.v1 + * @interface IQueryConsensusStatesRequest + * @property {string|null} [clientId] QueryConsensusStatesRequest clientId + * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryConsensusStatesRequest pagination + */ + + /** + * Constructs a new QueryConsensusStatesRequest. + * @memberof ibc.core.client.v1 + * @classdesc Represents a QueryConsensusStatesRequest. + * @implements IQueryConsensusStatesRequest + * @constructor + * @param {ibc.core.client.v1.IQueryConsensusStatesRequest=} [properties] Properties to set + */ + function QueryConsensusStatesRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryConsensusStatesRequest clientId. + * @member {string} clientId + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @instance + */ + QueryConsensusStatesRequest.prototype.clientId = ""; + + /** + * QueryConsensusStatesRequest pagination. + * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @instance + */ + QueryConsensusStatesRequest.prototype.pagination = null; + + /** + * Creates a new QueryConsensusStatesRequest instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @static + * @param {ibc.core.client.v1.IQueryConsensusStatesRequest=} [properties] Properties to set + * @returns {ibc.core.client.v1.QueryConsensusStatesRequest} QueryConsensusStatesRequest instance + */ + QueryConsensusStatesRequest.create = function create(properties) { + return new QueryConsensusStatesRequest(properties); + }; + + /** + * Encodes the specified QueryConsensusStatesRequest message. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStatesRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @static + * @param {ibc.core.client.v1.IQueryConsensusStatesRequest} message QueryConsensusStatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConsensusStatesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryConsensusStatesRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStatesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @static + * @param {ibc.core.client.v1.IQueryConsensusStatesRequest} message QueryConsensusStatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConsensusStatesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryConsensusStatesRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.QueryConsensusStatesRequest} QueryConsensusStatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConsensusStatesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryConsensusStatesRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryConsensusStatesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.QueryConsensusStatesRequest} QueryConsensusStatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConsensusStatesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryConsensusStatesRequest message. + * @function verify + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryConsensusStatesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryConsensusStatesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.QueryConsensusStatesRequest} QueryConsensusStatesRequest + */ + QueryConsensusStatesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.QueryConsensusStatesRequest) + return object; + let message = new $root.ibc.core.client.v1.QueryConsensusStatesRequest(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".ibc.core.client.v1.QueryConsensusStatesRequest.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryConsensusStatesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @static + * @param {ibc.core.client.v1.QueryConsensusStatesRequest} message QueryConsensusStatesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryConsensusStatesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.clientId = ""; + object.pagination = null; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryConsensusStatesRequest to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @instance + * @returns {Object.} JSON object + */ + QueryConsensusStatesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryConsensusStatesRequest; + })(v1.QueryConsensusStatesRequest || {}); + + v1.QueryConsensusStatesResponse = (function(QueryConsensusStatesResponse) { + + /** + * Properties of a QueryConsensusStatesResponse. + * @memberof ibc.core.client.v1 + * @interface IQueryConsensusStatesResponse + * @property {Array.|null} [consensusStates] QueryConsensusStatesResponse consensusStates + * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryConsensusStatesResponse pagination + */ + + /** + * Constructs a new QueryConsensusStatesResponse. + * @memberof ibc.core.client.v1 + * @classdesc Represents a QueryConsensusStatesResponse. + * @implements IQueryConsensusStatesResponse + * @constructor + * @param {ibc.core.client.v1.IQueryConsensusStatesResponse=} [properties] Properties to set + */ + function QueryConsensusStatesResponse(properties) { + this.consensusStates = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryConsensusStatesResponse consensusStates. + * @member {Array.} consensusStates + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @instance + */ + QueryConsensusStatesResponse.prototype.consensusStates = $util.emptyArray; + + /** + * QueryConsensusStatesResponse pagination. + * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @instance + */ + QueryConsensusStatesResponse.prototype.pagination = null; + + /** + * Creates a new QueryConsensusStatesResponse instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @static + * @param {ibc.core.client.v1.IQueryConsensusStatesResponse=} [properties] Properties to set + * @returns {ibc.core.client.v1.QueryConsensusStatesResponse} QueryConsensusStatesResponse instance + */ + QueryConsensusStatesResponse.create = function create(properties) { + return new QueryConsensusStatesResponse(properties); + }; + + /** + * Encodes the specified QueryConsensusStatesResponse message. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStatesResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @static + * @param {ibc.core.client.v1.IQueryConsensusStatesResponse} message QueryConsensusStatesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConsensusStatesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.consensusStates != null && message.consensusStates.length) + for (let i = 0; i < message.consensusStates.length; ++i) + $root.ibc.core.client.v1.ConsensusStateWithHeight.encode(message.consensusStates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryConsensusStatesResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStatesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @static + * @param {ibc.core.client.v1.IQueryConsensusStatesResponse} message QueryConsensusStatesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConsensusStatesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryConsensusStatesResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.QueryConsensusStatesResponse} QueryConsensusStatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConsensusStatesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryConsensusStatesResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.consensusStates && message.consensusStates.length)) + message.consensusStates = []; + message.consensusStates.push($root.ibc.core.client.v1.ConsensusStateWithHeight.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryConsensusStatesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.QueryConsensusStatesResponse} QueryConsensusStatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConsensusStatesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryConsensusStatesResponse message. + * @function verify + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryConsensusStatesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.consensusStates != null && message.hasOwnProperty("consensusStates")) { + if (!Array.isArray(message.consensusStates)) + return "consensusStates: array expected"; + for (let i = 0; i < message.consensusStates.length; ++i) { + let error = $root.ibc.core.client.v1.ConsensusStateWithHeight.verify(message.consensusStates[i]); + if (error) + return "consensusStates." + error; + } + } + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryConsensusStatesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.QueryConsensusStatesResponse} QueryConsensusStatesResponse + */ + QueryConsensusStatesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.QueryConsensusStatesResponse) + return object; + let message = new $root.ibc.core.client.v1.QueryConsensusStatesResponse(); + if (object.consensusStates) { + if (!Array.isArray(object.consensusStates)) + throw TypeError(".ibc.core.client.v1.QueryConsensusStatesResponse.consensusStates: array expected"); + message.consensusStates = []; + for (let i = 0; i < object.consensusStates.length; ++i) { + if (typeof object.consensusStates[i] !== "object") + throw TypeError(".ibc.core.client.v1.QueryConsensusStatesResponse.consensusStates: object expected"); + message.consensusStates[i] = $root.ibc.core.client.v1.ConsensusStateWithHeight.fromObject(object.consensusStates[i]); + } + } + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".ibc.core.client.v1.QueryConsensusStatesResponse.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryConsensusStatesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @static + * @param {ibc.core.client.v1.QueryConsensusStatesResponse} message QueryConsensusStatesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryConsensusStatesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.consensusStates = []; + if (options.defaults) + object.pagination = null; + if (message.consensusStates && message.consensusStates.length) { + object.consensusStates = []; + for (let j = 0; j < message.consensusStates.length; ++j) + object.consensusStates[j] = $root.ibc.core.client.v1.ConsensusStateWithHeight.toObject(message.consensusStates[j], options); + } + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryConsensusStatesResponse to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @instance + * @returns {Object.} JSON object + */ + QueryConsensusStatesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryConsensusStatesResponse; + })(v1.QueryConsensusStatesResponse || {}); + + v1.QueryClientParamsRequest = (function(QueryClientParamsRequest) { + + /** + * Properties of a QueryClientParamsRequest. + * @memberof ibc.core.client.v1 + * @interface IQueryClientParamsRequest + */ + + /** + * Constructs a new QueryClientParamsRequest. + * @memberof ibc.core.client.v1 + * @classdesc Represents a QueryClientParamsRequest. + * @implements IQueryClientParamsRequest + * @constructor + * @param {ibc.core.client.v1.IQueryClientParamsRequest=} [properties] Properties to set + */ + function QueryClientParamsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new QueryClientParamsRequest instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.QueryClientParamsRequest + * @static + * @param {ibc.core.client.v1.IQueryClientParamsRequest=} [properties] Properties to set + * @returns {ibc.core.client.v1.QueryClientParamsRequest} QueryClientParamsRequest instance + */ + QueryClientParamsRequest.create = function create(properties) { + return new QueryClientParamsRequest(properties); + }; + + /** + * Encodes the specified QueryClientParamsRequest message. Does not implicitly {@link ibc.core.client.v1.QueryClientParamsRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.QueryClientParamsRequest + * @static + * @param {ibc.core.client.v1.IQueryClientParamsRequest} message QueryClientParamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientParamsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified QueryClientParamsRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientParamsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.QueryClientParamsRequest + * @static + * @param {ibc.core.client.v1.IQueryClientParamsRequest} message QueryClientParamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryClientParamsRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.QueryClientParamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.QueryClientParamsRequest} QueryClientParamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientParamsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientParamsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryClientParamsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.QueryClientParamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.QueryClientParamsRequest} QueryClientParamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientParamsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryClientParamsRequest message. + * @function verify + * @memberof ibc.core.client.v1.QueryClientParamsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryClientParamsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a QueryClientParamsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.QueryClientParamsRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.QueryClientParamsRequest} QueryClientParamsRequest + */ + QueryClientParamsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.QueryClientParamsRequest) + return object; + return new $root.ibc.core.client.v1.QueryClientParamsRequest(); + }; + + /** + * Creates a plain object from a QueryClientParamsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.QueryClientParamsRequest + * @static + * @param {ibc.core.client.v1.QueryClientParamsRequest} message QueryClientParamsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryClientParamsRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this QueryClientParamsRequest to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.QueryClientParamsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryClientParamsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryClientParamsRequest; + })(v1.QueryClientParamsRequest || {}); + + v1.QueryClientParamsResponse = (function(QueryClientParamsResponse) { + + /** + * Properties of a QueryClientParamsResponse. + * @memberof ibc.core.client.v1 + * @interface IQueryClientParamsResponse + * @property {ibc.core.client.v1.IParams|null} [params] QueryClientParamsResponse params + */ + + /** + * Constructs a new QueryClientParamsResponse. + * @memberof ibc.core.client.v1 + * @classdesc Represents a QueryClientParamsResponse. + * @implements IQueryClientParamsResponse + * @constructor + * @param {ibc.core.client.v1.IQueryClientParamsResponse=} [properties] Properties to set + */ + function QueryClientParamsResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryClientParamsResponse params. + * @member {ibc.core.client.v1.IParams|null|undefined} params + * @memberof ibc.core.client.v1.QueryClientParamsResponse + * @instance + */ + QueryClientParamsResponse.prototype.params = null; + + /** + * Creates a new QueryClientParamsResponse instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.QueryClientParamsResponse + * @static + * @param {ibc.core.client.v1.IQueryClientParamsResponse=} [properties] Properties to set + * @returns {ibc.core.client.v1.QueryClientParamsResponse} QueryClientParamsResponse instance + */ + QueryClientParamsResponse.create = function create(properties) { + return new QueryClientParamsResponse(properties); + }; + + /** + * Encodes the specified QueryClientParamsResponse message. Does not implicitly {@link ibc.core.client.v1.QueryClientParamsResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.QueryClientParamsResponse + * @static + * @param {ibc.core.client.v1.IQueryClientParamsResponse} message QueryClientParamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientParamsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.ibc.core.client.v1.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryClientParamsResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientParamsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.QueryClientParamsResponse + * @static + * @param {ibc.core.client.v1.IQueryClientParamsResponse} message QueryClientParamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryClientParamsResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.QueryClientParamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.QueryClientParamsResponse} QueryClientParamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientParamsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientParamsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = $root.ibc.core.client.v1.Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryClientParamsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.QueryClientParamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.QueryClientParamsResponse} QueryClientParamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientParamsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryClientParamsResponse message. + * @function verify + * @memberof ibc.core.client.v1.QueryClientParamsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryClientParamsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.params != null && message.hasOwnProperty("params")) { + let error = $root.ibc.core.client.v1.Params.verify(message.params); + if (error) + return "params." + error; + } + return null; + }; + + /** + * Creates a QueryClientParamsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.QueryClientParamsResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.QueryClientParamsResponse} QueryClientParamsResponse + */ + QueryClientParamsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.QueryClientParamsResponse) + return object; + let message = new $root.ibc.core.client.v1.QueryClientParamsResponse(); + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".ibc.core.client.v1.QueryClientParamsResponse.params: object expected"); + message.params = $root.ibc.core.client.v1.Params.fromObject(object.params); + } + return message; + }; + + /** + * Creates a plain object from a QueryClientParamsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.QueryClientParamsResponse + * @static + * @param {ibc.core.client.v1.QueryClientParamsResponse} message QueryClientParamsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryClientParamsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.params = null; + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.ibc.core.client.v1.Params.toObject(message.params, options); + return object; + }; + + /** + * Converts this QueryClientParamsResponse to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.QueryClientParamsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryClientParamsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryClientParamsResponse; + })(v1.QueryClientParamsResponse || {}); + + v1.Msg = (function(Msg) { + + /** + * Constructs a new Msg service. + * @memberof ibc.core.client.v1 + * @classdesc Represents a Msg + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Msg(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; + + /** + * Creates new Msg service using the specified rpc implementation. + * @function create + * @memberof ibc.core.client.v1.Msg + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Msg} RPC service. Useful where requests and/or responses are streamed. + */ + Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link ibc.core.client.v1.Msg#createClient}. + * @memberof ibc.core.client.v1.Msg + * @typedef CreateClientCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.client.v1.IMsgCreateClientResponse} [response] MsgCreateClientResponse + */ + + /** + * Calls CreateClient. + * @function createClient + * @memberof ibc.core.client.v1.Msg + * @instance + * @param {ibc.core.client.v1.IMsgCreateClient} request MsgCreateClient message or plain object + * @param {ibc.core.client.v1.Msg.CreateClientCallback} callback Node-style callback called with the error, if any, and MsgCreateClientResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.createClient = function createClient(request, callback) { + return this.rpcCall(createClient, $root.ibc.core.client.v1.MsgCreateClient, $root.ibc.core.client.v1.MsgCreateClientResponse, request, callback); + }, "name", { value: "CreateClient" }); + + /** + * Calls CreateClient. + * @function createClient + * @memberof ibc.core.client.v1.Msg + * @instance + * @param {ibc.core.client.v1.IMsgCreateClient} request MsgCreateClient message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.client.v1.Msg#updateClient}. + * @memberof ibc.core.client.v1.Msg + * @typedef UpdateClientCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.client.v1.IMsgUpdateClientResponse} [response] MsgUpdateClientResponse + */ + + /** + * Calls UpdateClient. + * @function updateClient + * @memberof ibc.core.client.v1.Msg + * @instance + * @param {ibc.core.client.v1.IMsgUpdateClient} request MsgUpdateClient message or plain object + * @param {ibc.core.client.v1.Msg.UpdateClientCallback} callback Node-style callback called with the error, if any, and MsgUpdateClientResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.updateClient = function updateClient(request, callback) { + return this.rpcCall(updateClient, $root.ibc.core.client.v1.MsgUpdateClient, $root.ibc.core.client.v1.MsgUpdateClientResponse, request, callback); + }, "name", { value: "UpdateClient" }); + + /** + * Calls UpdateClient. + * @function updateClient + * @memberof ibc.core.client.v1.Msg + * @instance + * @param {ibc.core.client.v1.IMsgUpdateClient} request MsgUpdateClient message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.client.v1.Msg#upgradeClient}. + * @memberof ibc.core.client.v1.Msg + * @typedef UpgradeClientCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.client.v1.IMsgUpgradeClientResponse} [response] MsgUpgradeClientResponse + */ + + /** + * Calls UpgradeClient. + * @function upgradeClient + * @memberof ibc.core.client.v1.Msg + * @instance + * @param {ibc.core.client.v1.IMsgUpgradeClient} request MsgUpgradeClient message or plain object + * @param {ibc.core.client.v1.Msg.UpgradeClientCallback} callback Node-style callback called with the error, if any, and MsgUpgradeClientResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.upgradeClient = function upgradeClient(request, callback) { + return this.rpcCall(upgradeClient, $root.ibc.core.client.v1.MsgUpgradeClient, $root.ibc.core.client.v1.MsgUpgradeClientResponse, request, callback); + }, "name", { value: "UpgradeClient" }); + + /** + * Calls UpgradeClient. + * @function upgradeClient + * @memberof ibc.core.client.v1.Msg + * @instance + * @param {ibc.core.client.v1.IMsgUpgradeClient} request MsgUpgradeClient message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.client.v1.Msg#submitMisbehaviour}. + * @memberof ibc.core.client.v1.Msg + * @typedef SubmitMisbehaviourCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviourResponse} [response] MsgSubmitMisbehaviourResponse + */ + + /** + * Calls SubmitMisbehaviour. + * @function submitMisbehaviour + * @memberof ibc.core.client.v1.Msg + * @instance + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviour} request MsgSubmitMisbehaviour message or plain object + * @param {ibc.core.client.v1.Msg.SubmitMisbehaviourCallback} callback Node-style callback called with the error, if any, and MsgSubmitMisbehaviourResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.submitMisbehaviour = function submitMisbehaviour(request, callback) { + return this.rpcCall(submitMisbehaviour, $root.ibc.core.client.v1.MsgSubmitMisbehaviour, $root.ibc.core.client.v1.MsgSubmitMisbehaviourResponse, request, callback); + }, "name", { value: "SubmitMisbehaviour" }); + + /** + * Calls SubmitMisbehaviour. + * @function submitMisbehaviour + * @memberof ibc.core.client.v1.Msg + * @instance + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviour} request MsgSubmitMisbehaviour message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Msg; + })(v1.Msg || {}); + + v1.MsgCreateClient = (function(MsgCreateClient) { + + /** + * Properties of a MsgCreateClient. + * @memberof ibc.core.client.v1 + * @interface IMsgCreateClient + * @property {google.protobuf.IAny|null} [clientState] MsgCreateClient clientState + * @property {google.protobuf.IAny|null} [consensusState] MsgCreateClient consensusState + * @property {string|null} [signer] MsgCreateClient signer + */ + + /** + * Constructs a new MsgCreateClient. + * @memberof ibc.core.client.v1 + * @classdesc Represents a MsgCreateClient. + * @implements IMsgCreateClient + * @constructor + * @param {ibc.core.client.v1.IMsgCreateClient=} [properties] Properties to set + */ + function MsgCreateClient(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgCreateClient clientState. + * @member {google.protobuf.IAny|null|undefined} clientState + * @memberof ibc.core.client.v1.MsgCreateClient + * @instance + */ + MsgCreateClient.prototype.clientState = null; + + /** + * MsgCreateClient consensusState. + * @member {google.protobuf.IAny|null|undefined} consensusState + * @memberof ibc.core.client.v1.MsgCreateClient + * @instance + */ + MsgCreateClient.prototype.consensusState = null; + + /** + * MsgCreateClient signer. + * @member {string} signer + * @memberof ibc.core.client.v1.MsgCreateClient + * @instance + */ + MsgCreateClient.prototype.signer = ""; + + /** + * Creates a new MsgCreateClient instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.MsgCreateClient + * @static + * @param {ibc.core.client.v1.IMsgCreateClient=} [properties] Properties to set + * @returns {ibc.core.client.v1.MsgCreateClient} MsgCreateClient instance + */ + MsgCreateClient.create = function create(properties) { + return new MsgCreateClient(properties); + }; + + /** + * Encodes the specified MsgCreateClient message. Does not implicitly {@link ibc.core.client.v1.MsgCreateClient.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.MsgCreateClient + * @static + * @param {ibc.core.client.v1.IMsgCreateClient} message MsgCreateClient message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateClient.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientState != null && Object.hasOwnProperty.call(message, "clientState")) + $root.google.protobuf.Any.encode(message.clientState, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.consensusState != null && Object.hasOwnProperty.call(message, "consensusState")) + $root.google.protobuf.Any.encode(message.consensusState, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.signer); + return writer; + }; + + /** + * Encodes the specified MsgCreateClient message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgCreateClient.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.MsgCreateClient + * @static + * @param {ibc.core.client.v1.IMsgCreateClient} message MsgCreateClient message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateClient.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgCreateClient message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.MsgCreateClient + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.MsgCreateClient} MsgCreateClient + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateClient.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgCreateClient(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientState = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 2: + message.consensusState = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgCreateClient message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.MsgCreateClient + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.MsgCreateClient} MsgCreateClient + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateClient.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgCreateClient message. + * @function verify + * @memberof ibc.core.client.v1.MsgCreateClient + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgCreateClient.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientState != null && message.hasOwnProperty("clientState")) { + let error = $root.google.protobuf.Any.verify(message.clientState); + if (error) + return "clientState." + error; + } + if (message.consensusState != null && message.hasOwnProperty("consensusState")) { + let error = $root.google.protobuf.Any.verify(message.consensusState); + if (error) + return "consensusState." + error; + } + if (message.signer != null && message.hasOwnProperty("signer")) + if (!$util.isString(message.signer)) + return "signer: string expected"; + return null; + }; + + /** + * Creates a MsgCreateClient message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.MsgCreateClient + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.MsgCreateClient} MsgCreateClient + */ + MsgCreateClient.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.MsgCreateClient) + return object; + let message = new $root.ibc.core.client.v1.MsgCreateClient(); + if (object.clientState != null) { + if (typeof object.clientState !== "object") + throw TypeError(".ibc.core.client.v1.MsgCreateClient.clientState: object expected"); + message.clientState = $root.google.protobuf.Any.fromObject(object.clientState); + } + if (object.consensusState != null) { + if (typeof object.consensusState !== "object") + throw TypeError(".ibc.core.client.v1.MsgCreateClient.consensusState: object expected"); + message.consensusState = $root.google.protobuf.Any.fromObject(object.consensusState); + } + if (object.signer != null) + message.signer = String(object.signer); + return message; + }; + + /** + * Creates a plain object from a MsgCreateClient message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.MsgCreateClient + * @static + * @param {ibc.core.client.v1.MsgCreateClient} message MsgCreateClient + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgCreateClient.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.clientState = null; + object.consensusState = null; + object.signer = ""; + } + if (message.clientState != null && message.hasOwnProperty("clientState")) + object.clientState = $root.google.protobuf.Any.toObject(message.clientState, options); + if (message.consensusState != null && message.hasOwnProperty("consensusState")) + object.consensusState = $root.google.protobuf.Any.toObject(message.consensusState, options); + if (message.signer != null && message.hasOwnProperty("signer")) + object.signer = message.signer; + return object; + }; + + /** + * Converts this MsgCreateClient to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.MsgCreateClient + * @instance + * @returns {Object.} JSON object + */ + MsgCreateClient.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgCreateClient; + })(v1.MsgCreateClient || {}); + + v1.MsgCreateClientResponse = (function(MsgCreateClientResponse) { + + /** + * Properties of a MsgCreateClientResponse. + * @memberof ibc.core.client.v1 + * @interface IMsgCreateClientResponse + */ + + /** + * Constructs a new MsgCreateClientResponse. + * @memberof ibc.core.client.v1 + * @classdesc Represents a MsgCreateClientResponse. + * @implements IMsgCreateClientResponse + * @constructor + * @param {ibc.core.client.v1.IMsgCreateClientResponse=} [properties] Properties to set + */ + function MsgCreateClientResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgCreateClientResponse instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.MsgCreateClientResponse + * @static + * @param {ibc.core.client.v1.IMsgCreateClientResponse=} [properties] Properties to set + * @returns {ibc.core.client.v1.MsgCreateClientResponse} MsgCreateClientResponse instance + */ + MsgCreateClientResponse.create = function create(properties) { + return new MsgCreateClientResponse(properties); + }; + + /** + * Encodes the specified MsgCreateClientResponse message. Does not implicitly {@link ibc.core.client.v1.MsgCreateClientResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.MsgCreateClientResponse + * @static + * @param {ibc.core.client.v1.IMsgCreateClientResponse} message MsgCreateClientResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateClientResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgCreateClientResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgCreateClientResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.MsgCreateClientResponse + * @static + * @param {ibc.core.client.v1.IMsgCreateClientResponse} message MsgCreateClientResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateClientResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgCreateClientResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.MsgCreateClientResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.MsgCreateClientResponse} MsgCreateClientResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateClientResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgCreateClientResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgCreateClientResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.MsgCreateClientResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.MsgCreateClientResponse} MsgCreateClientResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateClientResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgCreateClientResponse message. + * @function verify + * @memberof ibc.core.client.v1.MsgCreateClientResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgCreateClientResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgCreateClientResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.MsgCreateClientResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.MsgCreateClientResponse} MsgCreateClientResponse + */ + MsgCreateClientResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.MsgCreateClientResponse) + return object; + return new $root.ibc.core.client.v1.MsgCreateClientResponse(); + }; + + /** + * Creates a plain object from a MsgCreateClientResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.MsgCreateClientResponse + * @static + * @param {ibc.core.client.v1.MsgCreateClientResponse} message MsgCreateClientResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgCreateClientResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgCreateClientResponse to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.MsgCreateClientResponse + * @instance + * @returns {Object.} JSON object + */ + MsgCreateClientResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgCreateClientResponse; + })(v1.MsgCreateClientResponse || {}); + + v1.MsgUpdateClient = (function(MsgUpdateClient) { + + /** + * Properties of a MsgUpdateClient. + * @memberof ibc.core.client.v1 + * @interface IMsgUpdateClient + * @property {string|null} [clientId] MsgUpdateClient clientId + * @property {google.protobuf.IAny|null} [header] MsgUpdateClient header + * @property {string|null} [signer] MsgUpdateClient signer + */ + + /** + * Constructs a new MsgUpdateClient. + * @memberof ibc.core.client.v1 + * @classdesc Represents a MsgUpdateClient. + * @implements IMsgUpdateClient + * @constructor + * @param {ibc.core.client.v1.IMsgUpdateClient=} [properties] Properties to set + */ + function MsgUpdateClient(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgUpdateClient clientId. + * @member {string} clientId + * @memberof ibc.core.client.v1.MsgUpdateClient + * @instance + */ + MsgUpdateClient.prototype.clientId = ""; + + /** + * MsgUpdateClient header. + * @member {google.protobuf.IAny|null|undefined} header + * @memberof ibc.core.client.v1.MsgUpdateClient + * @instance + */ + MsgUpdateClient.prototype.header = null; + + /** + * MsgUpdateClient signer. + * @member {string} signer + * @memberof ibc.core.client.v1.MsgUpdateClient + * @instance + */ + MsgUpdateClient.prototype.signer = ""; + + /** + * Creates a new MsgUpdateClient instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.MsgUpdateClient + * @static + * @param {ibc.core.client.v1.IMsgUpdateClient=} [properties] Properties to set + * @returns {ibc.core.client.v1.MsgUpdateClient} MsgUpdateClient instance + */ + MsgUpdateClient.create = function create(properties) { + return new MsgUpdateClient(properties); + }; + + /** + * Encodes the specified MsgUpdateClient message. Does not implicitly {@link ibc.core.client.v1.MsgUpdateClient.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.MsgUpdateClient + * @static + * @param {ibc.core.client.v1.IMsgUpdateClient} message MsgUpdateClient message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUpdateClient.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + $root.google.protobuf.Any.encode(message.header, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.signer); + return writer; + }; + + /** + * Encodes the specified MsgUpdateClient message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgUpdateClient.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.MsgUpdateClient + * @static + * @param {ibc.core.client.v1.IMsgUpdateClient} message MsgUpdateClient message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUpdateClient.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgUpdateClient message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.MsgUpdateClient + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.MsgUpdateClient} MsgUpdateClient + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUpdateClient.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgUpdateClient(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.header = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgUpdateClient message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.MsgUpdateClient + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.MsgUpdateClient} MsgUpdateClient + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUpdateClient.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgUpdateClient message. + * @function verify + * @memberof ibc.core.client.v1.MsgUpdateClient + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgUpdateClient.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.header != null && message.hasOwnProperty("header")) { + let error = $root.google.protobuf.Any.verify(message.header); + if (error) + return "header." + error; + } + if (message.signer != null && message.hasOwnProperty("signer")) + if (!$util.isString(message.signer)) + return "signer: string expected"; + return null; + }; + + /** + * Creates a MsgUpdateClient message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.MsgUpdateClient + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.MsgUpdateClient} MsgUpdateClient + */ + MsgUpdateClient.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.MsgUpdateClient) + return object; + let message = new $root.ibc.core.client.v1.MsgUpdateClient(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.header != null) { + if (typeof object.header !== "object") + throw TypeError(".ibc.core.client.v1.MsgUpdateClient.header: object expected"); + message.header = $root.google.protobuf.Any.fromObject(object.header); + } + if (object.signer != null) + message.signer = String(object.signer); + return message; + }; + + /** + * Creates a plain object from a MsgUpdateClient message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.MsgUpdateClient + * @static + * @param {ibc.core.client.v1.MsgUpdateClient} message MsgUpdateClient + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgUpdateClient.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.clientId = ""; + object.header = null; + object.signer = ""; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.header != null && message.hasOwnProperty("header")) + object.header = $root.google.protobuf.Any.toObject(message.header, options); + if (message.signer != null && message.hasOwnProperty("signer")) + object.signer = message.signer; + return object; + }; + + /** + * Converts this MsgUpdateClient to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.MsgUpdateClient + * @instance + * @returns {Object.} JSON object + */ + MsgUpdateClient.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgUpdateClient; + })(v1.MsgUpdateClient || {}); + + v1.MsgUpdateClientResponse = (function(MsgUpdateClientResponse) { + + /** + * Properties of a MsgUpdateClientResponse. + * @memberof ibc.core.client.v1 + * @interface IMsgUpdateClientResponse + */ + + /** + * Constructs a new MsgUpdateClientResponse. + * @memberof ibc.core.client.v1 + * @classdesc Represents a MsgUpdateClientResponse. + * @implements IMsgUpdateClientResponse + * @constructor + * @param {ibc.core.client.v1.IMsgUpdateClientResponse=} [properties] Properties to set + */ + function MsgUpdateClientResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgUpdateClientResponse instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.MsgUpdateClientResponse + * @static + * @param {ibc.core.client.v1.IMsgUpdateClientResponse=} [properties] Properties to set + * @returns {ibc.core.client.v1.MsgUpdateClientResponse} MsgUpdateClientResponse instance + */ + MsgUpdateClientResponse.create = function create(properties) { + return new MsgUpdateClientResponse(properties); + }; + + /** + * Encodes the specified MsgUpdateClientResponse message. Does not implicitly {@link ibc.core.client.v1.MsgUpdateClientResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.MsgUpdateClientResponse + * @static + * @param {ibc.core.client.v1.IMsgUpdateClientResponse} message MsgUpdateClientResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUpdateClientResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgUpdateClientResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgUpdateClientResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.MsgUpdateClientResponse + * @static + * @param {ibc.core.client.v1.IMsgUpdateClientResponse} message MsgUpdateClientResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUpdateClientResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgUpdateClientResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.MsgUpdateClientResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.MsgUpdateClientResponse} MsgUpdateClientResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUpdateClientResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgUpdateClientResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgUpdateClientResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.MsgUpdateClientResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.MsgUpdateClientResponse} MsgUpdateClientResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUpdateClientResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgUpdateClientResponse message. + * @function verify + * @memberof ibc.core.client.v1.MsgUpdateClientResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgUpdateClientResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgUpdateClientResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.MsgUpdateClientResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.MsgUpdateClientResponse} MsgUpdateClientResponse + */ + MsgUpdateClientResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.MsgUpdateClientResponse) + return object; + return new $root.ibc.core.client.v1.MsgUpdateClientResponse(); + }; + + /** + * Creates a plain object from a MsgUpdateClientResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.MsgUpdateClientResponse + * @static + * @param {ibc.core.client.v1.MsgUpdateClientResponse} message MsgUpdateClientResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgUpdateClientResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgUpdateClientResponse to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.MsgUpdateClientResponse + * @instance + * @returns {Object.} JSON object + */ + MsgUpdateClientResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgUpdateClientResponse; + })(v1.MsgUpdateClientResponse || {}); + + v1.MsgUpgradeClient = (function(MsgUpgradeClient) { + + /** + * Properties of a MsgUpgradeClient. + * @memberof ibc.core.client.v1 + * @interface IMsgUpgradeClient + * @property {string|null} [clientId] MsgUpgradeClient clientId + * @property {google.protobuf.IAny|null} [clientState] MsgUpgradeClient clientState + * @property {google.protobuf.IAny|null} [consensusState] MsgUpgradeClient consensusState + * @property {Uint8Array|null} [proofUpgradeClient] MsgUpgradeClient proofUpgradeClient + * @property {Uint8Array|null} [proofUpgradeConsensusState] MsgUpgradeClient proofUpgradeConsensusState + * @property {string|null} [signer] MsgUpgradeClient signer + */ + + /** + * Constructs a new MsgUpgradeClient. + * @memberof ibc.core.client.v1 + * @classdesc Represents a MsgUpgradeClient. + * @implements IMsgUpgradeClient + * @constructor + * @param {ibc.core.client.v1.IMsgUpgradeClient=} [properties] Properties to set + */ + function MsgUpgradeClient(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgUpgradeClient clientId. + * @member {string} clientId + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @instance + */ + MsgUpgradeClient.prototype.clientId = ""; + + /** + * MsgUpgradeClient clientState. + * @member {google.protobuf.IAny|null|undefined} clientState + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @instance + */ + MsgUpgradeClient.prototype.clientState = null; + + /** + * MsgUpgradeClient consensusState. + * @member {google.protobuf.IAny|null|undefined} consensusState + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @instance + */ + MsgUpgradeClient.prototype.consensusState = null; + + /** + * MsgUpgradeClient proofUpgradeClient. + * @member {Uint8Array} proofUpgradeClient + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @instance + */ + MsgUpgradeClient.prototype.proofUpgradeClient = $util.newBuffer([]); + + /** + * MsgUpgradeClient proofUpgradeConsensusState. + * @member {Uint8Array} proofUpgradeConsensusState + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @instance + */ + MsgUpgradeClient.prototype.proofUpgradeConsensusState = $util.newBuffer([]); + + /** + * MsgUpgradeClient signer. + * @member {string} signer + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @instance + */ + MsgUpgradeClient.prototype.signer = ""; + + /** + * Creates a new MsgUpgradeClient instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @static + * @param {ibc.core.client.v1.IMsgUpgradeClient=} [properties] Properties to set + * @returns {ibc.core.client.v1.MsgUpgradeClient} MsgUpgradeClient instance + */ + MsgUpgradeClient.create = function create(properties) { + return new MsgUpgradeClient(properties); + }; + + /** + * Encodes the specified MsgUpgradeClient message. Does not implicitly {@link ibc.core.client.v1.MsgUpgradeClient.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @static + * @param {ibc.core.client.v1.IMsgUpgradeClient} message MsgUpgradeClient message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUpgradeClient.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.clientState != null && Object.hasOwnProperty.call(message, "clientState")) + $root.google.protobuf.Any.encode(message.clientState, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.consensusState != null && Object.hasOwnProperty.call(message, "consensusState")) + $root.google.protobuf.Any.encode(message.consensusState, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.proofUpgradeClient != null && Object.hasOwnProperty.call(message, "proofUpgradeClient")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.proofUpgradeClient); + if (message.proofUpgradeConsensusState != null && Object.hasOwnProperty.call(message, "proofUpgradeConsensusState")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.proofUpgradeConsensusState); + if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.signer); + return writer; + }; + + /** + * Encodes the specified MsgUpgradeClient message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgUpgradeClient.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @static + * @param {ibc.core.client.v1.IMsgUpgradeClient} message MsgUpgradeClient message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUpgradeClient.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgUpgradeClient message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.MsgUpgradeClient} MsgUpgradeClient + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUpgradeClient.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgUpgradeClient(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.clientState = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 3: + message.consensusState = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 4: + message.proofUpgradeClient = reader.bytes(); + break; + case 5: + message.proofUpgradeConsensusState = reader.bytes(); + break; + case 6: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgUpgradeClient message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.MsgUpgradeClient} MsgUpgradeClient + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUpgradeClient.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgUpgradeClient message. + * @function verify + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgUpgradeClient.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.clientState != null && message.hasOwnProperty("clientState")) { + let error = $root.google.protobuf.Any.verify(message.clientState); + if (error) + return "clientState." + error; + } + if (message.consensusState != null && message.hasOwnProperty("consensusState")) { + let error = $root.google.protobuf.Any.verify(message.consensusState); + if (error) + return "consensusState." + error; + } + if (message.proofUpgradeClient != null && message.hasOwnProperty("proofUpgradeClient")) + if (!(message.proofUpgradeClient && typeof message.proofUpgradeClient.length === "number" || $util.isString(message.proofUpgradeClient))) + return "proofUpgradeClient: buffer expected"; + if (message.proofUpgradeConsensusState != null && message.hasOwnProperty("proofUpgradeConsensusState")) + if (!(message.proofUpgradeConsensusState && typeof message.proofUpgradeConsensusState.length === "number" || $util.isString(message.proofUpgradeConsensusState))) + return "proofUpgradeConsensusState: buffer expected"; + if (message.signer != null && message.hasOwnProperty("signer")) + if (!$util.isString(message.signer)) + return "signer: string expected"; + return null; + }; + + /** + * Creates a MsgUpgradeClient message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.MsgUpgradeClient} MsgUpgradeClient + */ + MsgUpgradeClient.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.MsgUpgradeClient) + return object; + let message = new $root.ibc.core.client.v1.MsgUpgradeClient(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.clientState != null) { + if (typeof object.clientState !== "object") + throw TypeError(".ibc.core.client.v1.MsgUpgradeClient.clientState: object expected"); + message.clientState = $root.google.protobuf.Any.fromObject(object.clientState); + } + if (object.consensusState != null) { + if (typeof object.consensusState !== "object") + throw TypeError(".ibc.core.client.v1.MsgUpgradeClient.consensusState: object expected"); + message.consensusState = $root.google.protobuf.Any.fromObject(object.consensusState); + } + if (object.proofUpgradeClient != null) + if (typeof object.proofUpgradeClient === "string") + $util.base64.decode(object.proofUpgradeClient, message.proofUpgradeClient = $util.newBuffer($util.base64.length(object.proofUpgradeClient)), 0); + else if (object.proofUpgradeClient.length) + message.proofUpgradeClient = object.proofUpgradeClient; + if (object.proofUpgradeConsensusState != null) + if (typeof object.proofUpgradeConsensusState === "string") + $util.base64.decode(object.proofUpgradeConsensusState, message.proofUpgradeConsensusState = $util.newBuffer($util.base64.length(object.proofUpgradeConsensusState)), 0); + else if (object.proofUpgradeConsensusState.length) + message.proofUpgradeConsensusState = object.proofUpgradeConsensusState; + if (object.signer != null) + message.signer = String(object.signer); + return message; + }; + + /** + * Creates a plain object from a MsgUpgradeClient message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @static + * @param {ibc.core.client.v1.MsgUpgradeClient} message MsgUpgradeClient + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgUpgradeClient.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.clientId = ""; + object.clientState = null; + object.consensusState = null; + if (options.bytes === String) + object.proofUpgradeClient = ""; + else { + object.proofUpgradeClient = []; + if (options.bytes !== Array) + object.proofUpgradeClient = $util.newBuffer(object.proofUpgradeClient); + } + if (options.bytes === String) + object.proofUpgradeConsensusState = ""; + else { + object.proofUpgradeConsensusState = []; + if (options.bytes !== Array) + object.proofUpgradeConsensusState = $util.newBuffer(object.proofUpgradeConsensusState); + } + object.signer = ""; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.clientState != null && message.hasOwnProperty("clientState")) + object.clientState = $root.google.protobuf.Any.toObject(message.clientState, options); + if (message.consensusState != null && message.hasOwnProperty("consensusState")) + object.consensusState = $root.google.protobuf.Any.toObject(message.consensusState, options); + if (message.proofUpgradeClient != null && message.hasOwnProperty("proofUpgradeClient")) + object.proofUpgradeClient = options.bytes === String ? $util.base64.encode(message.proofUpgradeClient, 0, message.proofUpgradeClient.length) : options.bytes === Array ? Array.prototype.slice.call(message.proofUpgradeClient) : message.proofUpgradeClient; + if (message.proofUpgradeConsensusState != null && message.hasOwnProperty("proofUpgradeConsensusState")) + object.proofUpgradeConsensusState = options.bytes === String ? $util.base64.encode(message.proofUpgradeConsensusState, 0, message.proofUpgradeConsensusState.length) : options.bytes === Array ? Array.prototype.slice.call(message.proofUpgradeConsensusState) : message.proofUpgradeConsensusState; + if (message.signer != null && message.hasOwnProperty("signer")) + object.signer = message.signer; + return object; + }; + + /** + * Converts this MsgUpgradeClient to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @instance + * @returns {Object.} JSON object + */ + MsgUpgradeClient.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgUpgradeClient; + })(v1.MsgUpgradeClient || {}); + + v1.MsgUpgradeClientResponse = (function(MsgUpgradeClientResponse) { + + /** + * Properties of a MsgUpgradeClientResponse. + * @memberof ibc.core.client.v1 + * @interface IMsgUpgradeClientResponse + */ + + /** + * Constructs a new MsgUpgradeClientResponse. + * @memberof ibc.core.client.v1 + * @classdesc Represents a MsgUpgradeClientResponse. + * @implements IMsgUpgradeClientResponse + * @constructor + * @param {ibc.core.client.v1.IMsgUpgradeClientResponse=} [properties] Properties to set + */ + function MsgUpgradeClientResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgUpgradeClientResponse instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.MsgUpgradeClientResponse + * @static + * @param {ibc.core.client.v1.IMsgUpgradeClientResponse=} [properties] Properties to set + * @returns {ibc.core.client.v1.MsgUpgradeClientResponse} MsgUpgradeClientResponse instance + */ + MsgUpgradeClientResponse.create = function create(properties) { + return new MsgUpgradeClientResponse(properties); + }; + + /** + * Encodes the specified MsgUpgradeClientResponse message. Does not implicitly {@link ibc.core.client.v1.MsgUpgradeClientResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.MsgUpgradeClientResponse + * @static + * @param {ibc.core.client.v1.IMsgUpgradeClientResponse} message MsgUpgradeClientResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUpgradeClientResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgUpgradeClientResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgUpgradeClientResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.MsgUpgradeClientResponse + * @static + * @param {ibc.core.client.v1.IMsgUpgradeClientResponse} message MsgUpgradeClientResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUpgradeClientResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgUpgradeClientResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.MsgUpgradeClientResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.MsgUpgradeClientResponse} MsgUpgradeClientResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUpgradeClientResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgUpgradeClientResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgUpgradeClientResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.MsgUpgradeClientResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.MsgUpgradeClientResponse} MsgUpgradeClientResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUpgradeClientResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgUpgradeClientResponse message. + * @function verify + * @memberof ibc.core.client.v1.MsgUpgradeClientResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgUpgradeClientResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgUpgradeClientResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.MsgUpgradeClientResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.MsgUpgradeClientResponse} MsgUpgradeClientResponse + */ + MsgUpgradeClientResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.MsgUpgradeClientResponse) + return object; + return new $root.ibc.core.client.v1.MsgUpgradeClientResponse(); + }; + + /** + * Creates a plain object from a MsgUpgradeClientResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.MsgUpgradeClientResponse + * @static + * @param {ibc.core.client.v1.MsgUpgradeClientResponse} message MsgUpgradeClientResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgUpgradeClientResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgUpgradeClientResponse to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.MsgUpgradeClientResponse + * @instance + * @returns {Object.} JSON object + */ + MsgUpgradeClientResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgUpgradeClientResponse; + })(v1.MsgUpgradeClientResponse || {}); + + v1.MsgSubmitMisbehaviour = (function(MsgSubmitMisbehaviour) { + + /** + * Properties of a MsgSubmitMisbehaviour. + * @memberof ibc.core.client.v1 + * @interface IMsgSubmitMisbehaviour + * @property {string|null} [clientId] MsgSubmitMisbehaviour clientId + * @property {google.protobuf.IAny|null} [misbehaviour] MsgSubmitMisbehaviour misbehaviour + * @property {string|null} [signer] MsgSubmitMisbehaviour signer + */ + + /** + * Constructs a new MsgSubmitMisbehaviour. + * @memberof ibc.core.client.v1 + * @classdesc Represents a MsgSubmitMisbehaviour. + * @implements IMsgSubmitMisbehaviour + * @constructor + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviour=} [properties] Properties to set + */ + function MsgSubmitMisbehaviour(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgSubmitMisbehaviour clientId. + * @member {string} clientId + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @instance + */ + MsgSubmitMisbehaviour.prototype.clientId = ""; + + /** + * MsgSubmitMisbehaviour misbehaviour. + * @member {google.protobuf.IAny|null|undefined} misbehaviour + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @instance + */ + MsgSubmitMisbehaviour.prototype.misbehaviour = null; + + /** + * MsgSubmitMisbehaviour signer. + * @member {string} signer + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @instance + */ + MsgSubmitMisbehaviour.prototype.signer = ""; + + /** + * Creates a new MsgSubmitMisbehaviour instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @static + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviour=} [properties] Properties to set + * @returns {ibc.core.client.v1.MsgSubmitMisbehaviour} MsgSubmitMisbehaviour instance + */ + MsgSubmitMisbehaviour.create = function create(properties) { + return new MsgSubmitMisbehaviour(properties); + }; + + /** + * Encodes the specified MsgSubmitMisbehaviour message. Does not implicitly {@link ibc.core.client.v1.MsgSubmitMisbehaviour.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @static + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviour} message MsgSubmitMisbehaviour message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitMisbehaviour.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.misbehaviour != null && Object.hasOwnProperty.call(message, "misbehaviour")) + $root.google.protobuf.Any.encode(message.misbehaviour, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.signer); + return writer; + }; + + /** + * Encodes the specified MsgSubmitMisbehaviour message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgSubmitMisbehaviour.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @static + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviour} message MsgSubmitMisbehaviour message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitMisbehaviour.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgSubmitMisbehaviour message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.MsgSubmitMisbehaviour} MsgSubmitMisbehaviour + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitMisbehaviour.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgSubmitMisbehaviour(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.misbehaviour = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgSubmitMisbehaviour message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.MsgSubmitMisbehaviour} MsgSubmitMisbehaviour + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitMisbehaviour.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgSubmitMisbehaviour message. + * @function verify + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgSubmitMisbehaviour.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.misbehaviour != null && message.hasOwnProperty("misbehaviour")) { + let error = $root.google.protobuf.Any.verify(message.misbehaviour); + if (error) + return "misbehaviour." + error; + } + if (message.signer != null && message.hasOwnProperty("signer")) + if (!$util.isString(message.signer)) + return "signer: string expected"; + return null; + }; + + /** + * Creates a MsgSubmitMisbehaviour message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.MsgSubmitMisbehaviour} MsgSubmitMisbehaviour + */ + MsgSubmitMisbehaviour.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.MsgSubmitMisbehaviour) + return object; + let message = new $root.ibc.core.client.v1.MsgSubmitMisbehaviour(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.misbehaviour != null) { + if (typeof object.misbehaviour !== "object") + throw TypeError(".ibc.core.client.v1.MsgSubmitMisbehaviour.misbehaviour: object expected"); + message.misbehaviour = $root.google.protobuf.Any.fromObject(object.misbehaviour); + } + if (object.signer != null) + message.signer = String(object.signer); + return message; + }; + + /** + * Creates a plain object from a MsgSubmitMisbehaviour message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @static + * @param {ibc.core.client.v1.MsgSubmitMisbehaviour} message MsgSubmitMisbehaviour + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSubmitMisbehaviour.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.clientId = ""; + object.misbehaviour = null; + object.signer = ""; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.misbehaviour != null && message.hasOwnProperty("misbehaviour")) + object.misbehaviour = $root.google.protobuf.Any.toObject(message.misbehaviour, options); + if (message.signer != null && message.hasOwnProperty("signer")) + object.signer = message.signer; + return object; + }; + + /** + * Converts this MsgSubmitMisbehaviour to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @instance + * @returns {Object.} JSON object + */ + MsgSubmitMisbehaviour.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgSubmitMisbehaviour; + })(v1.MsgSubmitMisbehaviour || {}); + + v1.MsgSubmitMisbehaviourResponse = (function(MsgSubmitMisbehaviourResponse) { + + /** + * Properties of a MsgSubmitMisbehaviourResponse. + * @memberof ibc.core.client.v1 + * @interface IMsgSubmitMisbehaviourResponse + */ + + /** + * Constructs a new MsgSubmitMisbehaviourResponse. + * @memberof ibc.core.client.v1 + * @classdesc Represents a MsgSubmitMisbehaviourResponse. + * @implements IMsgSubmitMisbehaviourResponse + * @constructor + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviourResponse=} [properties] Properties to set + */ + function MsgSubmitMisbehaviourResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgSubmitMisbehaviourResponse instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse + * @static + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviourResponse=} [properties] Properties to set + * @returns {ibc.core.client.v1.MsgSubmitMisbehaviourResponse} MsgSubmitMisbehaviourResponse instance + */ + MsgSubmitMisbehaviourResponse.create = function create(properties) { + return new MsgSubmitMisbehaviourResponse(properties); + }; + + /** + * Encodes the specified MsgSubmitMisbehaviourResponse message. Does not implicitly {@link ibc.core.client.v1.MsgSubmitMisbehaviourResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse + * @static + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviourResponse} message MsgSubmitMisbehaviourResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitMisbehaviourResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgSubmitMisbehaviourResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgSubmitMisbehaviourResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse + * @static + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviourResponse} message MsgSubmitMisbehaviourResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitMisbehaviourResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgSubmitMisbehaviourResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.MsgSubmitMisbehaviourResponse} MsgSubmitMisbehaviourResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitMisbehaviourResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgSubmitMisbehaviourResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgSubmitMisbehaviourResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.MsgSubmitMisbehaviourResponse} MsgSubmitMisbehaviourResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitMisbehaviourResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgSubmitMisbehaviourResponse message. + * @function verify + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgSubmitMisbehaviourResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgSubmitMisbehaviourResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.MsgSubmitMisbehaviourResponse} MsgSubmitMisbehaviourResponse + */ + MsgSubmitMisbehaviourResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.MsgSubmitMisbehaviourResponse) + return object; + return new $root.ibc.core.client.v1.MsgSubmitMisbehaviourResponse(); + }; + + /** + * Creates a plain object from a MsgSubmitMisbehaviourResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse + * @static + * @param {ibc.core.client.v1.MsgSubmitMisbehaviourResponse} message MsgSubmitMisbehaviourResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSubmitMisbehaviourResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgSubmitMisbehaviourResponse to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse + * @instance + * @returns {Object.} JSON object + */ + MsgSubmitMisbehaviourResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgSubmitMisbehaviourResponse; + })(v1.MsgSubmitMisbehaviourResponse || {}); + + return v1; + })(client.v1 || {}); + + return client; + })(core.client || {}); + + /** + * Namespace commitment. + * @memberof ibc.core + * @namespace + */ + + core.commitment = (function(commitment) { + + /** + * Namespace v1. + * @memberof ibc.core.commitment + * @namespace + */ + + commitment.v1 = (function(v1) { + + v1.MerkleRoot = (function(MerkleRoot) { + + /** + * Properties of a MerkleRoot. + * @memberof ibc.core.commitment.v1 + * @interface IMerkleRoot + * @property {Uint8Array|null} [hash] MerkleRoot hash + */ + + /** + * Constructs a new MerkleRoot. + * @memberof ibc.core.commitment.v1 + * @classdesc Represents a MerkleRoot. + * @implements IMerkleRoot + * @constructor + * @param {ibc.core.commitment.v1.IMerkleRoot=} [properties] Properties to set + */ + function MerkleRoot(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MerkleRoot hash. + * @member {Uint8Array} hash + * @memberof ibc.core.commitment.v1.MerkleRoot + * @instance + */ + MerkleRoot.prototype.hash = $util.newBuffer([]); + + /** + * Creates a new MerkleRoot instance using the specified properties. + * @function create + * @memberof ibc.core.commitment.v1.MerkleRoot + * @static + * @param {ibc.core.commitment.v1.IMerkleRoot=} [properties] Properties to set + * @returns {ibc.core.commitment.v1.MerkleRoot} MerkleRoot instance + */ + MerkleRoot.create = function create(properties) { + return new MerkleRoot(properties); + }; + + /** + * Encodes the specified MerkleRoot message. Does not implicitly {@link ibc.core.commitment.v1.MerkleRoot.verify|verify} messages. + * @function encode + * @memberof ibc.core.commitment.v1.MerkleRoot + * @static + * @param {ibc.core.commitment.v1.IMerkleRoot} message MerkleRoot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MerkleRoot.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.hash); + return writer; + }; + + /** + * Encodes the specified MerkleRoot message, length delimited. Does not implicitly {@link ibc.core.commitment.v1.MerkleRoot.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.commitment.v1.MerkleRoot + * @static + * @param {ibc.core.commitment.v1.IMerkleRoot} message MerkleRoot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MerkleRoot.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MerkleRoot message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.commitment.v1.MerkleRoot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.commitment.v1.MerkleRoot} MerkleRoot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MerkleRoot.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.commitment.v1.MerkleRoot(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MerkleRoot message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.commitment.v1.MerkleRoot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.commitment.v1.MerkleRoot} MerkleRoot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MerkleRoot.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MerkleRoot message. + * @function verify + * @memberof ibc.core.commitment.v1.MerkleRoot + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MerkleRoot.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash))) + return "hash: buffer expected"; + return null; + }; + + /** + * Creates a MerkleRoot message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.commitment.v1.MerkleRoot + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.commitment.v1.MerkleRoot} MerkleRoot + */ + MerkleRoot.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.commitment.v1.MerkleRoot) + return object; + let message = new $root.ibc.core.commitment.v1.MerkleRoot(); + if (object.hash != null) + if (typeof object.hash === "string") + $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0); + else if (object.hash.length) + message.hash = object.hash; + return message; + }; + + /** + * Creates a plain object from a MerkleRoot message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.commitment.v1.MerkleRoot + * @static + * @param {ibc.core.commitment.v1.MerkleRoot} message MerkleRoot + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MerkleRoot.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + if (options.bytes === String) + object.hash = ""; + else { + object.hash = []; + if (options.bytes !== Array) + object.hash = $util.newBuffer(object.hash); + } + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash; + return object; + }; + + /** + * Converts this MerkleRoot to JSON. + * @function toJSON + * @memberof ibc.core.commitment.v1.MerkleRoot + * @instance + * @returns {Object.} JSON object + */ + MerkleRoot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MerkleRoot; + })(v1.MerkleRoot || {}); + + v1.MerklePrefix = (function(MerklePrefix) { + + /** + * Properties of a MerklePrefix. + * @memberof ibc.core.commitment.v1 + * @interface IMerklePrefix + * @property {Uint8Array|null} [keyPrefix] MerklePrefix keyPrefix + */ + + /** + * Constructs a new MerklePrefix. + * @memberof ibc.core.commitment.v1 + * @classdesc Represents a MerklePrefix. + * @implements IMerklePrefix + * @constructor + * @param {ibc.core.commitment.v1.IMerklePrefix=} [properties] Properties to set + */ + function MerklePrefix(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MerklePrefix keyPrefix. + * @member {Uint8Array} keyPrefix + * @memberof ibc.core.commitment.v1.MerklePrefix + * @instance + */ + MerklePrefix.prototype.keyPrefix = $util.newBuffer([]); + + /** + * Creates a new MerklePrefix instance using the specified properties. + * @function create + * @memberof ibc.core.commitment.v1.MerklePrefix + * @static + * @param {ibc.core.commitment.v1.IMerklePrefix=} [properties] Properties to set + * @returns {ibc.core.commitment.v1.MerklePrefix} MerklePrefix instance + */ + MerklePrefix.create = function create(properties) { + return new MerklePrefix(properties); + }; + + /** + * Encodes the specified MerklePrefix message. Does not implicitly {@link ibc.core.commitment.v1.MerklePrefix.verify|verify} messages. + * @function encode + * @memberof ibc.core.commitment.v1.MerklePrefix + * @static + * @param {ibc.core.commitment.v1.IMerklePrefix} message MerklePrefix message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MerklePrefix.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keyPrefix != null && Object.hasOwnProperty.call(message, "keyPrefix")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.keyPrefix); + return writer; + }; + + /** + * Encodes the specified MerklePrefix message, length delimited. Does not implicitly {@link ibc.core.commitment.v1.MerklePrefix.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.commitment.v1.MerklePrefix + * @static + * @param {ibc.core.commitment.v1.IMerklePrefix} message MerklePrefix message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MerklePrefix.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MerklePrefix message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.commitment.v1.MerklePrefix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.commitment.v1.MerklePrefix} MerklePrefix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MerklePrefix.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.commitment.v1.MerklePrefix(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.keyPrefix = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MerklePrefix message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.commitment.v1.MerklePrefix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.commitment.v1.MerklePrefix} MerklePrefix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MerklePrefix.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MerklePrefix message. + * @function verify + * @memberof ibc.core.commitment.v1.MerklePrefix + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MerklePrefix.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keyPrefix != null && message.hasOwnProperty("keyPrefix")) + if (!(message.keyPrefix && typeof message.keyPrefix.length === "number" || $util.isString(message.keyPrefix))) + return "keyPrefix: buffer expected"; + return null; + }; + + /** + * Creates a MerklePrefix message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.commitment.v1.MerklePrefix + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.commitment.v1.MerklePrefix} MerklePrefix + */ + MerklePrefix.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.commitment.v1.MerklePrefix) + return object; + let message = new $root.ibc.core.commitment.v1.MerklePrefix(); + if (object.keyPrefix != null) + if (typeof object.keyPrefix === "string") + $util.base64.decode(object.keyPrefix, message.keyPrefix = $util.newBuffer($util.base64.length(object.keyPrefix)), 0); + else if (object.keyPrefix.length) + message.keyPrefix = object.keyPrefix; + return message; + }; + + /** + * Creates a plain object from a MerklePrefix message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.commitment.v1.MerklePrefix + * @static + * @param {ibc.core.commitment.v1.MerklePrefix} message MerklePrefix + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MerklePrefix.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + if (options.bytes === String) + object.keyPrefix = ""; + else { + object.keyPrefix = []; + if (options.bytes !== Array) + object.keyPrefix = $util.newBuffer(object.keyPrefix); + } + if (message.keyPrefix != null && message.hasOwnProperty("keyPrefix")) + object.keyPrefix = options.bytes === String ? $util.base64.encode(message.keyPrefix, 0, message.keyPrefix.length) : options.bytes === Array ? Array.prototype.slice.call(message.keyPrefix) : message.keyPrefix; + return object; + }; + + /** + * Converts this MerklePrefix to JSON. + * @function toJSON + * @memberof ibc.core.commitment.v1.MerklePrefix + * @instance + * @returns {Object.} JSON object + */ + MerklePrefix.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MerklePrefix; + })(v1.MerklePrefix || {}); + + v1.MerklePath = (function(MerklePath) { + + /** + * Properties of a MerklePath. + * @memberof ibc.core.commitment.v1 + * @interface IMerklePath + * @property {Array.|null} [keyPath] MerklePath keyPath + */ + + /** + * Constructs a new MerklePath. + * @memberof ibc.core.commitment.v1 + * @classdesc Represents a MerklePath. + * @implements IMerklePath + * @constructor + * @param {ibc.core.commitment.v1.IMerklePath=} [properties] Properties to set + */ + function MerklePath(properties) { + this.keyPath = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MerklePath keyPath. + * @member {Array.} keyPath + * @memberof ibc.core.commitment.v1.MerklePath + * @instance + */ + MerklePath.prototype.keyPath = $util.emptyArray; + + /** + * Creates a new MerklePath instance using the specified properties. + * @function create + * @memberof ibc.core.commitment.v1.MerklePath + * @static + * @param {ibc.core.commitment.v1.IMerklePath=} [properties] Properties to set + * @returns {ibc.core.commitment.v1.MerklePath} MerklePath instance + */ + MerklePath.create = function create(properties) { + return new MerklePath(properties); + }; + + /** + * Encodes the specified MerklePath message. Does not implicitly {@link ibc.core.commitment.v1.MerklePath.verify|verify} messages. + * @function encode + * @memberof ibc.core.commitment.v1.MerklePath + * @static + * @param {ibc.core.commitment.v1.IMerklePath} message MerklePath message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MerklePath.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keyPath != null && message.keyPath.length) + for (let i = 0; i < message.keyPath.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.keyPath[i]); + return writer; + }; + + /** + * Encodes the specified MerklePath message, length delimited. Does not implicitly {@link ibc.core.commitment.v1.MerklePath.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.commitment.v1.MerklePath + * @static + * @param {ibc.core.commitment.v1.IMerklePath} message MerklePath message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MerklePath.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MerklePath message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.commitment.v1.MerklePath + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.commitment.v1.MerklePath} MerklePath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MerklePath.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.commitment.v1.MerklePath(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.keyPath && message.keyPath.length)) + message.keyPath = []; + message.keyPath.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MerklePath message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.commitment.v1.MerklePath + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.commitment.v1.MerklePath} MerklePath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MerklePath.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MerklePath message. + * @function verify + * @memberof ibc.core.commitment.v1.MerklePath + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MerklePath.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keyPath != null && message.hasOwnProperty("keyPath")) { + if (!Array.isArray(message.keyPath)) + return "keyPath: array expected"; + for (let i = 0; i < message.keyPath.length; ++i) + if (!$util.isString(message.keyPath[i])) + return "keyPath: string[] expected"; + } + return null; + }; + + /** + * Creates a MerklePath message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.commitment.v1.MerklePath + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.commitment.v1.MerklePath} MerklePath + */ + MerklePath.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.commitment.v1.MerklePath) + return object; + let message = new $root.ibc.core.commitment.v1.MerklePath(); + if (object.keyPath) { + if (!Array.isArray(object.keyPath)) + throw TypeError(".ibc.core.commitment.v1.MerklePath.keyPath: array expected"); + message.keyPath = []; + for (let i = 0; i < object.keyPath.length; ++i) + message.keyPath[i] = String(object.keyPath[i]); + } + return message; + }; + + /** + * Creates a plain object from a MerklePath message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.commitment.v1.MerklePath + * @static + * @param {ibc.core.commitment.v1.MerklePath} message MerklePath + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MerklePath.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.keyPath = []; + if (message.keyPath && message.keyPath.length) { + object.keyPath = []; + for (let j = 0; j < message.keyPath.length; ++j) + object.keyPath[j] = message.keyPath[j]; + } + return object; + }; + + /** + * Converts this MerklePath to JSON. + * @function toJSON + * @memberof ibc.core.commitment.v1.MerklePath + * @instance + * @returns {Object.} JSON object + */ + MerklePath.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MerklePath; + })(v1.MerklePath || {}); + + v1.MerkleProof = (function(MerkleProof) { + + /** + * Properties of a MerkleProof. + * @memberof ibc.core.commitment.v1 + * @interface IMerkleProof + * @property {Array.|null} [proofs] MerkleProof proofs + */ + + /** + * Constructs a new MerkleProof. + * @memberof ibc.core.commitment.v1 + * @classdesc Represents a MerkleProof. + * @implements IMerkleProof + * @constructor + * @param {ibc.core.commitment.v1.IMerkleProof=} [properties] Properties to set + */ + function MerkleProof(properties) { + this.proofs = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MerkleProof proofs. + * @member {Array.} proofs + * @memberof ibc.core.commitment.v1.MerkleProof + * @instance + */ + MerkleProof.prototype.proofs = $util.emptyArray; + + /** + * Creates a new MerkleProof instance using the specified properties. + * @function create + * @memberof ibc.core.commitment.v1.MerkleProof + * @static + * @param {ibc.core.commitment.v1.IMerkleProof=} [properties] Properties to set + * @returns {ibc.core.commitment.v1.MerkleProof} MerkleProof instance + */ + MerkleProof.create = function create(properties) { + return new MerkleProof(properties); + }; + + /** + * Encodes the specified MerkleProof message. Does not implicitly {@link ibc.core.commitment.v1.MerkleProof.verify|verify} messages. + * @function encode + * @memberof ibc.core.commitment.v1.MerkleProof + * @static + * @param {ibc.core.commitment.v1.IMerkleProof} message MerkleProof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MerkleProof.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proofs != null && message.proofs.length) + for (let i = 0; i < message.proofs.length; ++i) + $root.ics23.CommitmentProof.encode(message.proofs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MerkleProof message, length delimited. Does not implicitly {@link ibc.core.commitment.v1.MerkleProof.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.commitment.v1.MerkleProof + * @static + * @param {ibc.core.commitment.v1.IMerkleProof} message MerkleProof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MerkleProof.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MerkleProof message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.commitment.v1.MerkleProof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.commitment.v1.MerkleProof} MerkleProof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MerkleProof.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.commitment.v1.MerkleProof(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.proofs && message.proofs.length)) + message.proofs = []; + message.proofs.push($root.ics23.CommitmentProof.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MerkleProof message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.commitment.v1.MerkleProof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.commitment.v1.MerkleProof} MerkleProof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MerkleProof.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MerkleProof message. + * @function verify + * @memberof ibc.core.commitment.v1.MerkleProof + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MerkleProof.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proofs != null && message.hasOwnProperty("proofs")) { + if (!Array.isArray(message.proofs)) + return "proofs: array expected"; + for (let i = 0; i < message.proofs.length; ++i) { + let error = $root.ics23.CommitmentProof.verify(message.proofs[i]); + if (error) + return "proofs." + error; + } + } + return null; + }; + + /** + * Creates a MerkleProof message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.commitment.v1.MerkleProof + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.commitment.v1.MerkleProof} MerkleProof + */ + MerkleProof.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.commitment.v1.MerkleProof) + return object; + let message = new $root.ibc.core.commitment.v1.MerkleProof(); + if (object.proofs) { + if (!Array.isArray(object.proofs)) + throw TypeError(".ibc.core.commitment.v1.MerkleProof.proofs: array expected"); + message.proofs = []; + for (let i = 0; i < object.proofs.length; ++i) { + if (typeof object.proofs[i] !== "object") + throw TypeError(".ibc.core.commitment.v1.MerkleProof.proofs: object expected"); + message.proofs[i] = $root.ics23.CommitmentProof.fromObject(object.proofs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MerkleProof message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.commitment.v1.MerkleProof + * @static + * @param {ibc.core.commitment.v1.MerkleProof} message MerkleProof + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MerkleProof.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.proofs = []; + if (message.proofs && message.proofs.length) { + object.proofs = []; + for (let j = 0; j < message.proofs.length; ++j) + object.proofs[j] = $root.ics23.CommitmentProof.toObject(message.proofs[j], options); + } + return object; + }; + + /** + * Converts this MerkleProof to JSON. + * @function toJSON + * @memberof ibc.core.commitment.v1.MerkleProof + * @instance + * @returns {Object.} JSON object + */ + MerkleProof.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MerkleProof; + })(v1.MerkleProof || {}); + + return v1; + })(commitment.v1 || {}); + + return commitment; + })(core.commitment || {}); + + /** + * Namespace connection. + * @memberof ibc.core + * @namespace + */ + + core.connection = (function(connection) { + + /** + * Namespace v1. + * @memberof ibc.core.connection + * @namespace + */ + + connection.v1 = (function(v1) { + + v1.ConnectionEnd = (function(ConnectionEnd) { + + /** + * Properties of a ConnectionEnd. + * @memberof ibc.core.connection.v1 + * @interface IConnectionEnd + * @property {string|null} [clientId] ConnectionEnd clientId + * @property {Array.|null} [versions] ConnectionEnd versions + * @property {ibc.core.connection.v1.State|null} [state] ConnectionEnd state + * @property {ibc.core.connection.v1.ICounterparty|null} [counterparty] ConnectionEnd counterparty + * @property {number|Long|null} [delayPeriod] ConnectionEnd delayPeriod + */ + + /** + * Constructs a new ConnectionEnd. + * @memberof ibc.core.connection.v1 + * @classdesc Represents a ConnectionEnd. + * @implements IConnectionEnd + * @constructor + * @param {ibc.core.connection.v1.IConnectionEnd=} [properties] Properties to set + */ + function ConnectionEnd(properties) { + this.versions = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectionEnd clientId. + * @member {string} clientId + * @memberof ibc.core.connection.v1.ConnectionEnd + * @instance + */ + ConnectionEnd.prototype.clientId = ""; + + /** + * ConnectionEnd versions. + * @member {Array.} versions + * @memberof ibc.core.connection.v1.ConnectionEnd + * @instance + */ + ConnectionEnd.prototype.versions = $util.emptyArray; + + /** + * ConnectionEnd state. + * @member {ibc.core.connection.v1.State} state + * @memberof ibc.core.connection.v1.ConnectionEnd + * @instance + */ + ConnectionEnd.prototype.state = 0; + + /** + * ConnectionEnd counterparty. + * @member {ibc.core.connection.v1.ICounterparty|null|undefined} counterparty + * @memberof ibc.core.connection.v1.ConnectionEnd + * @instance + */ + ConnectionEnd.prototype.counterparty = null; + + /** + * ConnectionEnd delayPeriod. + * @member {number|Long} delayPeriod + * @memberof ibc.core.connection.v1.ConnectionEnd + * @instance + */ + ConnectionEnd.prototype.delayPeriod = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new ConnectionEnd instance using the specified properties. + * @function create + * @memberof ibc.core.connection.v1.ConnectionEnd + * @static + * @param {ibc.core.connection.v1.IConnectionEnd=} [properties] Properties to set + * @returns {ibc.core.connection.v1.ConnectionEnd} ConnectionEnd instance + */ + ConnectionEnd.create = function create(properties) { + return new ConnectionEnd(properties); + }; + + /** + * Encodes the specified ConnectionEnd message. Does not implicitly {@link ibc.core.connection.v1.ConnectionEnd.verify|verify} messages. + * @function encode + * @memberof ibc.core.connection.v1.ConnectionEnd + * @static + * @param {ibc.core.connection.v1.IConnectionEnd} message ConnectionEnd message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionEnd.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.versions != null && message.versions.length) + for (let i = 0; i < message.versions.length; ++i) + $root.ibc.core.connection.v1.Version.encode(message.versions[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.counterparty != null && Object.hasOwnProperty.call(message, "counterparty")) + $root.ibc.core.connection.v1.Counterparty.encode(message.counterparty, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.delayPeriod != null && Object.hasOwnProperty.call(message, "delayPeriod")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.delayPeriod); + return writer; + }; + + /** + * Encodes the specified ConnectionEnd message, length delimited. Does not implicitly {@link ibc.core.connection.v1.ConnectionEnd.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.connection.v1.ConnectionEnd + * @static + * @param {ibc.core.connection.v1.IConnectionEnd} message ConnectionEnd message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionEnd.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectionEnd message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.connection.v1.ConnectionEnd + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.connection.v1.ConnectionEnd} ConnectionEnd + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionEnd.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.ConnectionEnd(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + if (!(message.versions && message.versions.length)) + message.versions = []; + message.versions.push($root.ibc.core.connection.v1.Version.decode(reader, reader.uint32())); + break; + case 3: + message.state = reader.int32(); + break; + case 4: + message.counterparty = $root.ibc.core.connection.v1.Counterparty.decode(reader, reader.uint32()); + break; + case 5: + message.delayPeriod = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectionEnd message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.connection.v1.ConnectionEnd + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.connection.v1.ConnectionEnd} ConnectionEnd + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionEnd.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectionEnd message. + * @function verify + * @memberof ibc.core.connection.v1.ConnectionEnd + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectionEnd.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.versions != null && message.hasOwnProperty("versions")) { + if (!Array.isArray(message.versions)) + return "versions: array expected"; + for (let i = 0; i < message.versions.length; ++i) { + let error = $root.ibc.core.connection.v1.Version.verify(message.versions[i]); + if (error) + return "versions." + error; + } + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.counterparty != null && message.hasOwnProperty("counterparty")) { + let error = $root.ibc.core.connection.v1.Counterparty.verify(message.counterparty); + if (error) + return "counterparty." + error; + } + if (message.delayPeriod != null && message.hasOwnProperty("delayPeriod")) + if (!$util.isInteger(message.delayPeriod) && !(message.delayPeriod && $util.isInteger(message.delayPeriod.low) && $util.isInteger(message.delayPeriod.high))) + return "delayPeriod: integer|Long expected"; + return null; + }; + + /** + * Creates a ConnectionEnd message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.connection.v1.ConnectionEnd + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.connection.v1.ConnectionEnd} ConnectionEnd + */ + ConnectionEnd.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.connection.v1.ConnectionEnd) + return object; + let message = new $root.ibc.core.connection.v1.ConnectionEnd(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.versions) { + if (!Array.isArray(object.versions)) + throw TypeError(".ibc.core.connection.v1.ConnectionEnd.versions: array expected"); + message.versions = []; + for (let i = 0; i < object.versions.length; ++i) { + if (typeof object.versions[i] !== "object") + throw TypeError(".ibc.core.connection.v1.ConnectionEnd.versions: object expected"); + message.versions[i] = $root.ibc.core.connection.v1.Version.fromObject(object.versions[i]); + } + } + switch (object.state) { + case "STATE_UNINITIALIZED_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "STATE_INIT": + case 1: + message.state = 1; + break; + case "STATE_TRYOPEN": + case 2: + message.state = 2; + break; + case "STATE_OPEN": + case 3: + message.state = 3; + break; + } + if (object.counterparty != null) { + if (typeof object.counterparty !== "object") + throw TypeError(".ibc.core.connection.v1.ConnectionEnd.counterparty: object expected"); + message.counterparty = $root.ibc.core.connection.v1.Counterparty.fromObject(object.counterparty); + } + if (object.delayPeriod != null) + if ($util.Long) + (message.delayPeriod = $util.Long.fromValue(object.delayPeriod)).unsigned = true; + else if (typeof object.delayPeriod === "string") + message.delayPeriod = parseInt(object.delayPeriod, 10); + else if (typeof object.delayPeriod === "number") + message.delayPeriod = object.delayPeriod; + else if (typeof object.delayPeriod === "object") + message.delayPeriod = new $util.LongBits(object.delayPeriod.low >>> 0, object.delayPeriod.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a ConnectionEnd message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.connection.v1.ConnectionEnd + * @static + * @param {ibc.core.connection.v1.ConnectionEnd} message ConnectionEnd + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectionEnd.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.versions = []; + if (options.defaults) { + object.clientId = ""; + object.state = options.enums === String ? "STATE_UNINITIALIZED_UNSPECIFIED" : 0; + object.counterparty = null; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.delayPeriod = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.delayPeriod = options.longs === String ? "0" : 0; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.versions && message.versions.length) { + object.versions = []; + for (let j = 0; j < message.versions.length; ++j) + object.versions[j] = $root.ibc.core.connection.v1.Version.toObject(message.versions[j], options); + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.ibc.core.connection.v1.State[message.state] : message.state; + if (message.counterparty != null && message.hasOwnProperty("counterparty")) + object.counterparty = $root.ibc.core.connection.v1.Counterparty.toObject(message.counterparty, options); + if (message.delayPeriod != null && message.hasOwnProperty("delayPeriod")) + if (typeof message.delayPeriod === "number") + object.delayPeriod = options.longs === String ? String(message.delayPeriod) : message.delayPeriod; + else + object.delayPeriod = options.longs === String ? $util.Long.prototype.toString.call(message.delayPeriod) : options.longs === Number ? new $util.LongBits(message.delayPeriod.low >>> 0, message.delayPeriod.high >>> 0).toNumber(true) : message.delayPeriod; + return object; + }; + + /** + * Converts this ConnectionEnd to JSON. + * @function toJSON + * @memberof ibc.core.connection.v1.ConnectionEnd + * @instance + * @returns {Object.} JSON object + */ + ConnectionEnd.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ConnectionEnd; + })(v1.ConnectionEnd || {}); + + v1.IdentifiedConnection = (function(IdentifiedConnection) { + + /** + * Properties of an IdentifiedConnection. + * @memberof ibc.core.connection.v1 + * @interface IIdentifiedConnection + * @property {string|null} [id] IdentifiedConnection id + * @property {string|null} [clientId] IdentifiedConnection clientId + * @property {Array.|null} [versions] IdentifiedConnection versions + * @property {ibc.core.connection.v1.State|null} [state] IdentifiedConnection state + * @property {ibc.core.connection.v1.ICounterparty|null} [counterparty] IdentifiedConnection counterparty + * @property {number|Long|null} [delayPeriod] IdentifiedConnection delayPeriod + */ + + /** + * Constructs a new IdentifiedConnection. + * @memberof ibc.core.connection.v1 + * @classdesc Represents an IdentifiedConnection. + * @implements IIdentifiedConnection + * @constructor + * @param {ibc.core.connection.v1.IIdentifiedConnection=} [properties] Properties to set + */ + function IdentifiedConnection(properties) { + this.versions = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IdentifiedConnection id. + * @member {string} id + * @memberof ibc.core.connection.v1.IdentifiedConnection + * @instance + */ + IdentifiedConnection.prototype.id = ""; + + /** + * IdentifiedConnection clientId. + * @member {string} clientId + * @memberof ibc.core.connection.v1.IdentifiedConnection + * @instance + */ + IdentifiedConnection.prototype.clientId = ""; + + /** + * IdentifiedConnection versions. + * @member {Array.} versions + * @memberof ibc.core.connection.v1.IdentifiedConnection + * @instance + */ + IdentifiedConnection.prototype.versions = $util.emptyArray; + + /** + * IdentifiedConnection state. + * @member {ibc.core.connection.v1.State} state + * @memberof ibc.core.connection.v1.IdentifiedConnection + * @instance + */ + IdentifiedConnection.prototype.state = 0; + + /** + * IdentifiedConnection counterparty. + * @member {ibc.core.connection.v1.ICounterparty|null|undefined} counterparty + * @memberof ibc.core.connection.v1.IdentifiedConnection + * @instance + */ + IdentifiedConnection.prototype.counterparty = null; + + /** + * IdentifiedConnection delayPeriod. + * @member {number|Long} delayPeriod + * @memberof ibc.core.connection.v1.IdentifiedConnection + * @instance + */ + IdentifiedConnection.prototype.delayPeriod = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new IdentifiedConnection instance using the specified properties. + * @function create + * @memberof ibc.core.connection.v1.IdentifiedConnection + * @static + * @param {ibc.core.connection.v1.IIdentifiedConnection=} [properties] Properties to set + * @returns {ibc.core.connection.v1.IdentifiedConnection} IdentifiedConnection instance + */ + IdentifiedConnection.create = function create(properties) { + return new IdentifiedConnection(properties); + }; + + /** + * Encodes the specified IdentifiedConnection message. Does not implicitly {@link ibc.core.connection.v1.IdentifiedConnection.verify|verify} messages. + * @function encode + * @memberof ibc.core.connection.v1.IdentifiedConnection + * @static + * @param {ibc.core.connection.v1.IIdentifiedConnection} message IdentifiedConnection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentifiedConnection.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clientId); + if (message.versions != null && message.versions.length) + for (let i = 0; i < message.versions.length; ++i) + $root.ibc.core.connection.v1.Version.encode(message.versions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.counterparty != null && Object.hasOwnProperty.call(message, "counterparty")) + $root.ibc.core.connection.v1.Counterparty.encode(message.counterparty, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.delayPeriod != null && Object.hasOwnProperty.call(message, "delayPeriod")) + writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.delayPeriod); + return writer; + }; + + /** + * Encodes the specified IdentifiedConnection message, length delimited. Does not implicitly {@link ibc.core.connection.v1.IdentifiedConnection.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.connection.v1.IdentifiedConnection + * @static + * @param {ibc.core.connection.v1.IIdentifiedConnection} message IdentifiedConnection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentifiedConnection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentifiedConnection message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.connection.v1.IdentifiedConnection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.connection.v1.IdentifiedConnection} IdentifiedConnection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentifiedConnection.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.IdentifiedConnection(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.clientId = reader.string(); + break; + case 3: + if (!(message.versions && message.versions.length)) + message.versions = []; + message.versions.push($root.ibc.core.connection.v1.Version.decode(reader, reader.uint32())); + break; + case 4: + message.state = reader.int32(); + break; + case 5: + message.counterparty = $root.ibc.core.connection.v1.Counterparty.decode(reader, reader.uint32()); + break; + case 6: + message.delayPeriod = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentifiedConnection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.connection.v1.IdentifiedConnection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.connection.v1.IdentifiedConnection} IdentifiedConnection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentifiedConnection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentifiedConnection message. + * @function verify + * @memberof ibc.core.connection.v1.IdentifiedConnection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentifiedConnection.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.versions != null && message.hasOwnProperty("versions")) { + if (!Array.isArray(message.versions)) + return "versions: array expected"; + for (let i = 0; i < message.versions.length; ++i) { + let error = $root.ibc.core.connection.v1.Version.verify(message.versions[i]); + if (error) + return "versions." + error; + } + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.counterparty != null && message.hasOwnProperty("counterparty")) { + let error = $root.ibc.core.connection.v1.Counterparty.verify(message.counterparty); + if (error) + return "counterparty." + error; + } + if (message.delayPeriod != null && message.hasOwnProperty("delayPeriod")) + if (!$util.isInteger(message.delayPeriod) && !(message.delayPeriod && $util.isInteger(message.delayPeriod.low) && $util.isInteger(message.delayPeriod.high))) + return "delayPeriod: integer|Long expected"; + return null; + }; + + /** + * Creates an IdentifiedConnection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.connection.v1.IdentifiedConnection + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.connection.v1.IdentifiedConnection} IdentifiedConnection + */ + IdentifiedConnection.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.connection.v1.IdentifiedConnection) + return object; + let message = new $root.ibc.core.connection.v1.IdentifiedConnection(); + if (object.id != null) + message.id = String(object.id); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.versions) { + if (!Array.isArray(object.versions)) + throw TypeError(".ibc.core.connection.v1.IdentifiedConnection.versions: array expected"); + message.versions = []; + for (let i = 0; i < object.versions.length; ++i) { + if (typeof object.versions[i] !== "object") + throw TypeError(".ibc.core.connection.v1.IdentifiedConnection.versions: object expected"); + message.versions[i] = $root.ibc.core.connection.v1.Version.fromObject(object.versions[i]); + } + } + switch (object.state) { + case "STATE_UNINITIALIZED_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "STATE_INIT": + case 1: + message.state = 1; + break; + case "STATE_TRYOPEN": + case 2: + message.state = 2; + break; + case "STATE_OPEN": + case 3: + message.state = 3; + break; + } + if (object.counterparty != null) { + if (typeof object.counterparty !== "object") + throw TypeError(".ibc.core.connection.v1.IdentifiedConnection.counterparty: object expected"); + message.counterparty = $root.ibc.core.connection.v1.Counterparty.fromObject(object.counterparty); + } + if (object.delayPeriod != null) + if ($util.Long) + (message.delayPeriod = $util.Long.fromValue(object.delayPeriod)).unsigned = true; + else if (typeof object.delayPeriod === "string") + message.delayPeriod = parseInt(object.delayPeriod, 10); + else if (typeof object.delayPeriod === "number") + message.delayPeriod = object.delayPeriod; + else if (typeof object.delayPeriod === "object") + message.delayPeriod = new $util.LongBits(object.delayPeriod.low >>> 0, object.delayPeriod.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from an IdentifiedConnection message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.connection.v1.IdentifiedConnection + * @static + * @param {ibc.core.connection.v1.IdentifiedConnection} message IdentifiedConnection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentifiedConnection.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.versions = []; + if (options.defaults) { + object.id = ""; + object.clientId = ""; + object.state = options.enums === String ? "STATE_UNINITIALIZED_UNSPECIFIED" : 0; + object.counterparty = null; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.delayPeriod = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.delayPeriod = options.longs === String ? "0" : 0; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.versions && message.versions.length) { + object.versions = []; + for (let j = 0; j < message.versions.length; ++j) + object.versions[j] = $root.ibc.core.connection.v1.Version.toObject(message.versions[j], options); + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.ibc.core.connection.v1.State[message.state] : message.state; + if (message.counterparty != null && message.hasOwnProperty("counterparty")) + object.counterparty = $root.ibc.core.connection.v1.Counterparty.toObject(message.counterparty, options); + if (message.delayPeriod != null && message.hasOwnProperty("delayPeriod")) + if (typeof message.delayPeriod === "number") + object.delayPeriod = options.longs === String ? String(message.delayPeriod) : message.delayPeriod; + else + object.delayPeriod = options.longs === String ? $util.Long.prototype.toString.call(message.delayPeriod) : options.longs === Number ? new $util.LongBits(message.delayPeriod.low >>> 0, message.delayPeriod.high >>> 0).toNumber(true) : message.delayPeriod; + return object; + }; + + /** + * Converts this IdentifiedConnection to JSON. + * @function toJSON + * @memberof ibc.core.connection.v1.IdentifiedConnection + * @instance + * @returns {Object.} JSON object + */ + IdentifiedConnection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentifiedConnection; + })(v1.IdentifiedConnection || {}); + + /** + * State enum. + * @name ibc.core.connection.v1.State + * @enum {string} + * @property {number} STATE_UNINITIALIZED_UNSPECIFIED=0 STATE_UNINITIALIZED_UNSPECIFIED value + * @property {number} STATE_INIT=1 STATE_INIT value + * @property {number} STATE_TRYOPEN=2 STATE_TRYOPEN value + * @property {number} STATE_OPEN=3 STATE_OPEN value + */ + v1.State = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNINITIALIZED_UNSPECIFIED"] = 0; + values[valuesById[1] = "STATE_INIT"] = 1; + values[valuesById[2] = "STATE_TRYOPEN"] = 2; + values[valuesById[3] = "STATE_OPEN"] = 3; + return values; + })(); + + v1.Counterparty = (function(Counterparty) { + + /** + * Properties of a Counterparty. + * @memberof ibc.core.connection.v1 + * @interface ICounterparty + * @property {string|null} [clientId] Counterparty clientId + * @property {string|null} [connectionId] Counterparty connectionId + * @property {ibc.core.commitment.v1.IMerklePrefix|null} [prefix] Counterparty prefix + */ + + /** + * Constructs a new Counterparty. + * @memberof ibc.core.connection.v1 + * @classdesc Represents a Counterparty. + * @implements ICounterparty + * @constructor + * @param {ibc.core.connection.v1.ICounterparty=} [properties] Properties to set + */ + function Counterparty(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Counterparty clientId. + * @member {string} clientId + * @memberof ibc.core.connection.v1.Counterparty + * @instance + */ + Counterparty.prototype.clientId = ""; + + /** + * Counterparty connectionId. + * @member {string} connectionId + * @memberof ibc.core.connection.v1.Counterparty + * @instance + */ + Counterparty.prototype.connectionId = ""; + + /** + * Counterparty prefix. + * @member {ibc.core.commitment.v1.IMerklePrefix|null|undefined} prefix + * @memberof ibc.core.connection.v1.Counterparty + * @instance + */ + Counterparty.prototype.prefix = null; + + /** + * Creates a new Counterparty instance using the specified properties. + * @function create + * @memberof ibc.core.connection.v1.Counterparty + * @static + * @param {ibc.core.connection.v1.ICounterparty=} [properties] Properties to set + * @returns {ibc.core.connection.v1.Counterparty} Counterparty instance + */ + Counterparty.create = function create(properties) { + return new Counterparty(properties); + }; + + /** + * Encodes the specified Counterparty message. Does not implicitly {@link ibc.core.connection.v1.Counterparty.verify|verify} messages. + * @function encode + * @memberof ibc.core.connection.v1.Counterparty + * @static + * @param {ibc.core.connection.v1.ICounterparty} message Counterparty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Counterparty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.connectionId != null && Object.hasOwnProperty.call(message, "connectionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.connectionId); + if (message.prefix != null && Object.hasOwnProperty.call(message, "prefix")) + $root.ibc.core.commitment.v1.MerklePrefix.encode(message.prefix, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Counterparty message, length delimited. Does not implicitly {@link ibc.core.connection.v1.Counterparty.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.connection.v1.Counterparty + * @static + * @param {ibc.core.connection.v1.ICounterparty} message Counterparty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Counterparty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Counterparty message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.connection.v1.Counterparty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.connection.v1.Counterparty} Counterparty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Counterparty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.Counterparty(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.connectionId = reader.string(); + break; + case 3: + message.prefix = $root.ibc.core.commitment.v1.MerklePrefix.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Counterparty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.connection.v1.Counterparty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.connection.v1.Counterparty} Counterparty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Counterparty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Counterparty message. + * @function verify + * @memberof ibc.core.connection.v1.Counterparty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Counterparty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.connectionId != null && message.hasOwnProperty("connectionId")) + if (!$util.isString(message.connectionId)) + return "connectionId: string expected"; + if (message.prefix != null && message.hasOwnProperty("prefix")) { + let error = $root.ibc.core.commitment.v1.MerklePrefix.verify(message.prefix); + if (error) + return "prefix." + error; + } + return null; + }; + + /** + * Creates a Counterparty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.connection.v1.Counterparty + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.connection.v1.Counterparty} Counterparty + */ + Counterparty.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.connection.v1.Counterparty) + return object; + let message = new $root.ibc.core.connection.v1.Counterparty(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.connectionId != null) + message.connectionId = String(object.connectionId); + if (object.prefix != null) { + if (typeof object.prefix !== "object") + throw TypeError(".ibc.core.connection.v1.Counterparty.prefix: object expected"); + message.prefix = $root.ibc.core.commitment.v1.MerklePrefix.fromObject(object.prefix); + } + return message; + }; + + /** + * Creates a plain object from a Counterparty message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.connection.v1.Counterparty + * @static + * @param {ibc.core.connection.v1.Counterparty} message Counterparty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Counterparty.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.clientId = ""; + object.connectionId = ""; + object.prefix = null; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.connectionId != null && message.hasOwnProperty("connectionId")) + object.connectionId = message.connectionId; + if (message.prefix != null && message.hasOwnProperty("prefix")) + object.prefix = $root.ibc.core.commitment.v1.MerklePrefix.toObject(message.prefix, options); + return object; + }; + + /** + * Converts this Counterparty to JSON. + * @function toJSON + * @memberof ibc.core.connection.v1.Counterparty + * @instance + * @returns {Object.} JSON object + */ + Counterparty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Counterparty; + })(v1.Counterparty || {}); + + v1.ClientPaths = (function(ClientPaths) { + + /** + * Properties of a ClientPaths. + * @memberof ibc.core.connection.v1 + * @interface IClientPaths + * @property {Array.|null} [paths] ClientPaths paths + */ + + /** + * Constructs a new ClientPaths. + * @memberof ibc.core.connection.v1 + * @classdesc Represents a ClientPaths. + * @implements IClientPaths + * @constructor + * @param {ibc.core.connection.v1.IClientPaths=} [properties] Properties to set + */ + function ClientPaths(properties) { + this.paths = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientPaths paths. + * @member {Array.} paths + * @memberof ibc.core.connection.v1.ClientPaths + * @instance + */ + ClientPaths.prototype.paths = $util.emptyArray; + + /** + * Creates a new ClientPaths instance using the specified properties. + * @function create + * @memberof ibc.core.connection.v1.ClientPaths + * @static + * @param {ibc.core.connection.v1.IClientPaths=} [properties] Properties to set + * @returns {ibc.core.connection.v1.ClientPaths} ClientPaths instance + */ + ClientPaths.create = function create(properties) { + return new ClientPaths(properties); + }; + + /** + * Encodes the specified ClientPaths message. Does not implicitly {@link ibc.core.connection.v1.ClientPaths.verify|verify} messages. + * @function encode + * @memberof ibc.core.connection.v1.ClientPaths + * @static + * @param {ibc.core.connection.v1.IClientPaths} message ClientPaths message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientPaths.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (let i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified ClientPaths message, length delimited. Does not implicitly {@link ibc.core.connection.v1.ClientPaths.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.connection.v1.ClientPaths + * @static + * @param {ibc.core.connection.v1.IClientPaths} message ClientPaths message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientPaths.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientPaths message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.connection.v1.ClientPaths + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.connection.v1.ClientPaths} ClientPaths + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientPaths.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.ClientPaths(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientPaths message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.connection.v1.ClientPaths + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.connection.v1.ClientPaths} ClientPaths + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientPaths.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientPaths message. + * @function verify + * @memberof ibc.core.connection.v1.ClientPaths + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientPaths.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (let i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a ClientPaths message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.connection.v1.ClientPaths + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.connection.v1.ClientPaths} ClientPaths + */ + ClientPaths.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.connection.v1.ClientPaths) + return object; + let message = new $root.ibc.core.connection.v1.ClientPaths(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".ibc.core.connection.v1.ClientPaths.paths: array expected"); + message.paths = []; + for (let i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a ClientPaths message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.connection.v1.ClientPaths + * @static + * @param {ibc.core.connection.v1.ClientPaths} message ClientPaths + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientPaths.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (let j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this ClientPaths to JSON. + * @function toJSON + * @memberof ibc.core.connection.v1.ClientPaths + * @instance + * @returns {Object.} JSON object + */ + ClientPaths.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ClientPaths; + })(v1.ClientPaths || {}); + + v1.ConnectionPaths = (function(ConnectionPaths) { + + /** + * Properties of a ConnectionPaths. + * @memberof ibc.core.connection.v1 + * @interface IConnectionPaths + * @property {string|null} [clientId] ConnectionPaths clientId + * @property {Array.|null} [paths] ConnectionPaths paths + */ + + /** + * Constructs a new ConnectionPaths. + * @memberof ibc.core.connection.v1 + * @classdesc Represents a ConnectionPaths. + * @implements IConnectionPaths + * @constructor + * @param {ibc.core.connection.v1.IConnectionPaths=} [properties] Properties to set + */ + function ConnectionPaths(properties) { + this.paths = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectionPaths clientId. + * @member {string} clientId + * @memberof ibc.core.connection.v1.ConnectionPaths + * @instance + */ + ConnectionPaths.prototype.clientId = ""; + + /** + * ConnectionPaths paths. + * @member {Array.} paths + * @memberof ibc.core.connection.v1.ConnectionPaths + * @instance + */ + ConnectionPaths.prototype.paths = $util.emptyArray; + + /** + * Creates a new ConnectionPaths instance using the specified properties. + * @function create + * @memberof ibc.core.connection.v1.ConnectionPaths + * @static + * @param {ibc.core.connection.v1.IConnectionPaths=} [properties] Properties to set + * @returns {ibc.core.connection.v1.ConnectionPaths} ConnectionPaths instance + */ + ConnectionPaths.create = function create(properties) { + return new ConnectionPaths(properties); + }; + + /** + * Encodes the specified ConnectionPaths message. Does not implicitly {@link ibc.core.connection.v1.ConnectionPaths.verify|verify} messages. + * @function encode + * @memberof ibc.core.connection.v1.ConnectionPaths + * @static + * @param {ibc.core.connection.v1.IConnectionPaths} message ConnectionPaths message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionPaths.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.paths != null && message.paths.length) + for (let i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified ConnectionPaths message, length delimited. Does not implicitly {@link ibc.core.connection.v1.ConnectionPaths.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.connection.v1.ConnectionPaths + * @static + * @param {ibc.core.connection.v1.IConnectionPaths} message ConnectionPaths message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionPaths.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectionPaths message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.connection.v1.ConnectionPaths + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.connection.v1.ConnectionPaths} ConnectionPaths + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionPaths.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.ConnectionPaths(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectionPaths message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.connection.v1.ConnectionPaths + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.connection.v1.ConnectionPaths} ConnectionPaths + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionPaths.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectionPaths message. + * @function verify + * @memberof ibc.core.connection.v1.ConnectionPaths + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectionPaths.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (let i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a ConnectionPaths message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.connection.v1.ConnectionPaths + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.connection.v1.ConnectionPaths} ConnectionPaths + */ + ConnectionPaths.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.connection.v1.ConnectionPaths) + return object; + let message = new $root.ibc.core.connection.v1.ConnectionPaths(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".ibc.core.connection.v1.ConnectionPaths.paths: array expected"); + message.paths = []; + for (let i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a ConnectionPaths message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.connection.v1.ConnectionPaths + * @static + * @param {ibc.core.connection.v1.ConnectionPaths} message ConnectionPaths + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectionPaths.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (options.defaults) + object.clientId = ""; + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.paths && message.paths.length) { + object.paths = []; + for (let j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this ConnectionPaths to JSON. + * @function toJSON + * @memberof ibc.core.connection.v1.ConnectionPaths + * @instance + * @returns {Object.} JSON object + */ + ConnectionPaths.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ConnectionPaths; + })(v1.ConnectionPaths || {}); + + v1.Version = (function(Version) { + + /** + * Properties of a Version. + * @memberof ibc.core.connection.v1 + * @interface IVersion + * @property {string|null} [identifier] Version identifier + * @property {Array.|null} [features] Version features + */ + + /** + * Constructs a new Version. + * @memberof ibc.core.connection.v1 + * @classdesc Represents a Version. + * @implements IVersion + * @constructor + * @param {ibc.core.connection.v1.IVersion=} [properties] Properties to set + */ + function Version(properties) { + this.features = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Version identifier. + * @member {string} identifier + * @memberof ibc.core.connection.v1.Version + * @instance + */ + Version.prototype.identifier = ""; + + /** + * Version features. + * @member {Array.} features + * @memberof ibc.core.connection.v1.Version + * @instance + */ + Version.prototype.features = $util.emptyArray; + + /** + * Creates a new Version instance using the specified properties. + * @function create + * @memberof ibc.core.connection.v1.Version + * @static + * @param {ibc.core.connection.v1.IVersion=} [properties] Properties to set + * @returns {ibc.core.connection.v1.Version} Version instance + */ + Version.create = function create(properties) { + return new Version(properties); + }; + + /** + * Encodes the specified Version message. Does not implicitly {@link ibc.core.connection.v1.Version.verify|verify} messages. + * @function encode + * @memberof ibc.core.connection.v1.Version + * @static + * @param {ibc.core.connection.v1.IVersion} message Version message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Version.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identifier != null && Object.hasOwnProperty.call(message, "identifier")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.identifier); + if (message.features != null && message.features.length) + for (let i = 0; i < message.features.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.features[i]); + return writer; + }; + + /** + * Encodes the specified Version message, length delimited. Does not implicitly {@link ibc.core.connection.v1.Version.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.connection.v1.Version + * @static + * @param {ibc.core.connection.v1.IVersion} message Version message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Version.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Version message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.connection.v1.Version + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.connection.v1.Version} Version + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Version.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.Version(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identifier = reader.string(); + break; + case 2: + if (!(message.features && message.features.length)) + message.features = []; + message.features.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Version message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.connection.v1.Version + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.connection.v1.Version} Version + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Version.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Version message. + * @function verify + * @memberof ibc.core.connection.v1.Version + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Version.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identifier != null && message.hasOwnProperty("identifier")) + if (!$util.isString(message.identifier)) + return "identifier: string expected"; + if (message.features != null && message.hasOwnProperty("features")) { + if (!Array.isArray(message.features)) + return "features: array expected"; + for (let i = 0; i < message.features.length; ++i) + if (!$util.isString(message.features[i])) + return "features: string[] expected"; + } + return null; + }; + + /** + * Creates a Version message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.connection.v1.Version + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.connection.v1.Version} Version + */ + Version.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.connection.v1.Version) + return object; + let message = new $root.ibc.core.connection.v1.Version(); + if (object.identifier != null) + message.identifier = String(object.identifier); + if (object.features) { + if (!Array.isArray(object.features)) + throw TypeError(".ibc.core.connection.v1.Version.features: array expected"); + message.features = []; + for (let i = 0; i < object.features.length; ++i) + message.features[i] = String(object.features[i]); + } + return message; + }; + + /** + * Creates a plain object from a Version message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.connection.v1.Version + * @static + * @param {ibc.core.connection.v1.Version} message Version + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Version.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.features = []; + if (options.defaults) + object.identifier = ""; + if (message.identifier != null && message.hasOwnProperty("identifier")) + object.identifier = message.identifier; + if (message.features && message.features.length) { + object.features = []; + for (let j = 0; j < message.features.length; ++j) + object.features[j] = message.features[j]; + } + return object; + }; + + /** + * Converts this Version to JSON. + * @function toJSON + * @memberof ibc.core.connection.v1.Version + * @instance + * @returns {Object.} JSON object + */ + Version.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Version; + })(v1.Version || {}); + + v1.GenesisState = (function(GenesisState) { + + /** + * Properties of a GenesisState. + * @memberof ibc.core.connection.v1 + * @interface IGenesisState + * @property {Array.|null} [connections] GenesisState connections + * @property {Array.|null} [clientConnectionPaths] GenesisState clientConnectionPaths + * @property {number|Long|null} [nextConnectionSequence] GenesisState nextConnectionSequence + */ + + /** + * Constructs a new GenesisState. + * @memberof ibc.core.connection.v1 + * @classdesc Represents a GenesisState. + * @implements IGenesisState + * @constructor + * @param {ibc.core.connection.v1.IGenesisState=} [properties] Properties to set + */ + function GenesisState(properties) { + this.connections = []; + this.clientConnectionPaths = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenesisState connections. + * @member {Array.} connections + * @memberof ibc.core.connection.v1.GenesisState + * @instance + */ + GenesisState.prototype.connections = $util.emptyArray; + + /** + * GenesisState clientConnectionPaths. + * @member {Array.} clientConnectionPaths + * @memberof ibc.core.connection.v1.GenesisState + * @instance + */ + GenesisState.prototype.clientConnectionPaths = $util.emptyArray; + + /** + * GenesisState nextConnectionSequence. + * @member {number|Long} nextConnectionSequence + * @memberof ibc.core.connection.v1.GenesisState + * @instance + */ + GenesisState.prototype.nextConnectionSequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new GenesisState instance using the specified properties. + * @function create + * @memberof ibc.core.connection.v1.GenesisState + * @static + * @param {ibc.core.connection.v1.IGenesisState=} [properties] Properties to set + * @returns {ibc.core.connection.v1.GenesisState} GenesisState instance + */ + GenesisState.create = function create(properties) { + return new GenesisState(properties); + }; + + /** + * Encodes the specified GenesisState message. Does not implicitly {@link ibc.core.connection.v1.GenesisState.verify|verify} messages. + * @function encode + * @memberof ibc.core.connection.v1.GenesisState + * @static + * @param {ibc.core.connection.v1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connections != null && message.connections.length) + for (let i = 0; i < message.connections.length; ++i) + $root.ibc.core.connection.v1.IdentifiedConnection.encode(message.connections[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.clientConnectionPaths != null && message.clientConnectionPaths.length) + for (let i = 0; i < message.clientConnectionPaths.length; ++i) + $root.ibc.core.connection.v1.ConnectionPaths.encode(message.clientConnectionPaths[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextConnectionSequence != null && Object.hasOwnProperty.call(message, "nextConnectionSequence")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.nextConnectionSequence); + return writer; + }; + + /** + * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link ibc.core.connection.v1.GenesisState.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.connection.v1.GenesisState + * @static + * @param {ibc.core.connection.v1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.connection.v1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.connection.v1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.GenesisState(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.connections && message.connections.length)) + message.connections = []; + message.connections.push($root.ibc.core.connection.v1.IdentifiedConnection.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.clientConnectionPaths && message.clientConnectionPaths.length)) + message.clientConnectionPaths = []; + message.clientConnectionPaths.push($root.ibc.core.connection.v1.ConnectionPaths.decode(reader, reader.uint32())); + break; + case 3: + message.nextConnectionSequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.connection.v1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.connection.v1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenesisState message. + * @function verify + * @memberof ibc.core.connection.v1.GenesisState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenesisState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.connections != null && message.hasOwnProperty("connections")) { + if (!Array.isArray(message.connections)) + return "connections: array expected"; + for (let i = 0; i < message.connections.length; ++i) { + let error = $root.ibc.core.connection.v1.IdentifiedConnection.verify(message.connections[i]); + if (error) + return "connections." + error; + } + } + if (message.clientConnectionPaths != null && message.hasOwnProperty("clientConnectionPaths")) { + if (!Array.isArray(message.clientConnectionPaths)) + return "clientConnectionPaths: array expected"; + for (let i = 0; i < message.clientConnectionPaths.length; ++i) { + let error = $root.ibc.core.connection.v1.ConnectionPaths.verify(message.clientConnectionPaths[i]); + if (error) + return "clientConnectionPaths." + error; + } + } + if (message.nextConnectionSequence != null && message.hasOwnProperty("nextConnectionSequence")) + if (!$util.isInteger(message.nextConnectionSequence) && !(message.nextConnectionSequence && $util.isInteger(message.nextConnectionSequence.low) && $util.isInteger(message.nextConnectionSequence.high))) + return "nextConnectionSequence: integer|Long expected"; + return null; + }; + + /** + * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.connection.v1.GenesisState + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.connection.v1.GenesisState} GenesisState + */ + GenesisState.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.connection.v1.GenesisState) + return object; + let message = new $root.ibc.core.connection.v1.GenesisState(); + if (object.connections) { + if (!Array.isArray(object.connections)) + throw TypeError(".ibc.core.connection.v1.GenesisState.connections: array expected"); + message.connections = []; + for (let i = 0; i < object.connections.length; ++i) { + if (typeof object.connections[i] !== "object") + throw TypeError(".ibc.core.connection.v1.GenesisState.connections: object expected"); + message.connections[i] = $root.ibc.core.connection.v1.IdentifiedConnection.fromObject(object.connections[i]); + } + } + if (object.clientConnectionPaths) { + if (!Array.isArray(object.clientConnectionPaths)) + throw TypeError(".ibc.core.connection.v1.GenesisState.clientConnectionPaths: array expected"); + message.clientConnectionPaths = []; + for (let i = 0; i < object.clientConnectionPaths.length; ++i) { + if (typeof object.clientConnectionPaths[i] !== "object") + throw TypeError(".ibc.core.connection.v1.GenesisState.clientConnectionPaths: object expected"); + message.clientConnectionPaths[i] = $root.ibc.core.connection.v1.ConnectionPaths.fromObject(object.clientConnectionPaths[i]); + } + } + if (object.nextConnectionSequence != null) + if ($util.Long) + (message.nextConnectionSequence = $util.Long.fromValue(object.nextConnectionSequence)).unsigned = true; + else if (typeof object.nextConnectionSequence === "string") + message.nextConnectionSequence = parseInt(object.nextConnectionSequence, 10); + else if (typeof object.nextConnectionSequence === "number") + message.nextConnectionSequence = object.nextConnectionSequence; + else if (typeof object.nextConnectionSequence === "object") + message.nextConnectionSequence = new $util.LongBits(object.nextConnectionSequence.low >>> 0, object.nextConnectionSequence.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a GenesisState message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.connection.v1.GenesisState + * @static + * @param {ibc.core.connection.v1.GenesisState} message GenesisState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenesisState.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) { + object.connections = []; + object.clientConnectionPaths = []; + } + if (options.defaults) + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.nextConnectionSequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nextConnectionSequence = options.longs === String ? "0" : 0; + if (message.connections && message.connections.length) { + object.connections = []; + for (let j = 0; j < message.connections.length; ++j) + object.connections[j] = $root.ibc.core.connection.v1.IdentifiedConnection.toObject(message.connections[j], options); + } + if (message.clientConnectionPaths && message.clientConnectionPaths.length) { + object.clientConnectionPaths = []; + for (let j = 0; j < message.clientConnectionPaths.length; ++j) + object.clientConnectionPaths[j] = $root.ibc.core.connection.v1.ConnectionPaths.toObject(message.clientConnectionPaths[j], options); + } + if (message.nextConnectionSequence != null && message.hasOwnProperty("nextConnectionSequence")) + if (typeof message.nextConnectionSequence === "number") + object.nextConnectionSequence = options.longs === String ? String(message.nextConnectionSequence) : message.nextConnectionSequence; + else + object.nextConnectionSequence = options.longs === String ? $util.Long.prototype.toString.call(message.nextConnectionSequence) : options.longs === Number ? new $util.LongBits(message.nextConnectionSequence.low >>> 0, message.nextConnectionSequence.high >>> 0).toNumber(true) : message.nextConnectionSequence; + return object; + }; + + /** + * Converts this GenesisState to JSON. + * @function toJSON + * @memberof ibc.core.connection.v1.GenesisState + * @instance + * @returns {Object.} JSON object + */ + GenesisState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GenesisState; + })(v1.GenesisState || {}); + + v1.Query = (function(Query) { + + /** + * Constructs a new Query service. + * @memberof ibc.core.connection.v1 + * @classdesc Represents a Query + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Query(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; + + /** + * Creates new Query service using the specified rpc implementation. + * @function create + * @memberof ibc.core.connection.v1.Query + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Query} RPC service. Useful where requests and/or responses are streamed. + */ + Query.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link ibc.core.connection.v1.Query#connection}. + * @memberof ibc.core.connection.v1.Query + * @typedef ConnectionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.connection.v1.IQueryConnectionResponse} [response] QueryConnectionResponse + */ + + /** + * Calls Connection. + * @function connection + * @memberof ibc.core.connection.v1.Query + * @instance + * @param {ibc.core.connection.v1.IQueryConnectionRequest} request QueryConnectionRequest message or plain object + * @param {ibc.core.connection.v1.Query.ConnectionCallback} callback Node-style callback called with the error, if any, and QueryConnectionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.connection = function connection(request, callback) { + return this.rpcCall(connection, $root.ibc.core.connection.v1.QueryConnectionRequest, $root.ibc.core.connection.v1.QueryConnectionResponse, request, callback); + }, "name", { value: "Connection" }); + + /** + * Calls Connection. + * @function connection + * @memberof ibc.core.connection.v1.Query + * @instance + * @param {ibc.core.connection.v1.IQueryConnectionRequest} request QueryConnectionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.connection.v1.Query#connections}. + * @memberof ibc.core.connection.v1.Query + * @typedef ConnectionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.connection.v1.IQueryConnectionsResponse} [response] QueryConnectionsResponse + */ + + /** + * Calls Connections. + * @function connections + * @memberof ibc.core.connection.v1.Query + * @instance + * @param {ibc.core.connection.v1.IQueryConnectionsRequest} request QueryConnectionsRequest message or plain object + * @param {ibc.core.connection.v1.Query.ConnectionsCallback} callback Node-style callback called with the error, if any, and QueryConnectionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.connections = function connections(request, callback) { + return this.rpcCall(connections, $root.ibc.core.connection.v1.QueryConnectionsRequest, $root.ibc.core.connection.v1.QueryConnectionsResponse, request, callback); + }, "name", { value: "Connections" }); + + /** + * Calls Connections. + * @function connections + * @memberof ibc.core.connection.v1.Query + * @instance + * @param {ibc.core.connection.v1.IQueryConnectionsRequest} request QueryConnectionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.connection.v1.Query#clientConnections}. + * @memberof ibc.core.connection.v1.Query + * @typedef ClientConnectionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.connection.v1.IQueryClientConnectionsResponse} [response] QueryClientConnectionsResponse + */ + + /** + * Calls ClientConnections. + * @function clientConnections + * @memberof ibc.core.connection.v1.Query + * @instance + * @param {ibc.core.connection.v1.IQueryClientConnectionsRequest} request QueryClientConnectionsRequest message or plain object + * @param {ibc.core.connection.v1.Query.ClientConnectionsCallback} callback Node-style callback called with the error, if any, and QueryClientConnectionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.clientConnections = function clientConnections(request, callback) { + return this.rpcCall(clientConnections, $root.ibc.core.connection.v1.QueryClientConnectionsRequest, $root.ibc.core.connection.v1.QueryClientConnectionsResponse, request, callback); + }, "name", { value: "ClientConnections" }); + + /** + * Calls ClientConnections. + * @function clientConnections + * @memberof ibc.core.connection.v1.Query + * @instance + * @param {ibc.core.connection.v1.IQueryClientConnectionsRequest} request QueryClientConnectionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.connection.v1.Query#connectionClientState}. + * @memberof ibc.core.connection.v1.Query + * @typedef ConnectionClientStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.connection.v1.IQueryConnectionClientStateResponse} [response] QueryConnectionClientStateResponse + */ + + /** + * Calls ConnectionClientState. + * @function connectionClientState + * @memberof ibc.core.connection.v1.Query + * @instance + * @param {ibc.core.connection.v1.IQueryConnectionClientStateRequest} request QueryConnectionClientStateRequest message or plain object + * @param {ibc.core.connection.v1.Query.ConnectionClientStateCallback} callback Node-style callback called with the error, if any, and QueryConnectionClientStateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.connectionClientState = function connectionClientState(request, callback) { + return this.rpcCall(connectionClientState, $root.ibc.core.connection.v1.QueryConnectionClientStateRequest, $root.ibc.core.connection.v1.QueryConnectionClientStateResponse, request, callback); + }, "name", { value: "ConnectionClientState" }); + + /** + * Calls ConnectionClientState. + * @function connectionClientState + * @memberof ibc.core.connection.v1.Query + * @instance + * @param {ibc.core.connection.v1.IQueryConnectionClientStateRequest} request QueryConnectionClientStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.connection.v1.Query#connectionConsensusState}. + * @memberof ibc.core.connection.v1.Query + * @typedef ConnectionConsensusStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.connection.v1.IQueryConnectionConsensusStateResponse} [response] QueryConnectionConsensusStateResponse + */ + + /** + * Calls ConnectionConsensusState. + * @function connectionConsensusState + * @memberof ibc.core.connection.v1.Query + * @instance + * @param {ibc.core.connection.v1.IQueryConnectionConsensusStateRequest} request QueryConnectionConsensusStateRequest message or plain object + * @param {ibc.core.connection.v1.Query.ConnectionConsensusStateCallback} callback Node-style callback called with the error, if any, and QueryConnectionConsensusStateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.connectionConsensusState = function connectionConsensusState(request, callback) { + return this.rpcCall(connectionConsensusState, $root.ibc.core.connection.v1.QueryConnectionConsensusStateRequest, $root.ibc.core.connection.v1.QueryConnectionConsensusStateResponse, request, callback); + }, "name", { value: "ConnectionConsensusState" }); + + /** + * Calls ConnectionConsensusState. + * @function connectionConsensusState + * @memberof ibc.core.connection.v1.Query + * @instance + * @param {ibc.core.connection.v1.IQueryConnectionConsensusStateRequest} request QueryConnectionConsensusStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Query; + })(v1.Query || {}); + + v1.QueryConnectionRequest = (function(QueryConnectionRequest) { + + /** + * Properties of a QueryConnectionRequest. + * @memberof ibc.core.connection.v1 + * @interface IQueryConnectionRequest + * @property {string|null} [connectionId] QueryConnectionRequest connectionId + */ + + /** + * Constructs a new QueryConnectionRequest. + * @memberof ibc.core.connection.v1 + * @classdesc Represents a QueryConnectionRequest. + * @implements IQueryConnectionRequest + * @constructor + * @param {ibc.core.connection.v1.IQueryConnectionRequest=} [properties] Properties to set + */ + function QueryConnectionRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryConnectionRequest connectionId. + * @member {string} connectionId + * @memberof ibc.core.connection.v1.QueryConnectionRequest + * @instance + */ + QueryConnectionRequest.prototype.connectionId = ""; + + /** + * Creates a new QueryConnectionRequest instance using the specified properties. + * @function create + * @memberof ibc.core.connection.v1.QueryConnectionRequest + * @static + * @param {ibc.core.connection.v1.IQueryConnectionRequest=} [properties] Properties to set + * @returns {ibc.core.connection.v1.QueryConnectionRequest} QueryConnectionRequest instance + */ + QueryConnectionRequest.create = function create(properties) { + return new QueryConnectionRequest(properties); + }; + + /** + * Encodes the specified QueryConnectionRequest message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.connection.v1.QueryConnectionRequest + * @static + * @param {ibc.core.connection.v1.IQueryConnectionRequest} message QueryConnectionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConnectionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connectionId != null && Object.hasOwnProperty.call(message, "connectionId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.connectionId); + return writer; + }; + + /** + * Encodes the specified QueryConnectionRequest message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.connection.v1.QueryConnectionRequest + * @static + * @param {ibc.core.connection.v1.IQueryConnectionRequest} message QueryConnectionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConnectionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryConnectionRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.connection.v1.QueryConnectionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.connection.v1.QueryConnectionRequest} QueryConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConnectionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.QueryConnectionRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryConnectionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.connection.v1.QueryConnectionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.connection.v1.QueryConnectionRequest} QueryConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConnectionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryConnectionRequest message. + * @function verify + * @memberof ibc.core.connection.v1.QueryConnectionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryConnectionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.connectionId != null && message.hasOwnProperty("connectionId")) + if (!$util.isString(message.connectionId)) + return "connectionId: string expected"; + return null; + }; + + /** + * Creates a QueryConnectionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.connection.v1.QueryConnectionRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.connection.v1.QueryConnectionRequest} QueryConnectionRequest + */ + QueryConnectionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.connection.v1.QueryConnectionRequest) + return object; + let message = new $root.ibc.core.connection.v1.QueryConnectionRequest(); + if (object.connectionId != null) + message.connectionId = String(object.connectionId); + return message; + }; + + /** + * Creates a plain object from a QueryConnectionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.connection.v1.QueryConnectionRequest + * @static + * @param {ibc.core.connection.v1.QueryConnectionRequest} message QueryConnectionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryConnectionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.connectionId = ""; + if (message.connectionId != null && message.hasOwnProperty("connectionId")) + object.connectionId = message.connectionId; + return object; + }; + + /** + * Converts this QueryConnectionRequest to JSON. + * @function toJSON + * @memberof ibc.core.connection.v1.QueryConnectionRequest + * @instance + * @returns {Object.} JSON object + */ + QueryConnectionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryConnectionRequest; + })(v1.QueryConnectionRequest || {}); + + v1.QueryConnectionResponse = (function(QueryConnectionResponse) { + + /** + * Properties of a QueryConnectionResponse. + * @memberof ibc.core.connection.v1 + * @interface IQueryConnectionResponse + * @property {ibc.core.connection.v1.IConnectionEnd|null} [connection] QueryConnectionResponse connection + * @property {Uint8Array|null} [proof] QueryConnectionResponse proof + * @property {ibc.core.client.v1.IHeight|null} [proofHeight] QueryConnectionResponse proofHeight + */ + + /** + * Constructs a new QueryConnectionResponse. + * @memberof ibc.core.connection.v1 + * @classdesc Represents a QueryConnectionResponse. + * @implements IQueryConnectionResponse + * @constructor + * @param {ibc.core.connection.v1.IQueryConnectionResponse=} [properties] Properties to set + */ + function QueryConnectionResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryConnectionResponse connection. + * @member {ibc.core.connection.v1.IConnectionEnd|null|undefined} connection + * @memberof ibc.core.connection.v1.QueryConnectionResponse + * @instance + */ + QueryConnectionResponse.prototype.connection = null; + + /** + * QueryConnectionResponse proof. + * @member {Uint8Array} proof + * @memberof ibc.core.connection.v1.QueryConnectionResponse + * @instance + */ + QueryConnectionResponse.prototype.proof = $util.newBuffer([]); + + /** + * QueryConnectionResponse proofHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} proofHeight + * @memberof ibc.core.connection.v1.QueryConnectionResponse + * @instance + */ + QueryConnectionResponse.prototype.proofHeight = null; + + /** + * Creates a new QueryConnectionResponse instance using the specified properties. + * @function create + * @memberof ibc.core.connection.v1.QueryConnectionResponse + * @static + * @param {ibc.core.connection.v1.IQueryConnectionResponse=} [properties] Properties to set + * @returns {ibc.core.connection.v1.QueryConnectionResponse} QueryConnectionResponse instance + */ + QueryConnectionResponse.create = function create(properties) { + return new QueryConnectionResponse(properties); + }; + + /** + * Encodes the specified QueryConnectionResponse message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.connection.v1.QueryConnectionResponse + * @static + * @param {ibc.core.connection.v1.IQueryConnectionResponse} message QueryConnectionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConnectionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) + $root.ibc.core.connection.v1.ConnectionEnd.encode(message.connection, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); + if (message.proofHeight != null && Object.hasOwnProperty.call(message, "proofHeight")) + $root.ibc.core.client.v1.Height.encode(message.proofHeight, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryConnectionResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.connection.v1.QueryConnectionResponse + * @static + * @param {ibc.core.connection.v1.IQueryConnectionResponse} message QueryConnectionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConnectionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryConnectionResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.connection.v1.QueryConnectionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.connection.v1.QueryConnectionResponse} QueryConnectionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConnectionResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.QueryConnectionResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connection = $root.ibc.core.connection.v1.ConnectionEnd.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryConnectionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.connection.v1.QueryConnectionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.connection.v1.QueryConnectionResponse} QueryConnectionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConnectionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryConnectionResponse message. + * @function verify + * @memberof ibc.core.connection.v1.QueryConnectionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryConnectionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.connection != null && message.hasOwnProperty("connection")) { + let error = $root.ibc.core.connection.v1.ConnectionEnd.verify(message.connection); + if (error) + return "connection." + error; + } + if (message.proof != null && message.hasOwnProperty("proof")) + if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) + return "proof: buffer expected"; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) { + let error = $root.ibc.core.client.v1.Height.verify(message.proofHeight); + if (error) + return "proofHeight." + error; + } + return null; + }; + + /** + * Creates a QueryConnectionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.connection.v1.QueryConnectionResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.connection.v1.QueryConnectionResponse} QueryConnectionResponse + */ + QueryConnectionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.connection.v1.QueryConnectionResponse) + return object; + let message = new $root.ibc.core.connection.v1.QueryConnectionResponse(); + if (object.connection != null) { + if (typeof object.connection !== "object") + throw TypeError(".ibc.core.connection.v1.QueryConnectionResponse.connection: object expected"); + message.connection = $root.ibc.core.connection.v1.ConnectionEnd.fromObject(object.connection); + } + if (object.proof != null) + if (typeof object.proof === "string") + $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); + else if (object.proof.length) + message.proof = object.proof; + if (object.proofHeight != null) { + if (typeof object.proofHeight !== "object") + throw TypeError(".ibc.core.connection.v1.QueryConnectionResponse.proofHeight: object expected"); + message.proofHeight = $root.ibc.core.client.v1.Height.fromObject(object.proofHeight); + } + return message; + }; + + /** + * Creates a plain object from a QueryConnectionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.connection.v1.QueryConnectionResponse + * @static + * @param {ibc.core.connection.v1.QueryConnectionResponse} message QueryConnectionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryConnectionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.connection = null; + if (options.bytes === String) + object.proof = ""; + else { + object.proof = []; + if (options.bytes !== Array) + object.proof = $util.newBuffer(object.proof); + } + object.proofHeight = null; + } + if (message.connection != null && message.hasOwnProperty("connection")) + object.connection = $root.ibc.core.connection.v1.ConnectionEnd.toObject(message.connection, options); + if (message.proof != null && message.hasOwnProperty("proof")) + object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) + object.proofHeight = $root.ibc.core.client.v1.Height.toObject(message.proofHeight, options); + return object; + }; + + /** + * Converts this QueryConnectionResponse to JSON. + * @function toJSON + * @memberof ibc.core.connection.v1.QueryConnectionResponse + * @instance + * @returns {Object.} JSON object + */ + QueryConnectionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryConnectionResponse; + })(v1.QueryConnectionResponse || {}); + + v1.QueryConnectionsRequest = (function(QueryConnectionsRequest) { + + /** + * Properties of a QueryConnectionsRequest. + * @memberof ibc.core.connection.v1 + * @interface IQueryConnectionsRequest + * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryConnectionsRequest pagination + */ + + /** + * Constructs a new QueryConnectionsRequest. + * @memberof ibc.core.connection.v1 + * @classdesc Represents a QueryConnectionsRequest. + * @implements IQueryConnectionsRequest + * @constructor + * @param {ibc.core.connection.v1.IQueryConnectionsRequest=} [properties] Properties to set + */ + function QueryConnectionsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryConnectionsRequest pagination. + * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination + * @memberof ibc.core.connection.v1.QueryConnectionsRequest + * @instance + */ + QueryConnectionsRequest.prototype.pagination = null; + + /** + * Creates a new QueryConnectionsRequest instance using the specified properties. + * @function create + * @memberof ibc.core.connection.v1.QueryConnectionsRequest + * @static + * @param {ibc.core.connection.v1.IQueryConnectionsRequest=} [properties] Properties to set + * @returns {ibc.core.connection.v1.QueryConnectionsRequest} QueryConnectionsRequest instance + */ + QueryConnectionsRequest.create = function create(properties) { + return new QueryConnectionsRequest(properties); + }; + + /** + * Encodes the specified QueryConnectionsRequest message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionsRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.connection.v1.QueryConnectionsRequest + * @static + * @param {ibc.core.connection.v1.IQueryConnectionsRequest} message QueryConnectionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConnectionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryConnectionsRequest message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.connection.v1.QueryConnectionsRequest + * @static + * @param {ibc.core.connection.v1.IQueryConnectionsRequest} message QueryConnectionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConnectionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryConnectionsRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.connection.v1.QueryConnectionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.connection.v1.QueryConnectionsRequest} QueryConnectionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConnectionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.QueryConnectionsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryConnectionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.connection.v1.QueryConnectionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.connection.v1.QueryConnectionsRequest} QueryConnectionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConnectionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryConnectionsRequest message. + * @function verify + * @memberof ibc.core.connection.v1.QueryConnectionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryConnectionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryConnectionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.connection.v1.QueryConnectionsRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.connection.v1.QueryConnectionsRequest} QueryConnectionsRequest + */ + QueryConnectionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.connection.v1.QueryConnectionsRequest) + return object; + let message = new $root.ibc.core.connection.v1.QueryConnectionsRequest(); + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".ibc.core.connection.v1.QueryConnectionsRequest.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryConnectionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.connection.v1.QueryConnectionsRequest + * @static + * @param {ibc.core.connection.v1.QueryConnectionsRequest} message QueryConnectionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryConnectionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.pagination = null; + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryConnectionsRequest to JSON. + * @function toJSON + * @memberof ibc.core.connection.v1.QueryConnectionsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryConnectionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryConnectionsRequest; + })(v1.QueryConnectionsRequest || {}); + + v1.QueryConnectionsResponse = (function(QueryConnectionsResponse) { + + /** + * Properties of a QueryConnectionsResponse. + * @memberof ibc.core.connection.v1 + * @interface IQueryConnectionsResponse + * @property {Array.|null} [connections] QueryConnectionsResponse connections + * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryConnectionsResponse pagination + * @property {ibc.core.client.v1.IHeight|null} [height] QueryConnectionsResponse height + */ + + /** + * Constructs a new QueryConnectionsResponse. + * @memberof ibc.core.connection.v1 + * @classdesc Represents a QueryConnectionsResponse. + * @implements IQueryConnectionsResponse + * @constructor + * @param {ibc.core.connection.v1.IQueryConnectionsResponse=} [properties] Properties to set + */ + function QueryConnectionsResponse(properties) { + this.connections = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryConnectionsResponse connections. + * @member {Array.} connections + * @memberof ibc.core.connection.v1.QueryConnectionsResponse + * @instance + */ + QueryConnectionsResponse.prototype.connections = $util.emptyArray; + + /** + * QueryConnectionsResponse pagination. + * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination + * @memberof ibc.core.connection.v1.QueryConnectionsResponse + * @instance + */ + QueryConnectionsResponse.prototype.pagination = null; + + /** + * QueryConnectionsResponse height. + * @member {ibc.core.client.v1.IHeight|null|undefined} height + * @memberof ibc.core.connection.v1.QueryConnectionsResponse + * @instance + */ + QueryConnectionsResponse.prototype.height = null; + + /** + * Creates a new QueryConnectionsResponse instance using the specified properties. + * @function create + * @memberof ibc.core.connection.v1.QueryConnectionsResponse + * @static + * @param {ibc.core.connection.v1.IQueryConnectionsResponse=} [properties] Properties to set + * @returns {ibc.core.connection.v1.QueryConnectionsResponse} QueryConnectionsResponse instance + */ + QueryConnectionsResponse.create = function create(properties) { + return new QueryConnectionsResponse(properties); + }; + + /** + * Encodes the specified QueryConnectionsResponse message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionsResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.connection.v1.QueryConnectionsResponse + * @static + * @param {ibc.core.connection.v1.IQueryConnectionsResponse} message QueryConnectionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConnectionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connections != null && message.connections.length) + for (let i = 0; i < message.connections.length; ++i) + $root.ibc.core.connection.v1.IdentifiedConnection.encode(message.connections[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + $root.ibc.core.client.v1.Height.encode(message.height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryConnectionsResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.connection.v1.QueryConnectionsResponse + * @static + * @param {ibc.core.connection.v1.IQueryConnectionsResponse} message QueryConnectionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConnectionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryConnectionsResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.connection.v1.QueryConnectionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.connection.v1.QueryConnectionsResponse} QueryConnectionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConnectionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.QueryConnectionsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.connections && message.connections.length)) + message.connections = []; + message.connections.push($root.ibc.core.connection.v1.IdentifiedConnection.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); + break; + case 3: + message.height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryConnectionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.connection.v1.QueryConnectionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.connection.v1.QueryConnectionsResponse} QueryConnectionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConnectionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryConnectionsResponse message. + * @function verify + * @memberof ibc.core.connection.v1.QueryConnectionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryConnectionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.connections != null && message.hasOwnProperty("connections")) { + if (!Array.isArray(message.connections)) + return "connections: array expected"; + for (let i = 0; i < message.connections.length; ++i) { + let error = $root.ibc.core.connection.v1.IdentifiedConnection.verify(message.connections[i]); + if (error) + return "connections." + error; + } + } + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); + if (error) + return "pagination." + error; + } + if (message.height != null && message.hasOwnProperty("height")) { + let error = $root.ibc.core.client.v1.Height.verify(message.height); + if (error) + return "height." + error; + } + return null; + }; + + /** + * Creates a QueryConnectionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.connection.v1.QueryConnectionsResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.connection.v1.QueryConnectionsResponse} QueryConnectionsResponse + */ + QueryConnectionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.connection.v1.QueryConnectionsResponse) + return object; + let message = new $root.ibc.core.connection.v1.QueryConnectionsResponse(); + if (object.connections) { + if (!Array.isArray(object.connections)) + throw TypeError(".ibc.core.connection.v1.QueryConnectionsResponse.connections: array expected"); + message.connections = []; + for (let i = 0; i < object.connections.length; ++i) { + if (typeof object.connections[i] !== "object") + throw TypeError(".ibc.core.connection.v1.QueryConnectionsResponse.connections: object expected"); + message.connections[i] = $root.ibc.core.connection.v1.IdentifiedConnection.fromObject(object.connections[i]); + } + } + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".ibc.core.connection.v1.QueryConnectionsResponse.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); + } + if (object.height != null) { + if (typeof object.height !== "object") + throw TypeError(".ibc.core.connection.v1.QueryConnectionsResponse.height: object expected"); + message.height = $root.ibc.core.client.v1.Height.fromObject(object.height); + } + return message; + }; + + /** + * Creates a plain object from a QueryConnectionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.connection.v1.QueryConnectionsResponse + * @static + * @param {ibc.core.connection.v1.QueryConnectionsResponse} message QueryConnectionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryConnectionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.connections = []; + if (options.defaults) { + object.pagination = null; + object.height = null; + } + if (message.connections && message.connections.length) { + object.connections = []; + for (let j = 0; j < message.connections.length; ++j) + object.connections[j] = $root.ibc.core.connection.v1.IdentifiedConnection.toObject(message.connections[j], options); + } + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); + if (message.height != null && message.hasOwnProperty("height")) + object.height = $root.ibc.core.client.v1.Height.toObject(message.height, options); + return object; + }; + + /** + * Converts this QueryConnectionsResponse to JSON. + * @function toJSON + * @memberof ibc.core.connection.v1.QueryConnectionsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryConnectionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryConnectionsResponse; + })(v1.QueryConnectionsResponse || {}); + + v1.QueryClientConnectionsRequest = (function(QueryClientConnectionsRequest) { + + /** + * Properties of a QueryClientConnectionsRequest. + * @memberof ibc.core.connection.v1 + * @interface IQueryClientConnectionsRequest + * @property {string|null} [clientId] QueryClientConnectionsRequest clientId + */ + + /** + * Constructs a new QueryClientConnectionsRequest. + * @memberof ibc.core.connection.v1 + * @classdesc Represents a QueryClientConnectionsRequest. + * @implements IQueryClientConnectionsRequest + * @constructor + * @param {ibc.core.connection.v1.IQueryClientConnectionsRequest=} [properties] Properties to set + */ + function QueryClientConnectionsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryClientConnectionsRequest clientId. + * @member {string} clientId + * @memberof ibc.core.connection.v1.QueryClientConnectionsRequest + * @instance + */ + QueryClientConnectionsRequest.prototype.clientId = ""; + + /** + * Creates a new QueryClientConnectionsRequest instance using the specified properties. + * @function create + * @memberof ibc.core.connection.v1.QueryClientConnectionsRequest + * @static + * @param {ibc.core.connection.v1.IQueryClientConnectionsRequest=} [properties] Properties to set + * @returns {ibc.core.connection.v1.QueryClientConnectionsRequest} QueryClientConnectionsRequest instance + */ + QueryClientConnectionsRequest.create = function create(properties) { + return new QueryClientConnectionsRequest(properties); + }; + + /** + * Encodes the specified QueryClientConnectionsRequest message. Does not implicitly {@link ibc.core.connection.v1.QueryClientConnectionsRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.connection.v1.QueryClientConnectionsRequest + * @static + * @param {ibc.core.connection.v1.IQueryClientConnectionsRequest} message QueryClientConnectionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientConnectionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + return writer; + }; + + /** + * Encodes the specified QueryClientConnectionsRequest message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryClientConnectionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.connection.v1.QueryClientConnectionsRequest + * @static + * @param {ibc.core.connection.v1.IQueryClientConnectionsRequest} message QueryClientConnectionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientConnectionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryClientConnectionsRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.connection.v1.QueryClientConnectionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.connection.v1.QueryClientConnectionsRequest} QueryClientConnectionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientConnectionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.QueryClientConnectionsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryClientConnectionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.connection.v1.QueryClientConnectionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.connection.v1.QueryClientConnectionsRequest} QueryClientConnectionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientConnectionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryClientConnectionsRequest message. + * @function verify + * @memberof ibc.core.connection.v1.QueryClientConnectionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryClientConnectionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + return null; + }; + + /** + * Creates a QueryClientConnectionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.connection.v1.QueryClientConnectionsRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.connection.v1.QueryClientConnectionsRequest} QueryClientConnectionsRequest + */ + QueryClientConnectionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.connection.v1.QueryClientConnectionsRequest) + return object; + let message = new $root.ibc.core.connection.v1.QueryClientConnectionsRequest(); + if (object.clientId != null) + message.clientId = String(object.clientId); + return message; + }; + + /** + * Creates a plain object from a QueryClientConnectionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.connection.v1.QueryClientConnectionsRequest + * @static + * @param {ibc.core.connection.v1.QueryClientConnectionsRequest} message QueryClientConnectionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryClientConnectionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.clientId = ""; + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + return object; + }; + + /** + * Converts this QueryClientConnectionsRequest to JSON. + * @function toJSON + * @memberof ibc.core.connection.v1.QueryClientConnectionsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryClientConnectionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryClientConnectionsRequest; + })(v1.QueryClientConnectionsRequest || {}); + + v1.QueryClientConnectionsResponse = (function(QueryClientConnectionsResponse) { + + /** + * Properties of a QueryClientConnectionsResponse. + * @memberof ibc.core.connection.v1 + * @interface IQueryClientConnectionsResponse + * @property {Array.|null} [connectionPaths] QueryClientConnectionsResponse connectionPaths + * @property {Uint8Array|null} [proof] QueryClientConnectionsResponse proof + * @property {ibc.core.client.v1.IHeight|null} [proofHeight] QueryClientConnectionsResponse proofHeight + */ + + /** + * Constructs a new QueryClientConnectionsResponse. + * @memberof ibc.core.connection.v1 + * @classdesc Represents a QueryClientConnectionsResponse. + * @implements IQueryClientConnectionsResponse + * @constructor + * @param {ibc.core.connection.v1.IQueryClientConnectionsResponse=} [properties] Properties to set + */ + function QueryClientConnectionsResponse(properties) { + this.connectionPaths = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryClientConnectionsResponse connectionPaths. + * @member {Array.} connectionPaths + * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse + * @instance + */ + QueryClientConnectionsResponse.prototype.connectionPaths = $util.emptyArray; + + /** + * QueryClientConnectionsResponse proof. + * @member {Uint8Array} proof + * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse + * @instance + */ + QueryClientConnectionsResponse.prototype.proof = $util.newBuffer([]); + + /** + * QueryClientConnectionsResponse proofHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} proofHeight + * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse + * @instance + */ + QueryClientConnectionsResponse.prototype.proofHeight = null; + + /** + * Creates a new QueryClientConnectionsResponse instance using the specified properties. + * @function create + * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse + * @static + * @param {ibc.core.connection.v1.IQueryClientConnectionsResponse=} [properties] Properties to set + * @returns {ibc.core.connection.v1.QueryClientConnectionsResponse} QueryClientConnectionsResponse instance + */ + QueryClientConnectionsResponse.create = function create(properties) { + return new QueryClientConnectionsResponse(properties); + }; + + /** + * Encodes the specified QueryClientConnectionsResponse message. Does not implicitly {@link ibc.core.connection.v1.QueryClientConnectionsResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse + * @static + * @param {ibc.core.connection.v1.IQueryClientConnectionsResponse} message QueryClientConnectionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientConnectionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connectionPaths != null && message.connectionPaths.length) + for (let i = 0; i < message.connectionPaths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.connectionPaths[i]); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); + if (message.proofHeight != null && Object.hasOwnProperty.call(message, "proofHeight")) + $root.ibc.core.client.v1.Height.encode(message.proofHeight, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryClientConnectionsResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryClientConnectionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse + * @static + * @param {ibc.core.connection.v1.IQueryClientConnectionsResponse} message QueryClientConnectionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientConnectionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryClientConnectionsResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.connection.v1.QueryClientConnectionsResponse} QueryClientConnectionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientConnectionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.QueryClientConnectionsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.connectionPaths && message.connectionPaths.length)) + message.connectionPaths = []; + message.connectionPaths.push(reader.string()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryClientConnectionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.connection.v1.QueryClientConnectionsResponse} QueryClientConnectionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientConnectionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryClientConnectionsResponse message. + * @function verify + * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryClientConnectionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.connectionPaths != null && message.hasOwnProperty("connectionPaths")) { + if (!Array.isArray(message.connectionPaths)) + return "connectionPaths: array expected"; + for (let i = 0; i < message.connectionPaths.length; ++i) + if (!$util.isString(message.connectionPaths[i])) + return "connectionPaths: string[] expected"; + } + if (message.proof != null && message.hasOwnProperty("proof")) + if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) + return "proof: buffer expected"; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) { + let error = $root.ibc.core.client.v1.Height.verify(message.proofHeight); + if (error) + return "proofHeight." + error; + } + return null; + }; + + /** + * Creates a QueryClientConnectionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.connection.v1.QueryClientConnectionsResponse} QueryClientConnectionsResponse + */ + QueryClientConnectionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.connection.v1.QueryClientConnectionsResponse) + return object; + let message = new $root.ibc.core.connection.v1.QueryClientConnectionsResponse(); + if (object.connectionPaths) { + if (!Array.isArray(object.connectionPaths)) + throw TypeError(".ibc.core.connection.v1.QueryClientConnectionsResponse.connectionPaths: array expected"); + message.connectionPaths = []; + for (let i = 0; i < object.connectionPaths.length; ++i) + message.connectionPaths[i] = String(object.connectionPaths[i]); + } + if (object.proof != null) + if (typeof object.proof === "string") + $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); + else if (object.proof.length) + message.proof = object.proof; + if (object.proofHeight != null) { + if (typeof object.proofHeight !== "object") + throw TypeError(".ibc.core.connection.v1.QueryClientConnectionsResponse.proofHeight: object expected"); + message.proofHeight = $root.ibc.core.client.v1.Height.fromObject(object.proofHeight); + } + return message; + }; + + /** + * Creates a plain object from a QueryClientConnectionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse + * @static + * @param {ibc.core.connection.v1.QueryClientConnectionsResponse} message QueryClientConnectionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryClientConnectionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.connectionPaths = []; + if (options.defaults) { + if (options.bytes === String) + object.proof = ""; + else { + object.proof = []; + if (options.bytes !== Array) + object.proof = $util.newBuffer(object.proof); + } + object.proofHeight = null; + } + if (message.connectionPaths && message.connectionPaths.length) { + object.connectionPaths = []; + for (let j = 0; j < message.connectionPaths.length; ++j) + object.connectionPaths[j] = message.connectionPaths[j]; + } + if (message.proof != null && message.hasOwnProperty("proof")) + object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) + object.proofHeight = $root.ibc.core.client.v1.Height.toObject(message.proofHeight, options); + return object; + }; + + /** + * Converts this QueryClientConnectionsResponse to JSON. + * @function toJSON + * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryClientConnectionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryClientConnectionsResponse; + })(v1.QueryClientConnectionsResponse || {}); + + v1.QueryConnectionClientStateRequest = (function(QueryConnectionClientStateRequest) { + + /** + * Properties of a QueryConnectionClientStateRequest. + * @memberof ibc.core.connection.v1 + * @interface IQueryConnectionClientStateRequest + * @property {string|null} [connectionId] QueryConnectionClientStateRequest connectionId + */ + + /** + * Constructs a new QueryConnectionClientStateRequest. + * @memberof ibc.core.connection.v1 + * @classdesc Represents a QueryConnectionClientStateRequest. + * @implements IQueryConnectionClientStateRequest + * @constructor + * @param {ibc.core.connection.v1.IQueryConnectionClientStateRequest=} [properties] Properties to set + */ + function QueryConnectionClientStateRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryConnectionClientStateRequest connectionId. + * @member {string} connectionId + * @memberof ibc.core.connection.v1.QueryConnectionClientStateRequest + * @instance + */ + QueryConnectionClientStateRequest.prototype.connectionId = ""; + + /** + * Creates a new QueryConnectionClientStateRequest instance using the specified properties. + * @function create + * @memberof ibc.core.connection.v1.QueryConnectionClientStateRequest + * @static + * @param {ibc.core.connection.v1.IQueryConnectionClientStateRequest=} [properties] Properties to set + * @returns {ibc.core.connection.v1.QueryConnectionClientStateRequest} QueryConnectionClientStateRequest instance + */ + QueryConnectionClientStateRequest.create = function create(properties) { + return new QueryConnectionClientStateRequest(properties); + }; + + /** + * Encodes the specified QueryConnectionClientStateRequest message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionClientStateRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.connection.v1.QueryConnectionClientStateRequest + * @static + * @param {ibc.core.connection.v1.IQueryConnectionClientStateRequest} message QueryConnectionClientStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConnectionClientStateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connectionId != null && Object.hasOwnProperty.call(message, "connectionId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.connectionId); + return writer; + }; + + /** + * Encodes the specified QueryConnectionClientStateRequest message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionClientStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.connection.v1.QueryConnectionClientStateRequest + * @static + * @param {ibc.core.connection.v1.IQueryConnectionClientStateRequest} message QueryConnectionClientStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConnectionClientStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryConnectionClientStateRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.connection.v1.QueryConnectionClientStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.connection.v1.QueryConnectionClientStateRequest} QueryConnectionClientStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConnectionClientStateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.QueryConnectionClientStateRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryConnectionClientStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.connection.v1.QueryConnectionClientStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.connection.v1.QueryConnectionClientStateRequest} QueryConnectionClientStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConnectionClientStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryConnectionClientStateRequest message. + * @function verify + * @memberof ibc.core.connection.v1.QueryConnectionClientStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryConnectionClientStateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.connectionId != null && message.hasOwnProperty("connectionId")) + if (!$util.isString(message.connectionId)) + return "connectionId: string expected"; + return null; + }; + + /** + * Creates a QueryConnectionClientStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.connection.v1.QueryConnectionClientStateRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.connection.v1.QueryConnectionClientStateRequest} QueryConnectionClientStateRequest + */ + QueryConnectionClientStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.connection.v1.QueryConnectionClientStateRequest) + return object; + let message = new $root.ibc.core.connection.v1.QueryConnectionClientStateRequest(); + if (object.connectionId != null) + message.connectionId = String(object.connectionId); + return message; + }; + + /** + * Creates a plain object from a QueryConnectionClientStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.connection.v1.QueryConnectionClientStateRequest + * @static + * @param {ibc.core.connection.v1.QueryConnectionClientStateRequest} message QueryConnectionClientStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryConnectionClientStateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.connectionId = ""; + if (message.connectionId != null && message.hasOwnProperty("connectionId")) + object.connectionId = message.connectionId; + return object; + }; + + /** + * Converts this QueryConnectionClientStateRequest to JSON. + * @function toJSON + * @memberof ibc.core.connection.v1.QueryConnectionClientStateRequest + * @instance + * @returns {Object.} JSON object + */ + QueryConnectionClientStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryConnectionClientStateRequest; + })(v1.QueryConnectionClientStateRequest || {}); + + v1.QueryConnectionClientStateResponse = (function(QueryConnectionClientStateResponse) { + + /** + * Properties of a QueryConnectionClientStateResponse. + * @memberof ibc.core.connection.v1 + * @interface IQueryConnectionClientStateResponse + * @property {ibc.core.client.v1.IIdentifiedClientState|null} [identifiedClientState] QueryConnectionClientStateResponse identifiedClientState + * @property {Uint8Array|null} [proof] QueryConnectionClientStateResponse proof + * @property {ibc.core.client.v1.IHeight|null} [proofHeight] QueryConnectionClientStateResponse proofHeight + */ + + /** + * Constructs a new QueryConnectionClientStateResponse. + * @memberof ibc.core.connection.v1 + * @classdesc Represents a QueryConnectionClientStateResponse. + * @implements IQueryConnectionClientStateResponse + * @constructor + * @param {ibc.core.connection.v1.IQueryConnectionClientStateResponse=} [properties] Properties to set + */ + function QueryConnectionClientStateResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryConnectionClientStateResponse identifiedClientState. + * @member {ibc.core.client.v1.IIdentifiedClientState|null|undefined} identifiedClientState + * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse + * @instance + */ + QueryConnectionClientStateResponse.prototype.identifiedClientState = null; + + /** + * QueryConnectionClientStateResponse proof. + * @member {Uint8Array} proof + * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse + * @instance + */ + QueryConnectionClientStateResponse.prototype.proof = $util.newBuffer([]); + + /** + * QueryConnectionClientStateResponse proofHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} proofHeight + * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse + * @instance + */ + QueryConnectionClientStateResponse.prototype.proofHeight = null; + + /** + * Creates a new QueryConnectionClientStateResponse instance using the specified properties. + * @function create + * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse + * @static + * @param {ibc.core.connection.v1.IQueryConnectionClientStateResponse=} [properties] Properties to set + * @returns {ibc.core.connection.v1.QueryConnectionClientStateResponse} QueryConnectionClientStateResponse instance + */ + QueryConnectionClientStateResponse.create = function create(properties) { + return new QueryConnectionClientStateResponse(properties); + }; + + /** + * Encodes the specified QueryConnectionClientStateResponse message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionClientStateResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse + * @static + * @param {ibc.core.connection.v1.IQueryConnectionClientStateResponse} message QueryConnectionClientStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConnectionClientStateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identifiedClientState != null && Object.hasOwnProperty.call(message, "identifiedClientState")) + $root.ibc.core.client.v1.IdentifiedClientState.encode(message.identifiedClientState, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); + if (message.proofHeight != null && Object.hasOwnProperty.call(message, "proofHeight")) + $root.ibc.core.client.v1.Height.encode(message.proofHeight, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryConnectionClientStateResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionClientStateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse + * @static + * @param {ibc.core.connection.v1.IQueryConnectionClientStateResponse} message QueryConnectionClientStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConnectionClientStateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryConnectionClientStateResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.connection.v1.QueryConnectionClientStateResponse} QueryConnectionClientStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConnectionClientStateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.QueryConnectionClientStateResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identifiedClientState = $root.ibc.core.client.v1.IdentifiedClientState.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryConnectionClientStateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.connection.v1.QueryConnectionClientStateResponse} QueryConnectionClientStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConnectionClientStateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryConnectionClientStateResponse message. + * @function verify + * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryConnectionClientStateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identifiedClientState != null && message.hasOwnProperty("identifiedClientState")) { + let error = $root.ibc.core.client.v1.IdentifiedClientState.verify(message.identifiedClientState); + if (error) + return "identifiedClientState." + error; + } + if (message.proof != null && message.hasOwnProperty("proof")) + if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) + return "proof: buffer expected"; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) { + let error = $root.ibc.core.client.v1.Height.verify(message.proofHeight); + if (error) + return "proofHeight." + error; + } + return null; + }; + + /** + * Creates a QueryConnectionClientStateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.connection.v1.QueryConnectionClientStateResponse} QueryConnectionClientStateResponse + */ + QueryConnectionClientStateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.connection.v1.QueryConnectionClientStateResponse) + return object; + let message = new $root.ibc.core.connection.v1.QueryConnectionClientStateResponse(); + if (object.identifiedClientState != null) { + if (typeof object.identifiedClientState !== "object") + throw TypeError(".ibc.core.connection.v1.QueryConnectionClientStateResponse.identifiedClientState: object expected"); + message.identifiedClientState = $root.ibc.core.client.v1.IdentifiedClientState.fromObject(object.identifiedClientState); + } + if (object.proof != null) + if (typeof object.proof === "string") + $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); + else if (object.proof.length) + message.proof = object.proof; + if (object.proofHeight != null) { + if (typeof object.proofHeight !== "object") + throw TypeError(".ibc.core.connection.v1.QueryConnectionClientStateResponse.proofHeight: object expected"); + message.proofHeight = $root.ibc.core.client.v1.Height.fromObject(object.proofHeight); + } + return message; + }; + + /** + * Creates a plain object from a QueryConnectionClientStateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse + * @static + * @param {ibc.core.connection.v1.QueryConnectionClientStateResponse} message QueryConnectionClientStateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryConnectionClientStateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.identifiedClientState = null; + if (options.bytes === String) + object.proof = ""; + else { + object.proof = []; + if (options.bytes !== Array) + object.proof = $util.newBuffer(object.proof); + } + object.proofHeight = null; + } + if (message.identifiedClientState != null && message.hasOwnProperty("identifiedClientState")) + object.identifiedClientState = $root.ibc.core.client.v1.IdentifiedClientState.toObject(message.identifiedClientState, options); + if (message.proof != null && message.hasOwnProperty("proof")) + object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) + object.proofHeight = $root.ibc.core.client.v1.Height.toObject(message.proofHeight, options); + return object; + }; + + /** + * Converts this QueryConnectionClientStateResponse to JSON. + * @function toJSON + * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse + * @instance + * @returns {Object.} JSON object + */ + QueryConnectionClientStateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryConnectionClientStateResponse; + })(v1.QueryConnectionClientStateResponse || {}); + + v1.QueryConnectionConsensusStateRequest = (function(QueryConnectionConsensusStateRequest) { + + /** + * Properties of a QueryConnectionConsensusStateRequest. + * @memberof ibc.core.connection.v1 + * @interface IQueryConnectionConsensusStateRequest + * @property {string|null} [connectionId] QueryConnectionConsensusStateRequest connectionId + * @property {number|Long|null} [revisionNumber] QueryConnectionConsensusStateRequest revisionNumber + * @property {number|Long|null} [revisionHeight] QueryConnectionConsensusStateRequest revisionHeight + */ + + /** + * Constructs a new QueryConnectionConsensusStateRequest. + * @memberof ibc.core.connection.v1 + * @classdesc Represents a QueryConnectionConsensusStateRequest. + * @implements IQueryConnectionConsensusStateRequest + * @constructor + * @param {ibc.core.connection.v1.IQueryConnectionConsensusStateRequest=} [properties] Properties to set + */ + function QueryConnectionConsensusStateRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryConnectionConsensusStateRequest connectionId. + * @member {string} connectionId + * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest + * @instance + */ + QueryConnectionConsensusStateRequest.prototype.connectionId = ""; + + /** + * QueryConnectionConsensusStateRequest revisionNumber. + * @member {number|Long} revisionNumber + * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest + * @instance + */ + QueryConnectionConsensusStateRequest.prototype.revisionNumber = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * QueryConnectionConsensusStateRequest revisionHeight. + * @member {number|Long} revisionHeight + * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest + * @instance + */ + QueryConnectionConsensusStateRequest.prototype.revisionHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new QueryConnectionConsensusStateRequest instance using the specified properties. + * @function create + * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest + * @static + * @param {ibc.core.connection.v1.IQueryConnectionConsensusStateRequest=} [properties] Properties to set + * @returns {ibc.core.connection.v1.QueryConnectionConsensusStateRequest} QueryConnectionConsensusStateRequest instance + */ + QueryConnectionConsensusStateRequest.create = function create(properties) { + return new QueryConnectionConsensusStateRequest(properties); + }; + + /** + * Encodes the specified QueryConnectionConsensusStateRequest message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionConsensusStateRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest + * @static + * @param {ibc.core.connection.v1.IQueryConnectionConsensusStateRequest} message QueryConnectionConsensusStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConnectionConsensusStateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connectionId != null && Object.hasOwnProperty.call(message, "connectionId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.connectionId); + if (message.revisionNumber != null && Object.hasOwnProperty.call(message, "revisionNumber")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.revisionNumber); + if (message.revisionHeight != null && Object.hasOwnProperty.call(message, "revisionHeight")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.revisionHeight); + return writer; + }; + + /** + * Encodes the specified QueryConnectionConsensusStateRequest message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionConsensusStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest + * @static + * @param {ibc.core.connection.v1.IQueryConnectionConsensusStateRequest} message QueryConnectionConsensusStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConnectionConsensusStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryConnectionConsensusStateRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.connection.v1.QueryConnectionConsensusStateRequest} QueryConnectionConsensusStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConnectionConsensusStateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.QueryConnectionConsensusStateRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + case 2: + message.revisionNumber = reader.uint64(); + break; + case 3: + message.revisionHeight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryConnectionConsensusStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.connection.v1.QueryConnectionConsensusStateRequest} QueryConnectionConsensusStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConnectionConsensusStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryConnectionConsensusStateRequest message. + * @function verify + * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryConnectionConsensusStateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.connectionId != null && message.hasOwnProperty("connectionId")) + if (!$util.isString(message.connectionId)) + return "connectionId: string expected"; + if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) + if (!$util.isInteger(message.revisionNumber) && !(message.revisionNumber && $util.isInteger(message.revisionNumber.low) && $util.isInteger(message.revisionNumber.high))) + return "revisionNumber: integer|Long expected"; + if (message.revisionHeight != null && message.hasOwnProperty("revisionHeight")) + if (!$util.isInteger(message.revisionHeight) && !(message.revisionHeight && $util.isInteger(message.revisionHeight.low) && $util.isInteger(message.revisionHeight.high))) + return "revisionHeight: integer|Long expected"; + return null; + }; + + /** + * Creates a QueryConnectionConsensusStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.connection.v1.QueryConnectionConsensusStateRequest} QueryConnectionConsensusStateRequest + */ + QueryConnectionConsensusStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.connection.v1.QueryConnectionConsensusStateRequest) + return object; + let message = new $root.ibc.core.connection.v1.QueryConnectionConsensusStateRequest(); + if (object.connectionId != null) + message.connectionId = String(object.connectionId); + if (object.revisionNumber != null) + if ($util.Long) + (message.revisionNumber = $util.Long.fromValue(object.revisionNumber)).unsigned = true; + else if (typeof object.revisionNumber === "string") + message.revisionNumber = parseInt(object.revisionNumber, 10); + else if (typeof object.revisionNumber === "number") + message.revisionNumber = object.revisionNumber; + else if (typeof object.revisionNumber === "object") + message.revisionNumber = new $util.LongBits(object.revisionNumber.low >>> 0, object.revisionNumber.high >>> 0).toNumber(true); + if (object.revisionHeight != null) + if ($util.Long) + (message.revisionHeight = $util.Long.fromValue(object.revisionHeight)).unsigned = true; + else if (typeof object.revisionHeight === "string") + message.revisionHeight = parseInt(object.revisionHeight, 10); + else if (typeof object.revisionHeight === "number") + message.revisionHeight = object.revisionHeight; + else if (typeof object.revisionHeight === "object") + message.revisionHeight = new $util.LongBits(object.revisionHeight.low >>> 0, object.revisionHeight.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a QueryConnectionConsensusStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest + * @static + * @param {ibc.core.connection.v1.QueryConnectionConsensusStateRequest} message QueryConnectionConsensusStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryConnectionConsensusStateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.connectionId = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.revisionNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.revisionNumber = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.revisionHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.revisionHeight = options.longs === String ? "0" : 0; + } + if (message.connectionId != null && message.hasOwnProperty("connectionId")) + object.connectionId = message.connectionId; + if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) + if (typeof message.revisionNumber === "number") + object.revisionNumber = options.longs === String ? String(message.revisionNumber) : message.revisionNumber; + else + object.revisionNumber = options.longs === String ? $util.Long.prototype.toString.call(message.revisionNumber) : options.longs === Number ? new $util.LongBits(message.revisionNumber.low >>> 0, message.revisionNumber.high >>> 0).toNumber(true) : message.revisionNumber; + if (message.revisionHeight != null && message.hasOwnProperty("revisionHeight")) + if (typeof message.revisionHeight === "number") + object.revisionHeight = options.longs === String ? String(message.revisionHeight) : message.revisionHeight; + else + object.revisionHeight = options.longs === String ? $util.Long.prototype.toString.call(message.revisionHeight) : options.longs === Number ? new $util.LongBits(message.revisionHeight.low >>> 0, message.revisionHeight.high >>> 0).toNumber(true) : message.revisionHeight; + return object; + }; + + /** + * Converts this QueryConnectionConsensusStateRequest to JSON. + * @function toJSON + * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest + * @instance + * @returns {Object.} JSON object + */ + QueryConnectionConsensusStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryConnectionConsensusStateRequest; + })(v1.QueryConnectionConsensusStateRequest || {}); + + v1.QueryConnectionConsensusStateResponse = (function(QueryConnectionConsensusStateResponse) { + + /** + * Properties of a QueryConnectionConsensusStateResponse. + * @memberof ibc.core.connection.v1 + * @interface IQueryConnectionConsensusStateResponse + * @property {google.protobuf.IAny|null} [consensusState] QueryConnectionConsensusStateResponse consensusState + * @property {string|null} [clientId] QueryConnectionConsensusStateResponse clientId + * @property {Uint8Array|null} [proof] QueryConnectionConsensusStateResponse proof + * @property {ibc.core.client.v1.IHeight|null} [proofHeight] QueryConnectionConsensusStateResponse proofHeight + */ + + /** + * Constructs a new QueryConnectionConsensusStateResponse. + * @memberof ibc.core.connection.v1 + * @classdesc Represents a QueryConnectionConsensusStateResponse. + * @implements IQueryConnectionConsensusStateResponse + * @constructor + * @param {ibc.core.connection.v1.IQueryConnectionConsensusStateResponse=} [properties] Properties to set + */ + function QueryConnectionConsensusStateResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryConnectionConsensusStateResponse consensusState. + * @member {google.protobuf.IAny|null|undefined} consensusState + * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse + * @instance + */ + QueryConnectionConsensusStateResponse.prototype.consensusState = null; + + /** + * QueryConnectionConsensusStateResponse clientId. + * @member {string} clientId + * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse + * @instance + */ + QueryConnectionConsensusStateResponse.prototype.clientId = ""; + + /** + * QueryConnectionConsensusStateResponse proof. + * @member {Uint8Array} proof + * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse + * @instance + */ + QueryConnectionConsensusStateResponse.prototype.proof = $util.newBuffer([]); + + /** + * QueryConnectionConsensusStateResponse proofHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} proofHeight + * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse + * @instance + */ + QueryConnectionConsensusStateResponse.prototype.proofHeight = null; + + /** + * Creates a new QueryConnectionConsensusStateResponse instance using the specified properties. + * @function create + * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse + * @static + * @param {ibc.core.connection.v1.IQueryConnectionConsensusStateResponse=} [properties] Properties to set + * @returns {ibc.core.connection.v1.QueryConnectionConsensusStateResponse} QueryConnectionConsensusStateResponse instance + */ + QueryConnectionConsensusStateResponse.create = function create(properties) { + return new QueryConnectionConsensusStateResponse(properties); + }; + + /** + * Encodes the specified QueryConnectionConsensusStateResponse message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionConsensusStateResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse + * @static + * @param {ibc.core.connection.v1.IQueryConnectionConsensusStateResponse} message QueryConnectionConsensusStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConnectionConsensusStateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.consensusState != null && Object.hasOwnProperty.call(message, "consensusState")) + $root.google.protobuf.Any.encode(message.consensusState, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clientId); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.proof); + if (message.proofHeight != null && Object.hasOwnProperty.call(message, "proofHeight")) + $root.ibc.core.client.v1.Height.encode(message.proofHeight, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryConnectionConsensusStateResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionConsensusStateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse + * @static + * @param {ibc.core.connection.v1.IQueryConnectionConsensusStateResponse} message QueryConnectionConsensusStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConnectionConsensusStateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryConnectionConsensusStateResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.connection.v1.QueryConnectionConsensusStateResponse} QueryConnectionConsensusStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConnectionConsensusStateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.QueryConnectionConsensusStateResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consensusState = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 2: + message.clientId = reader.string(); + break; + case 3: + message.proof = reader.bytes(); + break; + case 4: + message.proofHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryConnectionConsensusStateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.connection.v1.QueryConnectionConsensusStateResponse} QueryConnectionConsensusStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConnectionConsensusStateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryConnectionConsensusStateResponse message. + * @function verify + * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryConnectionConsensusStateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.consensusState != null && message.hasOwnProperty("consensusState")) { + let error = $root.google.protobuf.Any.verify(message.consensusState); + if (error) + return "consensusState." + error; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.proof != null && message.hasOwnProperty("proof")) + if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) + return "proof: buffer expected"; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) { + let error = $root.ibc.core.client.v1.Height.verify(message.proofHeight); + if (error) + return "proofHeight." + error; + } + return null; + }; + + /** + * Creates a QueryConnectionConsensusStateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.connection.v1.QueryConnectionConsensusStateResponse} QueryConnectionConsensusStateResponse + */ + QueryConnectionConsensusStateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.connection.v1.QueryConnectionConsensusStateResponse) + return object; + let message = new $root.ibc.core.connection.v1.QueryConnectionConsensusStateResponse(); + if (object.consensusState != null) { + if (typeof object.consensusState !== "object") + throw TypeError(".ibc.core.connection.v1.QueryConnectionConsensusStateResponse.consensusState: object expected"); + message.consensusState = $root.google.protobuf.Any.fromObject(object.consensusState); + } + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.proof != null) + if (typeof object.proof === "string") + $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); + else if (object.proof.length) + message.proof = object.proof; + if (object.proofHeight != null) { + if (typeof object.proofHeight !== "object") + throw TypeError(".ibc.core.connection.v1.QueryConnectionConsensusStateResponse.proofHeight: object expected"); + message.proofHeight = $root.ibc.core.client.v1.Height.fromObject(object.proofHeight); + } + return message; + }; + + /** + * Creates a plain object from a QueryConnectionConsensusStateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse + * @static + * @param {ibc.core.connection.v1.QueryConnectionConsensusStateResponse} message QueryConnectionConsensusStateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryConnectionConsensusStateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.consensusState = null; + object.clientId = ""; + if (options.bytes === String) + object.proof = ""; + else { + object.proof = []; + if (options.bytes !== Array) + object.proof = $util.newBuffer(object.proof); + } + object.proofHeight = null; + } + if (message.consensusState != null && message.hasOwnProperty("consensusState")) + object.consensusState = $root.google.protobuf.Any.toObject(message.consensusState, options); + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.proof != null && message.hasOwnProperty("proof")) + object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) + object.proofHeight = $root.ibc.core.client.v1.Height.toObject(message.proofHeight, options); + return object; + }; + + /** + * Converts this QueryConnectionConsensusStateResponse to JSON. + * @function toJSON + * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse + * @instance + * @returns {Object.} JSON object + */ + QueryConnectionConsensusStateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryConnectionConsensusStateResponse; + })(v1.QueryConnectionConsensusStateResponse || {}); + + v1.Msg = (function(Msg) { + + /** + * Constructs a new Msg service. + * @memberof ibc.core.connection.v1 + * @classdesc Represents a Msg + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Msg(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; + + /** + * Creates new Msg service using the specified rpc implementation. + * @function create + * @memberof ibc.core.connection.v1.Msg + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Msg} RPC service. Useful where requests and/or responses are streamed. + */ + Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link ibc.core.connection.v1.Msg#connectionOpenInit}. + * @memberof ibc.core.connection.v1.Msg + * @typedef ConnectionOpenInitCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.connection.v1.IMsgConnectionOpenInitResponse} [response] MsgConnectionOpenInitResponse + */ + + /** + * Calls ConnectionOpenInit. + * @function connectionOpenInit + * @memberof ibc.core.connection.v1.Msg + * @instance + * @param {ibc.core.connection.v1.IMsgConnectionOpenInit} request MsgConnectionOpenInit message or plain object + * @param {ibc.core.connection.v1.Msg.ConnectionOpenInitCallback} callback Node-style callback called with the error, if any, and MsgConnectionOpenInitResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.connectionOpenInit = function connectionOpenInit(request, callback) { + return this.rpcCall(connectionOpenInit, $root.ibc.core.connection.v1.MsgConnectionOpenInit, $root.ibc.core.connection.v1.MsgConnectionOpenInitResponse, request, callback); + }, "name", { value: "ConnectionOpenInit" }); + + /** + * Calls ConnectionOpenInit. + * @function connectionOpenInit + * @memberof ibc.core.connection.v1.Msg + * @instance + * @param {ibc.core.connection.v1.IMsgConnectionOpenInit} request MsgConnectionOpenInit message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.connection.v1.Msg#connectionOpenTry}. + * @memberof ibc.core.connection.v1.Msg + * @typedef ConnectionOpenTryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.connection.v1.IMsgConnectionOpenTryResponse} [response] MsgConnectionOpenTryResponse + */ + + /** + * Calls ConnectionOpenTry. + * @function connectionOpenTry + * @memberof ibc.core.connection.v1.Msg + * @instance + * @param {ibc.core.connection.v1.IMsgConnectionOpenTry} request MsgConnectionOpenTry message or plain object + * @param {ibc.core.connection.v1.Msg.ConnectionOpenTryCallback} callback Node-style callback called with the error, if any, and MsgConnectionOpenTryResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.connectionOpenTry = function connectionOpenTry(request, callback) { + return this.rpcCall(connectionOpenTry, $root.ibc.core.connection.v1.MsgConnectionOpenTry, $root.ibc.core.connection.v1.MsgConnectionOpenTryResponse, request, callback); + }, "name", { value: "ConnectionOpenTry" }); + + /** + * Calls ConnectionOpenTry. + * @function connectionOpenTry + * @memberof ibc.core.connection.v1.Msg + * @instance + * @param {ibc.core.connection.v1.IMsgConnectionOpenTry} request MsgConnectionOpenTry message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.connection.v1.Msg#connectionOpenAck}. + * @memberof ibc.core.connection.v1.Msg + * @typedef ConnectionOpenAckCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.connection.v1.IMsgConnectionOpenAckResponse} [response] MsgConnectionOpenAckResponse + */ + + /** + * Calls ConnectionOpenAck. + * @function connectionOpenAck + * @memberof ibc.core.connection.v1.Msg + * @instance + * @param {ibc.core.connection.v1.IMsgConnectionOpenAck} request MsgConnectionOpenAck message or plain object + * @param {ibc.core.connection.v1.Msg.ConnectionOpenAckCallback} callback Node-style callback called with the error, if any, and MsgConnectionOpenAckResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.connectionOpenAck = function connectionOpenAck(request, callback) { + return this.rpcCall(connectionOpenAck, $root.ibc.core.connection.v1.MsgConnectionOpenAck, $root.ibc.core.connection.v1.MsgConnectionOpenAckResponse, request, callback); + }, "name", { value: "ConnectionOpenAck" }); + + /** + * Calls ConnectionOpenAck. + * @function connectionOpenAck + * @memberof ibc.core.connection.v1.Msg + * @instance + * @param {ibc.core.connection.v1.IMsgConnectionOpenAck} request MsgConnectionOpenAck message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.connection.v1.Msg#connectionOpenConfirm}. + * @memberof ibc.core.connection.v1.Msg + * @typedef ConnectionOpenConfirmCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.connection.v1.IMsgConnectionOpenConfirmResponse} [response] MsgConnectionOpenConfirmResponse + */ + + /** + * Calls ConnectionOpenConfirm. + * @function connectionOpenConfirm + * @memberof ibc.core.connection.v1.Msg + * @instance + * @param {ibc.core.connection.v1.IMsgConnectionOpenConfirm} request MsgConnectionOpenConfirm message or plain object + * @param {ibc.core.connection.v1.Msg.ConnectionOpenConfirmCallback} callback Node-style callback called with the error, if any, and MsgConnectionOpenConfirmResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.connectionOpenConfirm = function connectionOpenConfirm(request, callback) { + return this.rpcCall(connectionOpenConfirm, $root.ibc.core.connection.v1.MsgConnectionOpenConfirm, $root.ibc.core.connection.v1.MsgConnectionOpenConfirmResponse, request, callback); + }, "name", { value: "ConnectionOpenConfirm" }); + + /** + * Calls ConnectionOpenConfirm. + * @function connectionOpenConfirm + * @memberof ibc.core.connection.v1.Msg + * @instance + * @param {ibc.core.connection.v1.IMsgConnectionOpenConfirm} request MsgConnectionOpenConfirm message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Msg; + })(v1.Msg || {}); + + v1.MsgConnectionOpenInit = (function(MsgConnectionOpenInit) { + + /** + * Properties of a MsgConnectionOpenInit. + * @memberof ibc.core.connection.v1 + * @interface IMsgConnectionOpenInit + * @property {string|null} [clientId] MsgConnectionOpenInit clientId + * @property {ibc.core.connection.v1.ICounterparty|null} [counterparty] MsgConnectionOpenInit counterparty + * @property {ibc.core.connection.v1.IVersion|null} [version] MsgConnectionOpenInit version + * @property {number|Long|null} [delayPeriod] MsgConnectionOpenInit delayPeriod + * @property {string|null} [signer] MsgConnectionOpenInit signer + */ + + /** + * Constructs a new MsgConnectionOpenInit. + * @memberof ibc.core.connection.v1 + * @classdesc Represents a MsgConnectionOpenInit. + * @implements IMsgConnectionOpenInit + * @constructor + * @param {ibc.core.connection.v1.IMsgConnectionOpenInit=} [properties] Properties to set + */ + function MsgConnectionOpenInit(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgConnectionOpenInit clientId. + * @member {string} clientId + * @memberof ibc.core.connection.v1.MsgConnectionOpenInit + * @instance + */ + MsgConnectionOpenInit.prototype.clientId = ""; + + /** + * MsgConnectionOpenInit counterparty. + * @member {ibc.core.connection.v1.ICounterparty|null|undefined} counterparty + * @memberof ibc.core.connection.v1.MsgConnectionOpenInit + * @instance + */ + MsgConnectionOpenInit.prototype.counterparty = null; + + /** + * MsgConnectionOpenInit version. + * @member {ibc.core.connection.v1.IVersion|null|undefined} version + * @memberof ibc.core.connection.v1.MsgConnectionOpenInit + * @instance + */ + MsgConnectionOpenInit.prototype.version = null; + + /** + * MsgConnectionOpenInit delayPeriod. + * @member {number|Long} delayPeriod + * @memberof ibc.core.connection.v1.MsgConnectionOpenInit + * @instance + */ + MsgConnectionOpenInit.prototype.delayPeriod = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * MsgConnectionOpenInit signer. + * @member {string} signer + * @memberof ibc.core.connection.v1.MsgConnectionOpenInit + * @instance + */ + MsgConnectionOpenInit.prototype.signer = ""; + + /** + * Creates a new MsgConnectionOpenInit instance using the specified properties. + * @function create + * @memberof ibc.core.connection.v1.MsgConnectionOpenInit + * @static + * @param {ibc.core.connection.v1.IMsgConnectionOpenInit=} [properties] Properties to set + * @returns {ibc.core.connection.v1.MsgConnectionOpenInit} MsgConnectionOpenInit instance + */ + MsgConnectionOpenInit.create = function create(properties) { + return new MsgConnectionOpenInit(properties); + }; + + /** + * Encodes the specified MsgConnectionOpenInit message. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenInit.verify|verify} messages. + * @function encode + * @memberof ibc.core.connection.v1.MsgConnectionOpenInit + * @static + * @param {ibc.core.connection.v1.IMsgConnectionOpenInit} message MsgConnectionOpenInit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgConnectionOpenInit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.counterparty != null && Object.hasOwnProperty.call(message, "counterparty")) + $root.ibc.core.connection.v1.Counterparty.encode(message.counterparty, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + $root.ibc.core.connection.v1.Version.encode(message.version, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.delayPeriod != null && Object.hasOwnProperty.call(message, "delayPeriod")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.delayPeriod); + if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.signer); + return writer; + }; + + /** + * Encodes the specified MsgConnectionOpenInit message, length delimited. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenInit.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.connection.v1.MsgConnectionOpenInit + * @static + * @param {ibc.core.connection.v1.IMsgConnectionOpenInit} message MsgConnectionOpenInit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgConnectionOpenInit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgConnectionOpenInit message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.connection.v1.MsgConnectionOpenInit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.connection.v1.MsgConnectionOpenInit} MsgConnectionOpenInit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgConnectionOpenInit.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.MsgConnectionOpenInit(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.counterparty = $root.ibc.core.connection.v1.Counterparty.decode(reader, reader.uint32()); + break; + case 3: + message.version = $root.ibc.core.connection.v1.Version.decode(reader, reader.uint32()); + break; + case 4: + message.delayPeriod = reader.uint64(); + break; + case 5: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgConnectionOpenInit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.connection.v1.MsgConnectionOpenInit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.connection.v1.MsgConnectionOpenInit} MsgConnectionOpenInit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgConnectionOpenInit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgConnectionOpenInit message. + * @function verify + * @memberof ibc.core.connection.v1.MsgConnectionOpenInit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgConnectionOpenInit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.counterparty != null && message.hasOwnProperty("counterparty")) { + let error = $root.ibc.core.connection.v1.Counterparty.verify(message.counterparty); + if (error) + return "counterparty." + error; + } + if (message.version != null && message.hasOwnProperty("version")) { + let error = $root.ibc.core.connection.v1.Version.verify(message.version); + if (error) + return "version." + error; + } + if (message.delayPeriod != null && message.hasOwnProperty("delayPeriod")) + if (!$util.isInteger(message.delayPeriod) && !(message.delayPeriod && $util.isInteger(message.delayPeriod.low) && $util.isInteger(message.delayPeriod.high))) + return "delayPeriod: integer|Long expected"; + if (message.signer != null && message.hasOwnProperty("signer")) + if (!$util.isString(message.signer)) + return "signer: string expected"; + return null; + }; + + /** + * Creates a MsgConnectionOpenInit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.connection.v1.MsgConnectionOpenInit + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.connection.v1.MsgConnectionOpenInit} MsgConnectionOpenInit + */ + MsgConnectionOpenInit.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.connection.v1.MsgConnectionOpenInit) + return object; + let message = new $root.ibc.core.connection.v1.MsgConnectionOpenInit(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.counterparty != null) { + if (typeof object.counterparty !== "object") + throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenInit.counterparty: object expected"); + message.counterparty = $root.ibc.core.connection.v1.Counterparty.fromObject(object.counterparty); + } + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenInit.version: object expected"); + message.version = $root.ibc.core.connection.v1.Version.fromObject(object.version); + } + if (object.delayPeriod != null) + if ($util.Long) + (message.delayPeriod = $util.Long.fromValue(object.delayPeriod)).unsigned = true; + else if (typeof object.delayPeriod === "string") + message.delayPeriod = parseInt(object.delayPeriod, 10); + else if (typeof object.delayPeriod === "number") + message.delayPeriod = object.delayPeriod; + else if (typeof object.delayPeriod === "object") + message.delayPeriod = new $util.LongBits(object.delayPeriod.low >>> 0, object.delayPeriod.high >>> 0).toNumber(true); + if (object.signer != null) + message.signer = String(object.signer); + return message; + }; + + /** + * Creates a plain object from a MsgConnectionOpenInit message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.connection.v1.MsgConnectionOpenInit + * @static + * @param {ibc.core.connection.v1.MsgConnectionOpenInit} message MsgConnectionOpenInit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgConnectionOpenInit.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.clientId = ""; + object.counterparty = null; + object.version = null; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.delayPeriod = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.delayPeriod = options.longs === String ? "0" : 0; + object.signer = ""; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.counterparty != null && message.hasOwnProperty("counterparty")) + object.counterparty = $root.ibc.core.connection.v1.Counterparty.toObject(message.counterparty, options); + if (message.version != null && message.hasOwnProperty("version")) + object.version = $root.ibc.core.connection.v1.Version.toObject(message.version, options); + if (message.delayPeriod != null && message.hasOwnProperty("delayPeriod")) + if (typeof message.delayPeriod === "number") + object.delayPeriod = options.longs === String ? String(message.delayPeriod) : message.delayPeriod; + else + object.delayPeriod = options.longs === String ? $util.Long.prototype.toString.call(message.delayPeriod) : options.longs === Number ? new $util.LongBits(message.delayPeriod.low >>> 0, message.delayPeriod.high >>> 0).toNumber(true) : message.delayPeriod; + if (message.signer != null && message.hasOwnProperty("signer")) + object.signer = message.signer; + return object; + }; + + /** + * Converts this MsgConnectionOpenInit to JSON. + * @function toJSON + * @memberof ibc.core.connection.v1.MsgConnectionOpenInit + * @instance + * @returns {Object.} JSON object + */ + MsgConnectionOpenInit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgConnectionOpenInit; + })(v1.MsgConnectionOpenInit || {}); + + v1.MsgConnectionOpenInitResponse = (function(MsgConnectionOpenInitResponse) { + + /** + * Properties of a MsgConnectionOpenInitResponse. + * @memberof ibc.core.connection.v1 + * @interface IMsgConnectionOpenInitResponse + */ + + /** + * Constructs a new MsgConnectionOpenInitResponse. + * @memberof ibc.core.connection.v1 + * @classdesc Represents a MsgConnectionOpenInitResponse. + * @implements IMsgConnectionOpenInitResponse + * @constructor + * @param {ibc.core.connection.v1.IMsgConnectionOpenInitResponse=} [properties] Properties to set + */ + function MsgConnectionOpenInitResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgConnectionOpenInitResponse instance using the specified properties. + * @function create + * @memberof ibc.core.connection.v1.MsgConnectionOpenInitResponse + * @static + * @param {ibc.core.connection.v1.IMsgConnectionOpenInitResponse=} [properties] Properties to set + * @returns {ibc.core.connection.v1.MsgConnectionOpenInitResponse} MsgConnectionOpenInitResponse instance + */ + MsgConnectionOpenInitResponse.create = function create(properties) { + return new MsgConnectionOpenInitResponse(properties); + }; + + /** + * Encodes the specified MsgConnectionOpenInitResponse message. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenInitResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.connection.v1.MsgConnectionOpenInitResponse + * @static + * @param {ibc.core.connection.v1.IMsgConnectionOpenInitResponse} message MsgConnectionOpenInitResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgConnectionOpenInitResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgConnectionOpenInitResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenInitResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.connection.v1.MsgConnectionOpenInitResponse + * @static + * @param {ibc.core.connection.v1.IMsgConnectionOpenInitResponse} message MsgConnectionOpenInitResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgConnectionOpenInitResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgConnectionOpenInitResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.connection.v1.MsgConnectionOpenInitResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.connection.v1.MsgConnectionOpenInitResponse} MsgConnectionOpenInitResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgConnectionOpenInitResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.MsgConnectionOpenInitResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgConnectionOpenInitResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.connection.v1.MsgConnectionOpenInitResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.connection.v1.MsgConnectionOpenInitResponse} MsgConnectionOpenInitResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgConnectionOpenInitResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgConnectionOpenInitResponse message. + * @function verify + * @memberof ibc.core.connection.v1.MsgConnectionOpenInitResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgConnectionOpenInitResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgConnectionOpenInitResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.connection.v1.MsgConnectionOpenInitResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.connection.v1.MsgConnectionOpenInitResponse} MsgConnectionOpenInitResponse + */ + MsgConnectionOpenInitResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.connection.v1.MsgConnectionOpenInitResponse) + return object; + return new $root.ibc.core.connection.v1.MsgConnectionOpenInitResponse(); + }; + + /** + * Creates a plain object from a MsgConnectionOpenInitResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.connection.v1.MsgConnectionOpenInitResponse + * @static + * @param {ibc.core.connection.v1.MsgConnectionOpenInitResponse} message MsgConnectionOpenInitResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgConnectionOpenInitResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgConnectionOpenInitResponse to JSON. + * @function toJSON + * @memberof ibc.core.connection.v1.MsgConnectionOpenInitResponse + * @instance + * @returns {Object.} JSON object + */ + MsgConnectionOpenInitResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgConnectionOpenInitResponse; + })(v1.MsgConnectionOpenInitResponse || {}); + + v1.MsgConnectionOpenTry = (function(MsgConnectionOpenTry) { + + /** + * Properties of a MsgConnectionOpenTry. + * @memberof ibc.core.connection.v1 + * @interface IMsgConnectionOpenTry + * @property {string|null} [clientId] MsgConnectionOpenTry clientId + * @property {string|null} [previousConnectionId] MsgConnectionOpenTry previousConnectionId + * @property {google.protobuf.IAny|null} [clientState] MsgConnectionOpenTry clientState + * @property {ibc.core.connection.v1.ICounterparty|null} [counterparty] MsgConnectionOpenTry counterparty + * @property {number|Long|null} [delayPeriod] MsgConnectionOpenTry delayPeriod + * @property {Array.|null} [counterpartyVersions] MsgConnectionOpenTry counterpartyVersions + * @property {ibc.core.client.v1.IHeight|null} [proofHeight] MsgConnectionOpenTry proofHeight + * @property {Uint8Array|null} [proofInit] MsgConnectionOpenTry proofInit + * @property {Uint8Array|null} [proofClient] MsgConnectionOpenTry proofClient + * @property {Uint8Array|null} [proofConsensus] MsgConnectionOpenTry proofConsensus + * @property {ibc.core.client.v1.IHeight|null} [consensusHeight] MsgConnectionOpenTry consensusHeight + * @property {string|null} [signer] MsgConnectionOpenTry signer + */ + + /** + * Constructs a new MsgConnectionOpenTry. + * @memberof ibc.core.connection.v1 + * @classdesc Represents a MsgConnectionOpenTry. + * @implements IMsgConnectionOpenTry + * @constructor + * @param {ibc.core.connection.v1.IMsgConnectionOpenTry=} [properties] Properties to set + */ + function MsgConnectionOpenTry(properties) { + this.counterpartyVersions = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgConnectionOpenTry clientId. + * @member {string} clientId + * @memberof ibc.core.connection.v1.MsgConnectionOpenTry + * @instance + */ + MsgConnectionOpenTry.prototype.clientId = ""; + + /** + * MsgConnectionOpenTry previousConnectionId. + * @member {string} previousConnectionId + * @memberof ibc.core.connection.v1.MsgConnectionOpenTry + * @instance + */ + MsgConnectionOpenTry.prototype.previousConnectionId = ""; + + /** + * MsgConnectionOpenTry clientState. + * @member {google.protobuf.IAny|null|undefined} clientState + * @memberof ibc.core.connection.v1.MsgConnectionOpenTry + * @instance + */ + MsgConnectionOpenTry.prototype.clientState = null; + + /** + * MsgConnectionOpenTry counterparty. + * @member {ibc.core.connection.v1.ICounterparty|null|undefined} counterparty + * @memberof ibc.core.connection.v1.MsgConnectionOpenTry + * @instance + */ + MsgConnectionOpenTry.prototype.counterparty = null; + + /** + * MsgConnectionOpenTry delayPeriod. + * @member {number|Long} delayPeriod + * @memberof ibc.core.connection.v1.MsgConnectionOpenTry + * @instance + */ + MsgConnectionOpenTry.prototype.delayPeriod = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * MsgConnectionOpenTry counterpartyVersions. + * @member {Array.} counterpartyVersions + * @memberof ibc.core.connection.v1.MsgConnectionOpenTry + * @instance + */ + MsgConnectionOpenTry.prototype.counterpartyVersions = $util.emptyArray; + + /** + * MsgConnectionOpenTry proofHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} proofHeight + * @memberof ibc.core.connection.v1.MsgConnectionOpenTry + * @instance + */ + MsgConnectionOpenTry.prototype.proofHeight = null; + + /** + * MsgConnectionOpenTry proofInit. + * @member {Uint8Array} proofInit + * @memberof ibc.core.connection.v1.MsgConnectionOpenTry + * @instance + */ + MsgConnectionOpenTry.prototype.proofInit = $util.newBuffer([]); + + /** + * MsgConnectionOpenTry proofClient. + * @member {Uint8Array} proofClient + * @memberof ibc.core.connection.v1.MsgConnectionOpenTry + * @instance + */ + MsgConnectionOpenTry.prototype.proofClient = $util.newBuffer([]); + + /** + * MsgConnectionOpenTry proofConsensus. + * @member {Uint8Array} proofConsensus + * @memberof ibc.core.connection.v1.MsgConnectionOpenTry + * @instance + */ + MsgConnectionOpenTry.prototype.proofConsensus = $util.newBuffer([]); + + /** + * MsgConnectionOpenTry consensusHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} consensusHeight + * @memberof ibc.core.connection.v1.MsgConnectionOpenTry + * @instance + */ + MsgConnectionOpenTry.prototype.consensusHeight = null; + + /** + * MsgConnectionOpenTry signer. + * @member {string} signer + * @memberof ibc.core.connection.v1.MsgConnectionOpenTry + * @instance + */ + MsgConnectionOpenTry.prototype.signer = ""; + + /** + * Creates a new MsgConnectionOpenTry instance using the specified properties. + * @function create + * @memberof ibc.core.connection.v1.MsgConnectionOpenTry + * @static + * @param {ibc.core.connection.v1.IMsgConnectionOpenTry=} [properties] Properties to set + * @returns {ibc.core.connection.v1.MsgConnectionOpenTry} MsgConnectionOpenTry instance + */ + MsgConnectionOpenTry.create = function create(properties) { + return new MsgConnectionOpenTry(properties); + }; + + /** + * Encodes the specified MsgConnectionOpenTry message. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenTry.verify|verify} messages. + * @function encode + * @memberof ibc.core.connection.v1.MsgConnectionOpenTry + * @static + * @param {ibc.core.connection.v1.IMsgConnectionOpenTry} message MsgConnectionOpenTry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgConnectionOpenTry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.previousConnectionId != null && Object.hasOwnProperty.call(message, "previousConnectionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.previousConnectionId); + if (message.clientState != null && Object.hasOwnProperty.call(message, "clientState")) + $root.google.protobuf.Any.encode(message.clientState, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.counterparty != null && Object.hasOwnProperty.call(message, "counterparty")) + $root.ibc.core.connection.v1.Counterparty.encode(message.counterparty, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.delayPeriod != null && Object.hasOwnProperty.call(message, "delayPeriod")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.delayPeriod); + if (message.counterpartyVersions != null && message.counterpartyVersions.length) + for (let i = 0; i < message.counterpartyVersions.length; ++i) + $root.ibc.core.connection.v1.Version.encode(message.counterpartyVersions[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.proofHeight != null && Object.hasOwnProperty.call(message, "proofHeight")) + $root.ibc.core.client.v1.Height.encode(message.proofHeight, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.proofInit != null && Object.hasOwnProperty.call(message, "proofInit")) + writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.proofInit); + if (message.proofClient != null && Object.hasOwnProperty.call(message, "proofClient")) + writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.proofClient); + if (message.proofConsensus != null && Object.hasOwnProperty.call(message, "proofConsensus")) + writer.uint32(/* id 10, wireType 2 =*/82).bytes(message.proofConsensus); + if (message.consensusHeight != null && Object.hasOwnProperty.call(message, "consensusHeight")) + $root.ibc.core.client.v1.Height.encode(message.consensusHeight, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.signer); + return writer; + }; + + /** + * Encodes the specified MsgConnectionOpenTry message, length delimited. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenTry.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.connection.v1.MsgConnectionOpenTry + * @static + * @param {ibc.core.connection.v1.IMsgConnectionOpenTry} message MsgConnectionOpenTry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgConnectionOpenTry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgConnectionOpenTry message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.connection.v1.MsgConnectionOpenTry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.connection.v1.MsgConnectionOpenTry} MsgConnectionOpenTry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgConnectionOpenTry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.MsgConnectionOpenTry(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.previousConnectionId = reader.string(); + break; + case 3: + message.clientState = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 4: + message.counterparty = $root.ibc.core.connection.v1.Counterparty.decode(reader, reader.uint32()); + break; + case 5: + message.delayPeriod = reader.uint64(); + break; + case 6: + if (!(message.counterpartyVersions && message.counterpartyVersions.length)) + message.counterpartyVersions = []; + message.counterpartyVersions.push($root.ibc.core.connection.v1.Version.decode(reader, reader.uint32())); + break; + case 7: + message.proofHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + case 8: + message.proofInit = reader.bytes(); + break; + case 9: + message.proofClient = reader.bytes(); + break; + case 10: + message.proofConsensus = reader.bytes(); + break; + case 11: + message.consensusHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + case 12: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgConnectionOpenTry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.connection.v1.MsgConnectionOpenTry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.connection.v1.MsgConnectionOpenTry} MsgConnectionOpenTry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgConnectionOpenTry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgConnectionOpenTry message. + * @function verify + * @memberof ibc.core.connection.v1.MsgConnectionOpenTry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgConnectionOpenTry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.previousConnectionId != null && message.hasOwnProperty("previousConnectionId")) + if (!$util.isString(message.previousConnectionId)) + return "previousConnectionId: string expected"; + if (message.clientState != null && message.hasOwnProperty("clientState")) { + let error = $root.google.protobuf.Any.verify(message.clientState); + if (error) + return "clientState." + error; + } + if (message.counterparty != null && message.hasOwnProperty("counterparty")) { + let error = $root.ibc.core.connection.v1.Counterparty.verify(message.counterparty); + if (error) + return "counterparty." + error; + } + if (message.delayPeriod != null && message.hasOwnProperty("delayPeriod")) + if (!$util.isInteger(message.delayPeriod) && !(message.delayPeriod && $util.isInteger(message.delayPeriod.low) && $util.isInteger(message.delayPeriod.high))) + return "delayPeriod: integer|Long expected"; + if (message.counterpartyVersions != null && message.hasOwnProperty("counterpartyVersions")) { + if (!Array.isArray(message.counterpartyVersions)) + return "counterpartyVersions: array expected"; + for (let i = 0; i < message.counterpartyVersions.length; ++i) { + let error = $root.ibc.core.connection.v1.Version.verify(message.counterpartyVersions[i]); + if (error) + return "counterpartyVersions." + error; + } + } + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) { + let error = $root.ibc.core.client.v1.Height.verify(message.proofHeight); + if (error) + return "proofHeight." + error; + } + if (message.proofInit != null && message.hasOwnProperty("proofInit")) + if (!(message.proofInit && typeof message.proofInit.length === "number" || $util.isString(message.proofInit))) + return "proofInit: buffer expected"; + if (message.proofClient != null && message.hasOwnProperty("proofClient")) + if (!(message.proofClient && typeof message.proofClient.length === "number" || $util.isString(message.proofClient))) + return "proofClient: buffer expected"; + if (message.proofConsensus != null && message.hasOwnProperty("proofConsensus")) + if (!(message.proofConsensus && typeof message.proofConsensus.length === "number" || $util.isString(message.proofConsensus))) + return "proofConsensus: buffer expected"; + if (message.consensusHeight != null && message.hasOwnProperty("consensusHeight")) { + let error = $root.ibc.core.client.v1.Height.verify(message.consensusHeight); + if (error) + return "consensusHeight." + error; + } + if (message.signer != null && message.hasOwnProperty("signer")) + if (!$util.isString(message.signer)) + return "signer: string expected"; + return null; + }; + + /** + * Creates a MsgConnectionOpenTry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.connection.v1.MsgConnectionOpenTry + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.connection.v1.MsgConnectionOpenTry} MsgConnectionOpenTry + */ + MsgConnectionOpenTry.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.connection.v1.MsgConnectionOpenTry) + return object; + let message = new $root.ibc.core.connection.v1.MsgConnectionOpenTry(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.previousConnectionId != null) + message.previousConnectionId = String(object.previousConnectionId); + if (object.clientState != null) { + if (typeof object.clientState !== "object") + throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenTry.clientState: object expected"); + message.clientState = $root.google.protobuf.Any.fromObject(object.clientState); + } + if (object.counterparty != null) { + if (typeof object.counterparty !== "object") + throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenTry.counterparty: object expected"); + message.counterparty = $root.ibc.core.connection.v1.Counterparty.fromObject(object.counterparty); + } + if (object.delayPeriod != null) + if ($util.Long) + (message.delayPeriod = $util.Long.fromValue(object.delayPeriod)).unsigned = true; + else if (typeof object.delayPeriod === "string") + message.delayPeriod = parseInt(object.delayPeriod, 10); + else if (typeof object.delayPeriod === "number") + message.delayPeriod = object.delayPeriod; + else if (typeof object.delayPeriod === "object") + message.delayPeriod = new $util.LongBits(object.delayPeriod.low >>> 0, object.delayPeriod.high >>> 0).toNumber(true); + if (object.counterpartyVersions) { + if (!Array.isArray(object.counterpartyVersions)) + throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenTry.counterpartyVersions: array expected"); + message.counterpartyVersions = []; + for (let i = 0; i < object.counterpartyVersions.length; ++i) { + if (typeof object.counterpartyVersions[i] !== "object") + throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenTry.counterpartyVersions: object expected"); + message.counterpartyVersions[i] = $root.ibc.core.connection.v1.Version.fromObject(object.counterpartyVersions[i]); + } + } + if (object.proofHeight != null) { + if (typeof object.proofHeight !== "object") + throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenTry.proofHeight: object expected"); + message.proofHeight = $root.ibc.core.client.v1.Height.fromObject(object.proofHeight); + } + if (object.proofInit != null) + if (typeof object.proofInit === "string") + $util.base64.decode(object.proofInit, message.proofInit = $util.newBuffer($util.base64.length(object.proofInit)), 0); + else if (object.proofInit.length) + message.proofInit = object.proofInit; + if (object.proofClient != null) + if (typeof object.proofClient === "string") + $util.base64.decode(object.proofClient, message.proofClient = $util.newBuffer($util.base64.length(object.proofClient)), 0); + else if (object.proofClient.length) + message.proofClient = object.proofClient; + if (object.proofConsensus != null) + if (typeof object.proofConsensus === "string") + $util.base64.decode(object.proofConsensus, message.proofConsensus = $util.newBuffer($util.base64.length(object.proofConsensus)), 0); + else if (object.proofConsensus.length) + message.proofConsensus = object.proofConsensus; + if (object.consensusHeight != null) { + if (typeof object.consensusHeight !== "object") + throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenTry.consensusHeight: object expected"); + message.consensusHeight = $root.ibc.core.client.v1.Height.fromObject(object.consensusHeight); + } + if (object.signer != null) + message.signer = String(object.signer); + return message; + }; + + /** + * Creates a plain object from a MsgConnectionOpenTry message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.connection.v1.MsgConnectionOpenTry + * @static + * @param {ibc.core.connection.v1.MsgConnectionOpenTry} message MsgConnectionOpenTry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgConnectionOpenTry.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.counterpartyVersions = []; + if (options.defaults) { + object.clientId = ""; + object.previousConnectionId = ""; + object.clientState = null; + object.counterparty = null; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.delayPeriod = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.delayPeriod = options.longs === String ? "0" : 0; + object.proofHeight = null; + if (options.bytes === String) + object.proofInit = ""; + else { + object.proofInit = []; + if (options.bytes !== Array) + object.proofInit = $util.newBuffer(object.proofInit); + } + if (options.bytes === String) + object.proofClient = ""; + else { + object.proofClient = []; + if (options.bytes !== Array) + object.proofClient = $util.newBuffer(object.proofClient); + } + if (options.bytes === String) + object.proofConsensus = ""; + else { + object.proofConsensus = []; + if (options.bytes !== Array) + object.proofConsensus = $util.newBuffer(object.proofConsensus); + } + object.consensusHeight = null; + object.signer = ""; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.previousConnectionId != null && message.hasOwnProperty("previousConnectionId")) + object.previousConnectionId = message.previousConnectionId; + if (message.clientState != null && message.hasOwnProperty("clientState")) + object.clientState = $root.google.protobuf.Any.toObject(message.clientState, options); + if (message.counterparty != null && message.hasOwnProperty("counterparty")) + object.counterparty = $root.ibc.core.connection.v1.Counterparty.toObject(message.counterparty, options); + if (message.delayPeriod != null && message.hasOwnProperty("delayPeriod")) + if (typeof message.delayPeriod === "number") + object.delayPeriod = options.longs === String ? String(message.delayPeriod) : message.delayPeriod; + else + object.delayPeriod = options.longs === String ? $util.Long.prototype.toString.call(message.delayPeriod) : options.longs === Number ? new $util.LongBits(message.delayPeriod.low >>> 0, message.delayPeriod.high >>> 0).toNumber(true) : message.delayPeriod; + if (message.counterpartyVersions && message.counterpartyVersions.length) { + object.counterpartyVersions = []; + for (let j = 0; j < message.counterpartyVersions.length; ++j) + object.counterpartyVersions[j] = $root.ibc.core.connection.v1.Version.toObject(message.counterpartyVersions[j], options); + } + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) + object.proofHeight = $root.ibc.core.client.v1.Height.toObject(message.proofHeight, options); + if (message.proofInit != null && message.hasOwnProperty("proofInit")) + object.proofInit = options.bytes === String ? $util.base64.encode(message.proofInit, 0, message.proofInit.length) : options.bytes === Array ? Array.prototype.slice.call(message.proofInit) : message.proofInit; + if (message.proofClient != null && message.hasOwnProperty("proofClient")) + object.proofClient = options.bytes === String ? $util.base64.encode(message.proofClient, 0, message.proofClient.length) : options.bytes === Array ? Array.prototype.slice.call(message.proofClient) : message.proofClient; + if (message.proofConsensus != null && message.hasOwnProperty("proofConsensus")) + object.proofConsensus = options.bytes === String ? $util.base64.encode(message.proofConsensus, 0, message.proofConsensus.length) : options.bytes === Array ? Array.prototype.slice.call(message.proofConsensus) : message.proofConsensus; + if (message.consensusHeight != null && message.hasOwnProperty("consensusHeight")) + object.consensusHeight = $root.ibc.core.client.v1.Height.toObject(message.consensusHeight, options); + if (message.signer != null && message.hasOwnProperty("signer")) + object.signer = message.signer; + return object; + }; + + /** + * Converts this MsgConnectionOpenTry to JSON. + * @function toJSON + * @memberof ibc.core.connection.v1.MsgConnectionOpenTry + * @instance + * @returns {Object.} JSON object + */ + MsgConnectionOpenTry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgConnectionOpenTry; + })(v1.MsgConnectionOpenTry || {}); + + v1.MsgConnectionOpenTryResponse = (function(MsgConnectionOpenTryResponse) { + + /** + * Properties of a MsgConnectionOpenTryResponse. + * @memberof ibc.core.connection.v1 + * @interface IMsgConnectionOpenTryResponse + */ + + /** + * Constructs a new MsgConnectionOpenTryResponse. + * @memberof ibc.core.connection.v1 + * @classdesc Represents a MsgConnectionOpenTryResponse. + * @implements IMsgConnectionOpenTryResponse + * @constructor + * @param {ibc.core.connection.v1.IMsgConnectionOpenTryResponse=} [properties] Properties to set + */ + function MsgConnectionOpenTryResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgConnectionOpenTryResponse instance using the specified properties. + * @function create + * @memberof ibc.core.connection.v1.MsgConnectionOpenTryResponse + * @static + * @param {ibc.core.connection.v1.IMsgConnectionOpenTryResponse=} [properties] Properties to set + * @returns {ibc.core.connection.v1.MsgConnectionOpenTryResponse} MsgConnectionOpenTryResponse instance + */ + MsgConnectionOpenTryResponse.create = function create(properties) { + return new MsgConnectionOpenTryResponse(properties); + }; + + /** + * Encodes the specified MsgConnectionOpenTryResponse message. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenTryResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.connection.v1.MsgConnectionOpenTryResponse + * @static + * @param {ibc.core.connection.v1.IMsgConnectionOpenTryResponse} message MsgConnectionOpenTryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgConnectionOpenTryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgConnectionOpenTryResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenTryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.connection.v1.MsgConnectionOpenTryResponse + * @static + * @param {ibc.core.connection.v1.IMsgConnectionOpenTryResponse} message MsgConnectionOpenTryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgConnectionOpenTryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgConnectionOpenTryResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.connection.v1.MsgConnectionOpenTryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.connection.v1.MsgConnectionOpenTryResponse} MsgConnectionOpenTryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgConnectionOpenTryResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.MsgConnectionOpenTryResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgConnectionOpenTryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.connection.v1.MsgConnectionOpenTryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.connection.v1.MsgConnectionOpenTryResponse} MsgConnectionOpenTryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgConnectionOpenTryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgConnectionOpenTryResponse message. + * @function verify + * @memberof ibc.core.connection.v1.MsgConnectionOpenTryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgConnectionOpenTryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgConnectionOpenTryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.connection.v1.MsgConnectionOpenTryResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.connection.v1.MsgConnectionOpenTryResponse} MsgConnectionOpenTryResponse + */ + MsgConnectionOpenTryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.connection.v1.MsgConnectionOpenTryResponse) + return object; + return new $root.ibc.core.connection.v1.MsgConnectionOpenTryResponse(); + }; + + /** + * Creates a plain object from a MsgConnectionOpenTryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.connection.v1.MsgConnectionOpenTryResponse + * @static + * @param {ibc.core.connection.v1.MsgConnectionOpenTryResponse} message MsgConnectionOpenTryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgConnectionOpenTryResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgConnectionOpenTryResponse to JSON. + * @function toJSON + * @memberof ibc.core.connection.v1.MsgConnectionOpenTryResponse + * @instance + * @returns {Object.} JSON object + */ + MsgConnectionOpenTryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgConnectionOpenTryResponse; + })(v1.MsgConnectionOpenTryResponse || {}); + + v1.MsgConnectionOpenAck = (function(MsgConnectionOpenAck) { + + /** + * Properties of a MsgConnectionOpenAck. + * @memberof ibc.core.connection.v1 + * @interface IMsgConnectionOpenAck + * @property {string|null} [connectionId] MsgConnectionOpenAck connectionId + * @property {string|null} [counterpartyConnectionId] MsgConnectionOpenAck counterpartyConnectionId + * @property {ibc.core.connection.v1.IVersion|null} [version] MsgConnectionOpenAck version + * @property {google.protobuf.IAny|null} [clientState] MsgConnectionOpenAck clientState + * @property {ibc.core.client.v1.IHeight|null} [proofHeight] MsgConnectionOpenAck proofHeight + * @property {Uint8Array|null} [proofTry] MsgConnectionOpenAck proofTry + * @property {Uint8Array|null} [proofClient] MsgConnectionOpenAck proofClient + * @property {Uint8Array|null} [proofConsensus] MsgConnectionOpenAck proofConsensus + * @property {ibc.core.client.v1.IHeight|null} [consensusHeight] MsgConnectionOpenAck consensusHeight + * @property {string|null} [signer] MsgConnectionOpenAck signer + */ + + /** + * Constructs a new MsgConnectionOpenAck. + * @memberof ibc.core.connection.v1 + * @classdesc Represents a MsgConnectionOpenAck. + * @implements IMsgConnectionOpenAck + * @constructor + * @param {ibc.core.connection.v1.IMsgConnectionOpenAck=} [properties] Properties to set + */ + function MsgConnectionOpenAck(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgConnectionOpenAck connectionId. + * @member {string} connectionId + * @memberof ibc.core.connection.v1.MsgConnectionOpenAck + * @instance + */ + MsgConnectionOpenAck.prototype.connectionId = ""; + + /** + * MsgConnectionOpenAck counterpartyConnectionId. + * @member {string} counterpartyConnectionId + * @memberof ibc.core.connection.v1.MsgConnectionOpenAck + * @instance + */ + MsgConnectionOpenAck.prototype.counterpartyConnectionId = ""; + + /** + * MsgConnectionOpenAck version. + * @member {ibc.core.connection.v1.IVersion|null|undefined} version + * @memberof ibc.core.connection.v1.MsgConnectionOpenAck + * @instance + */ + MsgConnectionOpenAck.prototype.version = null; + + /** + * MsgConnectionOpenAck clientState. + * @member {google.protobuf.IAny|null|undefined} clientState + * @memberof ibc.core.connection.v1.MsgConnectionOpenAck + * @instance + */ + MsgConnectionOpenAck.prototype.clientState = null; + + /** + * MsgConnectionOpenAck proofHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} proofHeight + * @memberof ibc.core.connection.v1.MsgConnectionOpenAck + * @instance + */ + MsgConnectionOpenAck.prototype.proofHeight = null; + + /** + * MsgConnectionOpenAck proofTry. + * @member {Uint8Array} proofTry + * @memberof ibc.core.connection.v1.MsgConnectionOpenAck + * @instance + */ + MsgConnectionOpenAck.prototype.proofTry = $util.newBuffer([]); + + /** + * MsgConnectionOpenAck proofClient. + * @member {Uint8Array} proofClient + * @memberof ibc.core.connection.v1.MsgConnectionOpenAck + * @instance + */ + MsgConnectionOpenAck.prototype.proofClient = $util.newBuffer([]); + + /** + * MsgConnectionOpenAck proofConsensus. + * @member {Uint8Array} proofConsensus + * @memberof ibc.core.connection.v1.MsgConnectionOpenAck + * @instance + */ + MsgConnectionOpenAck.prototype.proofConsensus = $util.newBuffer([]); + + /** + * MsgConnectionOpenAck consensusHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} consensusHeight + * @memberof ibc.core.connection.v1.MsgConnectionOpenAck + * @instance + */ + MsgConnectionOpenAck.prototype.consensusHeight = null; + + /** + * MsgConnectionOpenAck signer. + * @member {string} signer + * @memberof ibc.core.connection.v1.MsgConnectionOpenAck + * @instance + */ + MsgConnectionOpenAck.prototype.signer = ""; + + /** + * Creates a new MsgConnectionOpenAck instance using the specified properties. + * @function create + * @memberof ibc.core.connection.v1.MsgConnectionOpenAck + * @static + * @param {ibc.core.connection.v1.IMsgConnectionOpenAck=} [properties] Properties to set + * @returns {ibc.core.connection.v1.MsgConnectionOpenAck} MsgConnectionOpenAck instance + */ + MsgConnectionOpenAck.create = function create(properties) { + return new MsgConnectionOpenAck(properties); + }; + + /** + * Encodes the specified MsgConnectionOpenAck message. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenAck.verify|verify} messages. + * @function encode + * @memberof ibc.core.connection.v1.MsgConnectionOpenAck + * @static + * @param {ibc.core.connection.v1.IMsgConnectionOpenAck} message MsgConnectionOpenAck message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgConnectionOpenAck.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connectionId != null && Object.hasOwnProperty.call(message, "connectionId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.connectionId); + if (message.counterpartyConnectionId != null && Object.hasOwnProperty.call(message, "counterpartyConnectionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.counterpartyConnectionId); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + $root.ibc.core.connection.v1.Version.encode(message.version, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.clientState != null && Object.hasOwnProperty.call(message, "clientState")) + $root.google.protobuf.Any.encode(message.clientState, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.proofHeight != null && Object.hasOwnProperty.call(message, "proofHeight")) + $root.ibc.core.client.v1.Height.encode(message.proofHeight, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.proofTry != null && Object.hasOwnProperty.call(message, "proofTry")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.proofTry); + if (message.proofClient != null && Object.hasOwnProperty.call(message, "proofClient")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.proofClient); + if (message.proofConsensus != null && Object.hasOwnProperty.call(message, "proofConsensus")) + writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.proofConsensus); + if (message.consensusHeight != null && Object.hasOwnProperty.call(message, "consensusHeight")) + $root.ibc.core.client.v1.Height.encode(message.consensusHeight, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.signer); + return writer; + }; + + /** + * Encodes the specified MsgConnectionOpenAck message, length delimited. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenAck.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.connection.v1.MsgConnectionOpenAck + * @static + * @param {ibc.core.connection.v1.IMsgConnectionOpenAck} message MsgConnectionOpenAck message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgConnectionOpenAck.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgConnectionOpenAck message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.connection.v1.MsgConnectionOpenAck + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.connection.v1.MsgConnectionOpenAck} MsgConnectionOpenAck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgConnectionOpenAck.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.MsgConnectionOpenAck(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + case 2: + message.counterpartyConnectionId = reader.string(); + break; + case 3: + message.version = $root.ibc.core.connection.v1.Version.decode(reader, reader.uint32()); + break; + case 4: + message.clientState = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 5: + message.proofHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + case 6: + message.proofTry = reader.bytes(); + break; + case 7: + message.proofClient = reader.bytes(); + break; + case 8: + message.proofConsensus = reader.bytes(); + break; + case 9: + message.consensusHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + case 10: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgConnectionOpenAck message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.connection.v1.MsgConnectionOpenAck + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.connection.v1.MsgConnectionOpenAck} MsgConnectionOpenAck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgConnectionOpenAck.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgConnectionOpenAck message. + * @function verify + * @memberof ibc.core.connection.v1.MsgConnectionOpenAck + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgConnectionOpenAck.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.connectionId != null && message.hasOwnProperty("connectionId")) + if (!$util.isString(message.connectionId)) + return "connectionId: string expected"; + if (message.counterpartyConnectionId != null && message.hasOwnProperty("counterpartyConnectionId")) + if (!$util.isString(message.counterpartyConnectionId)) + return "counterpartyConnectionId: string expected"; + if (message.version != null && message.hasOwnProperty("version")) { + let error = $root.ibc.core.connection.v1.Version.verify(message.version); + if (error) + return "version." + error; + } + if (message.clientState != null && message.hasOwnProperty("clientState")) { + let error = $root.google.protobuf.Any.verify(message.clientState); + if (error) + return "clientState." + error; + } + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) { + let error = $root.ibc.core.client.v1.Height.verify(message.proofHeight); + if (error) + return "proofHeight." + error; + } + if (message.proofTry != null && message.hasOwnProperty("proofTry")) + if (!(message.proofTry && typeof message.proofTry.length === "number" || $util.isString(message.proofTry))) + return "proofTry: buffer expected"; + if (message.proofClient != null && message.hasOwnProperty("proofClient")) + if (!(message.proofClient && typeof message.proofClient.length === "number" || $util.isString(message.proofClient))) + return "proofClient: buffer expected"; + if (message.proofConsensus != null && message.hasOwnProperty("proofConsensus")) + if (!(message.proofConsensus && typeof message.proofConsensus.length === "number" || $util.isString(message.proofConsensus))) + return "proofConsensus: buffer expected"; + if (message.consensusHeight != null && message.hasOwnProperty("consensusHeight")) { + let error = $root.ibc.core.client.v1.Height.verify(message.consensusHeight); + if (error) + return "consensusHeight." + error; + } + if (message.signer != null && message.hasOwnProperty("signer")) + if (!$util.isString(message.signer)) + return "signer: string expected"; + return null; + }; + + /** + * Creates a MsgConnectionOpenAck message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.connection.v1.MsgConnectionOpenAck + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.connection.v1.MsgConnectionOpenAck} MsgConnectionOpenAck + */ + MsgConnectionOpenAck.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.connection.v1.MsgConnectionOpenAck) + return object; + let message = new $root.ibc.core.connection.v1.MsgConnectionOpenAck(); + if (object.connectionId != null) + message.connectionId = String(object.connectionId); + if (object.counterpartyConnectionId != null) + message.counterpartyConnectionId = String(object.counterpartyConnectionId); + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenAck.version: object expected"); + message.version = $root.ibc.core.connection.v1.Version.fromObject(object.version); + } + if (object.clientState != null) { + if (typeof object.clientState !== "object") + throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenAck.clientState: object expected"); + message.clientState = $root.google.protobuf.Any.fromObject(object.clientState); + } + if (object.proofHeight != null) { + if (typeof object.proofHeight !== "object") + throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenAck.proofHeight: object expected"); + message.proofHeight = $root.ibc.core.client.v1.Height.fromObject(object.proofHeight); + } + if (object.proofTry != null) + if (typeof object.proofTry === "string") + $util.base64.decode(object.proofTry, message.proofTry = $util.newBuffer($util.base64.length(object.proofTry)), 0); + else if (object.proofTry.length) + message.proofTry = object.proofTry; + if (object.proofClient != null) + if (typeof object.proofClient === "string") + $util.base64.decode(object.proofClient, message.proofClient = $util.newBuffer($util.base64.length(object.proofClient)), 0); + else if (object.proofClient.length) + message.proofClient = object.proofClient; + if (object.proofConsensus != null) + if (typeof object.proofConsensus === "string") + $util.base64.decode(object.proofConsensus, message.proofConsensus = $util.newBuffer($util.base64.length(object.proofConsensus)), 0); + else if (object.proofConsensus.length) + message.proofConsensus = object.proofConsensus; + if (object.consensusHeight != null) { + if (typeof object.consensusHeight !== "object") + throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenAck.consensusHeight: object expected"); + message.consensusHeight = $root.ibc.core.client.v1.Height.fromObject(object.consensusHeight); + } + if (object.signer != null) + message.signer = String(object.signer); + return message; + }; + + /** + * Creates a plain object from a MsgConnectionOpenAck message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.connection.v1.MsgConnectionOpenAck + * @static + * @param {ibc.core.connection.v1.MsgConnectionOpenAck} message MsgConnectionOpenAck + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgConnectionOpenAck.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.connectionId = ""; + object.counterpartyConnectionId = ""; + object.version = null; + object.clientState = null; + object.proofHeight = null; + if (options.bytes === String) + object.proofTry = ""; + else { + object.proofTry = []; + if (options.bytes !== Array) + object.proofTry = $util.newBuffer(object.proofTry); + } + if (options.bytes === String) + object.proofClient = ""; + else { + object.proofClient = []; + if (options.bytes !== Array) + object.proofClient = $util.newBuffer(object.proofClient); + } + if (options.bytes === String) + object.proofConsensus = ""; + else { + object.proofConsensus = []; + if (options.bytes !== Array) + object.proofConsensus = $util.newBuffer(object.proofConsensus); + } + object.consensusHeight = null; + object.signer = ""; + } + if (message.connectionId != null && message.hasOwnProperty("connectionId")) + object.connectionId = message.connectionId; + if (message.counterpartyConnectionId != null && message.hasOwnProperty("counterpartyConnectionId")) + object.counterpartyConnectionId = message.counterpartyConnectionId; + if (message.version != null && message.hasOwnProperty("version")) + object.version = $root.ibc.core.connection.v1.Version.toObject(message.version, options); + if (message.clientState != null && message.hasOwnProperty("clientState")) + object.clientState = $root.google.protobuf.Any.toObject(message.clientState, options); + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) + object.proofHeight = $root.ibc.core.client.v1.Height.toObject(message.proofHeight, options); + if (message.proofTry != null && message.hasOwnProperty("proofTry")) + object.proofTry = options.bytes === String ? $util.base64.encode(message.proofTry, 0, message.proofTry.length) : options.bytes === Array ? Array.prototype.slice.call(message.proofTry) : message.proofTry; + if (message.proofClient != null && message.hasOwnProperty("proofClient")) + object.proofClient = options.bytes === String ? $util.base64.encode(message.proofClient, 0, message.proofClient.length) : options.bytes === Array ? Array.prototype.slice.call(message.proofClient) : message.proofClient; + if (message.proofConsensus != null && message.hasOwnProperty("proofConsensus")) + object.proofConsensus = options.bytes === String ? $util.base64.encode(message.proofConsensus, 0, message.proofConsensus.length) : options.bytes === Array ? Array.prototype.slice.call(message.proofConsensus) : message.proofConsensus; + if (message.consensusHeight != null && message.hasOwnProperty("consensusHeight")) + object.consensusHeight = $root.ibc.core.client.v1.Height.toObject(message.consensusHeight, options); + if (message.signer != null && message.hasOwnProperty("signer")) + object.signer = message.signer; + return object; + }; + + /** + * Converts this MsgConnectionOpenAck to JSON. + * @function toJSON + * @memberof ibc.core.connection.v1.MsgConnectionOpenAck + * @instance + * @returns {Object.} JSON object + */ + MsgConnectionOpenAck.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgConnectionOpenAck; + })(v1.MsgConnectionOpenAck || {}); + + v1.MsgConnectionOpenAckResponse = (function(MsgConnectionOpenAckResponse) { + + /** + * Properties of a MsgConnectionOpenAckResponse. + * @memberof ibc.core.connection.v1 + * @interface IMsgConnectionOpenAckResponse + */ + + /** + * Constructs a new MsgConnectionOpenAckResponse. + * @memberof ibc.core.connection.v1 + * @classdesc Represents a MsgConnectionOpenAckResponse. + * @implements IMsgConnectionOpenAckResponse + * @constructor + * @param {ibc.core.connection.v1.IMsgConnectionOpenAckResponse=} [properties] Properties to set + */ + function MsgConnectionOpenAckResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgConnectionOpenAckResponse instance using the specified properties. + * @function create + * @memberof ibc.core.connection.v1.MsgConnectionOpenAckResponse + * @static + * @param {ibc.core.connection.v1.IMsgConnectionOpenAckResponse=} [properties] Properties to set + * @returns {ibc.core.connection.v1.MsgConnectionOpenAckResponse} MsgConnectionOpenAckResponse instance + */ + MsgConnectionOpenAckResponse.create = function create(properties) { + return new MsgConnectionOpenAckResponse(properties); + }; + + /** + * Encodes the specified MsgConnectionOpenAckResponse message. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenAckResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.connection.v1.MsgConnectionOpenAckResponse + * @static + * @param {ibc.core.connection.v1.IMsgConnectionOpenAckResponse} message MsgConnectionOpenAckResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgConnectionOpenAckResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgConnectionOpenAckResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenAckResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.connection.v1.MsgConnectionOpenAckResponse + * @static + * @param {ibc.core.connection.v1.IMsgConnectionOpenAckResponse} message MsgConnectionOpenAckResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgConnectionOpenAckResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgConnectionOpenAckResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.connection.v1.MsgConnectionOpenAckResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.connection.v1.MsgConnectionOpenAckResponse} MsgConnectionOpenAckResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgConnectionOpenAckResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.MsgConnectionOpenAckResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgConnectionOpenAckResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.connection.v1.MsgConnectionOpenAckResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.connection.v1.MsgConnectionOpenAckResponse} MsgConnectionOpenAckResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgConnectionOpenAckResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgConnectionOpenAckResponse message. + * @function verify + * @memberof ibc.core.connection.v1.MsgConnectionOpenAckResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgConnectionOpenAckResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgConnectionOpenAckResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.connection.v1.MsgConnectionOpenAckResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.connection.v1.MsgConnectionOpenAckResponse} MsgConnectionOpenAckResponse + */ + MsgConnectionOpenAckResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.connection.v1.MsgConnectionOpenAckResponse) + return object; + return new $root.ibc.core.connection.v1.MsgConnectionOpenAckResponse(); + }; + + /** + * Creates a plain object from a MsgConnectionOpenAckResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.connection.v1.MsgConnectionOpenAckResponse + * @static + * @param {ibc.core.connection.v1.MsgConnectionOpenAckResponse} message MsgConnectionOpenAckResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgConnectionOpenAckResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgConnectionOpenAckResponse to JSON. + * @function toJSON + * @memberof ibc.core.connection.v1.MsgConnectionOpenAckResponse + * @instance + * @returns {Object.} JSON object + */ + MsgConnectionOpenAckResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgConnectionOpenAckResponse; + })(v1.MsgConnectionOpenAckResponse || {}); + + v1.MsgConnectionOpenConfirm = (function(MsgConnectionOpenConfirm) { + + /** + * Properties of a MsgConnectionOpenConfirm. + * @memberof ibc.core.connection.v1 + * @interface IMsgConnectionOpenConfirm + * @property {string|null} [connectionId] MsgConnectionOpenConfirm connectionId + * @property {Uint8Array|null} [proofAck] MsgConnectionOpenConfirm proofAck + * @property {ibc.core.client.v1.IHeight|null} [proofHeight] MsgConnectionOpenConfirm proofHeight + * @property {string|null} [signer] MsgConnectionOpenConfirm signer + */ + + /** + * Constructs a new MsgConnectionOpenConfirm. + * @memberof ibc.core.connection.v1 + * @classdesc Represents a MsgConnectionOpenConfirm. + * @implements IMsgConnectionOpenConfirm + * @constructor + * @param {ibc.core.connection.v1.IMsgConnectionOpenConfirm=} [properties] Properties to set + */ + function MsgConnectionOpenConfirm(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgConnectionOpenConfirm connectionId. + * @member {string} connectionId + * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm + * @instance + */ + MsgConnectionOpenConfirm.prototype.connectionId = ""; + + /** + * MsgConnectionOpenConfirm proofAck. + * @member {Uint8Array} proofAck + * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm + * @instance + */ + MsgConnectionOpenConfirm.prototype.proofAck = $util.newBuffer([]); + + /** + * MsgConnectionOpenConfirm proofHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} proofHeight + * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm + * @instance + */ + MsgConnectionOpenConfirm.prototype.proofHeight = null; + + /** + * MsgConnectionOpenConfirm signer. + * @member {string} signer + * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm + * @instance + */ + MsgConnectionOpenConfirm.prototype.signer = ""; + + /** + * Creates a new MsgConnectionOpenConfirm instance using the specified properties. + * @function create + * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm + * @static + * @param {ibc.core.connection.v1.IMsgConnectionOpenConfirm=} [properties] Properties to set + * @returns {ibc.core.connection.v1.MsgConnectionOpenConfirm} MsgConnectionOpenConfirm instance + */ + MsgConnectionOpenConfirm.create = function create(properties) { + return new MsgConnectionOpenConfirm(properties); + }; + + /** + * Encodes the specified MsgConnectionOpenConfirm message. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenConfirm.verify|verify} messages. + * @function encode + * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm + * @static + * @param {ibc.core.connection.v1.IMsgConnectionOpenConfirm} message MsgConnectionOpenConfirm message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgConnectionOpenConfirm.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connectionId != null && Object.hasOwnProperty.call(message, "connectionId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.connectionId); + if (message.proofAck != null && Object.hasOwnProperty.call(message, "proofAck")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proofAck); + if (message.proofHeight != null && Object.hasOwnProperty.call(message, "proofHeight")) + $root.ibc.core.client.v1.Height.encode(message.proofHeight, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.signer); + return writer; + }; + + /** + * Encodes the specified MsgConnectionOpenConfirm message, length delimited. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenConfirm.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm + * @static + * @param {ibc.core.connection.v1.IMsgConnectionOpenConfirm} message MsgConnectionOpenConfirm message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgConnectionOpenConfirm.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgConnectionOpenConfirm message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.connection.v1.MsgConnectionOpenConfirm} MsgConnectionOpenConfirm + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgConnectionOpenConfirm.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.MsgConnectionOpenConfirm(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + case 2: + message.proofAck = reader.bytes(); + break; + case 3: + message.proofHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + case 4: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgConnectionOpenConfirm message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.connection.v1.MsgConnectionOpenConfirm} MsgConnectionOpenConfirm + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgConnectionOpenConfirm.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgConnectionOpenConfirm message. + * @function verify + * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgConnectionOpenConfirm.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.connectionId != null && message.hasOwnProperty("connectionId")) + if (!$util.isString(message.connectionId)) + return "connectionId: string expected"; + if (message.proofAck != null && message.hasOwnProperty("proofAck")) + if (!(message.proofAck && typeof message.proofAck.length === "number" || $util.isString(message.proofAck))) + return "proofAck: buffer expected"; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) { + let error = $root.ibc.core.client.v1.Height.verify(message.proofHeight); + if (error) + return "proofHeight." + error; + } + if (message.signer != null && message.hasOwnProperty("signer")) + if (!$util.isString(message.signer)) + return "signer: string expected"; + return null; + }; + + /** + * Creates a MsgConnectionOpenConfirm message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.connection.v1.MsgConnectionOpenConfirm} MsgConnectionOpenConfirm + */ + MsgConnectionOpenConfirm.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.connection.v1.MsgConnectionOpenConfirm) + return object; + let message = new $root.ibc.core.connection.v1.MsgConnectionOpenConfirm(); + if (object.connectionId != null) + message.connectionId = String(object.connectionId); + if (object.proofAck != null) + if (typeof object.proofAck === "string") + $util.base64.decode(object.proofAck, message.proofAck = $util.newBuffer($util.base64.length(object.proofAck)), 0); + else if (object.proofAck.length) + message.proofAck = object.proofAck; + if (object.proofHeight != null) { + if (typeof object.proofHeight !== "object") + throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenConfirm.proofHeight: object expected"); + message.proofHeight = $root.ibc.core.client.v1.Height.fromObject(object.proofHeight); + } + if (object.signer != null) + message.signer = String(object.signer); + return message; + }; + + /** + * Creates a plain object from a MsgConnectionOpenConfirm message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm + * @static + * @param {ibc.core.connection.v1.MsgConnectionOpenConfirm} message MsgConnectionOpenConfirm + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgConnectionOpenConfirm.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.connectionId = ""; + if (options.bytes === String) + object.proofAck = ""; + else { + object.proofAck = []; + if (options.bytes !== Array) + object.proofAck = $util.newBuffer(object.proofAck); + } + object.proofHeight = null; + object.signer = ""; + } + if (message.connectionId != null && message.hasOwnProperty("connectionId")) + object.connectionId = message.connectionId; + if (message.proofAck != null && message.hasOwnProperty("proofAck")) + object.proofAck = options.bytes === String ? $util.base64.encode(message.proofAck, 0, message.proofAck.length) : options.bytes === Array ? Array.prototype.slice.call(message.proofAck) : message.proofAck; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) + object.proofHeight = $root.ibc.core.client.v1.Height.toObject(message.proofHeight, options); + if (message.signer != null && message.hasOwnProperty("signer")) + object.signer = message.signer; + return object; + }; + + /** + * Converts this MsgConnectionOpenConfirm to JSON. + * @function toJSON + * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm + * @instance + * @returns {Object.} JSON object + */ + MsgConnectionOpenConfirm.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgConnectionOpenConfirm; + })(v1.MsgConnectionOpenConfirm || {}); + + v1.MsgConnectionOpenConfirmResponse = (function(MsgConnectionOpenConfirmResponse) { + + /** + * Properties of a MsgConnectionOpenConfirmResponse. + * @memberof ibc.core.connection.v1 + * @interface IMsgConnectionOpenConfirmResponse + */ + + /** + * Constructs a new MsgConnectionOpenConfirmResponse. + * @memberof ibc.core.connection.v1 + * @classdesc Represents a MsgConnectionOpenConfirmResponse. + * @implements IMsgConnectionOpenConfirmResponse + * @constructor + * @param {ibc.core.connection.v1.IMsgConnectionOpenConfirmResponse=} [properties] Properties to set + */ + function MsgConnectionOpenConfirmResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgConnectionOpenConfirmResponse instance using the specified properties. + * @function create + * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirmResponse + * @static + * @param {ibc.core.connection.v1.IMsgConnectionOpenConfirmResponse=} [properties] Properties to set + * @returns {ibc.core.connection.v1.MsgConnectionOpenConfirmResponse} MsgConnectionOpenConfirmResponse instance + */ + MsgConnectionOpenConfirmResponse.create = function create(properties) { + return new MsgConnectionOpenConfirmResponse(properties); + }; + + /** + * Encodes the specified MsgConnectionOpenConfirmResponse message. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenConfirmResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirmResponse + * @static + * @param {ibc.core.connection.v1.IMsgConnectionOpenConfirmResponse} message MsgConnectionOpenConfirmResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgConnectionOpenConfirmResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgConnectionOpenConfirmResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenConfirmResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirmResponse + * @static + * @param {ibc.core.connection.v1.IMsgConnectionOpenConfirmResponse} message MsgConnectionOpenConfirmResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgConnectionOpenConfirmResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgConnectionOpenConfirmResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirmResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.connection.v1.MsgConnectionOpenConfirmResponse} MsgConnectionOpenConfirmResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgConnectionOpenConfirmResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.MsgConnectionOpenConfirmResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgConnectionOpenConfirmResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirmResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.connection.v1.MsgConnectionOpenConfirmResponse} MsgConnectionOpenConfirmResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgConnectionOpenConfirmResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgConnectionOpenConfirmResponse message. + * @function verify + * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirmResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgConnectionOpenConfirmResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgConnectionOpenConfirmResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirmResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.connection.v1.MsgConnectionOpenConfirmResponse} MsgConnectionOpenConfirmResponse + */ + MsgConnectionOpenConfirmResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.connection.v1.MsgConnectionOpenConfirmResponse) + return object; + return new $root.ibc.core.connection.v1.MsgConnectionOpenConfirmResponse(); + }; + + /** + * Creates a plain object from a MsgConnectionOpenConfirmResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirmResponse + * @static + * @param {ibc.core.connection.v1.MsgConnectionOpenConfirmResponse} message MsgConnectionOpenConfirmResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgConnectionOpenConfirmResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgConnectionOpenConfirmResponse to JSON. + * @function toJSON + * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirmResponse + * @instance + * @returns {Object.} JSON object + */ + MsgConnectionOpenConfirmResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgConnectionOpenConfirmResponse; + })(v1.MsgConnectionOpenConfirmResponse || {}); + + return v1; + })(connection.v1 || {}); + + return connection; + })(core.connection || {}); + + /** + * Namespace types. + * @memberof ibc.core + * @namespace + */ + + core.types = (function(types) { + + /** + * Namespace v1. + * @memberof ibc.core.types + * @namespace + */ + + types.v1 = (function(v1) { + + v1.GenesisState = (function(GenesisState) { + + /** + * Properties of a GenesisState. + * @memberof ibc.core.types.v1 + * @interface IGenesisState + * @property {ibc.core.client.v1.IGenesisState|null} [clientGenesis] GenesisState clientGenesis + * @property {ibc.core.connection.v1.IGenesisState|null} [connectionGenesis] GenesisState connectionGenesis + * @property {ibc.core.channel.v1.IGenesisState|null} [channelGenesis] GenesisState channelGenesis + */ + + /** + * Constructs a new GenesisState. + * @memberof ibc.core.types.v1 + * @classdesc Represents a GenesisState. + * @implements IGenesisState + * @constructor + * @param {ibc.core.types.v1.IGenesisState=} [properties] Properties to set + */ + function GenesisState(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenesisState clientGenesis. + * @member {ibc.core.client.v1.IGenesisState|null|undefined} clientGenesis + * @memberof ibc.core.types.v1.GenesisState + * @instance + */ + GenesisState.prototype.clientGenesis = null; + + /** + * GenesisState connectionGenesis. + * @member {ibc.core.connection.v1.IGenesisState|null|undefined} connectionGenesis + * @memberof ibc.core.types.v1.GenesisState + * @instance + */ + GenesisState.prototype.connectionGenesis = null; + + /** + * GenesisState channelGenesis. + * @member {ibc.core.channel.v1.IGenesisState|null|undefined} channelGenesis + * @memberof ibc.core.types.v1.GenesisState + * @instance + */ + GenesisState.prototype.channelGenesis = null; + + /** + * Creates a new GenesisState instance using the specified properties. + * @function create + * @memberof ibc.core.types.v1.GenesisState + * @static + * @param {ibc.core.types.v1.IGenesisState=} [properties] Properties to set + * @returns {ibc.core.types.v1.GenesisState} GenesisState instance + */ + GenesisState.create = function create(properties) { + return new GenesisState(properties); + }; + + /** + * Encodes the specified GenesisState message. Does not implicitly {@link ibc.core.types.v1.GenesisState.verify|verify} messages. + * @function encode + * @memberof ibc.core.types.v1.GenesisState + * @static + * @param {ibc.core.types.v1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientGenesis != null && Object.hasOwnProperty.call(message, "clientGenesis")) + $root.ibc.core.client.v1.GenesisState.encode(message.clientGenesis, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.connectionGenesis != null && Object.hasOwnProperty.call(message, "connectionGenesis")) + $root.ibc.core.connection.v1.GenesisState.encode(message.connectionGenesis, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.channelGenesis != null && Object.hasOwnProperty.call(message, "channelGenesis")) + $root.ibc.core.channel.v1.GenesisState.encode(message.channelGenesis, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link ibc.core.types.v1.GenesisState.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.types.v1.GenesisState + * @static + * @param {ibc.core.types.v1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.types.v1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.types.v1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.types.v1.GenesisState(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientGenesis = $root.ibc.core.client.v1.GenesisState.decode(reader, reader.uint32()); + break; + case 2: + message.connectionGenesis = $root.ibc.core.connection.v1.GenesisState.decode(reader, reader.uint32()); + break; + case 3: + message.channelGenesis = $root.ibc.core.channel.v1.GenesisState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.types.v1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.types.v1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenesisState message. + * @function verify + * @memberof ibc.core.types.v1.GenesisState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenesisState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientGenesis != null && message.hasOwnProperty("clientGenesis")) { + let error = $root.ibc.core.client.v1.GenesisState.verify(message.clientGenesis); + if (error) + return "clientGenesis." + error; + } + if (message.connectionGenesis != null && message.hasOwnProperty("connectionGenesis")) { + let error = $root.ibc.core.connection.v1.GenesisState.verify(message.connectionGenesis); + if (error) + return "connectionGenesis." + error; + } + if (message.channelGenesis != null && message.hasOwnProperty("channelGenesis")) { + let error = $root.ibc.core.channel.v1.GenesisState.verify(message.channelGenesis); + if (error) + return "channelGenesis." + error; + } + return null; + }; + + /** + * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.types.v1.GenesisState + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.types.v1.GenesisState} GenesisState + */ + GenesisState.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.types.v1.GenesisState) + return object; + let message = new $root.ibc.core.types.v1.GenesisState(); + if (object.clientGenesis != null) { + if (typeof object.clientGenesis !== "object") + throw TypeError(".ibc.core.types.v1.GenesisState.clientGenesis: object expected"); + message.clientGenesis = $root.ibc.core.client.v1.GenesisState.fromObject(object.clientGenesis); + } + if (object.connectionGenesis != null) { + if (typeof object.connectionGenesis !== "object") + throw TypeError(".ibc.core.types.v1.GenesisState.connectionGenesis: object expected"); + message.connectionGenesis = $root.ibc.core.connection.v1.GenesisState.fromObject(object.connectionGenesis); + } + if (object.channelGenesis != null) { + if (typeof object.channelGenesis !== "object") + throw TypeError(".ibc.core.types.v1.GenesisState.channelGenesis: object expected"); + message.channelGenesis = $root.ibc.core.channel.v1.GenesisState.fromObject(object.channelGenesis); + } + return message; + }; + + /** + * Creates a plain object from a GenesisState message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.types.v1.GenesisState + * @static + * @param {ibc.core.types.v1.GenesisState} message GenesisState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenesisState.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.clientGenesis = null; + object.connectionGenesis = null; + object.channelGenesis = null; + } + if (message.clientGenesis != null && message.hasOwnProperty("clientGenesis")) + object.clientGenesis = $root.ibc.core.client.v1.GenesisState.toObject(message.clientGenesis, options); + if (message.connectionGenesis != null && message.hasOwnProperty("connectionGenesis")) + object.connectionGenesis = $root.ibc.core.connection.v1.GenesisState.toObject(message.connectionGenesis, options); + if (message.channelGenesis != null && message.hasOwnProperty("channelGenesis")) + object.channelGenesis = $root.ibc.core.channel.v1.GenesisState.toObject(message.channelGenesis, options); + return object; + }; + + /** + * Converts this GenesisState to JSON. + * @function toJSON + * @memberof ibc.core.types.v1.GenesisState + * @instance + * @returns {Object.} JSON object + */ + GenesisState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GenesisState; + })(v1.GenesisState || {}); + + return v1; + })(types.v1 || {}); + + return types; + })(core.types || {}); + + return core; + })(ibc.core || {}); + + return ibc; +})($root.ibc || {}); + +/** + * Namespace tendermint. + * @exports tendermint + * @namespace + */ + +export const tendermint = $root.tendermint = ((tendermint) => { + + /** + * Namespace abci. + * @memberof tendermint + * @namespace + */ + + tendermint.abci = (function(abci) { + + abci.Request = (function(Request) { + + /** + * Properties of a Request. + * @memberof tendermint.abci + * @interface IRequest + * @property {tendermint.abci.IRequestEcho|null} [echo] Request echo + * @property {tendermint.abci.IRequestFlush|null} [flush] Request flush + * @property {tendermint.abci.IRequestInfo|null} [info] Request info + * @property {tendermint.abci.IRequestSetOption|null} [setOption] Request setOption + * @property {tendermint.abci.IRequestInitChain|null} [initChain] Request initChain + * @property {tendermint.abci.IRequestQuery|null} [query] Request query + * @property {tendermint.abci.IRequestBeginBlock|null} [beginBlock] Request beginBlock + * @property {tendermint.abci.IRequestCheckTx|null} [checkTx] Request checkTx + * @property {tendermint.abci.IRequestDeliverTx|null} [deliverTx] Request deliverTx + * @property {tendermint.abci.IRequestEndBlock|null} [endBlock] Request endBlock + * @property {tendermint.abci.IRequestCommit|null} [commit] Request commit + * @property {tendermint.abci.IRequestListSnapshots|null} [listSnapshots] Request listSnapshots + * @property {tendermint.abci.IRequestOfferSnapshot|null} [offerSnapshot] Request offerSnapshot + * @property {tendermint.abci.IRequestLoadSnapshotChunk|null} [loadSnapshotChunk] Request loadSnapshotChunk + * @property {tendermint.abci.IRequestApplySnapshotChunk|null} [applySnapshotChunk] Request applySnapshotChunk + */ + + /** + * Constructs a new Request. + * @memberof tendermint.abci + * @classdesc Represents a Request. + * @implements IRequest + * @constructor + * @param {tendermint.abci.IRequest=} [properties] Properties to set + */ + function Request(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Request echo. + * @member {tendermint.abci.IRequestEcho|null|undefined} echo + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.echo = null; + + /** + * Request flush. + * @member {tendermint.abci.IRequestFlush|null|undefined} flush + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.flush = null; + + /** + * Request info. + * @member {tendermint.abci.IRequestInfo|null|undefined} info + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.info = null; + + /** + * Request setOption. + * @member {tendermint.abci.IRequestSetOption|null|undefined} setOption + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.setOption = null; + + /** + * Request initChain. + * @member {tendermint.abci.IRequestInitChain|null|undefined} initChain + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.initChain = null; + + /** + * Request query. + * @member {tendermint.abci.IRequestQuery|null|undefined} query + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.query = null; + + /** + * Request beginBlock. + * @member {tendermint.abci.IRequestBeginBlock|null|undefined} beginBlock + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.beginBlock = null; + + /** + * Request checkTx. + * @member {tendermint.abci.IRequestCheckTx|null|undefined} checkTx + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.checkTx = null; + + /** + * Request deliverTx. + * @member {tendermint.abci.IRequestDeliverTx|null|undefined} deliverTx + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.deliverTx = null; + + /** + * Request endBlock. + * @member {tendermint.abci.IRequestEndBlock|null|undefined} endBlock + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.endBlock = null; + + /** + * Request commit. + * @member {tendermint.abci.IRequestCommit|null|undefined} commit + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.commit = null; + + /** + * Request listSnapshots. + * @member {tendermint.abci.IRequestListSnapshots|null|undefined} listSnapshots + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.listSnapshots = null; + + /** + * Request offerSnapshot. + * @member {tendermint.abci.IRequestOfferSnapshot|null|undefined} offerSnapshot + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.offerSnapshot = null; + + /** + * Request loadSnapshotChunk. + * @member {tendermint.abci.IRequestLoadSnapshotChunk|null|undefined} loadSnapshotChunk + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.loadSnapshotChunk = null; + + /** + * Request applySnapshotChunk. + * @member {tendermint.abci.IRequestApplySnapshotChunk|null|undefined} applySnapshotChunk + * @memberof tendermint.abci.Request + * @instance + */ + Request.prototype.applySnapshotChunk = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Request value. + * @member {"echo"|"flush"|"info"|"setOption"|"initChain"|"query"|"beginBlock"|"checkTx"|"deliverTx"|"endBlock"|"commit"|"listSnapshots"|"offerSnapshot"|"loadSnapshotChunk"|"applySnapshotChunk"|undefined} value + * @memberof tendermint.abci.Request + * @instance + */ + Object.defineProperty(Request.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["echo", "flush", "info", "setOption", "initChain", "query", "beginBlock", "checkTx", "deliverTx", "endBlock", "commit", "listSnapshots", "offerSnapshot", "loadSnapshotChunk", "applySnapshotChunk"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Request instance using the specified properties. + * @function create + * @memberof tendermint.abci.Request + * @static + * @param {tendermint.abci.IRequest=} [properties] Properties to set + * @returns {tendermint.abci.Request} Request instance + */ + Request.create = function create(properties) { + return new Request(properties); + }; + + /** + * Encodes the specified Request message. Does not implicitly {@link tendermint.abci.Request.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.Request + * @static + * @param {tendermint.abci.IRequest} message Request message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Request.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.echo != null && Object.hasOwnProperty.call(message, "echo")) + $root.tendermint.abci.RequestEcho.encode(message.echo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.flush != null && Object.hasOwnProperty.call(message, "flush")) + $root.tendermint.abci.RequestFlush.encode(message.flush, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.info != null && Object.hasOwnProperty.call(message, "info")) + $root.tendermint.abci.RequestInfo.encode(message.info, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.setOption != null && Object.hasOwnProperty.call(message, "setOption")) + $root.tendermint.abci.RequestSetOption.encode(message.setOption, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.initChain != null && Object.hasOwnProperty.call(message, "initChain")) + $root.tendermint.abci.RequestInitChain.encode(message.initChain, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + $root.tendermint.abci.RequestQuery.encode(message.query, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.beginBlock != null && Object.hasOwnProperty.call(message, "beginBlock")) + $root.tendermint.abci.RequestBeginBlock.encode(message.beginBlock, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.checkTx != null && Object.hasOwnProperty.call(message, "checkTx")) + $root.tendermint.abci.RequestCheckTx.encode(message.checkTx, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.deliverTx != null && Object.hasOwnProperty.call(message, "deliverTx")) + $root.tendermint.abci.RequestDeliverTx.encode(message.deliverTx, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.endBlock != null && Object.hasOwnProperty.call(message, "endBlock")) + $root.tendermint.abci.RequestEndBlock.encode(message.endBlock, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.commit != null && Object.hasOwnProperty.call(message, "commit")) + $root.tendermint.abci.RequestCommit.encode(message.commit, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.listSnapshots != null && Object.hasOwnProperty.call(message, "listSnapshots")) + $root.tendermint.abci.RequestListSnapshots.encode(message.listSnapshots, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.offerSnapshot != null && Object.hasOwnProperty.call(message, "offerSnapshot")) + $root.tendermint.abci.RequestOfferSnapshot.encode(message.offerSnapshot, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.loadSnapshotChunk != null && Object.hasOwnProperty.call(message, "loadSnapshotChunk")) + $root.tendermint.abci.RequestLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.applySnapshotChunk != null && Object.hasOwnProperty.call(message, "applySnapshotChunk")) + $root.tendermint.abci.RequestApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Request message, length delimited. Does not implicitly {@link tendermint.abci.Request.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.Request + * @static + * @param {tendermint.abci.IRequest} message Request message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Request.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Request message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.Request + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.Request} Request + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Request.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.Request(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.echo = $root.tendermint.abci.RequestEcho.decode(reader, reader.uint32()); + break; + case 2: + message.flush = $root.tendermint.abci.RequestFlush.decode(reader, reader.uint32()); + break; + case 3: + message.info = $root.tendermint.abci.RequestInfo.decode(reader, reader.uint32()); + break; + case 4: + message.setOption = $root.tendermint.abci.RequestSetOption.decode(reader, reader.uint32()); + break; + case 5: + message.initChain = $root.tendermint.abci.RequestInitChain.decode(reader, reader.uint32()); + break; + case 6: + message.query = $root.tendermint.abci.RequestQuery.decode(reader, reader.uint32()); + break; + case 7: + message.beginBlock = $root.tendermint.abci.RequestBeginBlock.decode(reader, reader.uint32()); + break; + case 8: + message.checkTx = $root.tendermint.abci.RequestCheckTx.decode(reader, reader.uint32()); + break; + case 9: + message.deliverTx = $root.tendermint.abci.RequestDeliverTx.decode(reader, reader.uint32()); + break; + case 10: + message.endBlock = $root.tendermint.abci.RequestEndBlock.decode(reader, reader.uint32()); + break; + case 11: + message.commit = $root.tendermint.abci.RequestCommit.decode(reader, reader.uint32()); + break; + case 12: + message.listSnapshots = $root.tendermint.abci.RequestListSnapshots.decode(reader, reader.uint32()); + break; + case 13: + message.offerSnapshot = $root.tendermint.abci.RequestOfferSnapshot.decode(reader, reader.uint32()); + break; + case 14: + message.loadSnapshotChunk = $root.tendermint.abci.RequestLoadSnapshotChunk.decode(reader, reader.uint32()); + break; + case 15: + message.applySnapshotChunk = $root.tendermint.abci.RequestApplySnapshotChunk.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Request message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.Request + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.Request} Request + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Request.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Request message. + * @function verify + * @memberof tendermint.abci.Request + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Request.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + let properties = {}; + if (message.echo != null && message.hasOwnProperty("echo")) { + properties.value = 1; + { + let error = $root.tendermint.abci.RequestEcho.verify(message.echo); + if (error) + return "echo." + error; + } + } + if (message.flush != null && message.hasOwnProperty("flush")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + let error = $root.tendermint.abci.RequestFlush.verify(message.flush); + if (error) + return "flush." + error; + } + } + if (message.info != null && message.hasOwnProperty("info")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + let error = $root.tendermint.abci.RequestInfo.verify(message.info); + if (error) + return "info." + error; + } + } + if (message.setOption != null && message.hasOwnProperty("setOption")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + let error = $root.tendermint.abci.RequestSetOption.verify(message.setOption); + if (error) + return "setOption." + error; + } + } + if (message.initChain != null && message.hasOwnProperty("initChain")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + let error = $root.tendermint.abci.RequestInitChain.verify(message.initChain); + if (error) + return "initChain." + error; + } + } + if (message.query != null && message.hasOwnProperty("query")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + let error = $root.tendermint.abci.RequestQuery.verify(message.query); + if (error) + return "query." + error; + } + } + if (message.beginBlock != null && message.hasOwnProperty("beginBlock")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + let error = $root.tendermint.abci.RequestBeginBlock.verify(message.beginBlock); + if (error) + return "beginBlock." + error; + } + } + if (message.checkTx != null && message.hasOwnProperty("checkTx")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + let error = $root.tendermint.abci.RequestCheckTx.verify(message.checkTx); + if (error) + return "checkTx." + error; + } + } + if (message.deliverTx != null && message.hasOwnProperty("deliverTx")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + let error = $root.tendermint.abci.RequestDeliverTx.verify(message.deliverTx); + if (error) + return "deliverTx." + error; + } + } + if (message.endBlock != null && message.hasOwnProperty("endBlock")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + let error = $root.tendermint.abci.RequestEndBlock.verify(message.endBlock); + if (error) + return "endBlock." + error; + } + } + if (message.commit != null && message.hasOwnProperty("commit")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + let error = $root.tendermint.abci.RequestCommit.verify(message.commit); + if (error) + return "commit." + error; + } + } + if (message.listSnapshots != null && message.hasOwnProperty("listSnapshots")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + let error = $root.tendermint.abci.RequestListSnapshots.verify(message.listSnapshots); + if (error) + return "listSnapshots." + error; + } + } + if (message.offerSnapshot != null && message.hasOwnProperty("offerSnapshot")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + let error = $root.tendermint.abci.RequestOfferSnapshot.verify(message.offerSnapshot); + if (error) + return "offerSnapshot." + error; + } + } + if (message.loadSnapshotChunk != null && message.hasOwnProperty("loadSnapshotChunk")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + let error = $root.tendermint.abci.RequestLoadSnapshotChunk.verify(message.loadSnapshotChunk); + if (error) + return "loadSnapshotChunk." + error; + } + } + if (message.applySnapshotChunk != null && message.hasOwnProperty("applySnapshotChunk")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + let error = $root.tendermint.abci.RequestApplySnapshotChunk.verify(message.applySnapshotChunk); + if (error) + return "applySnapshotChunk." + error; + } + } + return null; + }; + + /** + * Creates a Request message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.Request + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.Request} Request + */ + Request.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.Request) + return object; + let message = new $root.tendermint.abci.Request(); + if (object.echo != null) { + if (typeof object.echo !== "object") + throw TypeError(".tendermint.abci.Request.echo: object expected"); + message.echo = $root.tendermint.abci.RequestEcho.fromObject(object.echo); + } + if (object.flush != null) { + if (typeof object.flush !== "object") + throw TypeError(".tendermint.abci.Request.flush: object expected"); + message.flush = $root.tendermint.abci.RequestFlush.fromObject(object.flush); + } + if (object.info != null) { + if (typeof object.info !== "object") + throw TypeError(".tendermint.abci.Request.info: object expected"); + message.info = $root.tendermint.abci.RequestInfo.fromObject(object.info); + } + if (object.setOption != null) { + if (typeof object.setOption !== "object") + throw TypeError(".tendermint.abci.Request.setOption: object expected"); + message.setOption = $root.tendermint.abci.RequestSetOption.fromObject(object.setOption); + } + if (object.initChain != null) { + if (typeof object.initChain !== "object") + throw TypeError(".tendermint.abci.Request.initChain: object expected"); + message.initChain = $root.tendermint.abci.RequestInitChain.fromObject(object.initChain); + } + if (object.query != null) { + if (typeof object.query !== "object") + throw TypeError(".tendermint.abci.Request.query: object expected"); + message.query = $root.tendermint.abci.RequestQuery.fromObject(object.query); + } + if (object.beginBlock != null) { + if (typeof object.beginBlock !== "object") + throw TypeError(".tendermint.abci.Request.beginBlock: object expected"); + message.beginBlock = $root.tendermint.abci.RequestBeginBlock.fromObject(object.beginBlock); + } + if (object.checkTx != null) { + if (typeof object.checkTx !== "object") + throw TypeError(".tendermint.abci.Request.checkTx: object expected"); + message.checkTx = $root.tendermint.abci.RequestCheckTx.fromObject(object.checkTx); + } + if (object.deliverTx != null) { + if (typeof object.deliverTx !== "object") + throw TypeError(".tendermint.abci.Request.deliverTx: object expected"); + message.deliverTx = $root.tendermint.abci.RequestDeliverTx.fromObject(object.deliverTx); + } + if (object.endBlock != null) { + if (typeof object.endBlock !== "object") + throw TypeError(".tendermint.abci.Request.endBlock: object expected"); + message.endBlock = $root.tendermint.abci.RequestEndBlock.fromObject(object.endBlock); + } + if (object.commit != null) { + if (typeof object.commit !== "object") + throw TypeError(".tendermint.abci.Request.commit: object expected"); + message.commit = $root.tendermint.abci.RequestCommit.fromObject(object.commit); + } + if (object.listSnapshots != null) { + if (typeof object.listSnapshots !== "object") + throw TypeError(".tendermint.abci.Request.listSnapshots: object expected"); + message.listSnapshots = $root.tendermint.abci.RequestListSnapshots.fromObject(object.listSnapshots); + } + if (object.offerSnapshot != null) { + if (typeof object.offerSnapshot !== "object") + throw TypeError(".tendermint.abci.Request.offerSnapshot: object expected"); + message.offerSnapshot = $root.tendermint.abci.RequestOfferSnapshot.fromObject(object.offerSnapshot); + } + if (object.loadSnapshotChunk != null) { + if (typeof object.loadSnapshotChunk !== "object") + throw TypeError(".tendermint.abci.Request.loadSnapshotChunk: object expected"); + message.loadSnapshotChunk = $root.tendermint.abci.RequestLoadSnapshotChunk.fromObject(object.loadSnapshotChunk); + } + if (object.applySnapshotChunk != null) { + if (typeof object.applySnapshotChunk !== "object") + throw TypeError(".tendermint.abci.Request.applySnapshotChunk: object expected"); + message.applySnapshotChunk = $root.tendermint.abci.RequestApplySnapshotChunk.fromObject(object.applySnapshotChunk); + } + return message; + }; + + /** + * Creates a plain object from a Request message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.Request + * @static + * @param {tendermint.abci.Request} message Request + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Request.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.echo != null && message.hasOwnProperty("echo")) { + object.echo = $root.tendermint.abci.RequestEcho.toObject(message.echo, options); + if (options.oneofs) + object.value = "echo"; + } + if (message.flush != null && message.hasOwnProperty("flush")) { + object.flush = $root.tendermint.abci.RequestFlush.toObject(message.flush, options); + if (options.oneofs) + object.value = "flush"; + } + if (message.info != null && message.hasOwnProperty("info")) { + object.info = $root.tendermint.abci.RequestInfo.toObject(message.info, options); + if (options.oneofs) + object.value = "info"; + } + if (message.setOption != null && message.hasOwnProperty("setOption")) { + object.setOption = $root.tendermint.abci.RequestSetOption.toObject(message.setOption, options); + if (options.oneofs) + object.value = "setOption"; + } + if (message.initChain != null && message.hasOwnProperty("initChain")) { + object.initChain = $root.tendermint.abci.RequestInitChain.toObject(message.initChain, options); + if (options.oneofs) + object.value = "initChain"; + } + if (message.query != null && message.hasOwnProperty("query")) { + object.query = $root.tendermint.abci.RequestQuery.toObject(message.query, options); + if (options.oneofs) + object.value = "query"; + } + if (message.beginBlock != null && message.hasOwnProperty("beginBlock")) { + object.beginBlock = $root.tendermint.abci.RequestBeginBlock.toObject(message.beginBlock, options); + if (options.oneofs) + object.value = "beginBlock"; + } + if (message.checkTx != null && message.hasOwnProperty("checkTx")) { + object.checkTx = $root.tendermint.abci.RequestCheckTx.toObject(message.checkTx, options); + if (options.oneofs) + object.value = "checkTx"; + } + if (message.deliverTx != null && message.hasOwnProperty("deliverTx")) { + object.deliverTx = $root.tendermint.abci.RequestDeliverTx.toObject(message.deliverTx, options); + if (options.oneofs) + object.value = "deliverTx"; + } + if (message.endBlock != null && message.hasOwnProperty("endBlock")) { + object.endBlock = $root.tendermint.abci.RequestEndBlock.toObject(message.endBlock, options); + if (options.oneofs) + object.value = "endBlock"; + } + if (message.commit != null && message.hasOwnProperty("commit")) { + object.commit = $root.tendermint.abci.RequestCommit.toObject(message.commit, options); + if (options.oneofs) + object.value = "commit"; + } + if (message.listSnapshots != null && message.hasOwnProperty("listSnapshots")) { + object.listSnapshots = $root.tendermint.abci.RequestListSnapshots.toObject(message.listSnapshots, options); + if (options.oneofs) + object.value = "listSnapshots"; + } + if (message.offerSnapshot != null && message.hasOwnProperty("offerSnapshot")) { + object.offerSnapshot = $root.tendermint.abci.RequestOfferSnapshot.toObject(message.offerSnapshot, options); + if (options.oneofs) + object.value = "offerSnapshot"; + } + if (message.loadSnapshotChunk != null && message.hasOwnProperty("loadSnapshotChunk")) { + object.loadSnapshotChunk = $root.tendermint.abci.RequestLoadSnapshotChunk.toObject(message.loadSnapshotChunk, options); + if (options.oneofs) + object.value = "loadSnapshotChunk"; + } + if (message.applySnapshotChunk != null && message.hasOwnProperty("applySnapshotChunk")) { + object.applySnapshotChunk = $root.tendermint.abci.RequestApplySnapshotChunk.toObject(message.applySnapshotChunk, options); + if (options.oneofs) + object.value = "applySnapshotChunk"; + } + return object; + }; + + /** + * Converts this Request to JSON. + * @function toJSON + * @memberof tendermint.abci.Request + * @instance + * @returns {Object.} JSON object + */ + Request.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Request; + })(abci.Request || {}); + + abci.RequestEcho = (function(RequestEcho) { + + /** + * Properties of a RequestEcho. + * @memberof tendermint.abci + * @interface IRequestEcho + * @property {string|null} [message] RequestEcho message + */ + + /** + * Constructs a new RequestEcho. + * @memberof tendermint.abci + * @classdesc Represents a RequestEcho. + * @implements IRequestEcho + * @constructor + * @param {tendermint.abci.IRequestEcho=} [properties] Properties to set + */ + function RequestEcho(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestEcho message. + * @member {string} message + * @memberof tendermint.abci.RequestEcho + * @instance + */ + RequestEcho.prototype.message = ""; + + /** + * Creates a new RequestEcho instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestEcho + * @static + * @param {tendermint.abci.IRequestEcho=} [properties] Properties to set + * @returns {tendermint.abci.RequestEcho} RequestEcho instance + */ + RequestEcho.create = function create(properties) { + return new RequestEcho(properties); + }; + + /** + * Encodes the specified RequestEcho message. Does not implicitly {@link tendermint.abci.RequestEcho.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestEcho + * @static + * @param {tendermint.abci.IRequestEcho} message RequestEcho message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestEcho.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + return writer; + }; + + /** + * Encodes the specified RequestEcho message, length delimited. Does not implicitly {@link tendermint.abci.RequestEcho.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestEcho + * @static + * @param {tendermint.abci.IRequestEcho} message RequestEcho message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestEcho.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestEcho message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestEcho + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestEcho} RequestEcho + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestEcho.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestEcho(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestEcho message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestEcho + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestEcho} RequestEcho + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestEcho.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestEcho message. + * @function verify + * @memberof tendermint.abci.RequestEcho + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestEcho.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + return null; + }; + + /** + * Creates a RequestEcho message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestEcho + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestEcho} RequestEcho + */ + RequestEcho.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestEcho) + return object; + let message = new $root.tendermint.abci.RequestEcho(); + if (object.message != null) + message.message = String(object.message); + return message; + }; + + /** + * Creates a plain object from a RequestEcho message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestEcho + * @static + * @param {tendermint.abci.RequestEcho} message RequestEcho + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestEcho.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.message = ""; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + return object; + }; + + /** + * Converts this RequestEcho to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestEcho + * @instance + * @returns {Object.} JSON object + */ + RequestEcho.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestEcho; + })(abci.RequestEcho || {}); + + abci.RequestFlush = (function(RequestFlush) { + + /** + * Properties of a RequestFlush. + * @memberof tendermint.abci + * @interface IRequestFlush + */ + + /** + * Constructs a new RequestFlush. + * @memberof tendermint.abci + * @classdesc Represents a RequestFlush. + * @implements IRequestFlush + * @constructor + * @param {tendermint.abci.IRequestFlush=} [properties] Properties to set + */ + function RequestFlush(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new RequestFlush instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestFlush + * @static + * @param {tendermint.abci.IRequestFlush=} [properties] Properties to set + * @returns {tendermint.abci.RequestFlush} RequestFlush instance + */ + RequestFlush.create = function create(properties) { + return new RequestFlush(properties); + }; + + /** + * Encodes the specified RequestFlush message. Does not implicitly {@link tendermint.abci.RequestFlush.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestFlush + * @static + * @param {tendermint.abci.IRequestFlush} message RequestFlush message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestFlush.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RequestFlush message, length delimited. Does not implicitly {@link tendermint.abci.RequestFlush.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestFlush + * @static + * @param {tendermint.abci.IRequestFlush} message RequestFlush message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestFlush.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestFlush message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestFlush + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestFlush} RequestFlush + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestFlush.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestFlush(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestFlush message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestFlush + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestFlush} RequestFlush + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestFlush.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestFlush message. + * @function verify + * @memberof tendermint.abci.RequestFlush + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestFlush.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RequestFlush message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestFlush + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestFlush} RequestFlush + */ + RequestFlush.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestFlush) + return object; + return new $root.tendermint.abci.RequestFlush(); + }; + + /** + * Creates a plain object from a RequestFlush message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestFlush + * @static + * @param {tendermint.abci.RequestFlush} message RequestFlush + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestFlush.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RequestFlush to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestFlush + * @instance + * @returns {Object.} JSON object + */ + RequestFlush.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestFlush; + })(abci.RequestFlush || {}); + + abci.RequestInfo = (function(RequestInfo) { + + /** + * Properties of a RequestInfo. + * @memberof tendermint.abci + * @interface IRequestInfo + * @property {string|null} [version] RequestInfo version + * @property {number|Long|null} [blockVersion] RequestInfo blockVersion + * @property {number|Long|null} [p2pVersion] RequestInfo p2pVersion + */ + + /** + * Constructs a new RequestInfo. + * @memberof tendermint.abci + * @classdesc Represents a RequestInfo. + * @implements IRequestInfo + * @constructor + * @param {tendermint.abci.IRequestInfo=} [properties] Properties to set + */ + function RequestInfo(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestInfo version. + * @member {string} version + * @memberof tendermint.abci.RequestInfo + * @instance + */ + RequestInfo.prototype.version = ""; + + /** + * RequestInfo blockVersion. + * @member {number|Long} blockVersion + * @memberof tendermint.abci.RequestInfo + * @instance + */ + RequestInfo.prototype.blockVersion = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * RequestInfo p2pVersion. + * @member {number|Long} p2pVersion + * @memberof tendermint.abci.RequestInfo + * @instance + */ + RequestInfo.prototype.p2pVersion = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new RequestInfo instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestInfo + * @static + * @param {tendermint.abci.IRequestInfo=} [properties] Properties to set + * @returns {tendermint.abci.RequestInfo} RequestInfo instance + */ + RequestInfo.create = function create(properties) { + return new RequestInfo(properties); + }; + + /** + * Encodes the specified RequestInfo message. Does not implicitly {@link tendermint.abci.RequestInfo.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestInfo + * @static + * @param {tendermint.abci.IRequestInfo} message RequestInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.blockVersion != null && Object.hasOwnProperty.call(message, "blockVersion")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.blockVersion); + if (message.p2pVersion != null && Object.hasOwnProperty.call(message, "p2pVersion")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.p2pVersion); + return writer; + }; + + /** + * Encodes the specified RequestInfo message, length delimited. Does not implicitly {@link tendermint.abci.RequestInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestInfo + * @static + * @param {tendermint.abci.IRequestInfo} message RequestInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestInfo message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestInfo} RequestInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestInfo(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.string(); + break; + case 2: + message.blockVersion = reader.uint64(); + break; + case 3: + message.p2pVersion = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestInfo} RequestInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestInfo message. + * @function verify + * @memberof tendermint.abci.RequestInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.blockVersion != null && message.hasOwnProperty("blockVersion")) + if (!$util.isInteger(message.blockVersion) && !(message.blockVersion && $util.isInteger(message.blockVersion.low) && $util.isInteger(message.blockVersion.high))) + return "blockVersion: integer|Long expected"; + if (message.p2pVersion != null && message.hasOwnProperty("p2pVersion")) + if (!$util.isInteger(message.p2pVersion) && !(message.p2pVersion && $util.isInteger(message.p2pVersion.low) && $util.isInteger(message.p2pVersion.high))) + return "p2pVersion: integer|Long expected"; + return null; + }; + + /** + * Creates a RequestInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestInfo + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestInfo} RequestInfo + */ + RequestInfo.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestInfo) + return object; + let message = new $root.tendermint.abci.RequestInfo(); + if (object.version != null) + message.version = String(object.version); + if (object.blockVersion != null) + if ($util.Long) + (message.blockVersion = $util.Long.fromValue(object.blockVersion)).unsigned = true; + else if (typeof object.blockVersion === "string") + message.blockVersion = parseInt(object.blockVersion, 10); + else if (typeof object.blockVersion === "number") + message.blockVersion = object.blockVersion; + else if (typeof object.blockVersion === "object") + message.blockVersion = new $util.LongBits(object.blockVersion.low >>> 0, object.blockVersion.high >>> 0).toNumber(true); + if (object.p2pVersion != null) + if ($util.Long) + (message.p2pVersion = $util.Long.fromValue(object.p2pVersion)).unsigned = true; + else if (typeof object.p2pVersion === "string") + message.p2pVersion = parseInt(object.p2pVersion, 10); + else if (typeof object.p2pVersion === "number") + message.p2pVersion = object.p2pVersion; + else if (typeof object.p2pVersion === "object") + message.p2pVersion = new $util.LongBits(object.p2pVersion.low >>> 0, object.p2pVersion.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a RequestInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestInfo + * @static + * @param {tendermint.abci.RequestInfo} message RequestInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.version = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.blockVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.blockVersion = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.p2pVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.p2pVersion = options.longs === String ? "0" : 0; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.blockVersion != null && message.hasOwnProperty("blockVersion")) + if (typeof message.blockVersion === "number") + object.blockVersion = options.longs === String ? String(message.blockVersion) : message.blockVersion; + else + object.blockVersion = options.longs === String ? $util.Long.prototype.toString.call(message.blockVersion) : options.longs === Number ? new $util.LongBits(message.blockVersion.low >>> 0, message.blockVersion.high >>> 0).toNumber(true) : message.blockVersion; + if (message.p2pVersion != null && message.hasOwnProperty("p2pVersion")) + if (typeof message.p2pVersion === "number") + object.p2pVersion = options.longs === String ? String(message.p2pVersion) : message.p2pVersion; + else + object.p2pVersion = options.longs === String ? $util.Long.prototype.toString.call(message.p2pVersion) : options.longs === Number ? new $util.LongBits(message.p2pVersion.low >>> 0, message.p2pVersion.high >>> 0).toNumber(true) : message.p2pVersion; + return object; + }; + + /** + * Converts this RequestInfo to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestInfo + * @instance + * @returns {Object.} JSON object + */ + RequestInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestInfo; + })(abci.RequestInfo || {}); + + abci.RequestSetOption = (function(RequestSetOption) { + + /** + * Properties of a RequestSetOption. + * @memberof tendermint.abci + * @interface IRequestSetOption + * @property {string|null} [key] RequestSetOption key + * @property {string|null} [value] RequestSetOption value + */ + + /** + * Constructs a new RequestSetOption. + * @memberof tendermint.abci + * @classdesc Represents a RequestSetOption. + * @implements IRequestSetOption + * @constructor + * @param {tendermint.abci.IRequestSetOption=} [properties] Properties to set + */ + function RequestSetOption(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestSetOption key. + * @member {string} key + * @memberof tendermint.abci.RequestSetOption + * @instance + */ + RequestSetOption.prototype.key = ""; + + /** + * RequestSetOption value. + * @member {string} value + * @memberof tendermint.abci.RequestSetOption + * @instance + */ + RequestSetOption.prototype.value = ""; + + /** + * Creates a new RequestSetOption instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestSetOption + * @static + * @param {tendermint.abci.IRequestSetOption=} [properties] Properties to set + * @returns {tendermint.abci.RequestSetOption} RequestSetOption instance + */ + RequestSetOption.create = function create(properties) { + return new RequestSetOption(properties); + }; + + /** + * Encodes the specified RequestSetOption message. Does not implicitly {@link tendermint.abci.RequestSetOption.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestSetOption + * @static + * @param {tendermint.abci.IRequestSetOption} message RequestSetOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestSetOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + return writer; + }; + + /** + * Encodes the specified RequestSetOption message, length delimited. Does not implicitly {@link tendermint.abci.RequestSetOption.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestSetOption + * @static + * @param {tendermint.abci.IRequestSetOption} message RequestSetOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestSetOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestSetOption message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestSetOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestSetOption} RequestSetOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestSetOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestSetOption(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestSetOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestSetOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestSetOption} RequestSetOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestSetOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestSetOption message. + * @function verify + * @memberof tendermint.abci.RequestSetOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestSetOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a RequestSetOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestSetOption + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestSetOption} RequestSetOption + */ + RequestSetOption.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestSetOption) + return object; + let message = new $root.tendermint.abci.RequestSetOption(); + if (object.key != null) + message.key = String(object.key); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a RequestSetOption message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestSetOption + * @static + * @param {tendermint.abci.RequestSetOption} message RequestSetOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestSetOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.key = ""; + object.value = ""; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this RequestSetOption to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestSetOption + * @instance + * @returns {Object.} JSON object + */ + RequestSetOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestSetOption; + })(abci.RequestSetOption || {}); + + abci.RequestInitChain = (function(RequestInitChain) { + + /** + * Properties of a RequestInitChain. + * @memberof tendermint.abci + * @interface IRequestInitChain + * @property {google.protobuf.ITimestamp|null} [time] RequestInitChain time + * @property {string|null} [chainId] RequestInitChain chainId + * @property {tendermint.abci.IConsensusParams|null} [consensusParams] RequestInitChain consensusParams + * @property {Array.|null} [validators] RequestInitChain validators + * @property {Uint8Array|null} [appStateBytes] RequestInitChain appStateBytes + * @property {number|Long|null} [initialHeight] RequestInitChain initialHeight + */ + + /** + * Constructs a new RequestInitChain. + * @memberof tendermint.abci + * @classdesc Represents a RequestInitChain. + * @implements IRequestInitChain + * @constructor + * @param {tendermint.abci.IRequestInitChain=} [properties] Properties to set + */ + function RequestInitChain(properties) { + this.validators = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestInitChain time. + * @member {google.protobuf.ITimestamp|null|undefined} time + * @memberof tendermint.abci.RequestInitChain + * @instance + */ + RequestInitChain.prototype.time = null; + + /** + * RequestInitChain chainId. + * @member {string} chainId + * @memberof tendermint.abci.RequestInitChain + * @instance + */ + RequestInitChain.prototype.chainId = ""; + + /** + * RequestInitChain consensusParams. + * @member {tendermint.abci.IConsensusParams|null|undefined} consensusParams + * @memberof tendermint.abci.RequestInitChain + * @instance + */ + RequestInitChain.prototype.consensusParams = null; + + /** + * RequestInitChain validators. + * @member {Array.} validators + * @memberof tendermint.abci.RequestInitChain + * @instance + */ + RequestInitChain.prototype.validators = $util.emptyArray; + + /** + * RequestInitChain appStateBytes. + * @member {Uint8Array} appStateBytes + * @memberof tendermint.abci.RequestInitChain + * @instance + */ + RequestInitChain.prototype.appStateBytes = $util.newBuffer([]); + + /** + * RequestInitChain initialHeight. + * @member {number|Long} initialHeight + * @memberof tendermint.abci.RequestInitChain + * @instance + */ + RequestInitChain.prototype.initialHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RequestInitChain instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestInitChain + * @static + * @param {tendermint.abci.IRequestInitChain=} [properties] Properties to set + * @returns {tendermint.abci.RequestInitChain} RequestInitChain instance + */ + RequestInitChain.create = function create(properties) { + return new RequestInitChain(properties); + }; + + /** + * Encodes the specified RequestInitChain message. Does not implicitly {@link tendermint.abci.RequestInitChain.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestInitChain + * @static + * @param {tendermint.abci.IRequestInitChain} message RequestInitChain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestInitChain.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.time != null && Object.hasOwnProperty.call(message, "time")) + $root.google.protobuf.Timestamp.encode(message.time, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.chainId != null && Object.hasOwnProperty.call(message, "chainId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.chainId); + if (message.consensusParams != null && Object.hasOwnProperty.call(message, "consensusParams")) + $root.tendermint.abci.ConsensusParams.encode(message.consensusParams, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.validators != null && message.validators.length) + for (let i = 0; i < message.validators.length; ++i) + $root.tendermint.abci.ValidatorUpdate.encode(message.validators[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.appStateBytes != null && Object.hasOwnProperty.call(message, "appStateBytes")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.appStateBytes); + if (message.initialHeight != null && Object.hasOwnProperty.call(message, "initialHeight")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.initialHeight); + return writer; + }; + + /** + * Encodes the specified RequestInitChain message, length delimited. Does not implicitly {@link tendermint.abci.RequestInitChain.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestInitChain + * @static + * @param {tendermint.abci.IRequestInitChain} message RequestInitChain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestInitChain.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestInitChain message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestInitChain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestInitChain} RequestInitChain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestInitChain.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestInitChain(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 2: + message.chainId = reader.string(); + break; + case 3: + message.consensusParams = $root.tendermint.abci.ConsensusParams.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.validators && message.validators.length)) + message.validators = []; + message.validators.push($root.tendermint.abci.ValidatorUpdate.decode(reader, reader.uint32())); + break; + case 5: + message.appStateBytes = reader.bytes(); + break; + case 6: + message.initialHeight = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestInitChain message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestInitChain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestInitChain} RequestInitChain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestInitChain.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestInitChain message. + * @function verify + * @memberof tendermint.abci.RequestInitChain + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestInitChain.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.time != null && message.hasOwnProperty("time")) { + let error = $root.google.protobuf.Timestamp.verify(message.time); + if (error) + return "time." + error; + } + if (message.chainId != null && message.hasOwnProperty("chainId")) + if (!$util.isString(message.chainId)) + return "chainId: string expected"; + if (message.consensusParams != null && message.hasOwnProperty("consensusParams")) { + let error = $root.tendermint.abci.ConsensusParams.verify(message.consensusParams); + if (error) + return "consensusParams." + error; + } + if (message.validators != null && message.hasOwnProperty("validators")) { + if (!Array.isArray(message.validators)) + return "validators: array expected"; + for (let i = 0; i < message.validators.length; ++i) { + let error = $root.tendermint.abci.ValidatorUpdate.verify(message.validators[i]); + if (error) + return "validators." + error; + } + } + if (message.appStateBytes != null && message.hasOwnProperty("appStateBytes")) + if (!(message.appStateBytes && typeof message.appStateBytes.length === "number" || $util.isString(message.appStateBytes))) + return "appStateBytes: buffer expected"; + if (message.initialHeight != null && message.hasOwnProperty("initialHeight")) + if (!$util.isInteger(message.initialHeight) && !(message.initialHeight && $util.isInteger(message.initialHeight.low) && $util.isInteger(message.initialHeight.high))) + return "initialHeight: integer|Long expected"; + return null; + }; + + /** + * Creates a RequestInitChain message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestInitChain + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestInitChain} RequestInitChain + */ + RequestInitChain.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestInitChain) + return object; + let message = new $root.tendermint.abci.RequestInitChain(); + if (object.time != null) { + if (typeof object.time !== "object") + throw TypeError(".tendermint.abci.RequestInitChain.time: object expected"); + message.time = $root.google.protobuf.Timestamp.fromObject(object.time); + } + if (object.chainId != null) + message.chainId = String(object.chainId); + if (object.consensusParams != null) { + if (typeof object.consensusParams !== "object") + throw TypeError(".tendermint.abci.RequestInitChain.consensusParams: object expected"); + message.consensusParams = $root.tendermint.abci.ConsensusParams.fromObject(object.consensusParams); + } + if (object.validators) { + if (!Array.isArray(object.validators)) + throw TypeError(".tendermint.abci.RequestInitChain.validators: array expected"); + message.validators = []; + for (let i = 0; i < object.validators.length; ++i) { + if (typeof object.validators[i] !== "object") + throw TypeError(".tendermint.abci.RequestInitChain.validators: object expected"); + message.validators[i] = $root.tendermint.abci.ValidatorUpdate.fromObject(object.validators[i]); + } + } + if (object.appStateBytes != null) + if (typeof object.appStateBytes === "string") + $util.base64.decode(object.appStateBytes, message.appStateBytes = $util.newBuffer($util.base64.length(object.appStateBytes)), 0); + else if (object.appStateBytes.length) + message.appStateBytes = object.appStateBytes; + if (object.initialHeight != null) + if ($util.Long) + (message.initialHeight = $util.Long.fromValue(object.initialHeight)).unsigned = false; + else if (typeof object.initialHeight === "string") + message.initialHeight = parseInt(object.initialHeight, 10); + else if (typeof object.initialHeight === "number") + message.initialHeight = object.initialHeight; + else if (typeof object.initialHeight === "object") + message.initialHeight = new $util.LongBits(object.initialHeight.low >>> 0, object.initialHeight.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a RequestInitChain message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestInitChain + * @static + * @param {tendermint.abci.RequestInitChain} message RequestInitChain + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestInitChain.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.validators = []; + if (options.defaults) { + object.time = null; + object.chainId = ""; + object.consensusParams = null; + if (options.bytes === String) + object.appStateBytes = ""; + else { + object.appStateBytes = []; + if (options.bytes !== Array) + object.appStateBytes = $util.newBuffer(object.appStateBytes); + } + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.initialHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.initialHeight = options.longs === String ? "0" : 0; + } + if (message.time != null && message.hasOwnProperty("time")) + object.time = $root.google.protobuf.Timestamp.toObject(message.time, options); + if (message.chainId != null && message.hasOwnProperty("chainId")) + object.chainId = message.chainId; + if (message.consensusParams != null && message.hasOwnProperty("consensusParams")) + object.consensusParams = $root.tendermint.abci.ConsensusParams.toObject(message.consensusParams, options); + if (message.validators && message.validators.length) { + object.validators = []; + for (let j = 0; j < message.validators.length; ++j) + object.validators[j] = $root.tendermint.abci.ValidatorUpdate.toObject(message.validators[j], options); + } + if (message.appStateBytes != null && message.hasOwnProperty("appStateBytes")) + object.appStateBytes = options.bytes === String ? $util.base64.encode(message.appStateBytes, 0, message.appStateBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.appStateBytes) : message.appStateBytes; + if (message.initialHeight != null && message.hasOwnProperty("initialHeight")) + if (typeof message.initialHeight === "number") + object.initialHeight = options.longs === String ? String(message.initialHeight) : message.initialHeight; + else + object.initialHeight = options.longs === String ? $util.Long.prototype.toString.call(message.initialHeight) : options.longs === Number ? new $util.LongBits(message.initialHeight.low >>> 0, message.initialHeight.high >>> 0).toNumber() : message.initialHeight; + return object; + }; + + /** + * Converts this RequestInitChain to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestInitChain + * @instance + * @returns {Object.} JSON object + */ + RequestInitChain.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestInitChain; + })(abci.RequestInitChain || {}); + + abci.RequestQuery = (function(RequestQuery) { + + /** + * Properties of a RequestQuery. + * @memberof tendermint.abci + * @interface IRequestQuery + * @property {Uint8Array|null} [data] RequestQuery data + * @property {string|null} [path] RequestQuery path + * @property {number|Long|null} [height] RequestQuery height + * @property {boolean|null} [prove] RequestQuery prove + */ + + /** + * Constructs a new RequestQuery. + * @memberof tendermint.abci + * @classdesc Represents a RequestQuery. + * @implements IRequestQuery + * @constructor + * @param {tendermint.abci.IRequestQuery=} [properties] Properties to set + */ + function RequestQuery(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestQuery data. + * @member {Uint8Array} data + * @memberof tendermint.abci.RequestQuery + * @instance + */ + RequestQuery.prototype.data = $util.newBuffer([]); + + /** + * RequestQuery path. + * @member {string} path + * @memberof tendermint.abci.RequestQuery + * @instance + */ + RequestQuery.prototype.path = ""; + + /** + * RequestQuery height. + * @member {number|Long} height + * @memberof tendermint.abci.RequestQuery + * @instance + */ + RequestQuery.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * RequestQuery prove. + * @member {boolean} prove + * @memberof tendermint.abci.RequestQuery + * @instance + */ + RequestQuery.prototype.prove = false; + + /** + * Creates a new RequestQuery instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestQuery + * @static + * @param {tendermint.abci.IRequestQuery=} [properties] Properties to set + * @returns {tendermint.abci.RequestQuery} RequestQuery instance + */ + RequestQuery.create = function create(properties) { + return new RequestQuery(properties); + }; + + /** + * Encodes the specified RequestQuery message. Does not implicitly {@link tendermint.abci.RequestQuery.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestQuery + * @static + * @param {tendermint.abci.IRequestQuery} message RequestQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestQuery.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.data); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.height); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified RequestQuery message, length delimited. Does not implicitly {@link tendermint.abci.RequestQuery.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestQuery + * @static + * @param {tendermint.abci.IRequestQuery} message RequestQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestQuery.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestQuery message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestQuery} RequestQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestQuery.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestQuery(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + case 2: + message.path = reader.string(); + break; + case 3: + message.height = reader.int64(); + break; + case 4: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestQuery message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestQuery} RequestQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestQuery.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestQuery message. + * @function verify + * @memberof tendermint.abci.RequestQuery + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestQuery.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a RequestQuery message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestQuery + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestQuery} RequestQuery + */ + RequestQuery.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestQuery) + return object; + let message = new $root.tendermint.abci.RequestQuery(); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length) + message.data = object.data; + if (object.path != null) + message.path = String(object.path); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a RequestQuery message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestQuery + * @static + * @param {tendermint.abci.RequestQuery} message RequestQuery + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestQuery.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + object.path = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.prove = false; + } + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this RequestQuery to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestQuery + * @instance + * @returns {Object.} JSON object + */ + RequestQuery.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestQuery; + })(abci.RequestQuery || {}); + + abci.RequestBeginBlock = (function(RequestBeginBlock) { + + /** + * Properties of a RequestBeginBlock. + * @memberof tendermint.abci + * @interface IRequestBeginBlock + * @property {Uint8Array|null} [hash] RequestBeginBlock hash + * @property {tendermint.types.IHeader|null} [header] RequestBeginBlock header + * @property {tendermint.abci.ILastCommitInfo|null} [lastCommitInfo] RequestBeginBlock lastCommitInfo + * @property {Array.|null} [byzantineValidators] RequestBeginBlock byzantineValidators + */ + + /** + * Constructs a new RequestBeginBlock. + * @memberof tendermint.abci + * @classdesc Represents a RequestBeginBlock. + * @implements IRequestBeginBlock + * @constructor + * @param {tendermint.abci.IRequestBeginBlock=} [properties] Properties to set + */ + function RequestBeginBlock(properties) { + this.byzantineValidators = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestBeginBlock hash. + * @member {Uint8Array} hash + * @memberof tendermint.abci.RequestBeginBlock + * @instance + */ + RequestBeginBlock.prototype.hash = $util.newBuffer([]); + + /** + * RequestBeginBlock header. + * @member {tendermint.types.IHeader|null|undefined} header + * @memberof tendermint.abci.RequestBeginBlock + * @instance + */ + RequestBeginBlock.prototype.header = null; + + /** + * RequestBeginBlock lastCommitInfo. + * @member {tendermint.abci.ILastCommitInfo|null|undefined} lastCommitInfo + * @memberof tendermint.abci.RequestBeginBlock + * @instance + */ + RequestBeginBlock.prototype.lastCommitInfo = null; + + /** + * RequestBeginBlock byzantineValidators. + * @member {Array.} byzantineValidators + * @memberof tendermint.abci.RequestBeginBlock + * @instance + */ + RequestBeginBlock.prototype.byzantineValidators = $util.emptyArray; + + /** + * Creates a new RequestBeginBlock instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestBeginBlock + * @static + * @param {tendermint.abci.IRequestBeginBlock=} [properties] Properties to set + * @returns {tendermint.abci.RequestBeginBlock} RequestBeginBlock instance + */ + RequestBeginBlock.create = function create(properties) { + return new RequestBeginBlock(properties); + }; + + /** + * Encodes the specified RequestBeginBlock message. Does not implicitly {@link tendermint.abci.RequestBeginBlock.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestBeginBlock + * @static + * @param {tendermint.abci.IRequestBeginBlock} message RequestBeginBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestBeginBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.hash); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + $root.tendermint.types.Header.encode(message.header, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.lastCommitInfo != null && Object.hasOwnProperty.call(message, "lastCommitInfo")) + $root.tendermint.abci.LastCommitInfo.encode(message.lastCommitInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.byzantineValidators != null && message.byzantineValidators.length) + for (let i = 0; i < message.byzantineValidators.length; ++i) + $root.tendermint.abci.Evidence.encode(message.byzantineValidators[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RequestBeginBlock message, length delimited. Does not implicitly {@link tendermint.abci.RequestBeginBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestBeginBlock + * @static + * @param {tendermint.abci.IRequestBeginBlock} message RequestBeginBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestBeginBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestBeginBlock message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestBeginBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestBeginBlock} RequestBeginBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestBeginBlock.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestBeginBlock(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.bytes(); + break; + case 2: + message.header = $root.tendermint.types.Header.decode(reader, reader.uint32()); + break; + case 3: + message.lastCommitInfo = $root.tendermint.abci.LastCommitInfo.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.byzantineValidators && message.byzantineValidators.length)) + message.byzantineValidators = []; + message.byzantineValidators.push($root.tendermint.abci.Evidence.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestBeginBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestBeginBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestBeginBlock} RequestBeginBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestBeginBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestBeginBlock message. + * @function verify + * @memberof tendermint.abci.RequestBeginBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestBeginBlock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash))) + return "hash: buffer expected"; + if (message.header != null && message.hasOwnProperty("header")) { + let error = $root.tendermint.types.Header.verify(message.header); + if (error) + return "header." + error; + } + if (message.lastCommitInfo != null && message.hasOwnProperty("lastCommitInfo")) { + let error = $root.tendermint.abci.LastCommitInfo.verify(message.lastCommitInfo); + if (error) + return "lastCommitInfo." + error; + } + if (message.byzantineValidators != null && message.hasOwnProperty("byzantineValidators")) { + if (!Array.isArray(message.byzantineValidators)) + return "byzantineValidators: array expected"; + for (let i = 0; i < message.byzantineValidators.length; ++i) { + let error = $root.tendermint.abci.Evidence.verify(message.byzantineValidators[i]); + if (error) + return "byzantineValidators." + error; + } + } + return null; + }; + + /** + * Creates a RequestBeginBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestBeginBlock + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestBeginBlock} RequestBeginBlock + */ + RequestBeginBlock.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestBeginBlock) + return object; + let message = new $root.tendermint.abci.RequestBeginBlock(); + if (object.hash != null) + if (typeof object.hash === "string") + $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0); + else if (object.hash.length) + message.hash = object.hash; + if (object.header != null) { + if (typeof object.header !== "object") + throw TypeError(".tendermint.abci.RequestBeginBlock.header: object expected"); + message.header = $root.tendermint.types.Header.fromObject(object.header); + } + if (object.lastCommitInfo != null) { + if (typeof object.lastCommitInfo !== "object") + throw TypeError(".tendermint.abci.RequestBeginBlock.lastCommitInfo: object expected"); + message.lastCommitInfo = $root.tendermint.abci.LastCommitInfo.fromObject(object.lastCommitInfo); + } + if (object.byzantineValidators) { + if (!Array.isArray(object.byzantineValidators)) + throw TypeError(".tendermint.abci.RequestBeginBlock.byzantineValidators: array expected"); + message.byzantineValidators = []; + for (let i = 0; i < object.byzantineValidators.length; ++i) { + if (typeof object.byzantineValidators[i] !== "object") + throw TypeError(".tendermint.abci.RequestBeginBlock.byzantineValidators: object expected"); + message.byzantineValidators[i] = $root.tendermint.abci.Evidence.fromObject(object.byzantineValidators[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RequestBeginBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestBeginBlock + * @static + * @param {tendermint.abci.RequestBeginBlock} message RequestBeginBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestBeginBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.byzantineValidators = []; + if (options.defaults) { + if (options.bytes === String) + object.hash = ""; + else { + object.hash = []; + if (options.bytes !== Array) + object.hash = $util.newBuffer(object.hash); + } + object.header = null; + object.lastCommitInfo = null; + } + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash; + if (message.header != null && message.hasOwnProperty("header")) + object.header = $root.tendermint.types.Header.toObject(message.header, options); + if (message.lastCommitInfo != null && message.hasOwnProperty("lastCommitInfo")) + object.lastCommitInfo = $root.tendermint.abci.LastCommitInfo.toObject(message.lastCommitInfo, options); + if (message.byzantineValidators && message.byzantineValidators.length) { + object.byzantineValidators = []; + for (let j = 0; j < message.byzantineValidators.length; ++j) + object.byzantineValidators[j] = $root.tendermint.abci.Evidence.toObject(message.byzantineValidators[j], options); + } + return object; + }; + + /** + * Converts this RequestBeginBlock to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestBeginBlock + * @instance + * @returns {Object.} JSON object + */ + RequestBeginBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestBeginBlock; + })(abci.RequestBeginBlock || {}); + + /** + * CheckTxType enum. + * @name tendermint.abci.CheckTxType + * @enum {string} + * @property {number} NEW=0 NEW value + * @property {number} RECHECK=1 RECHECK value + */ + abci.CheckTxType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NEW"] = 0; + values[valuesById[1] = "RECHECK"] = 1; + return values; + })(); + + abci.RequestCheckTx = (function(RequestCheckTx) { + + /** + * Properties of a RequestCheckTx. + * @memberof tendermint.abci + * @interface IRequestCheckTx + * @property {Uint8Array|null} [tx] RequestCheckTx tx + * @property {tendermint.abci.CheckTxType|null} [type] RequestCheckTx type + */ + + /** + * Constructs a new RequestCheckTx. + * @memberof tendermint.abci + * @classdesc Represents a RequestCheckTx. + * @implements IRequestCheckTx + * @constructor + * @param {tendermint.abci.IRequestCheckTx=} [properties] Properties to set + */ + function RequestCheckTx(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestCheckTx tx. + * @member {Uint8Array} tx + * @memberof tendermint.abci.RequestCheckTx + * @instance + */ + RequestCheckTx.prototype.tx = $util.newBuffer([]); + + /** + * RequestCheckTx type. + * @member {tendermint.abci.CheckTxType} type + * @memberof tendermint.abci.RequestCheckTx + * @instance + */ + RequestCheckTx.prototype.type = 0; + + /** + * Creates a new RequestCheckTx instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestCheckTx + * @static + * @param {tendermint.abci.IRequestCheckTx=} [properties] Properties to set + * @returns {tendermint.abci.RequestCheckTx} RequestCheckTx instance + */ + RequestCheckTx.create = function create(properties) { + return new RequestCheckTx(properties); + }; + + /** + * Encodes the specified RequestCheckTx message. Does not implicitly {@link tendermint.abci.RequestCheckTx.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestCheckTx + * @static + * @param {tendermint.abci.IRequestCheckTx} message RequestCheckTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestCheckTx.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tx != null && Object.hasOwnProperty.call(message, "tx")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tx); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + return writer; + }; + + /** + * Encodes the specified RequestCheckTx message, length delimited. Does not implicitly {@link tendermint.abci.RequestCheckTx.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestCheckTx + * @static + * @param {tendermint.abci.IRequestCheckTx} message RequestCheckTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestCheckTx.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestCheckTx message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestCheckTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestCheckTx} RequestCheckTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestCheckTx.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestCheckTx(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = reader.bytes(); + break; + case 2: + message.type = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestCheckTx message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestCheckTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestCheckTx} RequestCheckTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestCheckTx.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestCheckTx message. + * @function verify + * @memberof tendermint.abci.RequestCheckTx + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestCheckTx.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tx != null && message.hasOwnProperty("tx")) + if (!(message.tx && typeof message.tx.length === "number" || $util.isString(message.tx))) + return "tx: buffer expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a RequestCheckTx message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestCheckTx + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestCheckTx} RequestCheckTx + */ + RequestCheckTx.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestCheckTx) + return object; + let message = new $root.tendermint.abci.RequestCheckTx(); + if (object.tx != null) + if (typeof object.tx === "string") + $util.base64.decode(object.tx, message.tx = $util.newBuffer($util.base64.length(object.tx)), 0); + else if (object.tx.length) + message.tx = object.tx; + switch (object.type) { + case "NEW": + case 0: + message.type = 0; + break; + case "RECHECK": + case 1: + message.type = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a RequestCheckTx message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestCheckTx + * @static + * @param {tendermint.abci.RequestCheckTx} message RequestCheckTx + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestCheckTx.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if (options.bytes === String) + object.tx = ""; + else { + object.tx = []; + if (options.bytes !== Array) + object.tx = $util.newBuffer(object.tx); + } + object.type = options.enums === String ? "NEW" : 0; + } + if (message.tx != null && message.hasOwnProperty("tx")) + object.tx = options.bytes === String ? $util.base64.encode(message.tx, 0, message.tx.length) : options.bytes === Array ? Array.prototype.slice.call(message.tx) : message.tx; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.tendermint.abci.CheckTxType[message.type] : message.type; + return object; + }; + + /** + * Converts this RequestCheckTx to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestCheckTx + * @instance + * @returns {Object.} JSON object + */ + RequestCheckTx.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestCheckTx; + })(abci.RequestCheckTx || {}); + + abci.RequestDeliverTx = (function(RequestDeliverTx) { + + /** + * Properties of a RequestDeliverTx. + * @memberof tendermint.abci + * @interface IRequestDeliverTx + * @property {Uint8Array|null} [tx] RequestDeliverTx tx + */ + + /** + * Constructs a new RequestDeliverTx. + * @memberof tendermint.abci + * @classdesc Represents a RequestDeliverTx. + * @implements IRequestDeliverTx + * @constructor + * @param {tendermint.abci.IRequestDeliverTx=} [properties] Properties to set + */ + function RequestDeliverTx(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestDeliverTx tx. + * @member {Uint8Array} tx + * @memberof tendermint.abci.RequestDeliverTx + * @instance + */ + RequestDeliverTx.prototype.tx = $util.newBuffer([]); + + /** + * Creates a new RequestDeliverTx instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestDeliverTx + * @static + * @param {tendermint.abci.IRequestDeliverTx=} [properties] Properties to set + * @returns {tendermint.abci.RequestDeliverTx} RequestDeliverTx instance + */ + RequestDeliverTx.create = function create(properties) { + return new RequestDeliverTx(properties); + }; + + /** + * Encodes the specified RequestDeliverTx message. Does not implicitly {@link tendermint.abci.RequestDeliverTx.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestDeliverTx + * @static + * @param {tendermint.abci.IRequestDeliverTx} message RequestDeliverTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestDeliverTx.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tx != null && Object.hasOwnProperty.call(message, "tx")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tx); + return writer; + }; + + /** + * Encodes the specified RequestDeliverTx message, length delimited. Does not implicitly {@link tendermint.abci.RequestDeliverTx.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestDeliverTx + * @static + * @param {tendermint.abci.IRequestDeliverTx} message RequestDeliverTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestDeliverTx.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestDeliverTx message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestDeliverTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestDeliverTx} RequestDeliverTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestDeliverTx.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestDeliverTx(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestDeliverTx message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestDeliverTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestDeliverTx} RequestDeliverTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestDeliverTx.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestDeliverTx message. + * @function verify + * @memberof tendermint.abci.RequestDeliverTx + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestDeliverTx.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tx != null && message.hasOwnProperty("tx")) + if (!(message.tx && typeof message.tx.length === "number" || $util.isString(message.tx))) + return "tx: buffer expected"; + return null; + }; + + /** + * Creates a RequestDeliverTx message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestDeliverTx + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestDeliverTx} RequestDeliverTx + */ + RequestDeliverTx.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestDeliverTx) + return object; + let message = new $root.tendermint.abci.RequestDeliverTx(); + if (object.tx != null) + if (typeof object.tx === "string") + $util.base64.decode(object.tx, message.tx = $util.newBuffer($util.base64.length(object.tx)), 0); + else if (object.tx.length) + message.tx = object.tx; + return message; + }; + + /** + * Creates a plain object from a RequestDeliverTx message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestDeliverTx + * @static + * @param {tendermint.abci.RequestDeliverTx} message RequestDeliverTx + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestDeliverTx.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + if (options.bytes === String) + object.tx = ""; + else { + object.tx = []; + if (options.bytes !== Array) + object.tx = $util.newBuffer(object.tx); + } + if (message.tx != null && message.hasOwnProperty("tx")) + object.tx = options.bytes === String ? $util.base64.encode(message.tx, 0, message.tx.length) : options.bytes === Array ? Array.prototype.slice.call(message.tx) : message.tx; + return object; + }; + + /** + * Converts this RequestDeliverTx to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestDeliverTx + * @instance + * @returns {Object.} JSON object + */ + RequestDeliverTx.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestDeliverTx; + })(abci.RequestDeliverTx || {}); + + abci.RequestEndBlock = (function(RequestEndBlock) { + + /** + * Properties of a RequestEndBlock. + * @memberof tendermint.abci + * @interface IRequestEndBlock + * @property {number|Long|null} [height] RequestEndBlock height + */ + + /** + * Constructs a new RequestEndBlock. + * @memberof tendermint.abci + * @classdesc Represents a RequestEndBlock. + * @implements IRequestEndBlock + * @constructor + * @param {tendermint.abci.IRequestEndBlock=} [properties] Properties to set + */ + function RequestEndBlock(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestEndBlock height. + * @member {number|Long} height + * @memberof tendermint.abci.RequestEndBlock + * @instance + */ + RequestEndBlock.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RequestEndBlock instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestEndBlock + * @static + * @param {tendermint.abci.IRequestEndBlock=} [properties] Properties to set + * @returns {tendermint.abci.RequestEndBlock} RequestEndBlock instance + */ + RequestEndBlock.create = function create(properties) { + return new RequestEndBlock(properties); + }; + + /** + * Encodes the specified RequestEndBlock message. Does not implicitly {@link tendermint.abci.RequestEndBlock.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestEndBlock + * @static + * @param {tendermint.abci.IRequestEndBlock} message RequestEndBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestEndBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.height); + return writer; + }; + + /** + * Encodes the specified RequestEndBlock message, length delimited. Does not implicitly {@link tendermint.abci.RequestEndBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestEndBlock + * @static + * @param {tendermint.abci.IRequestEndBlock} message RequestEndBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestEndBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestEndBlock message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestEndBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestEndBlock} RequestEndBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestEndBlock.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestEndBlock(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestEndBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestEndBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestEndBlock} RequestEndBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestEndBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestEndBlock message. + * @function verify + * @memberof tendermint.abci.RequestEndBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestEndBlock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + return null; + }; + + /** + * Creates a RequestEndBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestEndBlock + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestEndBlock} RequestEndBlock + */ + RequestEndBlock.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestEndBlock) + return object; + let message = new $root.tendermint.abci.RequestEndBlock(); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a RequestEndBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestEndBlock + * @static + * @param {tendermint.abci.RequestEndBlock} message RequestEndBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestEndBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + return object; + }; + + /** + * Converts this RequestEndBlock to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestEndBlock + * @instance + * @returns {Object.} JSON object + */ + RequestEndBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestEndBlock; + })(abci.RequestEndBlock || {}); + + abci.RequestCommit = (function(RequestCommit) { + + /** + * Properties of a RequestCommit. + * @memberof tendermint.abci + * @interface IRequestCommit + */ + + /** + * Constructs a new RequestCommit. + * @memberof tendermint.abci + * @classdesc Represents a RequestCommit. + * @implements IRequestCommit + * @constructor + * @param {tendermint.abci.IRequestCommit=} [properties] Properties to set + */ + function RequestCommit(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new RequestCommit instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestCommit + * @static + * @param {tendermint.abci.IRequestCommit=} [properties] Properties to set + * @returns {tendermint.abci.RequestCommit} RequestCommit instance + */ + RequestCommit.create = function create(properties) { + return new RequestCommit(properties); + }; + + /** + * Encodes the specified RequestCommit message. Does not implicitly {@link tendermint.abci.RequestCommit.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestCommit + * @static + * @param {tendermint.abci.IRequestCommit} message RequestCommit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestCommit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RequestCommit message, length delimited. Does not implicitly {@link tendermint.abci.RequestCommit.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestCommit + * @static + * @param {tendermint.abci.IRequestCommit} message RequestCommit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestCommit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestCommit message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestCommit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestCommit} RequestCommit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestCommit.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestCommit(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestCommit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestCommit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestCommit} RequestCommit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestCommit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestCommit message. + * @function verify + * @memberof tendermint.abci.RequestCommit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestCommit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RequestCommit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestCommit + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestCommit} RequestCommit + */ + RequestCommit.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestCommit) + return object; + return new $root.tendermint.abci.RequestCommit(); + }; + + /** + * Creates a plain object from a RequestCommit message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestCommit + * @static + * @param {tendermint.abci.RequestCommit} message RequestCommit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestCommit.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RequestCommit to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestCommit + * @instance + * @returns {Object.} JSON object + */ + RequestCommit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestCommit; + })(abci.RequestCommit || {}); + + abci.RequestListSnapshots = (function(RequestListSnapshots) { + + /** + * Properties of a RequestListSnapshots. + * @memberof tendermint.abci + * @interface IRequestListSnapshots + */ + + /** + * Constructs a new RequestListSnapshots. + * @memberof tendermint.abci + * @classdesc Represents a RequestListSnapshots. + * @implements IRequestListSnapshots + * @constructor + * @param {tendermint.abci.IRequestListSnapshots=} [properties] Properties to set + */ + function RequestListSnapshots(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new RequestListSnapshots instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestListSnapshots + * @static + * @param {tendermint.abci.IRequestListSnapshots=} [properties] Properties to set + * @returns {tendermint.abci.RequestListSnapshots} RequestListSnapshots instance + */ + RequestListSnapshots.create = function create(properties) { + return new RequestListSnapshots(properties); + }; + + /** + * Encodes the specified RequestListSnapshots message. Does not implicitly {@link tendermint.abci.RequestListSnapshots.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestListSnapshots + * @static + * @param {tendermint.abci.IRequestListSnapshots} message RequestListSnapshots message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestListSnapshots.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RequestListSnapshots message, length delimited. Does not implicitly {@link tendermint.abci.RequestListSnapshots.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestListSnapshots + * @static + * @param {tendermint.abci.IRequestListSnapshots} message RequestListSnapshots message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestListSnapshots.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestListSnapshots message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestListSnapshots + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestListSnapshots} RequestListSnapshots + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestListSnapshots.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestListSnapshots(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestListSnapshots message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestListSnapshots + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestListSnapshots} RequestListSnapshots + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestListSnapshots.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestListSnapshots message. + * @function verify + * @memberof tendermint.abci.RequestListSnapshots + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestListSnapshots.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RequestListSnapshots message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestListSnapshots + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestListSnapshots} RequestListSnapshots + */ + RequestListSnapshots.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestListSnapshots) + return object; + return new $root.tendermint.abci.RequestListSnapshots(); + }; + + /** + * Creates a plain object from a RequestListSnapshots message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestListSnapshots + * @static + * @param {tendermint.abci.RequestListSnapshots} message RequestListSnapshots + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestListSnapshots.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RequestListSnapshots to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestListSnapshots + * @instance + * @returns {Object.} JSON object + */ + RequestListSnapshots.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestListSnapshots; + })(abci.RequestListSnapshots || {}); + + abci.RequestOfferSnapshot = (function(RequestOfferSnapshot) { + + /** + * Properties of a RequestOfferSnapshot. + * @memberof tendermint.abci + * @interface IRequestOfferSnapshot + * @property {tendermint.abci.ISnapshot|null} [snapshot] RequestOfferSnapshot snapshot + * @property {Uint8Array|null} [appHash] RequestOfferSnapshot appHash + */ + + /** + * Constructs a new RequestOfferSnapshot. + * @memberof tendermint.abci + * @classdesc Represents a RequestOfferSnapshot. + * @implements IRequestOfferSnapshot + * @constructor + * @param {tendermint.abci.IRequestOfferSnapshot=} [properties] Properties to set + */ + function RequestOfferSnapshot(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestOfferSnapshot snapshot. + * @member {tendermint.abci.ISnapshot|null|undefined} snapshot + * @memberof tendermint.abci.RequestOfferSnapshot + * @instance + */ + RequestOfferSnapshot.prototype.snapshot = null; + + /** + * RequestOfferSnapshot appHash. + * @member {Uint8Array} appHash + * @memberof tendermint.abci.RequestOfferSnapshot + * @instance + */ + RequestOfferSnapshot.prototype.appHash = $util.newBuffer([]); + + /** + * Creates a new RequestOfferSnapshot instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestOfferSnapshot + * @static + * @param {tendermint.abci.IRequestOfferSnapshot=} [properties] Properties to set + * @returns {tendermint.abci.RequestOfferSnapshot} RequestOfferSnapshot instance + */ + RequestOfferSnapshot.create = function create(properties) { + return new RequestOfferSnapshot(properties); + }; + + /** + * Encodes the specified RequestOfferSnapshot message. Does not implicitly {@link tendermint.abci.RequestOfferSnapshot.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestOfferSnapshot + * @static + * @param {tendermint.abci.IRequestOfferSnapshot} message RequestOfferSnapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestOfferSnapshot.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) + $root.tendermint.abci.Snapshot.encode(message.snapshot, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.appHash != null && Object.hasOwnProperty.call(message, "appHash")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.appHash); + return writer; + }; + + /** + * Encodes the specified RequestOfferSnapshot message, length delimited. Does not implicitly {@link tendermint.abci.RequestOfferSnapshot.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestOfferSnapshot + * @static + * @param {tendermint.abci.IRequestOfferSnapshot} message RequestOfferSnapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestOfferSnapshot.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestOfferSnapshot message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestOfferSnapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestOfferSnapshot} RequestOfferSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestOfferSnapshot.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestOfferSnapshot(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.snapshot = $root.tendermint.abci.Snapshot.decode(reader, reader.uint32()); + break; + case 2: + message.appHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestOfferSnapshot message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestOfferSnapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestOfferSnapshot} RequestOfferSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestOfferSnapshot.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestOfferSnapshot message. + * @function verify + * @memberof tendermint.abci.RequestOfferSnapshot + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestOfferSnapshot.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.snapshot != null && message.hasOwnProperty("snapshot")) { + let error = $root.tendermint.abci.Snapshot.verify(message.snapshot); + if (error) + return "snapshot." + error; + } + if (message.appHash != null && message.hasOwnProperty("appHash")) + if (!(message.appHash && typeof message.appHash.length === "number" || $util.isString(message.appHash))) + return "appHash: buffer expected"; + return null; + }; + + /** + * Creates a RequestOfferSnapshot message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestOfferSnapshot + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestOfferSnapshot} RequestOfferSnapshot + */ + RequestOfferSnapshot.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestOfferSnapshot) + return object; + let message = new $root.tendermint.abci.RequestOfferSnapshot(); + if (object.snapshot != null) { + if (typeof object.snapshot !== "object") + throw TypeError(".tendermint.abci.RequestOfferSnapshot.snapshot: object expected"); + message.snapshot = $root.tendermint.abci.Snapshot.fromObject(object.snapshot); + } + if (object.appHash != null) + if (typeof object.appHash === "string") + $util.base64.decode(object.appHash, message.appHash = $util.newBuffer($util.base64.length(object.appHash)), 0); + else if (object.appHash.length) + message.appHash = object.appHash; + return message; + }; + + /** + * Creates a plain object from a RequestOfferSnapshot message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestOfferSnapshot + * @static + * @param {tendermint.abci.RequestOfferSnapshot} message RequestOfferSnapshot + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestOfferSnapshot.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.snapshot = null; + if (options.bytes === String) + object.appHash = ""; + else { + object.appHash = []; + if (options.bytes !== Array) + object.appHash = $util.newBuffer(object.appHash); + } + } + if (message.snapshot != null && message.hasOwnProperty("snapshot")) + object.snapshot = $root.tendermint.abci.Snapshot.toObject(message.snapshot, options); + if (message.appHash != null && message.hasOwnProperty("appHash")) + object.appHash = options.bytes === String ? $util.base64.encode(message.appHash, 0, message.appHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.appHash) : message.appHash; + return object; + }; + + /** + * Converts this RequestOfferSnapshot to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestOfferSnapshot + * @instance + * @returns {Object.} JSON object + */ + RequestOfferSnapshot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestOfferSnapshot; + })(abci.RequestOfferSnapshot || {}); + + abci.RequestLoadSnapshotChunk = (function(RequestLoadSnapshotChunk) { + + /** + * Properties of a RequestLoadSnapshotChunk. + * @memberof tendermint.abci + * @interface IRequestLoadSnapshotChunk + * @property {number|Long|null} [height] RequestLoadSnapshotChunk height + * @property {number|null} [format] RequestLoadSnapshotChunk format + * @property {number|null} [chunk] RequestLoadSnapshotChunk chunk + */ + + /** + * Constructs a new RequestLoadSnapshotChunk. + * @memberof tendermint.abci + * @classdesc Represents a RequestLoadSnapshotChunk. + * @implements IRequestLoadSnapshotChunk + * @constructor + * @param {tendermint.abci.IRequestLoadSnapshotChunk=} [properties] Properties to set + */ + function RequestLoadSnapshotChunk(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestLoadSnapshotChunk height. + * @member {number|Long} height + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @instance + */ + RequestLoadSnapshotChunk.prototype.height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * RequestLoadSnapshotChunk format. + * @member {number} format + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @instance + */ + RequestLoadSnapshotChunk.prototype.format = 0; + + /** + * RequestLoadSnapshotChunk chunk. + * @member {number} chunk + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @instance + */ + RequestLoadSnapshotChunk.prototype.chunk = 0; + + /** + * Creates a new RequestLoadSnapshotChunk instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @static + * @param {tendermint.abci.IRequestLoadSnapshotChunk=} [properties] Properties to set + * @returns {tendermint.abci.RequestLoadSnapshotChunk} RequestLoadSnapshotChunk instance + */ + RequestLoadSnapshotChunk.create = function create(properties) { + return new RequestLoadSnapshotChunk(properties); + }; + + /** + * Encodes the specified RequestLoadSnapshotChunk message. Does not implicitly {@link tendermint.abci.RequestLoadSnapshotChunk.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @static + * @param {tendermint.abci.IRequestLoadSnapshotChunk} message RequestLoadSnapshotChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestLoadSnapshotChunk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.height); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.format); + if (message.chunk != null && Object.hasOwnProperty.call(message, "chunk")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.chunk); + return writer; + }; + + /** + * Encodes the specified RequestLoadSnapshotChunk message, length delimited. Does not implicitly {@link tendermint.abci.RequestLoadSnapshotChunk.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @static + * @param {tendermint.abci.IRequestLoadSnapshotChunk} message RequestLoadSnapshotChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestLoadSnapshotChunk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestLoadSnapshotChunk message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestLoadSnapshotChunk} RequestLoadSnapshotChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestLoadSnapshotChunk.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestLoadSnapshotChunk(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.uint64(); + break; + case 2: + message.format = reader.uint32(); + break; + case 3: + message.chunk = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestLoadSnapshotChunk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestLoadSnapshotChunk} RequestLoadSnapshotChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestLoadSnapshotChunk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestLoadSnapshotChunk message. + * @function verify + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestLoadSnapshotChunk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.format != null && message.hasOwnProperty("format")) + if (!$util.isInteger(message.format)) + return "format: integer expected"; + if (message.chunk != null && message.hasOwnProperty("chunk")) + if (!$util.isInteger(message.chunk)) + return "chunk: integer expected"; + return null; + }; + + /** + * Creates a RequestLoadSnapshotChunk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestLoadSnapshotChunk} RequestLoadSnapshotChunk + */ + RequestLoadSnapshotChunk.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestLoadSnapshotChunk) + return object; + let message = new $root.tendermint.abci.RequestLoadSnapshotChunk(); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = true; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(true); + if (object.format != null) + message.format = object.format >>> 0; + if (object.chunk != null) + message.chunk = object.chunk >>> 0; + return message; + }; + + /** + * Creates a plain object from a RequestLoadSnapshotChunk message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @static + * @param {tendermint.abci.RequestLoadSnapshotChunk} message RequestLoadSnapshotChunk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestLoadSnapshotChunk.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.format = 0; + object.chunk = 0; + } + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber(true) : message.height; + if (message.format != null && message.hasOwnProperty("format")) + object.format = message.format; + if (message.chunk != null && message.hasOwnProperty("chunk")) + object.chunk = message.chunk; + return object; + }; + + /** + * Converts this RequestLoadSnapshotChunk to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestLoadSnapshotChunk + * @instance + * @returns {Object.} JSON object + */ + RequestLoadSnapshotChunk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestLoadSnapshotChunk; + })(abci.RequestLoadSnapshotChunk || {}); + + abci.RequestApplySnapshotChunk = (function(RequestApplySnapshotChunk) { + + /** + * Properties of a RequestApplySnapshotChunk. + * @memberof tendermint.abci + * @interface IRequestApplySnapshotChunk + * @property {number|null} [index] RequestApplySnapshotChunk index + * @property {Uint8Array|null} [chunk] RequestApplySnapshotChunk chunk + * @property {string|null} [sender] RequestApplySnapshotChunk sender + */ + + /** + * Constructs a new RequestApplySnapshotChunk. + * @memberof tendermint.abci + * @classdesc Represents a RequestApplySnapshotChunk. + * @implements IRequestApplySnapshotChunk + * @constructor + * @param {tendermint.abci.IRequestApplySnapshotChunk=} [properties] Properties to set + */ + function RequestApplySnapshotChunk(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestApplySnapshotChunk index. + * @member {number} index + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @instance + */ + RequestApplySnapshotChunk.prototype.index = 0; + + /** + * RequestApplySnapshotChunk chunk. + * @member {Uint8Array} chunk + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @instance + */ + RequestApplySnapshotChunk.prototype.chunk = $util.newBuffer([]); + + /** + * RequestApplySnapshotChunk sender. + * @member {string} sender + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @instance + */ + RequestApplySnapshotChunk.prototype.sender = ""; + + /** + * Creates a new RequestApplySnapshotChunk instance using the specified properties. + * @function create + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @static + * @param {tendermint.abci.IRequestApplySnapshotChunk=} [properties] Properties to set + * @returns {tendermint.abci.RequestApplySnapshotChunk} RequestApplySnapshotChunk instance + */ + RequestApplySnapshotChunk.create = function create(properties) { + return new RequestApplySnapshotChunk(properties); + }; + + /** + * Encodes the specified RequestApplySnapshotChunk message. Does not implicitly {@link tendermint.abci.RequestApplySnapshotChunk.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @static + * @param {tendermint.abci.IRequestApplySnapshotChunk} message RequestApplySnapshotChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestApplySnapshotChunk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.index); + if (message.chunk != null && Object.hasOwnProperty.call(message, "chunk")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.chunk); + if (message.sender != null && Object.hasOwnProperty.call(message, "sender")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sender); + return writer; + }; + + /** + * Encodes the specified RequestApplySnapshotChunk message, length delimited. Does not implicitly {@link tendermint.abci.RequestApplySnapshotChunk.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @static + * @param {tendermint.abci.IRequestApplySnapshotChunk} message RequestApplySnapshotChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestApplySnapshotChunk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestApplySnapshotChunk message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.RequestApplySnapshotChunk} RequestApplySnapshotChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestApplySnapshotChunk.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestApplySnapshotChunk(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.uint32(); + break; + case 2: + message.chunk = reader.bytes(); + break; + case 3: + message.sender = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestApplySnapshotChunk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.RequestApplySnapshotChunk} RequestApplySnapshotChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestApplySnapshotChunk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestApplySnapshotChunk message. + * @function verify + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestApplySnapshotChunk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index)) + return "index: integer expected"; + if (message.chunk != null && message.hasOwnProperty("chunk")) + if (!(message.chunk && typeof message.chunk.length === "number" || $util.isString(message.chunk))) + return "chunk: buffer expected"; + if (message.sender != null && message.hasOwnProperty("sender")) + if (!$util.isString(message.sender)) + return "sender: string expected"; + return null; + }; + + /** + * Creates a RequestApplySnapshotChunk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.RequestApplySnapshotChunk} RequestApplySnapshotChunk + */ + RequestApplySnapshotChunk.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.RequestApplySnapshotChunk) + return object; + let message = new $root.tendermint.abci.RequestApplySnapshotChunk(); + if (object.index != null) + message.index = object.index >>> 0; + if (object.chunk != null) + if (typeof object.chunk === "string") + $util.base64.decode(object.chunk, message.chunk = $util.newBuffer($util.base64.length(object.chunk)), 0); + else if (object.chunk.length) + message.chunk = object.chunk; + if (object.sender != null) + message.sender = String(object.sender); + return message; + }; + + /** + * Creates a plain object from a RequestApplySnapshotChunk message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @static + * @param {tendermint.abci.RequestApplySnapshotChunk} message RequestApplySnapshotChunk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestApplySnapshotChunk.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.index = 0; + if (options.bytes === String) + object.chunk = ""; + else { + object.chunk = []; + if (options.bytes !== Array) + object.chunk = $util.newBuffer(object.chunk); + } + object.sender = ""; + } + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + if (message.chunk != null && message.hasOwnProperty("chunk")) + object.chunk = options.bytes === String ? $util.base64.encode(message.chunk, 0, message.chunk.length) : options.bytes === Array ? Array.prototype.slice.call(message.chunk) : message.chunk; + if (message.sender != null && message.hasOwnProperty("sender")) + object.sender = message.sender; + return object; + }; + + /** + * Converts this RequestApplySnapshotChunk to JSON. + * @function toJSON + * @memberof tendermint.abci.RequestApplySnapshotChunk + * @instance + * @returns {Object.} JSON object + */ + RequestApplySnapshotChunk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestApplySnapshotChunk; + })(abci.RequestApplySnapshotChunk || {}); + + abci.Response = (function(Response) { + + /** + * Properties of a Response. + * @memberof tendermint.abci + * @interface IResponse + * @property {tendermint.abci.IResponseException|null} [exception] Response exception + * @property {tendermint.abci.IResponseEcho|null} [echo] Response echo + * @property {tendermint.abci.IResponseFlush|null} [flush] Response flush + * @property {tendermint.abci.IResponseInfo|null} [info] Response info + * @property {tendermint.abci.IResponseSetOption|null} [setOption] Response setOption + * @property {tendermint.abci.IResponseInitChain|null} [initChain] Response initChain + * @property {tendermint.abci.IResponseQuery|null} [query] Response query + * @property {tendermint.abci.IResponseBeginBlock|null} [beginBlock] Response beginBlock + * @property {tendermint.abci.IResponseCheckTx|null} [checkTx] Response checkTx + * @property {tendermint.abci.IResponseDeliverTx|null} [deliverTx] Response deliverTx + * @property {tendermint.abci.IResponseEndBlock|null} [endBlock] Response endBlock + * @property {tendermint.abci.IResponseCommit|null} [commit] Response commit + * @property {tendermint.abci.IResponseListSnapshots|null} [listSnapshots] Response listSnapshots + * @property {tendermint.abci.IResponseOfferSnapshot|null} [offerSnapshot] Response offerSnapshot + * @property {tendermint.abci.IResponseLoadSnapshotChunk|null} [loadSnapshotChunk] Response loadSnapshotChunk + * @property {tendermint.abci.IResponseApplySnapshotChunk|null} [applySnapshotChunk] Response applySnapshotChunk + */ + + /** + * Constructs a new Response. + * @memberof tendermint.abci + * @classdesc Represents a Response. + * @implements IResponse + * @constructor + * @param {tendermint.abci.IResponse=} [properties] Properties to set + */ + function Response(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Response exception. + * @member {tendermint.abci.IResponseException|null|undefined} exception + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.exception = null; + + /** + * Response echo. + * @member {tendermint.abci.IResponseEcho|null|undefined} echo + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.echo = null; + + /** + * Response flush. + * @member {tendermint.abci.IResponseFlush|null|undefined} flush + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.flush = null; + + /** + * Response info. + * @member {tendermint.abci.IResponseInfo|null|undefined} info + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.info = null; + + /** + * Response setOption. + * @member {tendermint.abci.IResponseSetOption|null|undefined} setOption + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.setOption = null; + + /** + * Response initChain. + * @member {tendermint.abci.IResponseInitChain|null|undefined} initChain + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.initChain = null; + + /** + * Response query. + * @member {tendermint.abci.IResponseQuery|null|undefined} query + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.query = null; + + /** + * Response beginBlock. + * @member {tendermint.abci.IResponseBeginBlock|null|undefined} beginBlock + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.beginBlock = null; + + /** + * Response checkTx. + * @member {tendermint.abci.IResponseCheckTx|null|undefined} checkTx + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.checkTx = null; + + /** + * Response deliverTx. + * @member {tendermint.abci.IResponseDeliverTx|null|undefined} deliverTx + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.deliverTx = null; + + /** + * Response endBlock. + * @member {tendermint.abci.IResponseEndBlock|null|undefined} endBlock + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.endBlock = null; + + /** + * Response commit. + * @member {tendermint.abci.IResponseCommit|null|undefined} commit + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.commit = null; + + /** + * Response listSnapshots. + * @member {tendermint.abci.IResponseListSnapshots|null|undefined} listSnapshots + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.listSnapshots = null; + + /** + * Response offerSnapshot. + * @member {tendermint.abci.IResponseOfferSnapshot|null|undefined} offerSnapshot + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.offerSnapshot = null; + + /** + * Response loadSnapshotChunk. + * @member {tendermint.abci.IResponseLoadSnapshotChunk|null|undefined} loadSnapshotChunk + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.loadSnapshotChunk = null; + + /** + * Response applySnapshotChunk. + * @member {tendermint.abci.IResponseApplySnapshotChunk|null|undefined} applySnapshotChunk + * @memberof tendermint.abci.Response + * @instance + */ + Response.prototype.applySnapshotChunk = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Response value. + * @member {"exception"|"echo"|"flush"|"info"|"setOption"|"initChain"|"query"|"beginBlock"|"checkTx"|"deliverTx"|"endBlock"|"commit"|"listSnapshots"|"offerSnapshot"|"loadSnapshotChunk"|"applySnapshotChunk"|undefined} value + * @memberof tendermint.abci.Response + * @instance + */ + Object.defineProperty(Response.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["exception", "echo", "flush", "info", "setOption", "initChain", "query", "beginBlock", "checkTx", "deliverTx", "endBlock", "commit", "listSnapshots", "offerSnapshot", "loadSnapshotChunk", "applySnapshotChunk"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Response instance using the specified properties. + * @function create + * @memberof tendermint.abci.Response + * @static + * @param {tendermint.abci.IResponse=} [properties] Properties to set + * @returns {tendermint.abci.Response} Response instance + */ + Response.create = function create(properties) { + return new Response(properties); + }; + + /** + * Encodes the specified Response message. Does not implicitly {@link tendermint.abci.Response.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.Response + * @static + * @param {tendermint.abci.IResponse} message Response message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Response.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.exception != null && Object.hasOwnProperty.call(message, "exception")) + $root.tendermint.abci.ResponseException.encode(message.exception, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.echo != null && Object.hasOwnProperty.call(message, "echo")) + $root.tendermint.abci.ResponseEcho.encode(message.echo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.flush != null && Object.hasOwnProperty.call(message, "flush")) + $root.tendermint.abci.ResponseFlush.encode(message.flush, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.info != null && Object.hasOwnProperty.call(message, "info")) + $root.tendermint.abci.ResponseInfo.encode(message.info, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.setOption != null && Object.hasOwnProperty.call(message, "setOption")) + $root.tendermint.abci.ResponseSetOption.encode(message.setOption, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.initChain != null && Object.hasOwnProperty.call(message, "initChain")) + $root.tendermint.abci.ResponseInitChain.encode(message.initChain, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + $root.tendermint.abci.ResponseQuery.encode(message.query, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.beginBlock != null && Object.hasOwnProperty.call(message, "beginBlock")) + $root.tendermint.abci.ResponseBeginBlock.encode(message.beginBlock, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.checkTx != null && Object.hasOwnProperty.call(message, "checkTx")) + $root.tendermint.abci.ResponseCheckTx.encode(message.checkTx, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.deliverTx != null && Object.hasOwnProperty.call(message, "deliverTx")) + $root.tendermint.abci.ResponseDeliverTx.encode(message.deliverTx, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.endBlock != null && Object.hasOwnProperty.call(message, "endBlock")) + $root.tendermint.abci.ResponseEndBlock.encode(message.endBlock, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.commit != null && Object.hasOwnProperty.call(message, "commit")) + $root.tendermint.abci.ResponseCommit.encode(message.commit, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.listSnapshots != null && Object.hasOwnProperty.call(message, "listSnapshots")) + $root.tendermint.abci.ResponseListSnapshots.encode(message.listSnapshots, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.offerSnapshot != null && Object.hasOwnProperty.call(message, "offerSnapshot")) + $root.tendermint.abci.ResponseOfferSnapshot.encode(message.offerSnapshot, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.loadSnapshotChunk != null && Object.hasOwnProperty.call(message, "loadSnapshotChunk")) + $root.tendermint.abci.ResponseLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.applySnapshotChunk != null && Object.hasOwnProperty.call(message, "applySnapshotChunk")) + $root.tendermint.abci.ResponseApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Response message, length delimited. Does not implicitly {@link tendermint.abci.Response.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.Response + * @static + * @param {tendermint.abci.IResponse} message Response message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Response.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Response message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.Response + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.Response} Response + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Response.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.Response(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exception = $root.tendermint.abci.ResponseException.decode(reader, reader.uint32()); + break; + case 2: + message.echo = $root.tendermint.abci.ResponseEcho.decode(reader, reader.uint32()); + break; + case 3: + message.flush = $root.tendermint.abci.ResponseFlush.decode(reader, reader.uint32()); + break; + case 4: + message.info = $root.tendermint.abci.ResponseInfo.decode(reader, reader.uint32()); + break; + case 5: + message.setOption = $root.tendermint.abci.ResponseSetOption.decode(reader, reader.uint32()); + break; + case 6: + message.initChain = $root.tendermint.abci.ResponseInitChain.decode(reader, reader.uint32()); + break; + case 7: + message.query = $root.tendermint.abci.ResponseQuery.decode(reader, reader.uint32()); + break; + case 8: + message.beginBlock = $root.tendermint.abci.ResponseBeginBlock.decode(reader, reader.uint32()); + break; + case 9: + message.checkTx = $root.tendermint.abci.ResponseCheckTx.decode(reader, reader.uint32()); + break; + case 10: + message.deliverTx = $root.tendermint.abci.ResponseDeliverTx.decode(reader, reader.uint32()); + break; + case 11: + message.endBlock = $root.tendermint.abci.ResponseEndBlock.decode(reader, reader.uint32()); + break; + case 12: + message.commit = $root.tendermint.abci.ResponseCommit.decode(reader, reader.uint32()); + break; + case 13: + message.listSnapshots = $root.tendermint.abci.ResponseListSnapshots.decode(reader, reader.uint32()); + break; + case 14: + message.offerSnapshot = $root.tendermint.abci.ResponseOfferSnapshot.decode(reader, reader.uint32()); + break; + case 15: + message.loadSnapshotChunk = $root.tendermint.abci.ResponseLoadSnapshotChunk.decode(reader, reader.uint32()); + break; + case 16: + message.applySnapshotChunk = $root.tendermint.abci.ResponseApplySnapshotChunk.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Response message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.Response + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.Response} Response + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Response.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Response message. + * @function verify + * @memberof tendermint.abci.Response + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Response.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + let properties = {}; + if (message.exception != null && message.hasOwnProperty("exception")) { + properties.value = 1; + { + let error = $root.tendermint.abci.ResponseException.verify(message.exception); + if (error) + return "exception." + error; + } + } + if (message.echo != null && message.hasOwnProperty("echo")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + let error = $root.tendermint.abci.ResponseEcho.verify(message.echo); + if (error) + return "echo." + error; + } + } + if (message.flush != null && message.hasOwnProperty("flush")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + let error = $root.tendermint.abci.ResponseFlush.verify(message.flush); + if (error) + return "flush." + error; + } + } + if (message.info != null && message.hasOwnProperty("info")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + let error = $root.tendermint.abci.ResponseInfo.verify(message.info); + if (error) + return "info." + error; + } + } + if (message.setOption != null && message.hasOwnProperty("setOption")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + let error = $root.tendermint.abci.ResponseSetOption.verify(message.setOption); + if (error) + return "setOption." + error; + } + } + if (message.initChain != null && message.hasOwnProperty("initChain")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + let error = $root.tendermint.abci.ResponseInitChain.verify(message.initChain); + if (error) + return "initChain." + error; + } + } + if (message.query != null && message.hasOwnProperty("query")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + let error = $root.tendermint.abci.ResponseQuery.verify(message.query); + if (error) + return "query." + error; + } + } + if (message.beginBlock != null && message.hasOwnProperty("beginBlock")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + let error = $root.tendermint.abci.ResponseBeginBlock.verify(message.beginBlock); + if (error) + return "beginBlock." + error; + } + } + if (message.checkTx != null && message.hasOwnProperty("checkTx")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + let error = $root.tendermint.abci.ResponseCheckTx.verify(message.checkTx); + if (error) + return "checkTx." + error; + } + } + if (message.deliverTx != null && message.hasOwnProperty("deliverTx")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + let error = $root.tendermint.abci.ResponseDeliverTx.verify(message.deliverTx); + if (error) + return "deliverTx." + error; + } + } + if (message.endBlock != null && message.hasOwnProperty("endBlock")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + let error = $root.tendermint.abci.ResponseEndBlock.verify(message.endBlock); + if (error) + return "endBlock." + error; + } + } + if (message.commit != null && message.hasOwnProperty("commit")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + let error = $root.tendermint.abci.ResponseCommit.verify(message.commit); + if (error) + return "commit." + error; + } + } + if (message.listSnapshots != null && message.hasOwnProperty("listSnapshots")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + let error = $root.tendermint.abci.ResponseListSnapshots.verify(message.listSnapshots); + if (error) + return "listSnapshots." + error; + } + } + if (message.offerSnapshot != null && message.hasOwnProperty("offerSnapshot")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + let error = $root.tendermint.abci.ResponseOfferSnapshot.verify(message.offerSnapshot); + if (error) + return "offerSnapshot." + error; + } + } + if (message.loadSnapshotChunk != null && message.hasOwnProperty("loadSnapshotChunk")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + let error = $root.tendermint.abci.ResponseLoadSnapshotChunk.verify(message.loadSnapshotChunk); + if (error) + return "loadSnapshotChunk." + error; + } + } + if (message.applySnapshotChunk != null && message.hasOwnProperty("applySnapshotChunk")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + let error = $root.tendermint.abci.ResponseApplySnapshotChunk.verify(message.applySnapshotChunk); + if (error) + return "applySnapshotChunk." + error; + } + } + return null; + }; + + /** + * Creates a Response message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.Response + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.Response} Response + */ + Response.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.Response) + return object; + let message = new $root.tendermint.abci.Response(); + if (object.exception != null) { + if (typeof object.exception !== "object") + throw TypeError(".tendermint.abci.Response.exception: object expected"); + message.exception = $root.tendermint.abci.ResponseException.fromObject(object.exception); + } + if (object.echo != null) { + if (typeof object.echo !== "object") + throw TypeError(".tendermint.abci.Response.echo: object expected"); + message.echo = $root.tendermint.abci.ResponseEcho.fromObject(object.echo); + } + if (object.flush != null) { + if (typeof object.flush !== "object") + throw TypeError(".tendermint.abci.Response.flush: object expected"); + message.flush = $root.tendermint.abci.ResponseFlush.fromObject(object.flush); + } + if (object.info != null) { + if (typeof object.info !== "object") + throw TypeError(".tendermint.abci.Response.info: object expected"); + message.info = $root.tendermint.abci.ResponseInfo.fromObject(object.info); + } + if (object.setOption != null) { + if (typeof object.setOption !== "object") + throw TypeError(".tendermint.abci.Response.setOption: object expected"); + message.setOption = $root.tendermint.abci.ResponseSetOption.fromObject(object.setOption); + } + if (object.initChain != null) { + if (typeof object.initChain !== "object") + throw TypeError(".tendermint.abci.Response.initChain: object expected"); + message.initChain = $root.tendermint.abci.ResponseInitChain.fromObject(object.initChain); + } + if (object.query != null) { + if (typeof object.query !== "object") + throw TypeError(".tendermint.abci.Response.query: object expected"); + message.query = $root.tendermint.abci.ResponseQuery.fromObject(object.query); + } + if (object.beginBlock != null) { + if (typeof object.beginBlock !== "object") + throw TypeError(".tendermint.abci.Response.beginBlock: object expected"); + message.beginBlock = $root.tendermint.abci.ResponseBeginBlock.fromObject(object.beginBlock); + } + if (object.checkTx != null) { + if (typeof object.checkTx !== "object") + throw TypeError(".tendermint.abci.Response.checkTx: object expected"); + message.checkTx = $root.tendermint.abci.ResponseCheckTx.fromObject(object.checkTx); + } + if (object.deliverTx != null) { + if (typeof object.deliverTx !== "object") + throw TypeError(".tendermint.abci.Response.deliverTx: object expected"); + message.deliverTx = $root.tendermint.abci.ResponseDeliverTx.fromObject(object.deliverTx); + } + if (object.endBlock != null) { + if (typeof object.endBlock !== "object") + throw TypeError(".tendermint.abci.Response.endBlock: object expected"); + message.endBlock = $root.tendermint.abci.ResponseEndBlock.fromObject(object.endBlock); + } + if (object.commit != null) { + if (typeof object.commit !== "object") + throw TypeError(".tendermint.abci.Response.commit: object expected"); + message.commit = $root.tendermint.abci.ResponseCommit.fromObject(object.commit); + } + if (object.listSnapshots != null) { + if (typeof object.listSnapshots !== "object") + throw TypeError(".tendermint.abci.Response.listSnapshots: object expected"); + message.listSnapshots = $root.tendermint.abci.ResponseListSnapshots.fromObject(object.listSnapshots); + } + if (object.offerSnapshot != null) { + if (typeof object.offerSnapshot !== "object") + throw TypeError(".tendermint.abci.Response.offerSnapshot: object expected"); + message.offerSnapshot = $root.tendermint.abci.ResponseOfferSnapshot.fromObject(object.offerSnapshot); + } + if (object.loadSnapshotChunk != null) { + if (typeof object.loadSnapshotChunk !== "object") + throw TypeError(".tendermint.abci.Response.loadSnapshotChunk: object expected"); + message.loadSnapshotChunk = $root.tendermint.abci.ResponseLoadSnapshotChunk.fromObject(object.loadSnapshotChunk); + } + if (object.applySnapshotChunk != null) { + if (typeof object.applySnapshotChunk !== "object") + throw TypeError(".tendermint.abci.Response.applySnapshotChunk: object expected"); + message.applySnapshotChunk = $root.tendermint.abci.ResponseApplySnapshotChunk.fromObject(object.applySnapshotChunk); + } + return message; + }; + + /** + * Creates a plain object from a Response message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.Response + * @static + * @param {tendermint.abci.Response} message Response + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Response.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.exception != null && message.hasOwnProperty("exception")) { + object.exception = $root.tendermint.abci.ResponseException.toObject(message.exception, options); + if (options.oneofs) + object.value = "exception"; + } + if (message.echo != null && message.hasOwnProperty("echo")) { + object.echo = $root.tendermint.abci.ResponseEcho.toObject(message.echo, options); + if (options.oneofs) + object.value = "echo"; + } + if (message.flush != null && message.hasOwnProperty("flush")) { + object.flush = $root.tendermint.abci.ResponseFlush.toObject(message.flush, options); + if (options.oneofs) + object.value = "flush"; + } + if (message.info != null && message.hasOwnProperty("info")) { + object.info = $root.tendermint.abci.ResponseInfo.toObject(message.info, options); + if (options.oneofs) + object.value = "info"; + } + if (message.setOption != null && message.hasOwnProperty("setOption")) { + object.setOption = $root.tendermint.abci.ResponseSetOption.toObject(message.setOption, options); + if (options.oneofs) + object.value = "setOption"; + } + if (message.initChain != null && message.hasOwnProperty("initChain")) { + object.initChain = $root.tendermint.abci.ResponseInitChain.toObject(message.initChain, options); + if (options.oneofs) + object.value = "initChain"; + } + if (message.query != null && message.hasOwnProperty("query")) { + object.query = $root.tendermint.abci.ResponseQuery.toObject(message.query, options); + if (options.oneofs) + object.value = "query"; + } + if (message.beginBlock != null && message.hasOwnProperty("beginBlock")) { + object.beginBlock = $root.tendermint.abci.ResponseBeginBlock.toObject(message.beginBlock, options); + if (options.oneofs) + object.value = "beginBlock"; + } + if (message.checkTx != null && message.hasOwnProperty("checkTx")) { + object.checkTx = $root.tendermint.abci.ResponseCheckTx.toObject(message.checkTx, options); + if (options.oneofs) + object.value = "checkTx"; + } + if (message.deliverTx != null && message.hasOwnProperty("deliverTx")) { + object.deliverTx = $root.tendermint.abci.ResponseDeliverTx.toObject(message.deliverTx, options); + if (options.oneofs) + object.value = "deliverTx"; + } + if (message.endBlock != null && message.hasOwnProperty("endBlock")) { + object.endBlock = $root.tendermint.abci.ResponseEndBlock.toObject(message.endBlock, options); + if (options.oneofs) + object.value = "endBlock"; + } + if (message.commit != null && message.hasOwnProperty("commit")) { + object.commit = $root.tendermint.abci.ResponseCommit.toObject(message.commit, options); + if (options.oneofs) + object.value = "commit"; + } + if (message.listSnapshots != null && message.hasOwnProperty("listSnapshots")) { + object.listSnapshots = $root.tendermint.abci.ResponseListSnapshots.toObject(message.listSnapshots, options); + if (options.oneofs) + object.value = "listSnapshots"; + } + if (message.offerSnapshot != null && message.hasOwnProperty("offerSnapshot")) { + object.offerSnapshot = $root.tendermint.abci.ResponseOfferSnapshot.toObject(message.offerSnapshot, options); + if (options.oneofs) + object.value = "offerSnapshot"; + } + if (message.loadSnapshotChunk != null && message.hasOwnProperty("loadSnapshotChunk")) { + object.loadSnapshotChunk = $root.tendermint.abci.ResponseLoadSnapshotChunk.toObject(message.loadSnapshotChunk, options); + if (options.oneofs) + object.value = "loadSnapshotChunk"; + } + if (message.applySnapshotChunk != null && message.hasOwnProperty("applySnapshotChunk")) { + object.applySnapshotChunk = $root.tendermint.abci.ResponseApplySnapshotChunk.toObject(message.applySnapshotChunk, options); + if (options.oneofs) + object.value = "applySnapshotChunk"; + } + return object; + }; + + /** + * Converts this Response to JSON. + * @function toJSON + * @memberof tendermint.abci.Response + * @instance + * @returns {Object.} JSON object + */ + Response.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Response; + })(abci.Response || {}); + + abci.ResponseException = (function(ResponseException) { + + /** + * Properties of a ResponseException. + * @memberof tendermint.abci + * @interface IResponseException + * @property {string|null} [error] ResponseException error + */ + + /** + * Constructs a new ResponseException. + * @memberof tendermint.abci + * @classdesc Represents a ResponseException. + * @implements IResponseException + * @constructor + * @param {tendermint.abci.IResponseException=} [properties] Properties to set + */ + function ResponseException(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseException error. + * @member {string} error + * @memberof tendermint.abci.ResponseException + * @instance + */ + ResponseException.prototype.error = ""; + + /** + * Creates a new ResponseException instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseException + * @static + * @param {tendermint.abci.IResponseException=} [properties] Properties to set + * @returns {tendermint.abci.ResponseException} ResponseException instance + */ + ResponseException.create = function create(properties) { + return new ResponseException(properties); + }; + + /** + * Encodes the specified ResponseException message. Does not implicitly {@link tendermint.abci.ResponseException.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseException + * @static + * @param {tendermint.abci.IResponseException} message ResponseException message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseException.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.error); + return writer; + }; + + /** + * Encodes the specified ResponseException message, length delimited. Does not implicitly {@link tendermint.abci.ResponseException.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseException + * @static + * @param {tendermint.abci.IResponseException} message ResponseException message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseException.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseException message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseException + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseException} ResponseException + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseException.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseException(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.error = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseException message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseException + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseException} ResponseException + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseException.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseException message. + * @function verify + * @memberof tendermint.abci.ResponseException + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseException.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.error != null && message.hasOwnProperty("error")) + if (!$util.isString(message.error)) + return "error: string expected"; + return null; + }; + + /** + * Creates a ResponseException message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseException + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseException} ResponseException + */ + ResponseException.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseException) + return object; + let message = new $root.tendermint.abci.ResponseException(); + if (object.error != null) + message.error = String(object.error); + return message; + }; + + /** + * Creates a plain object from a ResponseException message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseException + * @static + * @param {tendermint.abci.ResponseException} message ResponseException + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseException.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.error = ""; + if (message.error != null && message.hasOwnProperty("error")) + object.error = message.error; + return object; + }; + + /** + * Converts this ResponseException to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseException + * @instance + * @returns {Object.} JSON object + */ + ResponseException.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseException; + })(abci.ResponseException || {}); + + abci.ResponseEcho = (function(ResponseEcho) { + + /** + * Properties of a ResponseEcho. + * @memberof tendermint.abci + * @interface IResponseEcho + * @property {string|null} [message] ResponseEcho message + */ + + /** + * Constructs a new ResponseEcho. + * @memberof tendermint.abci + * @classdesc Represents a ResponseEcho. + * @implements IResponseEcho + * @constructor + * @param {tendermint.abci.IResponseEcho=} [properties] Properties to set + */ + function ResponseEcho(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseEcho message. + * @member {string} message + * @memberof tendermint.abci.ResponseEcho + * @instance + */ + ResponseEcho.prototype.message = ""; + + /** + * Creates a new ResponseEcho instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseEcho + * @static + * @param {tendermint.abci.IResponseEcho=} [properties] Properties to set + * @returns {tendermint.abci.ResponseEcho} ResponseEcho instance + */ + ResponseEcho.create = function create(properties) { + return new ResponseEcho(properties); + }; + + /** + * Encodes the specified ResponseEcho message. Does not implicitly {@link tendermint.abci.ResponseEcho.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseEcho + * @static + * @param {tendermint.abci.IResponseEcho} message ResponseEcho message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseEcho.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + return writer; + }; + + /** + * Encodes the specified ResponseEcho message, length delimited. Does not implicitly {@link tendermint.abci.ResponseEcho.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseEcho + * @static + * @param {tendermint.abci.IResponseEcho} message ResponseEcho message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseEcho.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseEcho message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseEcho + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseEcho} ResponseEcho + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseEcho.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseEcho(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseEcho message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseEcho + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseEcho} ResponseEcho + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseEcho.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseEcho message. + * @function verify + * @memberof tendermint.abci.ResponseEcho + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseEcho.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + return null; + }; + + /** + * Creates a ResponseEcho message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseEcho + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseEcho} ResponseEcho + */ + ResponseEcho.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseEcho) + return object; + let message = new $root.tendermint.abci.ResponseEcho(); + if (object.message != null) + message.message = String(object.message); + return message; + }; + + /** + * Creates a plain object from a ResponseEcho message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseEcho + * @static + * @param {tendermint.abci.ResponseEcho} message ResponseEcho + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseEcho.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.message = ""; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + return object; + }; + + /** + * Converts this ResponseEcho to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseEcho + * @instance + * @returns {Object.} JSON object + */ + ResponseEcho.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseEcho; + })(abci.ResponseEcho || {}); + + abci.ResponseFlush = (function(ResponseFlush) { + + /** + * Properties of a ResponseFlush. + * @memberof tendermint.abci + * @interface IResponseFlush + */ + + /** + * Constructs a new ResponseFlush. + * @memberof tendermint.abci + * @classdesc Represents a ResponseFlush. + * @implements IResponseFlush + * @constructor + * @param {tendermint.abci.IResponseFlush=} [properties] Properties to set + */ + function ResponseFlush(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new ResponseFlush instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseFlush + * @static + * @param {tendermint.abci.IResponseFlush=} [properties] Properties to set + * @returns {tendermint.abci.ResponseFlush} ResponseFlush instance + */ + ResponseFlush.create = function create(properties) { + return new ResponseFlush(properties); + }; + + /** + * Encodes the specified ResponseFlush message. Does not implicitly {@link tendermint.abci.ResponseFlush.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseFlush + * @static + * @param {tendermint.abci.IResponseFlush} message ResponseFlush message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseFlush.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ResponseFlush message, length delimited. Does not implicitly {@link tendermint.abci.ResponseFlush.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseFlush + * @static + * @param {tendermint.abci.IResponseFlush} message ResponseFlush message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseFlush.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseFlush message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseFlush + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseFlush} ResponseFlush + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseFlush.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseFlush(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseFlush message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseFlush + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseFlush} ResponseFlush + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseFlush.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseFlush message. + * @function verify + * @memberof tendermint.abci.ResponseFlush + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseFlush.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a ResponseFlush message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseFlush + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseFlush} ResponseFlush + */ + ResponseFlush.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseFlush) + return object; + return new $root.tendermint.abci.ResponseFlush(); + }; + + /** + * Creates a plain object from a ResponseFlush message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseFlush + * @static + * @param {tendermint.abci.ResponseFlush} message ResponseFlush + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseFlush.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ResponseFlush to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseFlush + * @instance + * @returns {Object.} JSON object + */ + ResponseFlush.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseFlush; + })(abci.ResponseFlush || {}); + + abci.ResponseInfo = (function(ResponseInfo) { + + /** + * Properties of a ResponseInfo. + * @memberof tendermint.abci + * @interface IResponseInfo + * @property {string|null} [data] ResponseInfo data + * @property {string|null} [version] ResponseInfo version + * @property {number|Long|null} [appVersion] ResponseInfo appVersion + * @property {number|Long|null} [lastBlockHeight] ResponseInfo lastBlockHeight + * @property {Uint8Array|null} [lastBlockAppHash] ResponseInfo lastBlockAppHash + */ + + /** + * Constructs a new ResponseInfo. + * @memberof tendermint.abci + * @classdesc Represents a ResponseInfo. + * @implements IResponseInfo + * @constructor + * @param {tendermint.abci.IResponseInfo=} [properties] Properties to set + */ + function ResponseInfo(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseInfo data. + * @member {string} data + * @memberof tendermint.abci.ResponseInfo + * @instance + */ + ResponseInfo.prototype.data = ""; + + /** + * ResponseInfo version. + * @member {string} version + * @memberof tendermint.abci.ResponseInfo + * @instance + */ + ResponseInfo.prototype.version = ""; + + /** + * ResponseInfo appVersion. + * @member {number|Long} appVersion + * @memberof tendermint.abci.ResponseInfo + * @instance + */ + ResponseInfo.prototype.appVersion = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ResponseInfo lastBlockHeight. + * @member {number|Long} lastBlockHeight + * @memberof tendermint.abci.ResponseInfo + * @instance + */ + ResponseInfo.prototype.lastBlockHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ResponseInfo lastBlockAppHash. + * @member {Uint8Array} lastBlockAppHash + * @memberof tendermint.abci.ResponseInfo + * @instance + */ + ResponseInfo.prototype.lastBlockAppHash = $util.newBuffer([]); + + /** + * Creates a new ResponseInfo instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseInfo + * @static + * @param {tendermint.abci.IResponseInfo=} [properties] Properties to set + * @returns {tendermint.abci.ResponseInfo} ResponseInfo instance + */ + ResponseInfo.create = function create(properties) { + return new ResponseInfo(properties); + }; + + /** + * Encodes the specified ResponseInfo message. Does not implicitly {@link tendermint.abci.ResponseInfo.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseInfo + * @static + * @param {tendermint.abci.IResponseInfo} message ResponseInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.data); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); + if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.appVersion); + if (message.lastBlockHeight != null && Object.hasOwnProperty.call(message, "lastBlockHeight")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.lastBlockHeight); + if (message.lastBlockAppHash != null && Object.hasOwnProperty.call(message, "lastBlockAppHash")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.lastBlockAppHash); + return writer; + }; + + /** + * Encodes the specified ResponseInfo message, length delimited. Does not implicitly {@link tendermint.abci.ResponseInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseInfo + * @static + * @param {tendermint.abci.IResponseInfo} message ResponseInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseInfo message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseInfo} ResponseInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseInfo(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.string(); + break; + case 2: + message.version = reader.string(); + break; + case 3: + message.appVersion = reader.uint64(); + break; + case 4: + message.lastBlockHeight = reader.int64(); + break; + case 5: + message.lastBlockAppHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseInfo} ResponseInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseInfo message. + * @function verify + * @memberof tendermint.abci.ResponseInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!$util.isString(message.data)) + return "data: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + if (!$util.isInteger(message.appVersion) && !(message.appVersion && $util.isInteger(message.appVersion.low) && $util.isInteger(message.appVersion.high))) + return "appVersion: integer|Long expected"; + if (message.lastBlockHeight != null && message.hasOwnProperty("lastBlockHeight")) + if (!$util.isInteger(message.lastBlockHeight) && !(message.lastBlockHeight && $util.isInteger(message.lastBlockHeight.low) && $util.isInteger(message.lastBlockHeight.high))) + return "lastBlockHeight: integer|Long expected"; + if (message.lastBlockAppHash != null && message.hasOwnProperty("lastBlockAppHash")) + if (!(message.lastBlockAppHash && typeof message.lastBlockAppHash.length === "number" || $util.isString(message.lastBlockAppHash))) + return "lastBlockAppHash: buffer expected"; + return null; + }; + + /** + * Creates a ResponseInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseInfo + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseInfo} ResponseInfo + */ + ResponseInfo.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseInfo) + return object; + let message = new $root.tendermint.abci.ResponseInfo(); + if (object.data != null) + message.data = String(object.data); + if (object.version != null) + message.version = String(object.version); + if (object.appVersion != null) + if ($util.Long) + (message.appVersion = $util.Long.fromValue(object.appVersion)).unsigned = true; + else if (typeof object.appVersion === "string") + message.appVersion = parseInt(object.appVersion, 10); + else if (typeof object.appVersion === "number") + message.appVersion = object.appVersion; + else if (typeof object.appVersion === "object") + message.appVersion = new $util.LongBits(object.appVersion.low >>> 0, object.appVersion.high >>> 0).toNumber(true); + if (object.lastBlockHeight != null) + if ($util.Long) + (message.lastBlockHeight = $util.Long.fromValue(object.lastBlockHeight)).unsigned = false; + else if (typeof object.lastBlockHeight === "string") + message.lastBlockHeight = parseInt(object.lastBlockHeight, 10); + else if (typeof object.lastBlockHeight === "number") + message.lastBlockHeight = object.lastBlockHeight; + else if (typeof object.lastBlockHeight === "object") + message.lastBlockHeight = new $util.LongBits(object.lastBlockHeight.low >>> 0, object.lastBlockHeight.high >>> 0).toNumber(); + if (object.lastBlockAppHash != null) + if (typeof object.lastBlockAppHash === "string") + $util.base64.decode(object.lastBlockAppHash, message.lastBlockAppHash = $util.newBuffer($util.base64.length(object.lastBlockAppHash)), 0); + else if (object.lastBlockAppHash.length) + message.lastBlockAppHash = object.lastBlockAppHash; + return message; + }; + + /** + * Creates a plain object from a ResponseInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseInfo + * @static + * @param {tendermint.abci.ResponseInfo} message ResponseInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.data = ""; + object.version = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.appVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.appVersion = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.lastBlockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.lastBlockHeight = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.lastBlockAppHash = ""; + else { + object.lastBlockAppHash = []; + if (options.bytes !== Array) + object.lastBlockAppHash = $util.newBuffer(object.lastBlockAppHash); + } + } + if (message.data != null && message.hasOwnProperty("data")) + object.data = message.data; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + if (typeof message.appVersion === "number") + object.appVersion = options.longs === String ? String(message.appVersion) : message.appVersion; + else + object.appVersion = options.longs === String ? $util.Long.prototype.toString.call(message.appVersion) : options.longs === Number ? new $util.LongBits(message.appVersion.low >>> 0, message.appVersion.high >>> 0).toNumber(true) : message.appVersion; + if (message.lastBlockHeight != null && message.hasOwnProperty("lastBlockHeight")) + if (typeof message.lastBlockHeight === "number") + object.lastBlockHeight = options.longs === String ? String(message.lastBlockHeight) : message.lastBlockHeight; + else + object.lastBlockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.lastBlockHeight) : options.longs === Number ? new $util.LongBits(message.lastBlockHeight.low >>> 0, message.lastBlockHeight.high >>> 0).toNumber() : message.lastBlockHeight; + if (message.lastBlockAppHash != null && message.hasOwnProperty("lastBlockAppHash")) + object.lastBlockAppHash = options.bytes === String ? $util.base64.encode(message.lastBlockAppHash, 0, message.lastBlockAppHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.lastBlockAppHash) : message.lastBlockAppHash; + return object; + }; + + /** + * Converts this ResponseInfo to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseInfo + * @instance + * @returns {Object.} JSON object + */ + ResponseInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseInfo; + })(abci.ResponseInfo || {}); + + abci.ResponseSetOption = (function(ResponseSetOption) { + + /** + * Properties of a ResponseSetOption. + * @memberof tendermint.abci + * @interface IResponseSetOption + * @property {number|null} [code] ResponseSetOption code + * @property {string|null} [log] ResponseSetOption log + * @property {string|null} [info] ResponseSetOption info + */ + + /** + * Constructs a new ResponseSetOption. + * @memberof tendermint.abci + * @classdesc Represents a ResponseSetOption. + * @implements IResponseSetOption + * @constructor + * @param {tendermint.abci.IResponseSetOption=} [properties] Properties to set + */ + function ResponseSetOption(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseSetOption code. + * @member {number} code + * @memberof tendermint.abci.ResponseSetOption + * @instance + */ + ResponseSetOption.prototype.code = 0; + + /** + * ResponseSetOption log. + * @member {string} log + * @memberof tendermint.abci.ResponseSetOption + * @instance + */ + ResponseSetOption.prototype.log = ""; + + /** + * ResponseSetOption info. + * @member {string} info + * @memberof tendermint.abci.ResponseSetOption + * @instance + */ + ResponseSetOption.prototype.info = ""; + + /** + * Creates a new ResponseSetOption instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseSetOption + * @static + * @param {tendermint.abci.IResponseSetOption=} [properties] Properties to set + * @returns {tendermint.abci.ResponseSetOption} ResponseSetOption instance + */ + ResponseSetOption.create = function create(properties) { + return new ResponseSetOption(properties); + }; + + /** + * Encodes the specified ResponseSetOption message. Does not implicitly {@link tendermint.abci.ResponseSetOption.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseSetOption + * @static + * @param {tendermint.abci.IResponseSetOption} message ResponseSetOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseSetOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.code); + if (message.log != null && Object.hasOwnProperty.call(message, "log")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.log); + if (message.info != null && Object.hasOwnProperty.call(message, "info")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.info); + return writer; + }; + + /** + * Encodes the specified ResponseSetOption message, length delimited. Does not implicitly {@link tendermint.abci.ResponseSetOption.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseSetOption + * @static + * @param {tendermint.abci.IResponseSetOption} message ResponseSetOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseSetOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseSetOption message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseSetOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseSetOption} ResponseSetOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseSetOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseSetOption(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 3: + message.log = reader.string(); + break; + case 4: + message.info = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseSetOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseSetOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseSetOption} ResponseSetOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseSetOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseSetOption message. + * @function verify + * @memberof tendermint.abci.ResponseSetOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseSetOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.log != null && message.hasOwnProperty("log")) + if (!$util.isString(message.log)) + return "log: string expected"; + if (message.info != null && message.hasOwnProperty("info")) + if (!$util.isString(message.info)) + return "info: string expected"; + return null; + }; + + /** + * Creates a ResponseSetOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseSetOption + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseSetOption} ResponseSetOption + */ + ResponseSetOption.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseSetOption) + return object; + let message = new $root.tendermint.abci.ResponseSetOption(); + if (object.code != null) + message.code = object.code >>> 0; + if (object.log != null) + message.log = String(object.log); + if (object.info != null) + message.info = String(object.info); + return message; + }; + + /** + * Creates a plain object from a ResponseSetOption message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseSetOption + * @static + * @param {tendermint.abci.ResponseSetOption} message ResponseSetOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseSetOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.code = 0; + object.log = ""; + object.info = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.log != null && message.hasOwnProperty("log")) + object.log = message.log; + if (message.info != null && message.hasOwnProperty("info")) + object.info = message.info; + return object; + }; + + /** + * Converts this ResponseSetOption to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseSetOption + * @instance + * @returns {Object.} JSON object + */ + ResponseSetOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseSetOption; + })(abci.ResponseSetOption || {}); + + abci.ResponseInitChain = (function(ResponseInitChain) { + + /** + * Properties of a ResponseInitChain. + * @memberof tendermint.abci + * @interface IResponseInitChain + * @property {tendermint.abci.IConsensusParams|null} [consensusParams] ResponseInitChain consensusParams + * @property {Array.|null} [validators] ResponseInitChain validators + * @property {Uint8Array|null} [appHash] ResponseInitChain appHash + */ + + /** + * Constructs a new ResponseInitChain. + * @memberof tendermint.abci + * @classdesc Represents a ResponseInitChain. + * @implements IResponseInitChain + * @constructor + * @param {tendermint.abci.IResponseInitChain=} [properties] Properties to set + */ + function ResponseInitChain(properties) { + this.validators = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseInitChain consensusParams. + * @member {tendermint.abci.IConsensusParams|null|undefined} consensusParams + * @memberof tendermint.abci.ResponseInitChain + * @instance + */ + ResponseInitChain.prototype.consensusParams = null; + + /** + * ResponseInitChain validators. + * @member {Array.} validators + * @memberof tendermint.abci.ResponseInitChain + * @instance + */ + ResponseInitChain.prototype.validators = $util.emptyArray; + + /** + * ResponseInitChain appHash. + * @member {Uint8Array} appHash + * @memberof tendermint.abci.ResponseInitChain + * @instance + */ + ResponseInitChain.prototype.appHash = $util.newBuffer([]); + + /** + * Creates a new ResponseInitChain instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseInitChain + * @static + * @param {tendermint.abci.IResponseInitChain=} [properties] Properties to set + * @returns {tendermint.abci.ResponseInitChain} ResponseInitChain instance + */ + ResponseInitChain.create = function create(properties) { + return new ResponseInitChain(properties); + }; + + /** + * Encodes the specified ResponseInitChain message. Does not implicitly {@link tendermint.abci.ResponseInitChain.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseInitChain + * @static + * @param {tendermint.abci.IResponseInitChain} message ResponseInitChain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseInitChain.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.consensusParams != null && Object.hasOwnProperty.call(message, "consensusParams")) + $root.tendermint.abci.ConsensusParams.encode(message.consensusParams, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.validators != null && message.validators.length) + for (let i = 0; i < message.validators.length; ++i) + $root.tendermint.abci.ValidatorUpdate.encode(message.validators[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.appHash != null && Object.hasOwnProperty.call(message, "appHash")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.appHash); + return writer; + }; + + /** + * Encodes the specified ResponseInitChain message, length delimited. Does not implicitly {@link tendermint.abci.ResponseInitChain.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseInitChain + * @static + * @param {tendermint.abci.IResponseInitChain} message ResponseInitChain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseInitChain.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseInitChain message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseInitChain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseInitChain} ResponseInitChain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseInitChain.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseInitChain(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consensusParams = $root.tendermint.abci.ConsensusParams.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.validators && message.validators.length)) + message.validators = []; + message.validators.push($root.tendermint.abci.ValidatorUpdate.decode(reader, reader.uint32())); + break; + case 3: + message.appHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseInitChain message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseInitChain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseInitChain} ResponseInitChain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseInitChain.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseInitChain message. + * @function verify + * @memberof tendermint.abci.ResponseInitChain + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseInitChain.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.consensusParams != null && message.hasOwnProperty("consensusParams")) { + let error = $root.tendermint.abci.ConsensusParams.verify(message.consensusParams); + if (error) + return "consensusParams." + error; + } + if (message.validators != null && message.hasOwnProperty("validators")) { + if (!Array.isArray(message.validators)) + return "validators: array expected"; + for (let i = 0; i < message.validators.length; ++i) { + let error = $root.tendermint.abci.ValidatorUpdate.verify(message.validators[i]); + if (error) + return "validators." + error; + } + } + if (message.appHash != null && message.hasOwnProperty("appHash")) + if (!(message.appHash && typeof message.appHash.length === "number" || $util.isString(message.appHash))) + return "appHash: buffer expected"; + return null; + }; + + /** + * Creates a ResponseInitChain message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseInitChain + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseInitChain} ResponseInitChain + */ + ResponseInitChain.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseInitChain) + return object; + let message = new $root.tendermint.abci.ResponseInitChain(); + if (object.consensusParams != null) { + if (typeof object.consensusParams !== "object") + throw TypeError(".tendermint.abci.ResponseInitChain.consensusParams: object expected"); + message.consensusParams = $root.tendermint.abci.ConsensusParams.fromObject(object.consensusParams); + } + if (object.validators) { + if (!Array.isArray(object.validators)) + throw TypeError(".tendermint.abci.ResponseInitChain.validators: array expected"); + message.validators = []; + for (let i = 0; i < object.validators.length; ++i) { + if (typeof object.validators[i] !== "object") + throw TypeError(".tendermint.abci.ResponseInitChain.validators: object expected"); + message.validators[i] = $root.tendermint.abci.ValidatorUpdate.fromObject(object.validators[i]); + } + } + if (object.appHash != null) + if (typeof object.appHash === "string") + $util.base64.decode(object.appHash, message.appHash = $util.newBuffer($util.base64.length(object.appHash)), 0); + else if (object.appHash.length) + message.appHash = object.appHash; + return message; + }; + + /** + * Creates a plain object from a ResponseInitChain message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseInitChain + * @static + * @param {tendermint.abci.ResponseInitChain} message ResponseInitChain + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseInitChain.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.validators = []; + if (options.defaults) { + object.consensusParams = null; + if (options.bytes === String) + object.appHash = ""; + else { + object.appHash = []; + if (options.bytes !== Array) + object.appHash = $util.newBuffer(object.appHash); + } + } + if (message.consensusParams != null && message.hasOwnProperty("consensusParams")) + object.consensusParams = $root.tendermint.abci.ConsensusParams.toObject(message.consensusParams, options); + if (message.validators && message.validators.length) { + object.validators = []; + for (let j = 0; j < message.validators.length; ++j) + object.validators[j] = $root.tendermint.abci.ValidatorUpdate.toObject(message.validators[j], options); + } + if (message.appHash != null && message.hasOwnProperty("appHash")) + object.appHash = options.bytes === String ? $util.base64.encode(message.appHash, 0, message.appHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.appHash) : message.appHash; + return object; + }; + + /** + * Converts this ResponseInitChain to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseInitChain + * @instance + * @returns {Object.} JSON object + */ + ResponseInitChain.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseInitChain; + })(abci.ResponseInitChain || {}); + + abci.ResponseQuery = (function(ResponseQuery) { + + /** + * Properties of a ResponseQuery. + * @memberof tendermint.abci + * @interface IResponseQuery + * @property {number|null} [code] ResponseQuery code + * @property {string|null} [log] ResponseQuery log + * @property {string|null} [info] ResponseQuery info + * @property {number|Long|null} [index] ResponseQuery index + * @property {Uint8Array|null} [key] ResponseQuery key + * @property {Uint8Array|null} [value] ResponseQuery value + * @property {tendermint.crypto.IProofOps|null} [proofOps] ResponseQuery proofOps + * @property {number|Long|null} [height] ResponseQuery height + * @property {string|null} [codespace] ResponseQuery codespace + */ + + /** + * Constructs a new ResponseQuery. + * @memberof tendermint.abci + * @classdesc Represents a ResponseQuery. + * @implements IResponseQuery + * @constructor + * @param {tendermint.abci.IResponseQuery=} [properties] Properties to set + */ + function ResponseQuery(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseQuery code. + * @member {number} code + * @memberof tendermint.abci.ResponseQuery + * @instance + */ + ResponseQuery.prototype.code = 0; + + /** + * ResponseQuery log. + * @member {string} log + * @memberof tendermint.abci.ResponseQuery + * @instance + */ + ResponseQuery.prototype.log = ""; + + /** + * ResponseQuery info. + * @member {string} info + * @memberof tendermint.abci.ResponseQuery + * @instance + */ + ResponseQuery.prototype.info = ""; + + /** + * ResponseQuery index. + * @member {number|Long} index + * @memberof tendermint.abci.ResponseQuery + * @instance + */ + ResponseQuery.prototype.index = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ResponseQuery key. + * @member {Uint8Array} key + * @memberof tendermint.abci.ResponseQuery + * @instance + */ + ResponseQuery.prototype.key = $util.newBuffer([]); + + /** + * ResponseQuery value. + * @member {Uint8Array} value + * @memberof tendermint.abci.ResponseQuery + * @instance + */ + ResponseQuery.prototype.value = $util.newBuffer([]); + + /** + * ResponseQuery proofOps. + * @member {tendermint.crypto.IProofOps|null|undefined} proofOps + * @memberof tendermint.abci.ResponseQuery + * @instance + */ + ResponseQuery.prototype.proofOps = null; + + /** + * ResponseQuery height. + * @member {number|Long} height + * @memberof tendermint.abci.ResponseQuery + * @instance + */ + ResponseQuery.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ResponseQuery codespace. + * @member {string} codespace + * @memberof tendermint.abci.ResponseQuery + * @instance + */ + ResponseQuery.prototype.codespace = ""; + + /** + * Creates a new ResponseQuery instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseQuery + * @static + * @param {tendermint.abci.IResponseQuery=} [properties] Properties to set + * @returns {tendermint.abci.ResponseQuery} ResponseQuery instance + */ + ResponseQuery.create = function create(properties) { + return new ResponseQuery(properties); + }; + + /** + * Encodes the specified ResponseQuery message. Does not implicitly {@link tendermint.abci.ResponseQuery.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseQuery + * @static + * @param {tendermint.abci.IResponseQuery} message ResponseQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseQuery.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.code); + if (message.log != null && Object.hasOwnProperty.call(message, "log")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.log); + if (message.info != null && Object.hasOwnProperty.call(message, "info")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.info); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.index); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.value); + if (message.proofOps != null && Object.hasOwnProperty.call(message, "proofOps")) + $root.tendermint.crypto.ProofOps.encode(message.proofOps, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.height); + if (message.codespace != null && Object.hasOwnProperty.call(message, "codespace")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.codespace); + return writer; + }; + + /** + * Encodes the specified ResponseQuery message, length delimited. Does not implicitly {@link tendermint.abci.ResponseQuery.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseQuery + * @static + * @param {tendermint.abci.IResponseQuery} message ResponseQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseQuery.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseQuery message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseQuery} ResponseQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseQuery.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseQuery(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 3: + message.log = reader.string(); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.index = reader.int64(); + break; + case 6: + message.key = reader.bytes(); + break; + case 7: + message.value = reader.bytes(); + break; + case 8: + message.proofOps = $root.tendermint.crypto.ProofOps.decode(reader, reader.uint32()); + break; + case 9: + message.height = reader.int64(); + break; + case 10: + message.codespace = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseQuery message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseQuery} ResponseQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseQuery.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseQuery message. + * @function verify + * @memberof tendermint.abci.ResponseQuery + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseQuery.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.log != null && message.hasOwnProperty("log")) + if (!$util.isString(message.log)) + return "log: string expected"; + if (message.info != null && message.hasOwnProperty("info")) + if (!$util.isString(message.info)) + return "info: string expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index) && !(message.index && $util.isInteger(message.index.low) && $util.isInteger(message.index.high))) + return "index: integer|Long expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + if (message.proofOps != null && message.hasOwnProperty("proofOps")) { + let error = $root.tendermint.crypto.ProofOps.verify(message.proofOps); + if (error) + return "proofOps." + error; + } + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.codespace != null && message.hasOwnProperty("codespace")) + if (!$util.isString(message.codespace)) + return "codespace: string expected"; + return null; + }; + + /** + * Creates a ResponseQuery message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseQuery + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseQuery} ResponseQuery + */ + ResponseQuery.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseQuery) + return object; + let message = new $root.tendermint.abci.ResponseQuery(); + if (object.code != null) + message.code = object.code >>> 0; + if (object.log != null) + message.log = String(object.log); + if (object.info != null) + message.info = String(object.info); + if (object.index != null) + if ($util.Long) + (message.index = $util.Long.fromValue(object.index)).unsigned = false; + else if (typeof object.index === "string") + message.index = parseInt(object.index, 10); + else if (typeof object.index === "number") + message.index = object.index; + else if (typeof object.index === "object") + message.index = new $util.LongBits(object.index.low >>> 0, object.index.high >>> 0).toNumber(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length) + message.key = object.key; + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length) + message.value = object.value; + if (object.proofOps != null) { + if (typeof object.proofOps !== "object") + throw TypeError(".tendermint.abci.ResponseQuery.proofOps: object expected"); + message.proofOps = $root.tendermint.crypto.ProofOps.fromObject(object.proofOps); + } + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + if (object.codespace != null) + message.codespace = String(object.codespace); + return message; + }; + + /** + * Creates a plain object from a ResponseQuery message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseQuery + * @static + * @param {tendermint.abci.ResponseQuery} message ResponseQuery + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseQuery.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.code = 0; + object.log = ""; + object.info = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.index = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.index = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + object.proofOps = null; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.codespace = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.log != null && message.hasOwnProperty("log")) + object.log = message.log; + if (message.info != null && message.hasOwnProperty("info")) + object.info = message.info; + if (message.index != null && message.hasOwnProperty("index")) + if (typeof message.index === "number") + object.index = options.longs === String ? String(message.index) : message.index; + else + object.index = options.longs === String ? $util.Long.prototype.toString.call(message.index) : options.longs === Number ? new $util.LongBits(message.index.low >>> 0, message.index.high >>> 0).toNumber() : message.index; + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + if (message.proofOps != null && message.hasOwnProperty("proofOps")) + object.proofOps = $root.tendermint.crypto.ProofOps.toObject(message.proofOps, options); + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + if (message.codespace != null && message.hasOwnProperty("codespace")) + object.codespace = message.codespace; + return object; + }; + + /** + * Converts this ResponseQuery to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseQuery + * @instance + * @returns {Object.} JSON object + */ + ResponseQuery.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseQuery; + })(abci.ResponseQuery || {}); + + abci.ResponseBeginBlock = (function(ResponseBeginBlock) { + + /** + * Properties of a ResponseBeginBlock. + * @memberof tendermint.abci + * @interface IResponseBeginBlock + * @property {Array.|null} [events] ResponseBeginBlock events + */ + + /** + * Constructs a new ResponseBeginBlock. + * @memberof tendermint.abci + * @classdesc Represents a ResponseBeginBlock. + * @implements IResponseBeginBlock + * @constructor + * @param {tendermint.abci.IResponseBeginBlock=} [properties] Properties to set + */ + function ResponseBeginBlock(properties) { + this.events = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseBeginBlock events. + * @member {Array.} events + * @memberof tendermint.abci.ResponseBeginBlock + * @instance + */ + ResponseBeginBlock.prototype.events = $util.emptyArray; + + /** + * Creates a new ResponseBeginBlock instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseBeginBlock + * @static + * @param {tendermint.abci.IResponseBeginBlock=} [properties] Properties to set + * @returns {tendermint.abci.ResponseBeginBlock} ResponseBeginBlock instance + */ + ResponseBeginBlock.create = function create(properties) { + return new ResponseBeginBlock(properties); + }; + + /** + * Encodes the specified ResponseBeginBlock message. Does not implicitly {@link tendermint.abci.ResponseBeginBlock.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseBeginBlock + * @static + * @param {tendermint.abci.IResponseBeginBlock} message ResponseBeginBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseBeginBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.events != null && message.events.length) + for (let i = 0; i < message.events.length; ++i) + $root.tendermint.abci.Event.encode(message.events[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResponseBeginBlock message, length delimited. Does not implicitly {@link tendermint.abci.ResponseBeginBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseBeginBlock + * @static + * @param {tendermint.abci.IResponseBeginBlock} message ResponseBeginBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseBeginBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseBeginBlock message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseBeginBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseBeginBlock} ResponseBeginBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseBeginBlock.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseBeginBlock(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.events && message.events.length)) + message.events = []; + message.events.push($root.tendermint.abci.Event.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseBeginBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseBeginBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseBeginBlock} ResponseBeginBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseBeginBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseBeginBlock message. + * @function verify + * @memberof tendermint.abci.ResponseBeginBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseBeginBlock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.events != null && message.hasOwnProperty("events")) { + if (!Array.isArray(message.events)) + return "events: array expected"; + for (let i = 0; i < message.events.length; ++i) { + let error = $root.tendermint.abci.Event.verify(message.events[i]); + if (error) + return "events." + error; + } + } + return null; + }; + + /** + * Creates a ResponseBeginBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseBeginBlock + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseBeginBlock} ResponseBeginBlock + */ + ResponseBeginBlock.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseBeginBlock) + return object; + let message = new $root.tendermint.abci.ResponseBeginBlock(); + if (object.events) { + if (!Array.isArray(object.events)) + throw TypeError(".tendermint.abci.ResponseBeginBlock.events: array expected"); + message.events = []; + for (let i = 0; i < object.events.length; ++i) { + if (typeof object.events[i] !== "object") + throw TypeError(".tendermint.abci.ResponseBeginBlock.events: object expected"); + message.events[i] = $root.tendermint.abci.Event.fromObject(object.events[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ResponseBeginBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseBeginBlock + * @static + * @param {tendermint.abci.ResponseBeginBlock} message ResponseBeginBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseBeginBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.events = []; + if (message.events && message.events.length) { + object.events = []; + for (let j = 0; j < message.events.length; ++j) + object.events[j] = $root.tendermint.abci.Event.toObject(message.events[j], options); + } + return object; + }; + + /** + * Converts this ResponseBeginBlock to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseBeginBlock + * @instance + * @returns {Object.} JSON object + */ + ResponseBeginBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseBeginBlock; + })(abci.ResponseBeginBlock || {}); + + abci.ResponseCheckTx = (function(ResponseCheckTx) { + + /** + * Properties of a ResponseCheckTx. + * @memberof tendermint.abci + * @interface IResponseCheckTx + * @property {number|null} [code] ResponseCheckTx code + * @property {Uint8Array|null} [data] ResponseCheckTx data + * @property {string|null} [log] ResponseCheckTx log + * @property {string|null} [info] ResponseCheckTx info + * @property {number|Long|null} [gasWanted] ResponseCheckTx gasWanted + * @property {number|Long|null} [gasUsed] ResponseCheckTx gasUsed + * @property {Array.|null} [events] ResponseCheckTx events + * @property {string|null} [codespace] ResponseCheckTx codespace + */ + + /** + * Constructs a new ResponseCheckTx. + * @memberof tendermint.abci + * @classdesc Represents a ResponseCheckTx. + * @implements IResponseCheckTx + * @constructor + * @param {tendermint.abci.IResponseCheckTx=} [properties] Properties to set + */ + function ResponseCheckTx(properties) { + this.events = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseCheckTx code. + * @member {number} code + * @memberof tendermint.abci.ResponseCheckTx + * @instance + */ + ResponseCheckTx.prototype.code = 0; + + /** + * ResponseCheckTx data. + * @member {Uint8Array} data + * @memberof tendermint.abci.ResponseCheckTx + * @instance + */ + ResponseCheckTx.prototype.data = $util.newBuffer([]); + + /** + * ResponseCheckTx log. + * @member {string} log + * @memberof tendermint.abci.ResponseCheckTx + * @instance + */ + ResponseCheckTx.prototype.log = ""; + + /** + * ResponseCheckTx info. + * @member {string} info + * @memberof tendermint.abci.ResponseCheckTx + * @instance + */ + ResponseCheckTx.prototype.info = ""; + + /** + * ResponseCheckTx gasWanted. + * @member {number|Long} gasWanted + * @memberof tendermint.abci.ResponseCheckTx + * @instance + */ + ResponseCheckTx.prototype.gasWanted = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ResponseCheckTx gasUsed. + * @member {number|Long} gasUsed + * @memberof tendermint.abci.ResponseCheckTx + * @instance + */ + ResponseCheckTx.prototype.gasUsed = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ResponseCheckTx events. + * @member {Array.} events + * @memberof tendermint.abci.ResponseCheckTx + * @instance + */ + ResponseCheckTx.prototype.events = $util.emptyArray; + + /** + * ResponseCheckTx codespace. + * @member {string} codespace + * @memberof tendermint.abci.ResponseCheckTx + * @instance + */ + ResponseCheckTx.prototype.codespace = ""; + + /** + * Creates a new ResponseCheckTx instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseCheckTx + * @static + * @param {tendermint.abci.IResponseCheckTx=} [properties] Properties to set + * @returns {tendermint.abci.ResponseCheckTx} ResponseCheckTx instance + */ + ResponseCheckTx.create = function create(properties) { + return new ResponseCheckTx(properties); + }; + + /** + * Encodes the specified ResponseCheckTx message. Does not implicitly {@link tendermint.abci.ResponseCheckTx.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseCheckTx + * @static + * @param {tendermint.abci.IResponseCheckTx} message ResponseCheckTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseCheckTx.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.code); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); + if (message.log != null && Object.hasOwnProperty.call(message, "log")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.log); + if (message.info != null && Object.hasOwnProperty.call(message, "info")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.info); + if (message.gasWanted != null && Object.hasOwnProperty.call(message, "gasWanted")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.gasWanted); + if (message.gasUsed != null && Object.hasOwnProperty.call(message, "gasUsed")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.gasUsed); + if (message.events != null && message.events.length) + for (let i = 0; i < message.events.length; ++i) + $root.tendermint.abci.Event.encode(message.events[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.codespace != null && Object.hasOwnProperty.call(message, "codespace")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.codespace); + return writer; + }; + + /** + * Encodes the specified ResponseCheckTx message, length delimited. Does not implicitly {@link tendermint.abci.ResponseCheckTx.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseCheckTx + * @static + * @param {tendermint.abci.IResponseCheckTx} message ResponseCheckTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseCheckTx.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseCheckTx message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseCheckTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseCheckTx} ResponseCheckTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseCheckTx.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseCheckTx(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 2: + message.data = reader.bytes(); + break; + case 3: + message.log = reader.string(); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.gasWanted = reader.int64(); + break; + case 6: + message.gasUsed = reader.int64(); + break; + case 7: + if (!(message.events && message.events.length)) + message.events = []; + message.events.push($root.tendermint.abci.Event.decode(reader, reader.uint32())); + break; + case 8: + message.codespace = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseCheckTx message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseCheckTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseCheckTx} ResponseCheckTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseCheckTx.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseCheckTx message. + * @function verify + * @memberof tendermint.abci.ResponseCheckTx + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseCheckTx.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + if (message.log != null && message.hasOwnProperty("log")) + if (!$util.isString(message.log)) + return "log: string expected"; + if (message.info != null && message.hasOwnProperty("info")) + if (!$util.isString(message.info)) + return "info: string expected"; + if (message.gasWanted != null && message.hasOwnProperty("gasWanted")) + if (!$util.isInteger(message.gasWanted) && !(message.gasWanted && $util.isInteger(message.gasWanted.low) && $util.isInteger(message.gasWanted.high))) + return "gasWanted: integer|Long expected"; + if (message.gasUsed != null && message.hasOwnProperty("gasUsed")) + if (!$util.isInteger(message.gasUsed) && !(message.gasUsed && $util.isInteger(message.gasUsed.low) && $util.isInteger(message.gasUsed.high))) + return "gasUsed: integer|Long expected"; + if (message.events != null && message.hasOwnProperty("events")) { + if (!Array.isArray(message.events)) + return "events: array expected"; + for (let i = 0; i < message.events.length; ++i) { + let error = $root.tendermint.abci.Event.verify(message.events[i]); + if (error) + return "events." + error; + } + } + if (message.codespace != null && message.hasOwnProperty("codespace")) + if (!$util.isString(message.codespace)) + return "codespace: string expected"; + return null; + }; + + /** + * Creates a ResponseCheckTx message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseCheckTx + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseCheckTx} ResponseCheckTx + */ + ResponseCheckTx.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseCheckTx) + return object; + let message = new $root.tendermint.abci.ResponseCheckTx(); + if (object.code != null) + message.code = object.code >>> 0; + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length) + message.data = object.data; + if (object.log != null) + message.log = String(object.log); + if (object.info != null) + message.info = String(object.info); + if (object.gasWanted != null) + if ($util.Long) + (message.gasWanted = $util.Long.fromValue(object.gasWanted)).unsigned = false; + else if (typeof object.gasWanted === "string") + message.gasWanted = parseInt(object.gasWanted, 10); + else if (typeof object.gasWanted === "number") + message.gasWanted = object.gasWanted; + else if (typeof object.gasWanted === "object") + message.gasWanted = new $util.LongBits(object.gasWanted.low >>> 0, object.gasWanted.high >>> 0).toNumber(); + if (object.gasUsed != null) + if ($util.Long) + (message.gasUsed = $util.Long.fromValue(object.gasUsed)).unsigned = false; + else if (typeof object.gasUsed === "string") + message.gasUsed = parseInt(object.gasUsed, 10); + else if (typeof object.gasUsed === "number") + message.gasUsed = object.gasUsed; + else if (typeof object.gasUsed === "object") + message.gasUsed = new $util.LongBits(object.gasUsed.low >>> 0, object.gasUsed.high >>> 0).toNumber(); + if (object.events) { + if (!Array.isArray(object.events)) + throw TypeError(".tendermint.abci.ResponseCheckTx.events: array expected"); + message.events = []; + for (let i = 0; i < object.events.length; ++i) { + if (typeof object.events[i] !== "object") + throw TypeError(".tendermint.abci.ResponseCheckTx.events: object expected"); + message.events[i] = $root.tendermint.abci.Event.fromObject(object.events[i]); + } + } + if (object.codespace != null) + message.codespace = String(object.codespace); + return message; + }; + + /** + * Creates a plain object from a ResponseCheckTx message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseCheckTx + * @static + * @param {tendermint.abci.ResponseCheckTx} message ResponseCheckTx + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseCheckTx.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.events = []; + if (options.defaults) { + object.code = 0; + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + object.log = ""; + object.info = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.gasWanted = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.gasWanted = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.gasUsed = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.gasUsed = options.longs === String ? "0" : 0; + object.codespace = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + if (message.log != null && message.hasOwnProperty("log")) + object.log = message.log; + if (message.info != null && message.hasOwnProperty("info")) + object.info = message.info; + if (message.gasWanted != null && message.hasOwnProperty("gasWanted")) + if (typeof message.gasWanted === "number") + object.gasWanted = options.longs === String ? String(message.gasWanted) : message.gasWanted; + else + object.gasWanted = options.longs === String ? $util.Long.prototype.toString.call(message.gasWanted) : options.longs === Number ? new $util.LongBits(message.gasWanted.low >>> 0, message.gasWanted.high >>> 0).toNumber() : message.gasWanted; + if (message.gasUsed != null && message.hasOwnProperty("gasUsed")) + if (typeof message.gasUsed === "number") + object.gasUsed = options.longs === String ? String(message.gasUsed) : message.gasUsed; + else + object.gasUsed = options.longs === String ? $util.Long.prototype.toString.call(message.gasUsed) : options.longs === Number ? new $util.LongBits(message.gasUsed.low >>> 0, message.gasUsed.high >>> 0).toNumber() : message.gasUsed; + if (message.events && message.events.length) { + object.events = []; + for (let j = 0; j < message.events.length; ++j) + object.events[j] = $root.tendermint.abci.Event.toObject(message.events[j], options); + } + if (message.codespace != null && message.hasOwnProperty("codespace")) + object.codespace = message.codespace; + return object; + }; + + /** + * Converts this ResponseCheckTx to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseCheckTx + * @instance + * @returns {Object.} JSON object + */ + ResponseCheckTx.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseCheckTx; + })(abci.ResponseCheckTx || {}); + + abci.ResponseDeliverTx = (function(ResponseDeliverTx) { + + /** + * Properties of a ResponseDeliverTx. + * @memberof tendermint.abci + * @interface IResponseDeliverTx + * @property {number|null} [code] ResponseDeliverTx code + * @property {Uint8Array|null} [data] ResponseDeliverTx data + * @property {string|null} [log] ResponseDeliverTx log + * @property {string|null} [info] ResponseDeliverTx info + * @property {number|Long|null} [gasWanted] ResponseDeliverTx gasWanted + * @property {number|Long|null} [gasUsed] ResponseDeliverTx gasUsed + * @property {Array.|null} [events] ResponseDeliverTx events + * @property {string|null} [codespace] ResponseDeliverTx codespace + */ + + /** + * Constructs a new ResponseDeliverTx. + * @memberof tendermint.abci + * @classdesc Represents a ResponseDeliverTx. + * @implements IResponseDeliverTx + * @constructor + * @param {tendermint.abci.IResponseDeliverTx=} [properties] Properties to set + */ + function ResponseDeliverTx(properties) { + this.events = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseDeliverTx code. + * @member {number} code + * @memberof tendermint.abci.ResponseDeliverTx + * @instance + */ + ResponseDeliverTx.prototype.code = 0; + + /** + * ResponseDeliverTx data. + * @member {Uint8Array} data + * @memberof tendermint.abci.ResponseDeliverTx + * @instance + */ + ResponseDeliverTx.prototype.data = $util.newBuffer([]); + + /** + * ResponseDeliverTx log. + * @member {string} log + * @memberof tendermint.abci.ResponseDeliverTx + * @instance + */ + ResponseDeliverTx.prototype.log = ""; + + /** + * ResponseDeliverTx info. + * @member {string} info + * @memberof tendermint.abci.ResponseDeliverTx + * @instance + */ + ResponseDeliverTx.prototype.info = ""; + + /** + * ResponseDeliverTx gasWanted. + * @member {number|Long} gasWanted + * @memberof tendermint.abci.ResponseDeliverTx + * @instance + */ + ResponseDeliverTx.prototype.gasWanted = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ResponseDeliverTx gasUsed. + * @member {number|Long} gasUsed + * @memberof tendermint.abci.ResponseDeliverTx + * @instance + */ + ResponseDeliverTx.prototype.gasUsed = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ResponseDeliverTx events. + * @member {Array.} events + * @memberof tendermint.abci.ResponseDeliverTx + * @instance + */ + ResponseDeliverTx.prototype.events = $util.emptyArray; + + /** + * ResponseDeliverTx codespace. + * @member {string} codespace + * @memberof tendermint.abci.ResponseDeliverTx + * @instance + */ + ResponseDeliverTx.prototype.codespace = ""; + + /** + * Creates a new ResponseDeliverTx instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseDeliverTx + * @static + * @param {tendermint.abci.IResponseDeliverTx=} [properties] Properties to set + * @returns {tendermint.abci.ResponseDeliverTx} ResponseDeliverTx instance + */ + ResponseDeliverTx.create = function create(properties) { + return new ResponseDeliverTx(properties); + }; + + /** + * Encodes the specified ResponseDeliverTx message. Does not implicitly {@link tendermint.abci.ResponseDeliverTx.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseDeliverTx + * @static + * @param {tendermint.abci.IResponseDeliverTx} message ResponseDeliverTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseDeliverTx.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.code); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); + if (message.log != null && Object.hasOwnProperty.call(message, "log")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.log); + if (message.info != null && Object.hasOwnProperty.call(message, "info")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.info); + if (message.gasWanted != null && Object.hasOwnProperty.call(message, "gasWanted")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.gasWanted); + if (message.gasUsed != null && Object.hasOwnProperty.call(message, "gasUsed")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.gasUsed); + if (message.events != null && message.events.length) + for (let i = 0; i < message.events.length; ++i) + $root.tendermint.abci.Event.encode(message.events[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.codespace != null && Object.hasOwnProperty.call(message, "codespace")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.codespace); + return writer; + }; + + /** + * Encodes the specified ResponseDeliverTx message, length delimited. Does not implicitly {@link tendermint.abci.ResponseDeliverTx.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseDeliverTx + * @static + * @param {tendermint.abci.IResponseDeliverTx} message ResponseDeliverTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseDeliverTx.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseDeliverTx message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseDeliverTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseDeliverTx} ResponseDeliverTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseDeliverTx.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseDeliverTx(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 2: + message.data = reader.bytes(); + break; + case 3: + message.log = reader.string(); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.gasWanted = reader.int64(); + break; + case 6: + message.gasUsed = reader.int64(); + break; + case 7: + if (!(message.events && message.events.length)) + message.events = []; + message.events.push($root.tendermint.abci.Event.decode(reader, reader.uint32())); + break; + case 8: + message.codespace = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseDeliverTx message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseDeliverTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseDeliverTx} ResponseDeliverTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseDeliverTx.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseDeliverTx message. + * @function verify + * @memberof tendermint.abci.ResponseDeliverTx + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseDeliverTx.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + if (message.log != null && message.hasOwnProperty("log")) + if (!$util.isString(message.log)) + return "log: string expected"; + if (message.info != null && message.hasOwnProperty("info")) + if (!$util.isString(message.info)) + return "info: string expected"; + if (message.gasWanted != null && message.hasOwnProperty("gasWanted")) + if (!$util.isInteger(message.gasWanted) && !(message.gasWanted && $util.isInteger(message.gasWanted.low) && $util.isInteger(message.gasWanted.high))) + return "gasWanted: integer|Long expected"; + if (message.gasUsed != null && message.hasOwnProperty("gasUsed")) + if (!$util.isInteger(message.gasUsed) && !(message.gasUsed && $util.isInteger(message.gasUsed.low) && $util.isInteger(message.gasUsed.high))) + return "gasUsed: integer|Long expected"; + if (message.events != null && message.hasOwnProperty("events")) { + if (!Array.isArray(message.events)) + return "events: array expected"; + for (let i = 0; i < message.events.length; ++i) { + let error = $root.tendermint.abci.Event.verify(message.events[i]); + if (error) + return "events." + error; + } + } + if (message.codespace != null && message.hasOwnProperty("codespace")) + if (!$util.isString(message.codespace)) + return "codespace: string expected"; + return null; + }; + + /** + * Creates a ResponseDeliverTx message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseDeliverTx + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseDeliverTx} ResponseDeliverTx + */ + ResponseDeliverTx.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseDeliverTx) + return object; + let message = new $root.tendermint.abci.ResponseDeliverTx(); + if (object.code != null) + message.code = object.code >>> 0; + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length) + message.data = object.data; + if (object.log != null) + message.log = String(object.log); + if (object.info != null) + message.info = String(object.info); + if (object.gasWanted != null) + if ($util.Long) + (message.gasWanted = $util.Long.fromValue(object.gasWanted)).unsigned = false; + else if (typeof object.gasWanted === "string") + message.gasWanted = parseInt(object.gasWanted, 10); + else if (typeof object.gasWanted === "number") + message.gasWanted = object.gasWanted; + else if (typeof object.gasWanted === "object") + message.gasWanted = new $util.LongBits(object.gasWanted.low >>> 0, object.gasWanted.high >>> 0).toNumber(); + if (object.gasUsed != null) + if ($util.Long) + (message.gasUsed = $util.Long.fromValue(object.gasUsed)).unsigned = false; + else if (typeof object.gasUsed === "string") + message.gasUsed = parseInt(object.gasUsed, 10); + else if (typeof object.gasUsed === "number") + message.gasUsed = object.gasUsed; + else if (typeof object.gasUsed === "object") + message.gasUsed = new $util.LongBits(object.gasUsed.low >>> 0, object.gasUsed.high >>> 0).toNumber(); + if (object.events) { + if (!Array.isArray(object.events)) + throw TypeError(".tendermint.abci.ResponseDeliverTx.events: array expected"); + message.events = []; + for (let i = 0; i < object.events.length; ++i) { + if (typeof object.events[i] !== "object") + throw TypeError(".tendermint.abci.ResponseDeliverTx.events: object expected"); + message.events[i] = $root.tendermint.abci.Event.fromObject(object.events[i]); + } + } + if (object.codespace != null) + message.codespace = String(object.codespace); + return message; + }; + + /** + * Creates a plain object from a ResponseDeliverTx message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseDeliverTx + * @static + * @param {tendermint.abci.ResponseDeliverTx} message ResponseDeliverTx + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseDeliverTx.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.events = []; + if (options.defaults) { + object.code = 0; + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + object.log = ""; + object.info = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.gasWanted = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.gasWanted = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.gasUsed = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.gasUsed = options.longs === String ? "0" : 0; + object.codespace = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + if (message.log != null && message.hasOwnProperty("log")) + object.log = message.log; + if (message.info != null && message.hasOwnProperty("info")) + object.info = message.info; + if (message.gasWanted != null && message.hasOwnProperty("gasWanted")) + if (typeof message.gasWanted === "number") + object.gasWanted = options.longs === String ? String(message.gasWanted) : message.gasWanted; + else + object.gasWanted = options.longs === String ? $util.Long.prototype.toString.call(message.gasWanted) : options.longs === Number ? new $util.LongBits(message.gasWanted.low >>> 0, message.gasWanted.high >>> 0).toNumber() : message.gasWanted; + if (message.gasUsed != null && message.hasOwnProperty("gasUsed")) + if (typeof message.gasUsed === "number") + object.gasUsed = options.longs === String ? String(message.gasUsed) : message.gasUsed; + else + object.gasUsed = options.longs === String ? $util.Long.prototype.toString.call(message.gasUsed) : options.longs === Number ? new $util.LongBits(message.gasUsed.low >>> 0, message.gasUsed.high >>> 0).toNumber() : message.gasUsed; + if (message.events && message.events.length) { + object.events = []; + for (let j = 0; j < message.events.length; ++j) + object.events[j] = $root.tendermint.abci.Event.toObject(message.events[j], options); + } + if (message.codespace != null && message.hasOwnProperty("codespace")) + object.codespace = message.codespace; + return object; + }; + + /** + * Converts this ResponseDeliverTx to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseDeliverTx + * @instance + * @returns {Object.} JSON object + */ + ResponseDeliverTx.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseDeliverTx; + })(abci.ResponseDeliverTx || {}); + + abci.ResponseEndBlock = (function(ResponseEndBlock) { + + /** + * Properties of a ResponseEndBlock. + * @memberof tendermint.abci + * @interface IResponseEndBlock + * @property {Array.|null} [validatorUpdates] ResponseEndBlock validatorUpdates + * @property {tendermint.abci.IConsensusParams|null} [consensusParamUpdates] ResponseEndBlock consensusParamUpdates + * @property {Array.|null} [events] ResponseEndBlock events + */ + + /** + * Constructs a new ResponseEndBlock. + * @memberof tendermint.abci + * @classdesc Represents a ResponseEndBlock. + * @implements IResponseEndBlock + * @constructor + * @param {tendermint.abci.IResponseEndBlock=} [properties] Properties to set + */ + function ResponseEndBlock(properties) { + this.validatorUpdates = []; + this.events = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseEndBlock validatorUpdates. + * @member {Array.} validatorUpdates + * @memberof tendermint.abci.ResponseEndBlock + * @instance + */ + ResponseEndBlock.prototype.validatorUpdates = $util.emptyArray; + + /** + * ResponseEndBlock consensusParamUpdates. + * @member {tendermint.abci.IConsensusParams|null|undefined} consensusParamUpdates + * @memberof tendermint.abci.ResponseEndBlock + * @instance + */ + ResponseEndBlock.prototype.consensusParamUpdates = null; + + /** + * ResponseEndBlock events. + * @member {Array.} events + * @memberof tendermint.abci.ResponseEndBlock + * @instance + */ + ResponseEndBlock.prototype.events = $util.emptyArray; + + /** + * Creates a new ResponseEndBlock instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseEndBlock + * @static + * @param {tendermint.abci.IResponseEndBlock=} [properties] Properties to set + * @returns {tendermint.abci.ResponseEndBlock} ResponseEndBlock instance + */ + ResponseEndBlock.create = function create(properties) { + return new ResponseEndBlock(properties); + }; + + /** + * Encodes the specified ResponseEndBlock message. Does not implicitly {@link tendermint.abci.ResponseEndBlock.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseEndBlock + * @static + * @param {tendermint.abci.IResponseEndBlock} message ResponseEndBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseEndBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validatorUpdates != null && message.validatorUpdates.length) + for (let i = 0; i < message.validatorUpdates.length; ++i) + $root.tendermint.abci.ValidatorUpdate.encode(message.validatorUpdates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.consensusParamUpdates != null && Object.hasOwnProperty.call(message, "consensusParamUpdates")) + $root.tendermint.abci.ConsensusParams.encode(message.consensusParamUpdates, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.events != null && message.events.length) + for (let i = 0; i < message.events.length; ++i) + $root.tendermint.abci.Event.encode(message.events[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResponseEndBlock message, length delimited. Does not implicitly {@link tendermint.abci.ResponseEndBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseEndBlock + * @static + * @param {tendermint.abci.IResponseEndBlock} message ResponseEndBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseEndBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseEndBlock message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseEndBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseEndBlock} ResponseEndBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseEndBlock.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseEndBlock(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.validatorUpdates && message.validatorUpdates.length)) + message.validatorUpdates = []; + message.validatorUpdates.push($root.tendermint.abci.ValidatorUpdate.decode(reader, reader.uint32())); + break; + case 2: + message.consensusParamUpdates = $root.tendermint.abci.ConsensusParams.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.events && message.events.length)) + message.events = []; + message.events.push($root.tendermint.abci.Event.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseEndBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseEndBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseEndBlock} ResponseEndBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseEndBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseEndBlock message. + * @function verify + * @memberof tendermint.abci.ResponseEndBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseEndBlock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validatorUpdates != null && message.hasOwnProperty("validatorUpdates")) { + if (!Array.isArray(message.validatorUpdates)) + return "validatorUpdates: array expected"; + for (let i = 0; i < message.validatorUpdates.length; ++i) { + let error = $root.tendermint.abci.ValidatorUpdate.verify(message.validatorUpdates[i]); + if (error) + return "validatorUpdates." + error; + } + } + if (message.consensusParamUpdates != null && message.hasOwnProperty("consensusParamUpdates")) { + let error = $root.tendermint.abci.ConsensusParams.verify(message.consensusParamUpdates); + if (error) + return "consensusParamUpdates." + error; + } + if (message.events != null && message.hasOwnProperty("events")) { + if (!Array.isArray(message.events)) + return "events: array expected"; + for (let i = 0; i < message.events.length; ++i) { + let error = $root.tendermint.abci.Event.verify(message.events[i]); + if (error) + return "events." + error; + } + } + return null; + }; + + /** + * Creates a ResponseEndBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseEndBlock + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseEndBlock} ResponseEndBlock + */ + ResponseEndBlock.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseEndBlock) + return object; + let message = new $root.tendermint.abci.ResponseEndBlock(); + if (object.validatorUpdates) { + if (!Array.isArray(object.validatorUpdates)) + throw TypeError(".tendermint.abci.ResponseEndBlock.validatorUpdates: array expected"); + message.validatorUpdates = []; + for (let i = 0; i < object.validatorUpdates.length; ++i) { + if (typeof object.validatorUpdates[i] !== "object") + throw TypeError(".tendermint.abci.ResponseEndBlock.validatorUpdates: object expected"); + message.validatorUpdates[i] = $root.tendermint.abci.ValidatorUpdate.fromObject(object.validatorUpdates[i]); + } + } + if (object.consensusParamUpdates != null) { + if (typeof object.consensusParamUpdates !== "object") + throw TypeError(".tendermint.abci.ResponseEndBlock.consensusParamUpdates: object expected"); + message.consensusParamUpdates = $root.tendermint.abci.ConsensusParams.fromObject(object.consensusParamUpdates); + } + if (object.events) { + if (!Array.isArray(object.events)) + throw TypeError(".tendermint.abci.ResponseEndBlock.events: array expected"); + message.events = []; + for (let i = 0; i < object.events.length; ++i) { + if (typeof object.events[i] !== "object") + throw TypeError(".tendermint.abci.ResponseEndBlock.events: object expected"); + message.events[i] = $root.tendermint.abci.Event.fromObject(object.events[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ResponseEndBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseEndBlock + * @static + * @param {tendermint.abci.ResponseEndBlock} message ResponseEndBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseEndBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) { + object.validatorUpdates = []; + object.events = []; + } + if (options.defaults) + object.consensusParamUpdates = null; + if (message.validatorUpdates && message.validatorUpdates.length) { + object.validatorUpdates = []; + for (let j = 0; j < message.validatorUpdates.length; ++j) + object.validatorUpdates[j] = $root.tendermint.abci.ValidatorUpdate.toObject(message.validatorUpdates[j], options); + } + if (message.consensusParamUpdates != null && message.hasOwnProperty("consensusParamUpdates")) + object.consensusParamUpdates = $root.tendermint.abci.ConsensusParams.toObject(message.consensusParamUpdates, options); + if (message.events && message.events.length) { + object.events = []; + for (let j = 0; j < message.events.length; ++j) + object.events[j] = $root.tendermint.abci.Event.toObject(message.events[j], options); + } + return object; + }; + + /** + * Converts this ResponseEndBlock to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseEndBlock + * @instance + * @returns {Object.} JSON object + */ + ResponseEndBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseEndBlock; + })(abci.ResponseEndBlock || {}); + + abci.ResponseCommit = (function(ResponseCommit) { + + /** + * Properties of a ResponseCommit. + * @memberof tendermint.abci + * @interface IResponseCommit + * @property {Uint8Array|null} [data] ResponseCommit data + * @property {number|Long|null} [retainHeight] ResponseCommit retainHeight + */ + + /** + * Constructs a new ResponseCommit. + * @memberof tendermint.abci + * @classdesc Represents a ResponseCommit. + * @implements IResponseCommit + * @constructor + * @param {tendermint.abci.IResponseCommit=} [properties] Properties to set + */ + function ResponseCommit(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseCommit data. + * @member {Uint8Array} data + * @memberof tendermint.abci.ResponseCommit + * @instance + */ + ResponseCommit.prototype.data = $util.newBuffer([]); + + /** + * ResponseCommit retainHeight. + * @member {number|Long} retainHeight + * @memberof tendermint.abci.ResponseCommit + * @instance + */ + ResponseCommit.prototype.retainHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ResponseCommit instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseCommit + * @static + * @param {tendermint.abci.IResponseCommit=} [properties] Properties to set + * @returns {tendermint.abci.ResponseCommit} ResponseCommit instance + */ + ResponseCommit.create = function create(properties) { + return new ResponseCommit(properties); + }; + + /** + * Encodes the specified ResponseCommit message. Does not implicitly {@link tendermint.abci.ResponseCommit.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseCommit + * @static + * @param {tendermint.abci.IResponseCommit} message ResponseCommit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseCommit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); + if (message.retainHeight != null && Object.hasOwnProperty.call(message, "retainHeight")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.retainHeight); + return writer; + }; + + /** + * Encodes the specified ResponseCommit message, length delimited. Does not implicitly {@link tendermint.abci.ResponseCommit.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseCommit + * @static + * @param {tendermint.abci.IResponseCommit} message ResponseCommit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseCommit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseCommit message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseCommit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseCommit} ResponseCommit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseCommit.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseCommit(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.data = reader.bytes(); + break; + case 3: + message.retainHeight = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseCommit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseCommit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseCommit} ResponseCommit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseCommit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseCommit message. + * @function verify + * @memberof tendermint.abci.ResponseCommit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseCommit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + if (message.retainHeight != null && message.hasOwnProperty("retainHeight")) + if (!$util.isInteger(message.retainHeight) && !(message.retainHeight && $util.isInteger(message.retainHeight.low) && $util.isInteger(message.retainHeight.high))) + return "retainHeight: integer|Long expected"; + return null; + }; + + /** + * Creates a ResponseCommit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseCommit + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseCommit} ResponseCommit + */ + ResponseCommit.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseCommit) + return object; + let message = new $root.tendermint.abci.ResponseCommit(); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length) + message.data = object.data; + if (object.retainHeight != null) + if ($util.Long) + (message.retainHeight = $util.Long.fromValue(object.retainHeight)).unsigned = false; + else if (typeof object.retainHeight === "string") + message.retainHeight = parseInt(object.retainHeight, 10); + else if (typeof object.retainHeight === "number") + message.retainHeight = object.retainHeight; + else if (typeof object.retainHeight === "object") + message.retainHeight = new $util.LongBits(object.retainHeight.low >>> 0, object.retainHeight.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ResponseCommit message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseCommit + * @static + * @param {tendermint.abci.ResponseCommit} message ResponseCommit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseCommit.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.retainHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.retainHeight = options.longs === String ? "0" : 0; + } + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + if (message.retainHeight != null && message.hasOwnProperty("retainHeight")) + if (typeof message.retainHeight === "number") + object.retainHeight = options.longs === String ? String(message.retainHeight) : message.retainHeight; + else + object.retainHeight = options.longs === String ? $util.Long.prototype.toString.call(message.retainHeight) : options.longs === Number ? new $util.LongBits(message.retainHeight.low >>> 0, message.retainHeight.high >>> 0).toNumber() : message.retainHeight; + return object; + }; + + /** + * Converts this ResponseCommit to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseCommit + * @instance + * @returns {Object.} JSON object + */ + ResponseCommit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseCommit; + })(abci.ResponseCommit || {}); + + abci.ResponseListSnapshots = (function(ResponseListSnapshots) { + + /** + * Properties of a ResponseListSnapshots. + * @memberof tendermint.abci + * @interface IResponseListSnapshots + * @property {Array.|null} [snapshots] ResponseListSnapshots snapshots + */ + + /** + * Constructs a new ResponseListSnapshots. + * @memberof tendermint.abci + * @classdesc Represents a ResponseListSnapshots. + * @implements IResponseListSnapshots + * @constructor + * @param {tendermint.abci.IResponseListSnapshots=} [properties] Properties to set + */ + function ResponseListSnapshots(properties) { + this.snapshots = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseListSnapshots snapshots. + * @member {Array.} snapshots + * @memberof tendermint.abci.ResponseListSnapshots + * @instance + */ + ResponseListSnapshots.prototype.snapshots = $util.emptyArray; + + /** + * Creates a new ResponseListSnapshots instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseListSnapshots + * @static + * @param {tendermint.abci.IResponseListSnapshots=} [properties] Properties to set + * @returns {tendermint.abci.ResponseListSnapshots} ResponseListSnapshots instance + */ + ResponseListSnapshots.create = function create(properties) { + return new ResponseListSnapshots(properties); + }; + + /** + * Encodes the specified ResponseListSnapshots message. Does not implicitly {@link tendermint.abci.ResponseListSnapshots.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseListSnapshots + * @static + * @param {tendermint.abci.IResponseListSnapshots} message ResponseListSnapshots message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseListSnapshots.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.snapshots != null && message.snapshots.length) + for (let i = 0; i < message.snapshots.length; ++i) + $root.tendermint.abci.Snapshot.encode(message.snapshots[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResponseListSnapshots message, length delimited. Does not implicitly {@link tendermint.abci.ResponseListSnapshots.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseListSnapshots + * @static + * @param {tendermint.abci.IResponseListSnapshots} message ResponseListSnapshots message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseListSnapshots.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseListSnapshots message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseListSnapshots + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseListSnapshots} ResponseListSnapshots + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseListSnapshots.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseListSnapshots(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.snapshots && message.snapshots.length)) + message.snapshots = []; + message.snapshots.push($root.tendermint.abci.Snapshot.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseListSnapshots message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseListSnapshots + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseListSnapshots} ResponseListSnapshots + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseListSnapshots.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseListSnapshots message. + * @function verify + * @memberof tendermint.abci.ResponseListSnapshots + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseListSnapshots.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.snapshots != null && message.hasOwnProperty("snapshots")) { + if (!Array.isArray(message.snapshots)) + return "snapshots: array expected"; + for (let i = 0; i < message.snapshots.length; ++i) { + let error = $root.tendermint.abci.Snapshot.verify(message.snapshots[i]); + if (error) + return "snapshots." + error; + } + } + return null; + }; + + /** + * Creates a ResponseListSnapshots message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseListSnapshots + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseListSnapshots} ResponseListSnapshots + */ + ResponseListSnapshots.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseListSnapshots) + return object; + let message = new $root.tendermint.abci.ResponseListSnapshots(); + if (object.snapshots) { + if (!Array.isArray(object.snapshots)) + throw TypeError(".tendermint.abci.ResponseListSnapshots.snapshots: array expected"); + message.snapshots = []; + for (let i = 0; i < object.snapshots.length; ++i) { + if (typeof object.snapshots[i] !== "object") + throw TypeError(".tendermint.abci.ResponseListSnapshots.snapshots: object expected"); + message.snapshots[i] = $root.tendermint.abci.Snapshot.fromObject(object.snapshots[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ResponseListSnapshots message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseListSnapshots + * @static + * @param {tendermint.abci.ResponseListSnapshots} message ResponseListSnapshots + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseListSnapshots.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.snapshots = []; + if (message.snapshots && message.snapshots.length) { + object.snapshots = []; + for (let j = 0; j < message.snapshots.length; ++j) + object.snapshots[j] = $root.tendermint.abci.Snapshot.toObject(message.snapshots[j], options); + } + return object; + }; + + /** + * Converts this ResponseListSnapshots to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseListSnapshots + * @instance + * @returns {Object.} JSON object + */ + ResponseListSnapshots.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseListSnapshots; + })(abci.ResponseListSnapshots || {}); + + abci.ResponseOfferSnapshot = (function(ResponseOfferSnapshot) { + + /** + * Properties of a ResponseOfferSnapshot. + * @memberof tendermint.abci + * @interface IResponseOfferSnapshot + * @property {tendermint.abci.ResponseOfferSnapshot.Result|null} [result] ResponseOfferSnapshot result + */ + + /** + * Constructs a new ResponseOfferSnapshot. + * @memberof tendermint.abci + * @classdesc Represents a ResponseOfferSnapshot. + * @implements IResponseOfferSnapshot + * @constructor + * @param {tendermint.abci.IResponseOfferSnapshot=} [properties] Properties to set + */ + function ResponseOfferSnapshot(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseOfferSnapshot result. + * @member {tendermint.abci.ResponseOfferSnapshot.Result} result + * @memberof tendermint.abci.ResponseOfferSnapshot + * @instance + */ + ResponseOfferSnapshot.prototype.result = 0; + + /** + * Creates a new ResponseOfferSnapshot instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseOfferSnapshot + * @static + * @param {tendermint.abci.IResponseOfferSnapshot=} [properties] Properties to set + * @returns {tendermint.abci.ResponseOfferSnapshot} ResponseOfferSnapshot instance + */ + ResponseOfferSnapshot.create = function create(properties) { + return new ResponseOfferSnapshot(properties); + }; + + /** + * Encodes the specified ResponseOfferSnapshot message. Does not implicitly {@link tendermint.abci.ResponseOfferSnapshot.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseOfferSnapshot + * @static + * @param {tendermint.abci.IResponseOfferSnapshot} message ResponseOfferSnapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseOfferSnapshot.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.result != null && Object.hasOwnProperty.call(message, "result")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.result); + return writer; + }; + + /** + * Encodes the specified ResponseOfferSnapshot message, length delimited. Does not implicitly {@link tendermint.abci.ResponseOfferSnapshot.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseOfferSnapshot + * @static + * @param {tendermint.abci.IResponseOfferSnapshot} message ResponseOfferSnapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseOfferSnapshot.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseOfferSnapshot message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseOfferSnapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseOfferSnapshot} ResponseOfferSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseOfferSnapshot.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseOfferSnapshot(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.result = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseOfferSnapshot message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseOfferSnapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseOfferSnapshot} ResponseOfferSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseOfferSnapshot.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseOfferSnapshot message. + * @function verify + * @memberof tendermint.abci.ResponseOfferSnapshot + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseOfferSnapshot.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.result != null && message.hasOwnProperty("result")) + switch (message.result) { + default: + return "result: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a ResponseOfferSnapshot message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseOfferSnapshot + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseOfferSnapshot} ResponseOfferSnapshot + */ + ResponseOfferSnapshot.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseOfferSnapshot) + return object; + let message = new $root.tendermint.abci.ResponseOfferSnapshot(); + switch (object.result) { + case "UNKNOWN": + case 0: + message.result = 0; + break; + case "ACCEPT": + case 1: + message.result = 1; + break; + case "ABORT": + case 2: + message.result = 2; + break; + case "REJECT": + case 3: + message.result = 3; + break; + case "REJECT_FORMAT": + case 4: + message.result = 4; + break; + case "REJECT_SENDER": + case 5: + message.result = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a ResponseOfferSnapshot message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseOfferSnapshot + * @static + * @param {tendermint.abci.ResponseOfferSnapshot} message ResponseOfferSnapshot + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseOfferSnapshot.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.result = options.enums === String ? "UNKNOWN" : 0; + if (message.result != null && message.hasOwnProperty("result")) + object.result = options.enums === String ? $root.tendermint.abci.ResponseOfferSnapshot.Result[message.result] : message.result; + return object; + }; + + /** + * Converts this ResponseOfferSnapshot to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseOfferSnapshot + * @instance + * @returns {Object.} JSON object + */ + ResponseOfferSnapshot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Result enum. + * @name tendermint.abci.ResponseOfferSnapshot.Result + * @enum {string} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} ACCEPT=1 ACCEPT value + * @property {number} ABORT=2 ABORT value + * @property {number} REJECT=3 REJECT value + * @property {number} REJECT_FORMAT=4 REJECT_FORMAT value + * @property {number} REJECT_SENDER=5 REJECT_SENDER value + */ + ResponseOfferSnapshot.Result = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "ACCEPT"] = 1; + values[valuesById[2] = "ABORT"] = 2; + values[valuesById[3] = "REJECT"] = 3; + values[valuesById[4] = "REJECT_FORMAT"] = 4; + values[valuesById[5] = "REJECT_SENDER"] = 5; + return values; + })(); + + return ResponseOfferSnapshot; + })(abci.ResponseOfferSnapshot || {}); + + abci.ResponseLoadSnapshotChunk = (function(ResponseLoadSnapshotChunk) { + + /** + * Properties of a ResponseLoadSnapshotChunk. + * @memberof tendermint.abci + * @interface IResponseLoadSnapshotChunk + * @property {Uint8Array|null} [chunk] ResponseLoadSnapshotChunk chunk + */ + + /** + * Constructs a new ResponseLoadSnapshotChunk. + * @memberof tendermint.abci + * @classdesc Represents a ResponseLoadSnapshotChunk. + * @implements IResponseLoadSnapshotChunk + * @constructor + * @param {tendermint.abci.IResponseLoadSnapshotChunk=} [properties] Properties to set + */ + function ResponseLoadSnapshotChunk(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseLoadSnapshotChunk chunk. + * @member {Uint8Array} chunk + * @memberof tendermint.abci.ResponseLoadSnapshotChunk + * @instance + */ + ResponseLoadSnapshotChunk.prototype.chunk = $util.newBuffer([]); + + /** + * Creates a new ResponseLoadSnapshotChunk instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseLoadSnapshotChunk + * @static + * @param {tendermint.abci.IResponseLoadSnapshotChunk=} [properties] Properties to set + * @returns {tendermint.abci.ResponseLoadSnapshotChunk} ResponseLoadSnapshotChunk instance + */ + ResponseLoadSnapshotChunk.create = function create(properties) { + return new ResponseLoadSnapshotChunk(properties); + }; + + /** + * Encodes the specified ResponseLoadSnapshotChunk message. Does not implicitly {@link tendermint.abci.ResponseLoadSnapshotChunk.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseLoadSnapshotChunk + * @static + * @param {tendermint.abci.IResponseLoadSnapshotChunk} message ResponseLoadSnapshotChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseLoadSnapshotChunk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.chunk != null && Object.hasOwnProperty.call(message, "chunk")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.chunk); + return writer; + }; + + /** + * Encodes the specified ResponseLoadSnapshotChunk message, length delimited. Does not implicitly {@link tendermint.abci.ResponseLoadSnapshotChunk.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseLoadSnapshotChunk + * @static + * @param {tendermint.abci.IResponseLoadSnapshotChunk} message ResponseLoadSnapshotChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseLoadSnapshotChunk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseLoadSnapshotChunk message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseLoadSnapshotChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseLoadSnapshotChunk} ResponseLoadSnapshotChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseLoadSnapshotChunk.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseLoadSnapshotChunk(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chunk = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseLoadSnapshotChunk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseLoadSnapshotChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseLoadSnapshotChunk} ResponseLoadSnapshotChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseLoadSnapshotChunk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseLoadSnapshotChunk message. + * @function verify + * @memberof tendermint.abci.ResponseLoadSnapshotChunk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseLoadSnapshotChunk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.chunk != null && message.hasOwnProperty("chunk")) + if (!(message.chunk && typeof message.chunk.length === "number" || $util.isString(message.chunk))) + return "chunk: buffer expected"; + return null; + }; + + /** + * Creates a ResponseLoadSnapshotChunk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseLoadSnapshotChunk + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseLoadSnapshotChunk} ResponseLoadSnapshotChunk + */ + ResponseLoadSnapshotChunk.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseLoadSnapshotChunk) + return object; + let message = new $root.tendermint.abci.ResponseLoadSnapshotChunk(); + if (object.chunk != null) + if (typeof object.chunk === "string") + $util.base64.decode(object.chunk, message.chunk = $util.newBuffer($util.base64.length(object.chunk)), 0); + else if (object.chunk.length) + message.chunk = object.chunk; + return message; + }; + + /** + * Creates a plain object from a ResponseLoadSnapshotChunk message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseLoadSnapshotChunk + * @static + * @param {tendermint.abci.ResponseLoadSnapshotChunk} message ResponseLoadSnapshotChunk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseLoadSnapshotChunk.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + if (options.bytes === String) + object.chunk = ""; + else { + object.chunk = []; + if (options.bytes !== Array) + object.chunk = $util.newBuffer(object.chunk); + } + if (message.chunk != null && message.hasOwnProperty("chunk")) + object.chunk = options.bytes === String ? $util.base64.encode(message.chunk, 0, message.chunk.length) : options.bytes === Array ? Array.prototype.slice.call(message.chunk) : message.chunk; + return object; + }; + + /** + * Converts this ResponseLoadSnapshotChunk to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseLoadSnapshotChunk + * @instance + * @returns {Object.} JSON object + */ + ResponseLoadSnapshotChunk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseLoadSnapshotChunk; + })(abci.ResponseLoadSnapshotChunk || {}); + + abci.ResponseApplySnapshotChunk = (function(ResponseApplySnapshotChunk) { + + /** + * Properties of a ResponseApplySnapshotChunk. + * @memberof tendermint.abci + * @interface IResponseApplySnapshotChunk + * @property {tendermint.abci.ResponseApplySnapshotChunk.Result|null} [result] ResponseApplySnapshotChunk result + * @property {Array.|null} [refetchChunks] ResponseApplySnapshotChunk refetchChunks + * @property {Array.|null} [rejectSenders] ResponseApplySnapshotChunk rejectSenders + */ + + /** + * Constructs a new ResponseApplySnapshotChunk. + * @memberof tendermint.abci + * @classdesc Represents a ResponseApplySnapshotChunk. + * @implements IResponseApplySnapshotChunk + * @constructor + * @param {tendermint.abci.IResponseApplySnapshotChunk=} [properties] Properties to set + */ + function ResponseApplySnapshotChunk(properties) { + this.refetchChunks = []; + this.rejectSenders = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseApplySnapshotChunk result. + * @member {tendermint.abci.ResponseApplySnapshotChunk.Result} result + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @instance + */ + ResponseApplySnapshotChunk.prototype.result = 0; + + /** + * ResponseApplySnapshotChunk refetchChunks. + * @member {Array.} refetchChunks + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @instance + */ + ResponseApplySnapshotChunk.prototype.refetchChunks = $util.emptyArray; + + /** + * ResponseApplySnapshotChunk rejectSenders. + * @member {Array.} rejectSenders + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @instance + */ + ResponseApplySnapshotChunk.prototype.rejectSenders = $util.emptyArray; + + /** + * Creates a new ResponseApplySnapshotChunk instance using the specified properties. + * @function create + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @static + * @param {tendermint.abci.IResponseApplySnapshotChunk=} [properties] Properties to set + * @returns {tendermint.abci.ResponseApplySnapshotChunk} ResponseApplySnapshotChunk instance + */ + ResponseApplySnapshotChunk.create = function create(properties) { + return new ResponseApplySnapshotChunk(properties); + }; + + /** + * Encodes the specified ResponseApplySnapshotChunk message. Does not implicitly {@link tendermint.abci.ResponseApplySnapshotChunk.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @static + * @param {tendermint.abci.IResponseApplySnapshotChunk} message ResponseApplySnapshotChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseApplySnapshotChunk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.result != null && Object.hasOwnProperty.call(message, "result")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.result); + if (message.refetchChunks != null && message.refetchChunks.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (let i = 0; i < message.refetchChunks.length; ++i) + writer.uint32(message.refetchChunks[i]); + writer.ldelim(); + } + if (message.rejectSenders != null && message.rejectSenders.length) + for (let i = 0; i < message.rejectSenders.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.rejectSenders[i]); + return writer; + }; + + /** + * Encodes the specified ResponseApplySnapshotChunk message, length delimited. Does not implicitly {@link tendermint.abci.ResponseApplySnapshotChunk.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @static + * @param {tendermint.abci.IResponseApplySnapshotChunk} message ResponseApplySnapshotChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseApplySnapshotChunk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseApplySnapshotChunk message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ResponseApplySnapshotChunk} ResponseApplySnapshotChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseApplySnapshotChunk.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseApplySnapshotChunk(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.result = reader.int32(); + break; + case 2: + if (!(message.refetchChunks && message.refetchChunks.length)) + message.refetchChunks = []; + if ((tag & 7) === 2) { + let end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.refetchChunks.push(reader.uint32()); + } else + message.refetchChunks.push(reader.uint32()); + break; + case 3: + if (!(message.rejectSenders && message.rejectSenders.length)) + message.rejectSenders = []; + message.rejectSenders.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseApplySnapshotChunk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ResponseApplySnapshotChunk} ResponseApplySnapshotChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseApplySnapshotChunk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseApplySnapshotChunk message. + * @function verify + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseApplySnapshotChunk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.result != null && message.hasOwnProperty("result")) + switch (message.result) { + default: + return "result: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.refetchChunks != null && message.hasOwnProperty("refetchChunks")) { + if (!Array.isArray(message.refetchChunks)) + return "refetchChunks: array expected"; + for (let i = 0; i < message.refetchChunks.length; ++i) + if (!$util.isInteger(message.refetchChunks[i])) + return "refetchChunks: integer[] expected"; + } + if (message.rejectSenders != null && message.hasOwnProperty("rejectSenders")) { + if (!Array.isArray(message.rejectSenders)) + return "rejectSenders: array expected"; + for (let i = 0; i < message.rejectSenders.length; ++i) + if (!$util.isString(message.rejectSenders[i])) + return "rejectSenders: string[] expected"; + } + return null; + }; + + /** + * Creates a ResponseApplySnapshotChunk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ResponseApplySnapshotChunk} ResponseApplySnapshotChunk + */ + ResponseApplySnapshotChunk.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ResponseApplySnapshotChunk) + return object; + let message = new $root.tendermint.abci.ResponseApplySnapshotChunk(); + switch (object.result) { + case "UNKNOWN": + case 0: + message.result = 0; + break; + case "ACCEPT": + case 1: + message.result = 1; + break; + case "ABORT": + case 2: + message.result = 2; + break; + case "RETRY": + case 3: + message.result = 3; + break; + case "RETRY_SNAPSHOT": + case 4: + message.result = 4; + break; + case "REJECT_SNAPSHOT": + case 5: + message.result = 5; + break; + } + if (object.refetchChunks) { + if (!Array.isArray(object.refetchChunks)) + throw TypeError(".tendermint.abci.ResponseApplySnapshotChunk.refetchChunks: array expected"); + message.refetchChunks = []; + for (let i = 0; i < object.refetchChunks.length; ++i) + message.refetchChunks[i] = object.refetchChunks[i] >>> 0; + } + if (object.rejectSenders) { + if (!Array.isArray(object.rejectSenders)) + throw TypeError(".tendermint.abci.ResponseApplySnapshotChunk.rejectSenders: array expected"); + message.rejectSenders = []; + for (let i = 0; i < object.rejectSenders.length; ++i) + message.rejectSenders[i] = String(object.rejectSenders[i]); + } + return message; + }; + + /** + * Creates a plain object from a ResponseApplySnapshotChunk message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @static + * @param {tendermint.abci.ResponseApplySnapshotChunk} message ResponseApplySnapshotChunk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseApplySnapshotChunk.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) { + object.refetchChunks = []; + object.rejectSenders = []; + } + if (options.defaults) + object.result = options.enums === String ? "UNKNOWN" : 0; + if (message.result != null && message.hasOwnProperty("result")) + object.result = options.enums === String ? $root.tendermint.abci.ResponseApplySnapshotChunk.Result[message.result] : message.result; + if (message.refetchChunks && message.refetchChunks.length) { + object.refetchChunks = []; + for (let j = 0; j < message.refetchChunks.length; ++j) + object.refetchChunks[j] = message.refetchChunks[j]; + } + if (message.rejectSenders && message.rejectSenders.length) { + object.rejectSenders = []; + for (let j = 0; j < message.rejectSenders.length; ++j) + object.rejectSenders[j] = message.rejectSenders[j]; + } + return object; + }; + + /** + * Converts this ResponseApplySnapshotChunk to JSON. + * @function toJSON + * @memberof tendermint.abci.ResponseApplySnapshotChunk + * @instance + * @returns {Object.} JSON object + */ + ResponseApplySnapshotChunk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Result enum. + * @name tendermint.abci.ResponseApplySnapshotChunk.Result + * @enum {string} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} ACCEPT=1 ACCEPT value + * @property {number} ABORT=2 ABORT value + * @property {number} RETRY=3 RETRY value + * @property {number} RETRY_SNAPSHOT=4 RETRY_SNAPSHOT value + * @property {number} REJECT_SNAPSHOT=5 REJECT_SNAPSHOT value + */ + ResponseApplySnapshotChunk.Result = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "ACCEPT"] = 1; + values[valuesById[2] = "ABORT"] = 2; + values[valuesById[3] = "RETRY"] = 3; + values[valuesById[4] = "RETRY_SNAPSHOT"] = 4; + values[valuesById[5] = "REJECT_SNAPSHOT"] = 5; + return values; + })(); + + return ResponseApplySnapshotChunk; + })(abci.ResponseApplySnapshotChunk || {}); + + abci.ConsensusParams = (function(ConsensusParams) { + + /** + * Properties of a ConsensusParams. + * @memberof tendermint.abci + * @interface IConsensusParams + * @property {tendermint.abci.IBlockParams|null} [block] ConsensusParams block + * @property {tendermint.types.IEvidenceParams|null} [evidence] ConsensusParams evidence + * @property {tendermint.types.IValidatorParams|null} [validator] ConsensusParams validator + * @property {tendermint.types.IVersionParams|null} [version] ConsensusParams version + */ + + /** + * Constructs a new ConsensusParams. + * @memberof tendermint.abci + * @classdesc Represents a ConsensusParams. + * @implements IConsensusParams + * @constructor + * @param {tendermint.abci.IConsensusParams=} [properties] Properties to set + */ + function ConsensusParams(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConsensusParams block. + * @member {tendermint.abci.IBlockParams|null|undefined} block + * @memberof tendermint.abci.ConsensusParams + * @instance + */ + ConsensusParams.prototype.block = null; + + /** + * ConsensusParams evidence. + * @member {tendermint.types.IEvidenceParams|null|undefined} evidence + * @memberof tendermint.abci.ConsensusParams + * @instance + */ + ConsensusParams.prototype.evidence = null; + + /** + * ConsensusParams validator. + * @member {tendermint.types.IValidatorParams|null|undefined} validator + * @memberof tendermint.abci.ConsensusParams + * @instance + */ + ConsensusParams.prototype.validator = null; + + /** + * ConsensusParams version. + * @member {tendermint.types.IVersionParams|null|undefined} version + * @memberof tendermint.abci.ConsensusParams + * @instance + */ + ConsensusParams.prototype.version = null; + + /** + * Creates a new ConsensusParams instance using the specified properties. + * @function create + * @memberof tendermint.abci.ConsensusParams + * @static + * @param {tendermint.abci.IConsensusParams=} [properties] Properties to set + * @returns {tendermint.abci.ConsensusParams} ConsensusParams instance + */ + ConsensusParams.create = function create(properties) { + return new ConsensusParams(properties); + }; + + /** + * Encodes the specified ConsensusParams message. Does not implicitly {@link tendermint.abci.ConsensusParams.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ConsensusParams + * @static + * @param {tendermint.abci.IConsensusParams} message ConsensusParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.block != null && Object.hasOwnProperty.call(message, "block")) + $root.tendermint.abci.BlockParams.encode(message.block, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.evidence != null && Object.hasOwnProperty.call(message, "evidence")) + $root.tendermint.types.EvidenceParams.encode(message.evidence, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.validator != null && Object.hasOwnProperty.call(message, "validator")) + $root.tendermint.types.ValidatorParams.encode(message.validator, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + $root.tendermint.types.VersionParams.encode(message.version, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConsensusParams message, length delimited. Does not implicitly {@link tendermint.abci.ConsensusParams.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ConsensusParams + * @static + * @param {tendermint.abci.IConsensusParams} message ConsensusParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConsensusParams message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ConsensusParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ConsensusParams} ConsensusParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ConsensusParams(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.block = $root.tendermint.abci.BlockParams.decode(reader, reader.uint32()); + break; + case 2: + message.evidence = $root.tendermint.types.EvidenceParams.decode(reader, reader.uint32()); + break; + case 3: + message.validator = $root.tendermint.types.ValidatorParams.decode(reader, reader.uint32()); + break; + case 4: + message.version = $root.tendermint.types.VersionParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConsensusParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ConsensusParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ConsensusParams} ConsensusParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConsensusParams message. + * @function verify + * @memberof tendermint.abci.ConsensusParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConsensusParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.block != null && message.hasOwnProperty("block")) { + let error = $root.tendermint.abci.BlockParams.verify(message.block); + if (error) + return "block." + error; + } + if (message.evidence != null && message.hasOwnProperty("evidence")) { + let error = $root.tendermint.types.EvidenceParams.verify(message.evidence); + if (error) + return "evidence." + error; + } + if (message.validator != null && message.hasOwnProperty("validator")) { + let error = $root.tendermint.types.ValidatorParams.verify(message.validator); + if (error) + return "validator." + error; + } + if (message.version != null && message.hasOwnProperty("version")) { + let error = $root.tendermint.types.VersionParams.verify(message.version); + if (error) + return "version." + error; + } + return null; + }; + + /** + * Creates a ConsensusParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ConsensusParams + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ConsensusParams} ConsensusParams + */ + ConsensusParams.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ConsensusParams) + return object; + let message = new $root.tendermint.abci.ConsensusParams(); + if (object.block != null) { + if (typeof object.block !== "object") + throw TypeError(".tendermint.abci.ConsensusParams.block: object expected"); + message.block = $root.tendermint.abci.BlockParams.fromObject(object.block); + } + if (object.evidence != null) { + if (typeof object.evidence !== "object") + throw TypeError(".tendermint.abci.ConsensusParams.evidence: object expected"); + message.evidence = $root.tendermint.types.EvidenceParams.fromObject(object.evidence); + } + if (object.validator != null) { + if (typeof object.validator !== "object") + throw TypeError(".tendermint.abci.ConsensusParams.validator: object expected"); + message.validator = $root.tendermint.types.ValidatorParams.fromObject(object.validator); + } + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".tendermint.abci.ConsensusParams.version: object expected"); + message.version = $root.tendermint.types.VersionParams.fromObject(object.version); + } + return message; + }; + + /** + * Creates a plain object from a ConsensusParams message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ConsensusParams + * @static + * @param {tendermint.abci.ConsensusParams} message ConsensusParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConsensusParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.block = null; + object.evidence = null; + object.validator = null; + object.version = null; + } + if (message.block != null && message.hasOwnProperty("block")) + object.block = $root.tendermint.abci.BlockParams.toObject(message.block, options); + if (message.evidence != null && message.hasOwnProperty("evidence")) + object.evidence = $root.tendermint.types.EvidenceParams.toObject(message.evidence, options); + if (message.validator != null && message.hasOwnProperty("validator")) + object.validator = $root.tendermint.types.ValidatorParams.toObject(message.validator, options); + if (message.version != null && message.hasOwnProperty("version")) + object.version = $root.tendermint.types.VersionParams.toObject(message.version, options); + return object; + }; + + /** + * Converts this ConsensusParams to JSON. + * @function toJSON + * @memberof tendermint.abci.ConsensusParams + * @instance + * @returns {Object.} JSON object + */ + ConsensusParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ConsensusParams; + })(abci.ConsensusParams || {}); + + abci.BlockParams = (function(BlockParams) { + + /** + * Properties of a BlockParams. + * @memberof tendermint.abci + * @interface IBlockParams + * @property {number|Long|null} [maxBytes] BlockParams maxBytes + * @property {number|Long|null} [maxGas] BlockParams maxGas + */ + + /** + * Constructs a new BlockParams. + * @memberof tendermint.abci + * @classdesc Represents a BlockParams. + * @implements IBlockParams + * @constructor + * @param {tendermint.abci.IBlockParams=} [properties] Properties to set + */ + function BlockParams(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BlockParams maxBytes. + * @member {number|Long} maxBytes + * @memberof tendermint.abci.BlockParams + * @instance + */ + BlockParams.prototype.maxBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BlockParams maxGas. + * @member {number|Long} maxGas + * @memberof tendermint.abci.BlockParams + * @instance + */ + BlockParams.prototype.maxGas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new BlockParams instance using the specified properties. + * @function create + * @memberof tendermint.abci.BlockParams + * @static + * @param {tendermint.abci.IBlockParams=} [properties] Properties to set + * @returns {tendermint.abci.BlockParams} BlockParams instance + */ + BlockParams.create = function create(properties) { + return new BlockParams(properties); + }; + + /** + * Encodes the specified BlockParams message. Does not implicitly {@link tendermint.abci.BlockParams.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.BlockParams + * @static + * @param {tendermint.abci.IBlockParams} message BlockParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlockParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxBytes != null && Object.hasOwnProperty.call(message, "maxBytes")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.maxBytes); + if (message.maxGas != null && Object.hasOwnProperty.call(message, "maxGas")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.maxGas); + return writer; + }; + + /** + * Encodes the specified BlockParams message, length delimited. Does not implicitly {@link tendermint.abci.BlockParams.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.BlockParams + * @static + * @param {tendermint.abci.IBlockParams} message BlockParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlockParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BlockParams message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.BlockParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.BlockParams} BlockParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlockParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.BlockParams(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxBytes = reader.int64(); + break; + case 2: + message.maxGas = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BlockParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.BlockParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.BlockParams} BlockParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlockParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BlockParams message. + * @function verify + * @memberof tendermint.abci.BlockParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BlockParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + if (!$util.isInteger(message.maxBytes) && !(message.maxBytes && $util.isInteger(message.maxBytes.low) && $util.isInteger(message.maxBytes.high))) + return "maxBytes: integer|Long expected"; + if (message.maxGas != null && message.hasOwnProperty("maxGas")) + if (!$util.isInteger(message.maxGas) && !(message.maxGas && $util.isInteger(message.maxGas.low) && $util.isInteger(message.maxGas.high))) + return "maxGas: integer|Long expected"; + return null; + }; + + /** + * Creates a BlockParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.BlockParams + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.BlockParams} BlockParams + */ + BlockParams.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.BlockParams) + return object; + let message = new $root.tendermint.abci.BlockParams(); + if (object.maxBytes != null) + if ($util.Long) + (message.maxBytes = $util.Long.fromValue(object.maxBytes)).unsigned = false; + else if (typeof object.maxBytes === "string") + message.maxBytes = parseInt(object.maxBytes, 10); + else if (typeof object.maxBytes === "number") + message.maxBytes = object.maxBytes; + else if (typeof object.maxBytes === "object") + message.maxBytes = new $util.LongBits(object.maxBytes.low >>> 0, object.maxBytes.high >>> 0).toNumber(); + if (object.maxGas != null) + if ($util.Long) + (message.maxGas = $util.Long.fromValue(object.maxGas)).unsigned = false; + else if (typeof object.maxGas === "string") + message.maxGas = parseInt(object.maxGas, 10); + else if (typeof object.maxGas === "number") + message.maxGas = object.maxGas; + else if (typeof object.maxGas === "object") + message.maxGas = new $util.LongBits(object.maxGas.low >>> 0, object.maxGas.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a BlockParams message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.BlockParams + * @static + * @param {tendermint.abci.BlockParams} message BlockParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BlockParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.maxBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxBytes = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.maxGas = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxGas = options.longs === String ? "0" : 0; + } + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + if (typeof message.maxBytes === "number") + object.maxBytes = options.longs === String ? String(message.maxBytes) : message.maxBytes; + else + object.maxBytes = options.longs === String ? $util.Long.prototype.toString.call(message.maxBytes) : options.longs === Number ? new $util.LongBits(message.maxBytes.low >>> 0, message.maxBytes.high >>> 0).toNumber() : message.maxBytes; + if (message.maxGas != null && message.hasOwnProperty("maxGas")) + if (typeof message.maxGas === "number") + object.maxGas = options.longs === String ? String(message.maxGas) : message.maxGas; + else + object.maxGas = options.longs === String ? $util.Long.prototype.toString.call(message.maxGas) : options.longs === Number ? new $util.LongBits(message.maxGas.low >>> 0, message.maxGas.high >>> 0).toNumber() : message.maxGas; + return object; + }; + + /** + * Converts this BlockParams to JSON. + * @function toJSON + * @memberof tendermint.abci.BlockParams + * @instance + * @returns {Object.} JSON object + */ + BlockParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BlockParams; + })(abci.BlockParams || {}); + + abci.LastCommitInfo = (function(LastCommitInfo) { + + /** + * Properties of a LastCommitInfo. + * @memberof tendermint.abci + * @interface ILastCommitInfo + * @property {number|null} [round] LastCommitInfo round + * @property {Array.|null} [votes] LastCommitInfo votes + */ + + /** + * Constructs a new LastCommitInfo. + * @memberof tendermint.abci + * @classdesc Represents a LastCommitInfo. + * @implements ILastCommitInfo + * @constructor + * @param {tendermint.abci.ILastCommitInfo=} [properties] Properties to set + */ + function LastCommitInfo(properties) { + this.votes = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LastCommitInfo round. + * @member {number} round + * @memberof tendermint.abci.LastCommitInfo + * @instance + */ + LastCommitInfo.prototype.round = 0; + + /** + * LastCommitInfo votes. + * @member {Array.} votes + * @memberof tendermint.abci.LastCommitInfo + * @instance + */ + LastCommitInfo.prototype.votes = $util.emptyArray; + + /** + * Creates a new LastCommitInfo instance using the specified properties. + * @function create + * @memberof tendermint.abci.LastCommitInfo + * @static + * @param {tendermint.abci.ILastCommitInfo=} [properties] Properties to set + * @returns {tendermint.abci.LastCommitInfo} LastCommitInfo instance + */ + LastCommitInfo.create = function create(properties) { + return new LastCommitInfo(properties); + }; + + /** + * Encodes the specified LastCommitInfo message. Does not implicitly {@link tendermint.abci.LastCommitInfo.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.LastCommitInfo + * @static + * @param {tendermint.abci.ILastCommitInfo} message LastCommitInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LastCommitInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.round != null && Object.hasOwnProperty.call(message, "round")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.round); + if (message.votes != null && message.votes.length) + for (let i = 0; i < message.votes.length; ++i) + $root.tendermint.abci.VoteInfo.encode(message.votes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LastCommitInfo message, length delimited. Does not implicitly {@link tendermint.abci.LastCommitInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.LastCommitInfo + * @static + * @param {tendermint.abci.ILastCommitInfo} message LastCommitInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LastCommitInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LastCommitInfo message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.LastCommitInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.LastCommitInfo} LastCommitInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LastCommitInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.LastCommitInfo(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.round = reader.int32(); + break; + case 2: + if (!(message.votes && message.votes.length)) + message.votes = []; + message.votes.push($root.tendermint.abci.VoteInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LastCommitInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.LastCommitInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.LastCommitInfo} LastCommitInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LastCommitInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LastCommitInfo message. + * @function verify + * @memberof tendermint.abci.LastCommitInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LastCommitInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.round != null && message.hasOwnProperty("round")) + if (!$util.isInteger(message.round)) + return "round: integer expected"; + if (message.votes != null && message.hasOwnProperty("votes")) { + if (!Array.isArray(message.votes)) + return "votes: array expected"; + for (let i = 0; i < message.votes.length; ++i) { + let error = $root.tendermint.abci.VoteInfo.verify(message.votes[i]); + if (error) + return "votes." + error; + } + } + return null; + }; + + /** + * Creates a LastCommitInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.LastCommitInfo + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.LastCommitInfo} LastCommitInfo + */ + LastCommitInfo.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.LastCommitInfo) + return object; + let message = new $root.tendermint.abci.LastCommitInfo(); + if (object.round != null) + message.round = object.round | 0; + if (object.votes) { + if (!Array.isArray(object.votes)) + throw TypeError(".tendermint.abci.LastCommitInfo.votes: array expected"); + message.votes = []; + for (let i = 0; i < object.votes.length; ++i) { + if (typeof object.votes[i] !== "object") + throw TypeError(".tendermint.abci.LastCommitInfo.votes: object expected"); + message.votes[i] = $root.tendermint.abci.VoteInfo.fromObject(object.votes[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a LastCommitInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.LastCommitInfo + * @static + * @param {tendermint.abci.LastCommitInfo} message LastCommitInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LastCommitInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.votes = []; + if (options.defaults) + object.round = 0; + if (message.round != null && message.hasOwnProperty("round")) + object.round = message.round; + if (message.votes && message.votes.length) { + object.votes = []; + for (let j = 0; j < message.votes.length; ++j) + object.votes[j] = $root.tendermint.abci.VoteInfo.toObject(message.votes[j], options); + } + return object; + }; + + /** + * Converts this LastCommitInfo to JSON. + * @function toJSON + * @memberof tendermint.abci.LastCommitInfo + * @instance + * @returns {Object.} JSON object + */ + LastCommitInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LastCommitInfo; + })(abci.LastCommitInfo || {}); + + abci.Event = (function(Event) { + + /** + * Properties of an Event. + * @memberof tendermint.abci + * @interface IEvent + * @property {string|null} [type] Event type + * @property {Array.|null} [attributes] Event attributes + */ + + /** + * Constructs a new Event. + * @memberof tendermint.abci + * @classdesc Represents an Event. + * @implements IEvent + * @constructor + * @param {tendermint.abci.IEvent=} [properties] Properties to set + */ + function Event(properties) { + this.attributes = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Event type. + * @member {string} type + * @memberof tendermint.abci.Event + * @instance + */ + Event.prototype.type = ""; + + /** + * Event attributes. + * @member {Array.} attributes + * @memberof tendermint.abci.Event + * @instance + */ + Event.prototype.attributes = $util.emptyArray; + + /** + * Creates a new Event instance using the specified properties. + * @function create + * @memberof tendermint.abci.Event + * @static + * @param {tendermint.abci.IEvent=} [properties] Properties to set + * @returns {tendermint.abci.Event} Event instance + */ + Event.create = function create(properties) { + return new Event(properties); + }; + + /** + * Encodes the specified Event message. Does not implicitly {@link tendermint.abci.Event.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.Event + * @static + * @param {tendermint.abci.IEvent} message Event message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Event.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.attributes != null && message.attributes.length) + for (let i = 0; i < message.attributes.length; ++i) + $root.tendermint.abci.EventAttribute.encode(message.attributes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Event message, length delimited. Does not implicitly {@link tendermint.abci.Event.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.Event + * @static + * @param {tendermint.abci.IEvent} message Event message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Event.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Event message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.Event + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.Event} Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Event.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.Event(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + if (!(message.attributes && message.attributes.length)) + message.attributes = []; + message.attributes.push($root.tendermint.abci.EventAttribute.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Event message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.Event + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.Event} Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Event.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Event message. + * @function verify + * @memberof tendermint.abci.Event + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Event.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!Array.isArray(message.attributes)) + return "attributes: array expected"; + for (let i = 0; i < message.attributes.length; ++i) { + let error = $root.tendermint.abci.EventAttribute.verify(message.attributes[i]); + if (error) + return "attributes." + error; + } + } + return null; + }; + + /** + * Creates an Event message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.Event + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.Event} Event + */ + Event.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.Event) + return object; + let message = new $root.tendermint.abci.Event(); + if (object.type != null) + message.type = String(object.type); + if (object.attributes) { + if (!Array.isArray(object.attributes)) + throw TypeError(".tendermint.abci.Event.attributes: array expected"); + message.attributes = []; + for (let i = 0; i < object.attributes.length; ++i) { + if (typeof object.attributes[i] !== "object") + throw TypeError(".tendermint.abci.Event.attributes: object expected"); + message.attributes[i] = $root.tendermint.abci.EventAttribute.fromObject(object.attributes[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Event message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.Event + * @static + * @param {tendermint.abci.Event} message Event + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Event.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.attributes = []; + if (options.defaults) + object.type = ""; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.attributes && message.attributes.length) { + object.attributes = []; + for (let j = 0; j < message.attributes.length; ++j) + object.attributes[j] = $root.tendermint.abci.EventAttribute.toObject(message.attributes[j], options); + } + return object; + }; + + /** + * Converts this Event to JSON. + * @function toJSON + * @memberof tendermint.abci.Event + * @instance + * @returns {Object.} JSON object + */ + Event.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Event; + })(abci.Event || {}); + + abci.EventAttribute = (function(EventAttribute) { + + /** + * Properties of an EventAttribute. + * @memberof tendermint.abci + * @interface IEventAttribute + * @property {Uint8Array|null} [key] EventAttribute key + * @property {Uint8Array|null} [value] EventAttribute value + * @property {boolean|null} [index] EventAttribute index + */ + + /** + * Constructs a new EventAttribute. + * @memberof tendermint.abci + * @classdesc Represents an EventAttribute. + * @implements IEventAttribute + * @constructor + * @param {tendermint.abci.IEventAttribute=} [properties] Properties to set + */ + function EventAttribute(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EventAttribute key. + * @member {Uint8Array} key + * @memberof tendermint.abci.EventAttribute + * @instance + */ + EventAttribute.prototype.key = $util.newBuffer([]); + + /** + * EventAttribute value. + * @member {Uint8Array} value + * @memberof tendermint.abci.EventAttribute + * @instance + */ + EventAttribute.prototype.value = $util.newBuffer([]); + + /** + * EventAttribute index. + * @member {boolean} index + * @memberof tendermint.abci.EventAttribute + * @instance + */ + EventAttribute.prototype.index = false; + + /** + * Creates a new EventAttribute instance using the specified properties. + * @function create + * @memberof tendermint.abci.EventAttribute + * @static + * @param {tendermint.abci.IEventAttribute=} [properties] Properties to set + * @returns {tendermint.abci.EventAttribute} EventAttribute instance + */ + EventAttribute.create = function create(properties) { + return new EventAttribute(properties); + }; + + /** + * Encodes the specified EventAttribute message. Does not implicitly {@link tendermint.abci.EventAttribute.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.EventAttribute + * @static + * @param {tendermint.abci.IEventAttribute} message EventAttribute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventAttribute.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.index); + return writer; + }; + + /** + * Encodes the specified EventAttribute message, length delimited. Does not implicitly {@link tendermint.abci.EventAttribute.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.EventAttribute + * @static + * @param {tendermint.abci.IEventAttribute} message EventAttribute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventAttribute.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EventAttribute message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.EventAttribute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.EventAttribute} EventAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventAttribute.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.EventAttribute(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + case 3: + message.index = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EventAttribute message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.EventAttribute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.EventAttribute} EventAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventAttribute.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EventAttribute message. + * @function verify + * @memberof tendermint.abci.EventAttribute + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EventAttribute.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (typeof message.index !== "boolean") + return "index: boolean expected"; + return null; + }; + + /** + * Creates an EventAttribute message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.EventAttribute + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.EventAttribute} EventAttribute + */ + EventAttribute.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.EventAttribute) + return object; + let message = new $root.tendermint.abci.EventAttribute(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length) + message.key = object.key; + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length) + message.value = object.value; + if (object.index != null) + message.index = Boolean(object.index); + return message; + }; + + /** + * Creates a plain object from an EventAttribute message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.EventAttribute + * @static + * @param {tendermint.abci.EventAttribute} message EventAttribute + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EventAttribute.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + object.index = false; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + return object; + }; + + /** + * Converts this EventAttribute to JSON. + * @function toJSON + * @memberof tendermint.abci.EventAttribute + * @instance + * @returns {Object.} JSON object + */ + EventAttribute.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EventAttribute; + })(abci.EventAttribute || {}); + + abci.TxResult = (function(TxResult) { + + /** + * Properties of a TxResult. + * @memberof tendermint.abci + * @interface ITxResult + * @property {number|Long|null} [height] TxResult height + * @property {number|null} [index] TxResult index + * @property {Uint8Array|null} [tx] TxResult tx + * @property {tendermint.abci.IResponseDeliverTx|null} [result] TxResult result + */ + + /** + * Constructs a new TxResult. + * @memberof tendermint.abci + * @classdesc Represents a TxResult. + * @implements ITxResult + * @constructor + * @param {tendermint.abci.ITxResult=} [properties] Properties to set + */ + function TxResult(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TxResult height. + * @member {number|Long} height + * @memberof tendermint.abci.TxResult + * @instance + */ + TxResult.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TxResult index. + * @member {number} index + * @memberof tendermint.abci.TxResult + * @instance + */ + TxResult.prototype.index = 0; + + /** + * TxResult tx. + * @member {Uint8Array} tx + * @memberof tendermint.abci.TxResult + * @instance + */ + TxResult.prototype.tx = $util.newBuffer([]); + + /** + * TxResult result. + * @member {tendermint.abci.IResponseDeliverTx|null|undefined} result + * @memberof tendermint.abci.TxResult + * @instance + */ + TxResult.prototype.result = null; + + /** + * Creates a new TxResult instance using the specified properties. + * @function create + * @memberof tendermint.abci.TxResult + * @static + * @param {tendermint.abci.ITxResult=} [properties] Properties to set + * @returns {tendermint.abci.TxResult} TxResult instance + */ + TxResult.create = function create(properties) { + return new TxResult(properties); + }; + + /** + * Encodes the specified TxResult message. Does not implicitly {@link tendermint.abci.TxResult.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.TxResult + * @static + * @param {tendermint.abci.ITxResult} message TxResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TxResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.height); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.index); + if (message.tx != null && Object.hasOwnProperty.call(message, "tx")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.tx); + if (message.result != null && Object.hasOwnProperty.call(message, "result")) + $root.tendermint.abci.ResponseDeliverTx.encode(message.result, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TxResult message, length delimited. Does not implicitly {@link tendermint.abci.TxResult.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.TxResult + * @static + * @param {tendermint.abci.ITxResult} message TxResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TxResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TxResult message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.TxResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.TxResult} TxResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TxResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.TxResult(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + case 2: + message.index = reader.uint32(); + break; + case 3: + message.tx = reader.bytes(); + break; + case 4: + message.result = $root.tendermint.abci.ResponseDeliverTx.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TxResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.TxResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.TxResult} TxResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TxResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TxResult message. + * @function verify + * @memberof tendermint.abci.TxResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TxResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index)) + return "index: integer expected"; + if (message.tx != null && message.hasOwnProperty("tx")) + if (!(message.tx && typeof message.tx.length === "number" || $util.isString(message.tx))) + return "tx: buffer expected"; + if (message.result != null && message.hasOwnProperty("result")) { + let error = $root.tendermint.abci.ResponseDeliverTx.verify(message.result); + if (error) + return "result." + error; + } + return null; + }; + + /** + * Creates a TxResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.TxResult + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.TxResult} TxResult + */ + TxResult.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.TxResult) + return object; + let message = new $root.tendermint.abci.TxResult(); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + if (object.index != null) + message.index = object.index >>> 0; + if (object.tx != null) + if (typeof object.tx === "string") + $util.base64.decode(object.tx, message.tx = $util.newBuffer($util.base64.length(object.tx)), 0); + else if (object.tx.length) + message.tx = object.tx; + if (object.result != null) { + if (typeof object.result !== "object") + throw TypeError(".tendermint.abci.TxResult.result: object expected"); + message.result = $root.tendermint.abci.ResponseDeliverTx.fromObject(object.result); + } + return message; + }; + + /** + * Creates a plain object from a TxResult message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.TxResult + * @static + * @param {tendermint.abci.TxResult} message TxResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TxResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.index = 0; + if (options.bytes === String) + object.tx = ""; + else { + object.tx = []; + if (options.bytes !== Array) + object.tx = $util.newBuffer(object.tx); + } + object.result = null; + } + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + if (message.tx != null && message.hasOwnProperty("tx")) + object.tx = options.bytes === String ? $util.base64.encode(message.tx, 0, message.tx.length) : options.bytes === Array ? Array.prototype.slice.call(message.tx) : message.tx; + if (message.result != null && message.hasOwnProperty("result")) + object.result = $root.tendermint.abci.ResponseDeliverTx.toObject(message.result, options); + return object; + }; + + /** + * Converts this TxResult to JSON. + * @function toJSON + * @memberof tendermint.abci.TxResult + * @instance + * @returns {Object.} JSON object + */ + TxResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TxResult; + })(abci.TxResult || {}); + + abci.Validator = (function(Validator) { + + /** + * Properties of a Validator. + * @memberof tendermint.abci + * @interface IValidator + * @property {Uint8Array|null} [address] Validator address + * @property {number|Long|null} [power] Validator power + */ + + /** + * Constructs a new Validator. + * @memberof tendermint.abci + * @classdesc Represents a Validator. + * @implements IValidator + * @constructor + * @param {tendermint.abci.IValidator=} [properties] Properties to set + */ + function Validator(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Validator address. + * @member {Uint8Array} address + * @memberof tendermint.abci.Validator + * @instance + */ + Validator.prototype.address = $util.newBuffer([]); + + /** + * Validator power. + * @member {number|Long} power + * @memberof tendermint.abci.Validator + * @instance + */ + Validator.prototype.power = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Validator instance using the specified properties. + * @function create + * @memberof tendermint.abci.Validator + * @static + * @param {tendermint.abci.IValidator=} [properties] Properties to set + * @returns {tendermint.abci.Validator} Validator instance + */ + Validator.create = function create(properties) { + return new Validator(properties); + }; + + /** + * Encodes the specified Validator message. Does not implicitly {@link tendermint.abci.Validator.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.Validator + * @static + * @param {tendermint.abci.IValidator} message Validator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Validator.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.address); + if (message.power != null && Object.hasOwnProperty.call(message, "power")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.power); + return writer; + }; + + /** + * Encodes the specified Validator message, length delimited. Does not implicitly {@link tendermint.abci.Validator.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.Validator + * @static + * @param {tendermint.abci.IValidator} message Validator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Validator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Validator message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.Validator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.Validator} Validator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Validator.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.Validator(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.bytes(); + break; + case 3: + message.power = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Validator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.Validator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.Validator} Validator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Validator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Validator message. + * @function verify + * @memberof tendermint.abci.Validator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Validator.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!(message.address && typeof message.address.length === "number" || $util.isString(message.address))) + return "address: buffer expected"; + if (message.power != null && message.hasOwnProperty("power")) + if (!$util.isInteger(message.power) && !(message.power && $util.isInteger(message.power.low) && $util.isInteger(message.power.high))) + return "power: integer|Long expected"; + return null; + }; + + /** + * Creates a Validator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.Validator + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.Validator} Validator + */ + Validator.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.Validator) + return object; + let message = new $root.tendermint.abci.Validator(); + if (object.address != null) + if (typeof object.address === "string") + $util.base64.decode(object.address, message.address = $util.newBuffer($util.base64.length(object.address)), 0); + else if (object.address.length) + message.address = object.address; + if (object.power != null) + if ($util.Long) + (message.power = $util.Long.fromValue(object.power)).unsigned = false; + else if (typeof object.power === "string") + message.power = parseInt(object.power, 10); + else if (typeof object.power === "number") + message.power = object.power; + else if (typeof object.power === "object") + message.power = new $util.LongBits(object.power.low >>> 0, object.power.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a Validator message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.Validator + * @static + * @param {tendermint.abci.Validator} message Validator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Validator.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if (options.bytes === String) + object.address = ""; + else { + object.address = []; + if (options.bytes !== Array) + object.address = $util.newBuffer(object.address); + } + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.power = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.power = options.longs === String ? "0" : 0; + } + if (message.address != null && message.hasOwnProperty("address")) + object.address = options.bytes === String ? $util.base64.encode(message.address, 0, message.address.length) : options.bytes === Array ? Array.prototype.slice.call(message.address) : message.address; + if (message.power != null && message.hasOwnProperty("power")) + if (typeof message.power === "number") + object.power = options.longs === String ? String(message.power) : message.power; + else + object.power = options.longs === String ? $util.Long.prototype.toString.call(message.power) : options.longs === Number ? new $util.LongBits(message.power.low >>> 0, message.power.high >>> 0).toNumber() : message.power; + return object; + }; + + /** + * Converts this Validator to JSON. + * @function toJSON + * @memberof tendermint.abci.Validator + * @instance + * @returns {Object.} JSON object + */ + Validator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Validator; + })(abci.Validator || {}); + + abci.ValidatorUpdate = (function(ValidatorUpdate) { + + /** + * Properties of a ValidatorUpdate. + * @memberof tendermint.abci + * @interface IValidatorUpdate + * @property {tendermint.crypto.IPublicKey|null} [pubKey] ValidatorUpdate pubKey + * @property {number|Long|null} [power] ValidatorUpdate power + */ + + /** + * Constructs a new ValidatorUpdate. + * @memberof tendermint.abci + * @classdesc Represents a ValidatorUpdate. + * @implements IValidatorUpdate + * @constructor + * @param {tendermint.abci.IValidatorUpdate=} [properties] Properties to set + */ + function ValidatorUpdate(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidatorUpdate pubKey. + * @member {tendermint.crypto.IPublicKey|null|undefined} pubKey + * @memberof tendermint.abci.ValidatorUpdate + * @instance + */ + ValidatorUpdate.prototype.pubKey = null; + + /** + * ValidatorUpdate power. + * @member {number|Long} power + * @memberof tendermint.abci.ValidatorUpdate + * @instance + */ + ValidatorUpdate.prototype.power = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ValidatorUpdate instance using the specified properties. + * @function create + * @memberof tendermint.abci.ValidatorUpdate + * @static + * @param {tendermint.abci.IValidatorUpdate=} [properties] Properties to set + * @returns {tendermint.abci.ValidatorUpdate} ValidatorUpdate instance + */ + ValidatorUpdate.create = function create(properties) { + return new ValidatorUpdate(properties); + }; + + /** + * Encodes the specified ValidatorUpdate message. Does not implicitly {@link tendermint.abci.ValidatorUpdate.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.ValidatorUpdate + * @static + * @param {tendermint.abci.IValidatorUpdate} message ValidatorUpdate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorUpdate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pubKey != null && Object.hasOwnProperty.call(message, "pubKey")) + $root.tendermint.crypto.PublicKey.encode(message.pubKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.power != null && Object.hasOwnProperty.call(message, "power")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.power); + return writer; + }; + + /** + * Encodes the specified ValidatorUpdate message, length delimited. Does not implicitly {@link tendermint.abci.ValidatorUpdate.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.ValidatorUpdate + * @static + * @param {tendermint.abci.IValidatorUpdate} message ValidatorUpdate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorUpdate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidatorUpdate message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.ValidatorUpdate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.ValidatorUpdate} ValidatorUpdate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorUpdate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ValidatorUpdate(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pubKey = $root.tendermint.crypto.PublicKey.decode(reader, reader.uint32()); + break; + case 2: + message.power = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidatorUpdate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.ValidatorUpdate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.ValidatorUpdate} ValidatorUpdate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorUpdate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidatorUpdate message. + * @function verify + * @memberof tendermint.abci.ValidatorUpdate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidatorUpdate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pubKey != null && message.hasOwnProperty("pubKey")) { + let error = $root.tendermint.crypto.PublicKey.verify(message.pubKey); + if (error) + return "pubKey." + error; + } + if (message.power != null && message.hasOwnProperty("power")) + if (!$util.isInteger(message.power) && !(message.power && $util.isInteger(message.power.low) && $util.isInteger(message.power.high))) + return "power: integer|Long expected"; + return null; + }; + + /** + * Creates a ValidatorUpdate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.ValidatorUpdate + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.ValidatorUpdate} ValidatorUpdate + */ + ValidatorUpdate.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.ValidatorUpdate) + return object; + let message = new $root.tendermint.abci.ValidatorUpdate(); + if (object.pubKey != null) { + if (typeof object.pubKey !== "object") + throw TypeError(".tendermint.abci.ValidatorUpdate.pubKey: object expected"); + message.pubKey = $root.tendermint.crypto.PublicKey.fromObject(object.pubKey); + } + if (object.power != null) + if ($util.Long) + (message.power = $util.Long.fromValue(object.power)).unsigned = false; + else if (typeof object.power === "string") + message.power = parseInt(object.power, 10); + else if (typeof object.power === "number") + message.power = object.power; + else if (typeof object.power === "object") + message.power = new $util.LongBits(object.power.low >>> 0, object.power.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ValidatorUpdate message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.ValidatorUpdate + * @static + * @param {tendermint.abci.ValidatorUpdate} message ValidatorUpdate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidatorUpdate.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.pubKey = null; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.power = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.power = options.longs === String ? "0" : 0; + } + if (message.pubKey != null && message.hasOwnProperty("pubKey")) + object.pubKey = $root.tendermint.crypto.PublicKey.toObject(message.pubKey, options); + if (message.power != null && message.hasOwnProperty("power")) + if (typeof message.power === "number") + object.power = options.longs === String ? String(message.power) : message.power; + else + object.power = options.longs === String ? $util.Long.prototype.toString.call(message.power) : options.longs === Number ? new $util.LongBits(message.power.low >>> 0, message.power.high >>> 0).toNumber() : message.power; + return object; + }; + + /** + * Converts this ValidatorUpdate to JSON. + * @function toJSON + * @memberof tendermint.abci.ValidatorUpdate + * @instance + * @returns {Object.} JSON object + */ + ValidatorUpdate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidatorUpdate; + })(abci.ValidatorUpdate || {}); + + abci.VoteInfo = (function(VoteInfo) { + + /** + * Properties of a VoteInfo. + * @memberof tendermint.abci + * @interface IVoteInfo + * @property {tendermint.abci.IValidator|null} [validator] VoteInfo validator + * @property {boolean|null} [signedLastBlock] VoteInfo signedLastBlock + */ + + /** + * Constructs a new VoteInfo. + * @memberof tendermint.abci + * @classdesc Represents a VoteInfo. + * @implements IVoteInfo + * @constructor + * @param {tendermint.abci.IVoteInfo=} [properties] Properties to set + */ + function VoteInfo(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VoteInfo validator. + * @member {tendermint.abci.IValidator|null|undefined} validator + * @memberof tendermint.abci.VoteInfo + * @instance + */ + VoteInfo.prototype.validator = null; + + /** + * VoteInfo signedLastBlock. + * @member {boolean} signedLastBlock + * @memberof tendermint.abci.VoteInfo + * @instance + */ + VoteInfo.prototype.signedLastBlock = false; + + /** + * Creates a new VoteInfo instance using the specified properties. + * @function create + * @memberof tendermint.abci.VoteInfo + * @static + * @param {tendermint.abci.IVoteInfo=} [properties] Properties to set + * @returns {tendermint.abci.VoteInfo} VoteInfo instance + */ + VoteInfo.create = function create(properties) { + return new VoteInfo(properties); + }; + + /** + * Encodes the specified VoteInfo message. Does not implicitly {@link tendermint.abci.VoteInfo.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.VoteInfo + * @static + * @param {tendermint.abci.IVoteInfo} message VoteInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VoteInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validator != null && Object.hasOwnProperty.call(message, "validator")) + $root.tendermint.abci.Validator.encode(message.validator, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.signedLastBlock != null && Object.hasOwnProperty.call(message, "signedLastBlock")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.signedLastBlock); + return writer; + }; + + /** + * Encodes the specified VoteInfo message, length delimited. Does not implicitly {@link tendermint.abci.VoteInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.VoteInfo + * @static + * @param {tendermint.abci.IVoteInfo} message VoteInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VoteInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VoteInfo message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.VoteInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.VoteInfo} VoteInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VoteInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.VoteInfo(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validator = $root.tendermint.abci.Validator.decode(reader, reader.uint32()); + break; + case 2: + message.signedLastBlock = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VoteInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.VoteInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.VoteInfo} VoteInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VoteInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VoteInfo message. + * @function verify + * @memberof tendermint.abci.VoteInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VoteInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validator != null && message.hasOwnProperty("validator")) { + let error = $root.tendermint.abci.Validator.verify(message.validator); + if (error) + return "validator." + error; + } + if (message.signedLastBlock != null && message.hasOwnProperty("signedLastBlock")) + if (typeof message.signedLastBlock !== "boolean") + return "signedLastBlock: boolean expected"; + return null; + }; + + /** + * Creates a VoteInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.VoteInfo + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.VoteInfo} VoteInfo + */ + VoteInfo.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.VoteInfo) + return object; + let message = new $root.tendermint.abci.VoteInfo(); + if (object.validator != null) { + if (typeof object.validator !== "object") + throw TypeError(".tendermint.abci.VoteInfo.validator: object expected"); + message.validator = $root.tendermint.abci.Validator.fromObject(object.validator); + } + if (object.signedLastBlock != null) + message.signedLastBlock = Boolean(object.signedLastBlock); + return message; + }; + + /** + * Creates a plain object from a VoteInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.VoteInfo + * @static + * @param {tendermint.abci.VoteInfo} message VoteInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VoteInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.validator = null; + object.signedLastBlock = false; + } + if (message.validator != null && message.hasOwnProperty("validator")) + object.validator = $root.tendermint.abci.Validator.toObject(message.validator, options); + if (message.signedLastBlock != null && message.hasOwnProperty("signedLastBlock")) + object.signedLastBlock = message.signedLastBlock; + return object; + }; + + /** + * Converts this VoteInfo to JSON. + * @function toJSON + * @memberof tendermint.abci.VoteInfo + * @instance + * @returns {Object.} JSON object + */ + VoteInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VoteInfo; + })(abci.VoteInfo || {}); + + /** + * EvidenceType enum. + * @name tendermint.abci.EvidenceType + * @enum {string} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} DUPLICATE_VOTE=1 DUPLICATE_VOTE value + * @property {number} LIGHT_CLIENT_ATTACK=2 LIGHT_CLIENT_ATTACK value + */ + abci.EvidenceType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "DUPLICATE_VOTE"] = 1; + values[valuesById[2] = "LIGHT_CLIENT_ATTACK"] = 2; + return values; + })(); + + abci.Evidence = (function(Evidence) { + + /** + * Properties of an Evidence. + * @memberof tendermint.abci + * @interface IEvidence + * @property {tendermint.abci.EvidenceType|null} [type] Evidence type + * @property {tendermint.abci.IValidator|null} [validator] Evidence validator + * @property {number|Long|null} [height] Evidence height + * @property {google.protobuf.ITimestamp|null} [time] Evidence time + * @property {number|Long|null} [totalVotingPower] Evidence totalVotingPower + */ + + /** + * Constructs a new Evidence. + * @memberof tendermint.abci + * @classdesc Represents an Evidence. + * @implements IEvidence + * @constructor + * @param {tendermint.abci.IEvidence=} [properties] Properties to set + */ + function Evidence(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Evidence type. + * @member {tendermint.abci.EvidenceType} type + * @memberof tendermint.abci.Evidence + * @instance + */ + Evidence.prototype.type = 0; + + /** + * Evidence validator. + * @member {tendermint.abci.IValidator|null|undefined} validator + * @memberof tendermint.abci.Evidence + * @instance + */ + Evidence.prototype.validator = null; + + /** + * Evidence height. + * @member {number|Long} height + * @memberof tendermint.abci.Evidence + * @instance + */ + Evidence.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Evidence time. + * @member {google.protobuf.ITimestamp|null|undefined} time + * @memberof tendermint.abci.Evidence + * @instance + */ + Evidence.prototype.time = null; + + /** + * Evidence totalVotingPower. + * @member {number|Long} totalVotingPower + * @memberof tendermint.abci.Evidence + * @instance + */ + Evidence.prototype.totalVotingPower = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Evidence instance using the specified properties. + * @function create + * @memberof tendermint.abci.Evidence + * @static + * @param {tendermint.abci.IEvidence=} [properties] Properties to set + * @returns {tendermint.abci.Evidence} Evidence instance + */ + Evidence.create = function create(properties) { + return new Evidence(properties); + }; + + /** + * Encodes the specified Evidence message. Does not implicitly {@link tendermint.abci.Evidence.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.Evidence + * @static + * @param {tendermint.abci.IEvidence} message Evidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Evidence.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.validator != null && Object.hasOwnProperty.call(message, "validator")) + $root.tendermint.abci.Validator.encode(message.validator, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.height); + if (message.time != null && Object.hasOwnProperty.call(message, "time")) + $root.google.protobuf.Timestamp.encode(message.time, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.totalVotingPower != null && Object.hasOwnProperty.call(message, "totalVotingPower")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.totalVotingPower); + return writer; + }; + + /** + * Encodes the specified Evidence message, length delimited. Does not implicitly {@link tendermint.abci.Evidence.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.Evidence + * @static + * @param {tendermint.abci.IEvidence} message Evidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Evidence.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Evidence message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.Evidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.Evidence} Evidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Evidence.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.Evidence(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32(); + break; + case 2: + message.validator = $root.tendermint.abci.Validator.decode(reader, reader.uint32()); + break; + case 3: + message.height = reader.int64(); + break; + case 4: + message.time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.totalVotingPower = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Evidence message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.Evidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.Evidence} Evidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Evidence.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Evidence message. + * @function verify + * @memberof tendermint.abci.Evidence + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Evidence.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.validator != null && message.hasOwnProperty("validator")) { + let error = $root.tendermint.abci.Validator.verify(message.validator); + if (error) + return "validator." + error; + } + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.time != null && message.hasOwnProperty("time")) { + let error = $root.google.protobuf.Timestamp.verify(message.time); + if (error) + return "time." + error; + } + if (message.totalVotingPower != null && message.hasOwnProperty("totalVotingPower")) + if (!$util.isInteger(message.totalVotingPower) && !(message.totalVotingPower && $util.isInteger(message.totalVotingPower.low) && $util.isInteger(message.totalVotingPower.high))) + return "totalVotingPower: integer|Long expected"; + return null; + }; + + /** + * Creates an Evidence message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.Evidence + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.Evidence} Evidence + */ + Evidence.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.Evidence) + return object; + let message = new $root.tendermint.abci.Evidence(); + switch (object.type) { + case "UNKNOWN": + case 0: + message.type = 0; + break; + case "DUPLICATE_VOTE": + case 1: + message.type = 1; + break; + case "LIGHT_CLIENT_ATTACK": + case 2: + message.type = 2; + break; + } + if (object.validator != null) { + if (typeof object.validator !== "object") + throw TypeError(".tendermint.abci.Evidence.validator: object expected"); + message.validator = $root.tendermint.abci.Validator.fromObject(object.validator); + } + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + if (object.time != null) { + if (typeof object.time !== "object") + throw TypeError(".tendermint.abci.Evidence.time: object expected"); + message.time = $root.google.protobuf.Timestamp.fromObject(object.time); + } + if (object.totalVotingPower != null) + if ($util.Long) + (message.totalVotingPower = $util.Long.fromValue(object.totalVotingPower)).unsigned = false; + else if (typeof object.totalVotingPower === "string") + message.totalVotingPower = parseInt(object.totalVotingPower, 10); + else if (typeof object.totalVotingPower === "number") + message.totalVotingPower = object.totalVotingPower; + else if (typeof object.totalVotingPower === "object") + message.totalVotingPower = new $util.LongBits(object.totalVotingPower.low >>> 0, object.totalVotingPower.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Evidence message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.Evidence + * @static + * @param {tendermint.abci.Evidence} message Evidence + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Evidence.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.type = options.enums === String ? "UNKNOWN" : 0; + object.validator = null; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.time = null; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.totalVotingPower = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalVotingPower = options.longs === String ? "0" : 0; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.tendermint.abci.EvidenceType[message.type] : message.type; + if (message.validator != null && message.hasOwnProperty("validator")) + object.validator = $root.tendermint.abci.Validator.toObject(message.validator, options); + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + if (message.time != null && message.hasOwnProperty("time")) + object.time = $root.google.protobuf.Timestamp.toObject(message.time, options); + if (message.totalVotingPower != null && message.hasOwnProperty("totalVotingPower")) + if (typeof message.totalVotingPower === "number") + object.totalVotingPower = options.longs === String ? String(message.totalVotingPower) : message.totalVotingPower; + else + object.totalVotingPower = options.longs === String ? $util.Long.prototype.toString.call(message.totalVotingPower) : options.longs === Number ? new $util.LongBits(message.totalVotingPower.low >>> 0, message.totalVotingPower.high >>> 0).toNumber() : message.totalVotingPower; + return object; + }; + + /** + * Converts this Evidence to JSON. + * @function toJSON + * @memberof tendermint.abci.Evidence + * @instance + * @returns {Object.} JSON object + */ + Evidence.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Evidence; + })(abci.Evidence || {}); + + abci.Snapshot = (function(Snapshot) { + + /** + * Properties of a Snapshot. + * @memberof tendermint.abci + * @interface ISnapshot + * @property {number|Long|null} [height] Snapshot height + * @property {number|null} [format] Snapshot format + * @property {number|null} [chunks] Snapshot chunks + * @property {Uint8Array|null} [hash] Snapshot hash + * @property {Uint8Array|null} [metadata] Snapshot metadata + */ + + /** + * Constructs a new Snapshot. + * @memberof tendermint.abci + * @classdesc Represents a Snapshot. + * @implements ISnapshot + * @constructor + * @param {tendermint.abci.ISnapshot=} [properties] Properties to set + */ + function Snapshot(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Snapshot height. + * @member {number|Long} height + * @memberof tendermint.abci.Snapshot + * @instance + */ + Snapshot.prototype.height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Snapshot format. + * @member {number} format + * @memberof tendermint.abci.Snapshot + * @instance + */ + Snapshot.prototype.format = 0; + + /** + * Snapshot chunks. + * @member {number} chunks + * @memberof tendermint.abci.Snapshot + * @instance + */ + Snapshot.prototype.chunks = 0; + + /** + * Snapshot hash. + * @member {Uint8Array} hash + * @memberof tendermint.abci.Snapshot + * @instance + */ + Snapshot.prototype.hash = $util.newBuffer([]); + + /** + * Snapshot metadata. + * @member {Uint8Array} metadata + * @memberof tendermint.abci.Snapshot + * @instance + */ + Snapshot.prototype.metadata = $util.newBuffer([]); + + /** + * Creates a new Snapshot instance using the specified properties. + * @function create + * @memberof tendermint.abci.Snapshot + * @static + * @param {tendermint.abci.ISnapshot=} [properties] Properties to set + * @returns {tendermint.abci.Snapshot} Snapshot instance + */ + Snapshot.create = function create(properties) { + return new Snapshot(properties); + }; + + /** + * Encodes the specified Snapshot message. Does not implicitly {@link tendermint.abci.Snapshot.verify|verify} messages. + * @function encode + * @memberof tendermint.abci.Snapshot + * @static + * @param {tendermint.abci.ISnapshot} message Snapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Snapshot.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.height); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.format); + if (message.chunks != null && Object.hasOwnProperty.call(message, "chunks")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.chunks); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.hash); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.metadata); + return writer; + }; + + /** + * Encodes the specified Snapshot message, length delimited. Does not implicitly {@link tendermint.abci.Snapshot.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.abci.Snapshot + * @static + * @param {tendermint.abci.ISnapshot} message Snapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Snapshot.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Snapshot message from the specified reader or buffer. + * @function decode + * @memberof tendermint.abci.Snapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.abci.Snapshot} Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Snapshot.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.Snapshot(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.uint64(); + break; + case 2: + message.format = reader.uint32(); + break; + case 3: + message.chunks = reader.uint32(); + break; + case 4: + message.hash = reader.bytes(); + break; + case 5: + message.metadata = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Snapshot message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.abci.Snapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.abci.Snapshot} Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Snapshot.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Snapshot message. + * @function verify + * @memberof tendermint.abci.Snapshot + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Snapshot.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.format != null && message.hasOwnProperty("format")) + if (!$util.isInteger(message.format)) + return "format: integer expected"; + if (message.chunks != null && message.hasOwnProperty("chunks")) + if (!$util.isInteger(message.chunks)) + return "chunks: integer expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash))) + return "hash: buffer expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) + if (!(message.metadata && typeof message.metadata.length === "number" || $util.isString(message.metadata))) + return "metadata: buffer expected"; + return null; + }; + + /** + * Creates a Snapshot message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.abci.Snapshot + * @static + * @param {Object.} object Plain object + * @returns {tendermint.abci.Snapshot} Snapshot + */ + Snapshot.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.abci.Snapshot) + return object; + let message = new $root.tendermint.abci.Snapshot(); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = true; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(true); + if (object.format != null) + message.format = object.format >>> 0; + if (object.chunks != null) + message.chunks = object.chunks >>> 0; + if (object.hash != null) + if (typeof object.hash === "string") + $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0); + else if (object.hash.length) + message.hash = object.hash; + if (object.metadata != null) + if (typeof object.metadata === "string") + $util.base64.decode(object.metadata, message.metadata = $util.newBuffer($util.base64.length(object.metadata)), 0); + else if (object.metadata.length) + message.metadata = object.metadata; + return message; + }; + + /** + * Creates a plain object from a Snapshot message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.abci.Snapshot + * @static + * @param {tendermint.abci.Snapshot} message Snapshot + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Snapshot.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.format = 0; + object.chunks = 0; + if (options.bytes === String) + object.hash = ""; + else { + object.hash = []; + if (options.bytes !== Array) + object.hash = $util.newBuffer(object.hash); + } + if (options.bytes === String) + object.metadata = ""; + else { + object.metadata = []; + if (options.bytes !== Array) + object.metadata = $util.newBuffer(object.metadata); + } + } + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber(true) : message.height; + if (message.format != null && message.hasOwnProperty("format")) + object.format = message.format; + if (message.chunks != null && message.hasOwnProperty("chunks")) + object.chunks = message.chunks; + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = options.bytes === String ? $util.base64.encode(message.metadata, 0, message.metadata.length) : options.bytes === Array ? Array.prototype.slice.call(message.metadata) : message.metadata; + return object; + }; + + /** + * Converts this Snapshot to JSON. + * @function toJSON + * @memberof tendermint.abci.Snapshot + * @instance + * @returns {Object.} JSON object + */ + Snapshot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Snapshot; + })(abci.Snapshot || {}); + + abci.ABCIApplication = (function(ABCIApplication) { + + /** + * Constructs a new ABCIApplication service. + * @memberof tendermint.abci + * @classdesc Represents a ABCIApplication + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function ABCIApplication(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ABCIApplication.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ABCIApplication; + + /** + * Creates new ABCIApplication service using the specified rpc implementation. + * @function create + * @memberof tendermint.abci.ABCIApplication + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {ABCIApplication} RPC service. Useful where requests and/or responses are streamed. + */ + ABCIApplication.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#echo}. + * @memberof tendermint.abci.ABCIApplication + * @typedef EchoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseEcho} [response] ResponseEcho + */ + + /** + * Calls Echo. + * @function echo + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestEcho} request RequestEcho message or plain object + * @param {tendermint.abci.ABCIApplication.EchoCallback} callback Node-style callback called with the error, if any, and ResponseEcho + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.echo = function echo(request, callback) { + return this.rpcCall(echo, $root.tendermint.abci.RequestEcho, $root.tendermint.abci.ResponseEcho, request, callback); + }, "name", { value: "Echo" }); + + /** + * Calls Echo. + * @function echo + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestEcho} request RequestEcho message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#flush}. + * @memberof tendermint.abci.ABCIApplication + * @typedef FlushCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseFlush} [response] ResponseFlush + */ + + /** + * Calls Flush. + * @function flush + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestFlush} request RequestFlush message or plain object + * @param {tendermint.abci.ABCIApplication.FlushCallback} callback Node-style callback called with the error, if any, and ResponseFlush + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.flush = function flush(request, callback) { + return this.rpcCall(flush, $root.tendermint.abci.RequestFlush, $root.tendermint.abci.ResponseFlush, request, callback); + }, "name", { value: "Flush" }); + + /** + * Calls Flush. + * @function flush + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestFlush} request RequestFlush message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#info}. + * @memberof tendermint.abci.ABCIApplication + * @typedef InfoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseInfo} [response] ResponseInfo + */ + + /** + * Calls Info. + * @function info + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestInfo} request RequestInfo message or plain object + * @param {tendermint.abci.ABCIApplication.InfoCallback} callback Node-style callback called with the error, if any, and ResponseInfo + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.info = function info(request, callback) { + return this.rpcCall(info, $root.tendermint.abci.RequestInfo, $root.tendermint.abci.ResponseInfo, request, callback); + }, "name", { value: "Info" }); + + /** + * Calls Info. + * @function info + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestInfo} request RequestInfo message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#setOption}. + * @memberof tendermint.abci.ABCIApplication + * @typedef SetOptionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseSetOption} [response] ResponseSetOption + */ + + /** + * Calls SetOption. + * @function setOption + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestSetOption} request RequestSetOption message or plain object + * @param {tendermint.abci.ABCIApplication.SetOptionCallback} callback Node-style callback called with the error, if any, and ResponseSetOption + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.setOption = function setOption(request, callback) { + return this.rpcCall(setOption, $root.tendermint.abci.RequestSetOption, $root.tendermint.abci.ResponseSetOption, request, callback); + }, "name", { value: "SetOption" }); + + /** + * Calls SetOption. + * @function setOption + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestSetOption} request RequestSetOption message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#deliverTx}. + * @memberof tendermint.abci.ABCIApplication + * @typedef DeliverTxCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseDeliverTx} [response] ResponseDeliverTx + */ + + /** + * Calls DeliverTx. + * @function deliverTx + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestDeliverTx} request RequestDeliverTx message or plain object + * @param {tendermint.abci.ABCIApplication.DeliverTxCallback} callback Node-style callback called with the error, if any, and ResponseDeliverTx + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.deliverTx = function deliverTx(request, callback) { + return this.rpcCall(deliverTx, $root.tendermint.abci.RequestDeliverTx, $root.tendermint.abci.ResponseDeliverTx, request, callback); + }, "name", { value: "DeliverTx" }); + + /** + * Calls DeliverTx. + * @function deliverTx + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestDeliverTx} request RequestDeliverTx message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#checkTx}. + * @memberof tendermint.abci.ABCIApplication + * @typedef CheckTxCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseCheckTx} [response] ResponseCheckTx + */ + + /** + * Calls CheckTx. + * @function checkTx + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestCheckTx} request RequestCheckTx message or plain object + * @param {tendermint.abci.ABCIApplication.CheckTxCallback} callback Node-style callback called with the error, if any, and ResponseCheckTx + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.checkTx = function checkTx(request, callback) { + return this.rpcCall(checkTx, $root.tendermint.abci.RequestCheckTx, $root.tendermint.abci.ResponseCheckTx, request, callback); + }, "name", { value: "CheckTx" }); + + /** + * Calls CheckTx. + * @function checkTx + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestCheckTx} request RequestCheckTx message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#query}. + * @memberof tendermint.abci.ABCIApplication + * @typedef QueryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseQuery} [response] ResponseQuery + */ + + /** + * Calls Query. + * @function query + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestQuery} request RequestQuery message or plain object + * @param {tendermint.abci.ABCIApplication.QueryCallback} callback Node-style callback called with the error, if any, and ResponseQuery + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.query = function query(request, callback) { + return this.rpcCall(query, $root.tendermint.abci.RequestQuery, $root.tendermint.abci.ResponseQuery, request, callback); + }, "name", { value: "Query" }); + + /** + * Calls Query. + * @function query + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestQuery} request RequestQuery message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#commit}. + * @memberof tendermint.abci.ABCIApplication + * @typedef CommitCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseCommit} [response] ResponseCommit + */ + + /** + * Calls Commit. + * @function commit + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestCommit} request RequestCommit message or plain object + * @param {tendermint.abci.ABCIApplication.CommitCallback} callback Node-style callback called with the error, if any, and ResponseCommit + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.commit = function commit(request, callback) { + return this.rpcCall(commit, $root.tendermint.abci.RequestCommit, $root.tendermint.abci.ResponseCommit, request, callback); + }, "name", { value: "Commit" }); + + /** + * Calls Commit. + * @function commit + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestCommit} request RequestCommit message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#initChain}. + * @memberof tendermint.abci.ABCIApplication + * @typedef InitChainCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseInitChain} [response] ResponseInitChain + */ + + /** + * Calls InitChain. + * @function initChain + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestInitChain} request RequestInitChain message or plain object + * @param {tendermint.abci.ABCIApplication.InitChainCallback} callback Node-style callback called with the error, if any, and ResponseInitChain + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.initChain = function initChain(request, callback) { + return this.rpcCall(initChain, $root.tendermint.abci.RequestInitChain, $root.tendermint.abci.ResponseInitChain, request, callback); + }, "name", { value: "InitChain" }); + + /** + * Calls InitChain. + * @function initChain + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestInitChain} request RequestInitChain message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#beginBlock}. + * @memberof tendermint.abci.ABCIApplication + * @typedef BeginBlockCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseBeginBlock} [response] ResponseBeginBlock + */ + + /** + * Calls BeginBlock. + * @function beginBlock + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestBeginBlock} request RequestBeginBlock message or plain object + * @param {tendermint.abci.ABCIApplication.BeginBlockCallback} callback Node-style callback called with the error, if any, and ResponseBeginBlock + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.beginBlock = function beginBlock(request, callback) { + return this.rpcCall(beginBlock, $root.tendermint.abci.RequestBeginBlock, $root.tendermint.abci.ResponseBeginBlock, request, callback); + }, "name", { value: "BeginBlock" }); + + /** + * Calls BeginBlock. + * @function beginBlock + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestBeginBlock} request RequestBeginBlock message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#endBlock}. + * @memberof tendermint.abci.ABCIApplication + * @typedef EndBlockCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseEndBlock} [response] ResponseEndBlock + */ + + /** + * Calls EndBlock. + * @function endBlock + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestEndBlock} request RequestEndBlock message or plain object + * @param {tendermint.abci.ABCIApplication.EndBlockCallback} callback Node-style callback called with the error, if any, and ResponseEndBlock + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.endBlock = function endBlock(request, callback) { + return this.rpcCall(endBlock, $root.tendermint.abci.RequestEndBlock, $root.tendermint.abci.ResponseEndBlock, request, callback); + }, "name", { value: "EndBlock" }); + + /** + * Calls EndBlock. + * @function endBlock + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestEndBlock} request RequestEndBlock message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#listSnapshots}. + * @memberof tendermint.abci.ABCIApplication + * @typedef ListSnapshotsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseListSnapshots} [response] ResponseListSnapshots + */ + + /** + * Calls ListSnapshots. + * @function listSnapshots + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestListSnapshots} request RequestListSnapshots message or plain object + * @param {tendermint.abci.ABCIApplication.ListSnapshotsCallback} callback Node-style callback called with the error, if any, and ResponseListSnapshots + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.listSnapshots = function listSnapshots(request, callback) { + return this.rpcCall(listSnapshots, $root.tendermint.abci.RequestListSnapshots, $root.tendermint.abci.ResponseListSnapshots, request, callback); + }, "name", { value: "ListSnapshots" }); + + /** + * Calls ListSnapshots. + * @function listSnapshots + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestListSnapshots} request RequestListSnapshots message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#offerSnapshot}. + * @memberof tendermint.abci.ABCIApplication + * @typedef OfferSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseOfferSnapshot} [response] ResponseOfferSnapshot + */ + + /** + * Calls OfferSnapshot. + * @function offerSnapshot + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestOfferSnapshot} request RequestOfferSnapshot message or plain object + * @param {tendermint.abci.ABCIApplication.OfferSnapshotCallback} callback Node-style callback called with the error, if any, and ResponseOfferSnapshot + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.offerSnapshot = function offerSnapshot(request, callback) { + return this.rpcCall(offerSnapshot, $root.tendermint.abci.RequestOfferSnapshot, $root.tendermint.abci.ResponseOfferSnapshot, request, callback); + }, "name", { value: "OfferSnapshot" }); + + /** + * Calls OfferSnapshot. + * @function offerSnapshot + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestOfferSnapshot} request RequestOfferSnapshot message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#loadSnapshotChunk}. + * @memberof tendermint.abci.ABCIApplication + * @typedef LoadSnapshotChunkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseLoadSnapshotChunk} [response] ResponseLoadSnapshotChunk + */ + + /** + * Calls LoadSnapshotChunk. + * @function loadSnapshotChunk + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestLoadSnapshotChunk} request RequestLoadSnapshotChunk message or plain object + * @param {tendermint.abci.ABCIApplication.LoadSnapshotChunkCallback} callback Node-style callback called with the error, if any, and ResponseLoadSnapshotChunk + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.loadSnapshotChunk = function loadSnapshotChunk(request, callback) { + return this.rpcCall(loadSnapshotChunk, $root.tendermint.abci.RequestLoadSnapshotChunk, $root.tendermint.abci.ResponseLoadSnapshotChunk, request, callback); + }, "name", { value: "LoadSnapshotChunk" }); + + /** + * Calls LoadSnapshotChunk. + * @function loadSnapshotChunk + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestLoadSnapshotChunk} request RequestLoadSnapshotChunk message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link tendermint.abci.ABCIApplication#applySnapshotChunk}. + * @memberof tendermint.abci.ABCIApplication + * @typedef ApplySnapshotChunkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {tendermint.abci.IResponseApplySnapshotChunk} [response] ResponseApplySnapshotChunk + */ + + /** + * Calls ApplySnapshotChunk. + * @function applySnapshotChunk + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestApplySnapshotChunk} request RequestApplySnapshotChunk message or plain object + * @param {tendermint.abci.ABCIApplication.ApplySnapshotChunkCallback} callback Node-style callback called with the error, if any, and ResponseApplySnapshotChunk + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ABCIApplication.prototype.applySnapshotChunk = function applySnapshotChunk(request, callback) { + return this.rpcCall(applySnapshotChunk, $root.tendermint.abci.RequestApplySnapshotChunk, $root.tendermint.abci.ResponseApplySnapshotChunk, request, callback); + }, "name", { value: "ApplySnapshotChunk" }); + + /** + * Calls ApplySnapshotChunk. + * @function applySnapshotChunk + * @memberof tendermint.abci.ABCIApplication + * @instance + * @param {tendermint.abci.IRequestApplySnapshotChunk} request RequestApplySnapshotChunk message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ABCIApplication; + })(abci.ABCIApplication || {}); + + return abci; + })(tendermint.abci || {}); + + /** + * Namespace crypto. + * @memberof tendermint + * @namespace + */ + + tendermint.crypto = (function(crypto) { + + crypto.PublicKey = (function(PublicKey) { + + /** + * Properties of a PublicKey. + * @memberof tendermint.crypto + * @interface IPublicKey + * @property {Uint8Array|null} [ed25519] PublicKey ed25519 + * @property {Uint8Array|null} [secp256k1] PublicKey secp256k1 + */ + + /** + * Constructs a new PublicKey. + * @memberof tendermint.crypto + * @classdesc Represents a PublicKey. + * @implements IPublicKey + * @constructor + * @param {tendermint.crypto.IPublicKey=} [properties] Properties to set + */ + function PublicKey(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PublicKey ed25519. + * @member {Uint8Array} ed25519 + * @memberof tendermint.crypto.PublicKey + * @instance + */ + PublicKey.prototype.ed25519 = $util.newBuffer([]); + + /** + * PublicKey secp256k1. + * @member {Uint8Array} secp256k1 + * @memberof tendermint.crypto.PublicKey + * @instance + */ + PublicKey.prototype.secp256k1 = $util.newBuffer([]); + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PublicKey sum. + * @member {"ed25519"|"secp256k1"|undefined} sum + * @memberof tendermint.crypto.PublicKey + * @instance + */ + Object.defineProperty(PublicKey.prototype, "sum", { + get: $util.oneOfGetter($oneOfFields = ["ed25519", "secp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PublicKey instance using the specified properties. + * @function create + * @memberof tendermint.crypto.PublicKey + * @static + * @param {tendermint.crypto.IPublicKey=} [properties] Properties to set + * @returns {tendermint.crypto.PublicKey} PublicKey instance + */ + PublicKey.create = function create(properties) { + return new PublicKey(properties); + }; + + /** + * Encodes the specified PublicKey message. Does not implicitly {@link tendermint.crypto.PublicKey.verify|verify} messages. + * @function encode + * @memberof tendermint.crypto.PublicKey + * @static + * @param {tendermint.crypto.IPublicKey} message PublicKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ed25519 != null && Object.hasOwnProperty.call(message, "ed25519")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.ed25519); + if (message.secp256k1 != null && Object.hasOwnProperty.call(message, "secp256k1")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.secp256k1); + return writer; + }; + + /** + * Encodes the specified PublicKey message, length delimited. Does not implicitly {@link tendermint.crypto.PublicKey.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.crypto.PublicKey + * @static + * @param {tendermint.crypto.IPublicKey} message PublicKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PublicKey message from the specified reader or buffer. + * @function decode + * @memberof tendermint.crypto.PublicKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.crypto.PublicKey} PublicKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicKey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.PublicKey(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ed25519 = reader.bytes(); + break; + case 2: + message.secp256k1 = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PublicKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.crypto.PublicKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.crypto.PublicKey} PublicKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PublicKey message. + * @function verify + * @memberof tendermint.crypto.PublicKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PublicKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + let properties = {}; + if (message.ed25519 != null && message.hasOwnProperty("ed25519")) { + properties.sum = 1; + if (!(message.ed25519 && typeof message.ed25519.length === "number" || $util.isString(message.ed25519))) + return "ed25519: buffer expected"; + } + if (message.secp256k1 != null && message.hasOwnProperty("secp256k1")) { + if (properties.sum === 1) + return "sum: multiple values"; + properties.sum = 1; + if (!(message.secp256k1 && typeof message.secp256k1.length === "number" || $util.isString(message.secp256k1))) + return "secp256k1: buffer expected"; + } + return null; + }; + + /** + * Creates a PublicKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.crypto.PublicKey + * @static + * @param {Object.} object Plain object + * @returns {tendermint.crypto.PublicKey} PublicKey + */ + PublicKey.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.crypto.PublicKey) + return object; + let message = new $root.tendermint.crypto.PublicKey(); + if (object.ed25519 != null) + if (typeof object.ed25519 === "string") + $util.base64.decode(object.ed25519, message.ed25519 = $util.newBuffer($util.base64.length(object.ed25519)), 0); + else if (object.ed25519.length) + message.ed25519 = object.ed25519; + if (object.secp256k1 != null) + if (typeof object.secp256k1 === "string") + $util.base64.decode(object.secp256k1, message.secp256k1 = $util.newBuffer($util.base64.length(object.secp256k1)), 0); + else if (object.secp256k1.length) + message.secp256k1 = object.secp256k1; + return message; + }; + + /** + * Creates a plain object from a PublicKey message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.crypto.PublicKey + * @static + * @param {tendermint.crypto.PublicKey} message PublicKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PublicKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.ed25519 != null && message.hasOwnProperty("ed25519")) { + object.ed25519 = options.bytes === String ? $util.base64.encode(message.ed25519, 0, message.ed25519.length) : options.bytes === Array ? Array.prototype.slice.call(message.ed25519) : message.ed25519; + if (options.oneofs) + object.sum = "ed25519"; + } + if (message.secp256k1 != null && message.hasOwnProperty("secp256k1")) { + object.secp256k1 = options.bytes === String ? $util.base64.encode(message.secp256k1, 0, message.secp256k1.length) : options.bytes === Array ? Array.prototype.slice.call(message.secp256k1) : message.secp256k1; + if (options.oneofs) + object.sum = "secp256k1"; + } + return object; + }; + + /** + * Converts this PublicKey to JSON. + * @function toJSON + * @memberof tendermint.crypto.PublicKey + * @instance + * @returns {Object.} JSON object + */ + PublicKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PublicKey; + })(crypto.PublicKey || {}); + + crypto.Proof = (function(Proof) { + + /** + * Properties of a Proof. + * @memberof tendermint.crypto + * @interface IProof + * @property {number|Long|null} [total] Proof total + * @property {number|Long|null} [index] Proof index + * @property {Uint8Array|null} [leafHash] Proof leafHash + * @property {Array.|null} [aunts] Proof aunts + */ + + /** + * Constructs a new Proof. + * @memberof tendermint.crypto + * @classdesc Represents a Proof. + * @implements IProof + * @constructor + * @param {tendermint.crypto.IProof=} [properties] Properties to set + */ + function Proof(properties) { + this.aunts = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Proof total. + * @member {number|Long} total + * @memberof tendermint.crypto.Proof + * @instance + */ + Proof.prototype.total = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Proof index. + * @member {number|Long} index + * @memberof tendermint.crypto.Proof + * @instance + */ + Proof.prototype.index = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Proof leafHash. + * @member {Uint8Array} leafHash + * @memberof tendermint.crypto.Proof + * @instance + */ + Proof.prototype.leafHash = $util.newBuffer([]); + + /** + * Proof aunts. + * @member {Array.} aunts + * @memberof tendermint.crypto.Proof + * @instance + */ + Proof.prototype.aunts = $util.emptyArray; + + /** + * Creates a new Proof instance using the specified properties. + * @function create + * @memberof tendermint.crypto.Proof + * @static + * @param {tendermint.crypto.IProof=} [properties] Properties to set + * @returns {tendermint.crypto.Proof} Proof instance + */ + Proof.create = function create(properties) { + return new Proof(properties); + }; + + /** + * Encodes the specified Proof message. Does not implicitly {@link tendermint.crypto.Proof.verify|verify} messages. + * @function encode + * @memberof tendermint.crypto.Proof + * @static + * @param {tendermint.crypto.IProof} message Proof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proof.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.total != null && Object.hasOwnProperty.call(message, "total")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.total); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.index); + if (message.leafHash != null && Object.hasOwnProperty.call(message, "leafHash")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.leafHash); + if (message.aunts != null && message.aunts.length) + for (let i = 0; i < message.aunts.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.aunts[i]); + return writer; + }; + + /** + * Encodes the specified Proof message, length delimited. Does not implicitly {@link tendermint.crypto.Proof.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.crypto.Proof + * @static + * @param {tendermint.crypto.IProof} message Proof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proof.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Proof message from the specified reader or buffer. + * @function decode + * @memberof tendermint.crypto.Proof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.crypto.Proof} Proof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proof.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.Proof(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.total = reader.int64(); + break; + case 2: + message.index = reader.int64(); + break; + case 3: + message.leafHash = reader.bytes(); + break; + case 4: + if (!(message.aunts && message.aunts.length)) + message.aunts = []; + message.aunts.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Proof message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.crypto.Proof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.crypto.Proof} Proof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proof.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Proof message. + * @function verify + * @memberof tendermint.crypto.Proof + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Proof.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.total != null && message.hasOwnProperty("total")) + if (!$util.isInteger(message.total) && !(message.total && $util.isInteger(message.total.low) && $util.isInteger(message.total.high))) + return "total: integer|Long expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index) && !(message.index && $util.isInteger(message.index.low) && $util.isInteger(message.index.high))) + return "index: integer|Long expected"; + if (message.leafHash != null && message.hasOwnProperty("leafHash")) + if (!(message.leafHash && typeof message.leafHash.length === "number" || $util.isString(message.leafHash))) + return "leafHash: buffer expected"; + if (message.aunts != null && message.hasOwnProperty("aunts")) { + if (!Array.isArray(message.aunts)) + return "aunts: array expected"; + for (let i = 0; i < message.aunts.length; ++i) + if (!(message.aunts[i] && typeof message.aunts[i].length === "number" || $util.isString(message.aunts[i]))) + return "aunts: buffer[] expected"; + } + return null; + }; + + /** + * Creates a Proof message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.crypto.Proof + * @static + * @param {Object.} object Plain object + * @returns {tendermint.crypto.Proof} Proof + */ + Proof.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.crypto.Proof) + return object; + let message = new $root.tendermint.crypto.Proof(); + if (object.total != null) + if ($util.Long) + (message.total = $util.Long.fromValue(object.total)).unsigned = false; + else if (typeof object.total === "string") + message.total = parseInt(object.total, 10); + else if (typeof object.total === "number") + message.total = object.total; + else if (typeof object.total === "object") + message.total = new $util.LongBits(object.total.low >>> 0, object.total.high >>> 0).toNumber(); + if (object.index != null) + if ($util.Long) + (message.index = $util.Long.fromValue(object.index)).unsigned = false; + else if (typeof object.index === "string") + message.index = parseInt(object.index, 10); + else if (typeof object.index === "number") + message.index = object.index; + else if (typeof object.index === "object") + message.index = new $util.LongBits(object.index.low >>> 0, object.index.high >>> 0).toNumber(); + if (object.leafHash != null) + if (typeof object.leafHash === "string") + $util.base64.decode(object.leafHash, message.leafHash = $util.newBuffer($util.base64.length(object.leafHash)), 0); + else if (object.leafHash.length) + message.leafHash = object.leafHash; + if (object.aunts) { + if (!Array.isArray(object.aunts)) + throw TypeError(".tendermint.crypto.Proof.aunts: array expected"); + message.aunts = []; + for (let i = 0; i < object.aunts.length; ++i) + if (typeof object.aunts[i] === "string") + $util.base64.decode(object.aunts[i], message.aunts[i] = $util.newBuffer($util.base64.length(object.aunts[i])), 0); + else if (object.aunts[i].length) + message.aunts[i] = object.aunts[i]; + } + return message; + }; + + /** + * Creates a plain object from a Proof message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.crypto.Proof + * @static + * @param {tendermint.crypto.Proof} message Proof + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Proof.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.aunts = []; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.total = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.total = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.index = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.index = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.leafHash = ""; + else { + object.leafHash = []; + if (options.bytes !== Array) + object.leafHash = $util.newBuffer(object.leafHash); + } + } + if (message.total != null && message.hasOwnProperty("total")) + if (typeof message.total === "number") + object.total = options.longs === String ? String(message.total) : message.total; + else + object.total = options.longs === String ? $util.Long.prototype.toString.call(message.total) : options.longs === Number ? new $util.LongBits(message.total.low >>> 0, message.total.high >>> 0).toNumber() : message.total; + if (message.index != null && message.hasOwnProperty("index")) + if (typeof message.index === "number") + object.index = options.longs === String ? String(message.index) : message.index; + else + object.index = options.longs === String ? $util.Long.prototype.toString.call(message.index) : options.longs === Number ? new $util.LongBits(message.index.low >>> 0, message.index.high >>> 0).toNumber() : message.index; + if (message.leafHash != null && message.hasOwnProperty("leafHash")) + object.leafHash = options.bytes === String ? $util.base64.encode(message.leafHash, 0, message.leafHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.leafHash) : message.leafHash; + if (message.aunts && message.aunts.length) { + object.aunts = []; + for (let j = 0; j < message.aunts.length; ++j) + object.aunts[j] = options.bytes === String ? $util.base64.encode(message.aunts[j], 0, message.aunts[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.aunts[j]) : message.aunts[j]; + } + return object; + }; + + /** + * Converts this Proof to JSON. + * @function toJSON + * @memberof tendermint.crypto.Proof + * @instance + * @returns {Object.} JSON object + */ + Proof.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Proof; + })(crypto.Proof || {}); + + crypto.ValueOp = (function(ValueOp) { + + /** + * Properties of a ValueOp. + * @memberof tendermint.crypto + * @interface IValueOp + * @property {Uint8Array|null} [key] ValueOp key + * @property {tendermint.crypto.IProof|null} [proof] ValueOp proof + */ + + /** + * Constructs a new ValueOp. + * @memberof tendermint.crypto + * @classdesc Represents a ValueOp. + * @implements IValueOp + * @constructor + * @param {tendermint.crypto.IValueOp=} [properties] Properties to set + */ + function ValueOp(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValueOp key. + * @member {Uint8Array} key + * @memberof tendermint.crypto.ValueOp + * @instance + */ + ValueOp.prototype.key = $util.newBuffer([]); + + /** + * ValueOp proof. + * @member {tendermint.crypto.IProof|null|undefined} proof + * @memberof tendermint.crypto.ValueOp + * @instance + */ + ValueOp.prototype.proof = null; + + /** + * Creates a new ValueOp instance using the specified properties. + * @function create + * @memberof tendermint.crypto.ValueOp + * @static + * @param {tendermint.crypto.IValueOp=} [properties] Properties to set + * @returns {tendermint.crypto.ValueOp} ValueOp instance + */ + ValueOp.create = function create(properties) { + return new ValueOp(properties); + }; + + /** + * Encodes the specified ValueOp message. Does not implicitly {@link tendermint.crypto.ValueOp.verify|verify} messages. + * @function encode + * @memberof tendermint.crypto.ValueOp + * @static + * @param {tendermint.crypto.IValueOp} message ValueOp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValueOp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.tendermint.crypto.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ValueOp message, length delimited. Does not implicitly {@link tendermint.crypto.ValueOp.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.crypto.ValueOp + * @static + * @param {tendermint.crypto.IValueOp} message ValueOp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValueOp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValueOp message from the specified reader or buffer. + * @function decode + * @memberof tendermint.crypto.ValueOp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.crypto.ValueOp} ValueOp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValueOp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.ValueOp(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.proof = $root.tendermint.crypto.Proof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValueOp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.crypto.ValueOp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.crypto.ValueOp} ValueOp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValueOp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValueOp message. + * @function verify + * @memberof tendermint.crypto.ValueOp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValueOp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + if (message.proof != null && message.hasOwnProperty("proof")) { + let error = $root.tendermint.crypto.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + return null; + }; + + /** + * Creates a ValueOp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.crypto.ValueOp + * @static + * @param {Object.} object Plain object + * @returns {tendermint.crypto.ValueOp} ValueOp + */ + ValueOp.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.crypto.ValueOp) + return object; + let message = new $root.tendermint.crypto.ValueOp(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length) + message.key = object.key; + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".tendermint.crypto.ValueOp.proof: object expected"); + message.proof = $root.tendermint.crypto.Proof.fromObject(object.proof); + } + return message; + }; + + /** + * Creates a plain object from a ValueOp message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.crypto.ValueOp + * @static + * @param {tendermint.crypto.ValueOp} message ValueOp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValueOp.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + object.proof = null; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.proof != null && message.hasOwnProperty("proof")) + object.proof = $root.tendermint.crypto.Proof.toObject(message.proof, options); + return object; + }; + + /** + * Converts this ValueOp to JSON. + * @function toJSON + * @memberof tendermint.crypto.ValueOp + * @instance + * @returns {Object.} JSON object + */ + ValueOp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValueOp; + })(crypto.ValueOp || {}); + + crypto.DominoOp = (function(DominoOp) { + + /** + * Properties of a DominoOp. + * @memberof tendermint.crypto + * @interface IDominoOp + * @property {string|null} [key] DominoOp key + * @property {string|null} [input] DominoOp input + * @property {string|null} [output] DominoOp output + */ + + /** + * Constructs a new DominoOp. + * @memberof tendermint.crypto + * @classdesc Represents a DominoOp. + * @implements IDominoOp + * @constructor + * @param {tendermint.crypto.IDominoOp=} [properties] Properties to set + */ + function DominoOp(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DominoOp key. + * @member {string} key + * @memberof tendermint.crypto.DominoOp + * @instance + */ + DominoOp.prototype.key = ""; + + /** + * DominoOp input. + * @member {string} input + * @memberof tendermint.crypto.DominoOp + * @instance + */ + DominoOp.prototype.input = ""; + + /** + * DominoOp output. + * @member {string} output + * @memberof tendermint.crypto.DominoOp + * @instance + */ + DominoOp.prototype.output = ""; + + /** + * Creates a new DominoOp instance using the specified properties. + * @function create + * @memberof tendermint.crypto.DominoOp + * @static + * @param {tendermint.crypto.IDominoOp=} [properties] Properties to set + * @returns {tendermint.crypto.DominoOp} DominoOp instance + */ + DominoOp.create = function create(properties) { + return new DominoOp(properties); + }; + + /** + * Encodes the specified DominoOp message. Does not implicitly {@link tendermint.crypto.DominoOp.verify|verify} messages. + * @function encode + * @memberof tendermint.crypto.DominoOp + * @static + * @param {tendermint.crypto.IDominoOp} message DominoOp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DominoOp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.input != null && Object.hasOwnProperty.call(message, "input")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.input); + if (message.output != null && Object.hasOwnProperty.call(message, "output")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.output); + return writer; + }; + + /** + * Encodes the specified DominoOp message, length delimited. Does not implicitly {@link tendermint.crypto.DominoOp.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.crypto.DominoOp + * @static + * @param {tendermint.crypto.IDominoOp} message DominoOp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DominoOp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DominoOp message from the specified reader or buffer. + * @function decode + * @memberof tendermint.crypto.DominoOp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.crypto.DominoOp} DominoOp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DominoOp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.DominoOp(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.input = reader.string(); + break; + case 3: + message.output = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DominoOp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.crypto.DominoOp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.crypto.DominoOp} DominoOp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DominoOp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DominoOp message. + * @function verify + * @memberof tendermint.crypto.DominoOp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DominoOp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.input != null && message.hasOwnProperty("input")) + if (!$util.isString(message.input)) + return "input: string expected"; + if (message.output != null && message.hasOwnProperty("output")) + if (!$util.isString(message.output)) + return "output: string expected"; + return null; + }; + + /** + * Creates a DominoOp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.crypto.DominoOp + * @static + * @param {Object.} object Plain object + * @returns {tendermint.crypto.DominoOp} DominoOp + */ + DominoOp.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.crypto.DominoOp) + return object; + let message = new $root.tendermint.crypto.DominoOp(); + if (object.key != null) + message.key = String(object.key); + if (object.input != null) + message.input = String(object.input); + if (object.output != null) + message.output = String(object.output); + return message; + }; + + /** + * Creates a plain object from a DominoOp message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.crypto.DominoOp + * @static + * @param {tendermint.crypto.DominoOp} message DominoOp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DominoOp.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.key = ""; + object.input = ""; + object.output = ""; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.input != null && message.hasOwnProperty("input")) + object.input = message.input; + if (message.output != null && message.hasOwnProperty("output")) + object.output = message.output; + return object; + }; + + /** + * Converts this DominoOp to JSON. + * @function toJSON + * @memberof tendermint.crypto.DominoOp + * @instance + * @returns {Object.} JSON object + */ + DominoOp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DominoOp; + })(crypto.DominoOp || {}); + + crypto.ProofOp = (function(ProofOp) { + + /** + * Properties of a ProofOp. + * @memberof tendermint.crypto + * @interface IProofOp + * @property {string|null} [type] ProofOp type + * @property {Uint8Array|null} [key] ProofOp key + * @property {Uint8Array|null} [data] ProofOp data + */ + + /** + * Constructs a new ProofOp. + * @memberof tendermint.crypto + * @classdesc Represents a ProofOp. + * @implements IProofOp + * @constructor + * @param {tendermint.crypto.IProofOp=} [properties] Properties to set + */ + function ProofOp(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProofOp type. + * @member {string} type + * @memberof tendermint.crypto.ProofOp + * @instance + */ + ProofOp.prototype.type = ""; + + /** + * ProofOp key. + * @member {Uint8Array} key + * @memberof tendermint.crypto.ProofOp + * @instance + */ + ProofOp.prototype.key = $util.newBuffer([]); + + /** + * ProofOp data. + * @member {Uint8Array} data + * @memberof tendermint.crypto.ProofOp + * @instance + */ + ProofOp.prototype.data = $util.newBuffer([]); + + /** + * Creates a new ProofOp instance using the specified properties. + * @function create + * @memberof tendermint.crypto.ProofOp + * @static + * @param {tendermint.crypto.IProofOp=} [properties] Properties to set + * @returns {tendermint.crypto.ProofOp} ProofOp instance + */ + ProofOp.create = function create(properties) { + return new ProofOp(properties); + }; + + /** + * Encodes the specified ProofOp message. Does not implicitly {@link tendermint.crypto.ProofOp.verify|verify} messages. + * @function encode + * @memberof tendermint.crypto.ProofOp + * @static + * @param {tendermint.crypto.IProofOp} message ProofOp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProofOp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.key); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.data); + return writer; + }; + + /** + * Encodes the specified ProofOp message, length delimited. Does not implicitly {@link tendermint.crypto.ProofOp.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.crypto.ProofOp + * @static + * @param {tendermint.crypto.IProofOp} message ProofOp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProofOp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProofOp message from the specified reader or buffer. + * @function decode + * @memberof tendermint.crypto.ProofOp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.crypto.ProofOp} ProofOp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProofOp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.ProofOp(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.key = reader.bytes(); + break; + case 3: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProofOp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.crypto.ProofOp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.crypto.ProofOp} ProofOp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProofOp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProofOp message. + * @function verify + * @memberof tendermint.crypto.ProofOp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProofOp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + return null; + }; + + /** + * Creates a ProofOp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.crypto.ProofOp + * @static + * @param {Object.} object Plain object + * @returns {tendermint.crypto.ProofOp} ProofOp + */ + ProofOp.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.crypto.ProofOp) + return object; + let message = new $root.tendermint.crypto.ProofOp(); + if (object.type != null) + message.type = String(object.type); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length) + message.key = object.key; + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length) + message.data = object.data; + return message; + }; + + /** + * Creates a plain object from a ProofOp message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.crypto.ProofOp + * @static + * @param {tendermint.crypto.ProofOp} message ProofOp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProofOp.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.type = ""; + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + return object; + }; + + /** + * Converts this ProofOp to JSON. + * @function toJSON + * @memberof tendermint.crypto.ProofOp + * @instance + * @returns {Object.} JSON object + */ + ProofOp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ProofOp; + })(crypto.ProofOp || {}); + + crypto.ProofOps = (function(ProofOps) { + + /** + * Properties of a ProofOps. + * @memberof tendermint.crypto + * @interface IProofOps + * @property {Array.|null} [ops] ProofOps ops + */ + + /** + * Constructs a new ProofOps. + * @memberof tendermint.crypto + * @classdesc Represents a ProofOps. + * @implements IProofOps + * @constructor + * @param {tendermint.crypto.IProofOps=} [properties] Properties to set + */ + function ProofOps(properties) { + this.ops = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProofOps ops. + * @member {Array.} ops + * @memberof tendermint.crypto.ProofOps + * @instance + */ + ProofOps.prototype.ops = $util.emptyArray; + + /** + * Creates a new ProofOps instance using the specified properties. + * @function create + * @memberof tendermint.crypto.ProofOps + * @static + * @param {tendermint.crypto.IProofOps=} [properties] Properties to set + * @returns {tendermint.crypto.ProofOps} ProofOps instance + */ + ProofOps.create = function create(properties) { + return new ProofOps(properties); + }; + + /** + * Encodes the specified ProofOps message. Does not implicitly {@link tendermint.crypto.ProofOps.verify|verify} messages. + * @function encode + * @memberof tendermint.crypto.ProofOps + * @static + * @param {tendermint.crypto.IProofOps} message ProofOps message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProofOps.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ops != null && message.ops.length) + for (let i = 0; i < message.ops.length; ++i) + $root.tendermint.crypto.ProofOp.encode(message.ops[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProofOps message, length delimited. Does not implicitly {@link tendermint.crypto.ProofOps.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.crypto.ProofOps + * @static + * @param {tendermint.crypto.IProofOps} message ProofOps message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProofOps.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProofOps message from the specified reader or buffer. + * @function decode + * @memberof tendermint.crypto.ProofOps + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.crypto.ProofOps} ProofOps + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProofOps.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.ProofOps(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.ops && message.ops.length)) + message.ops = []; + message.ops.push($root.tendermint.crypto.ProofOp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProofOps message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.crypto.ProofOps + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.crypto.ProofOps} ProofOps + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProofOps.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProofOps message. + * @function verify + * @memberof tendermint.crypto.ProofOps + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProofOps.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ops != null && message.hasOwnProperty("ops")) { + if (!Array.isArray(message.ops)) + return "ops: array expected"; + for (let i = 0; i < message.ops.length; ++i) { + let error = $root.tendermint.crypto.ProofOp.verify(message.ops[i]); + if (error) + return "ops." + error; + } + } + return null; + }; + + /** + * Creates a ProofOps message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.crypto.ProofOps + * @static + * @param {Object.} object Plain object + * @returns {tendermint.crypto.ProofOps} ProofOps + */ + ProofOps.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.crypto.ProofOps) + return object; + let message = new $root.tendermint.crypto.ProofOps(); + if (object.ops) { + if (!Array.isArray(object.ops)) + throw TypeError(".tendermint.crypto.ProofOps.ops: array expected"); + message.ops = []; + for (let i = 0; i < object.ops.length; ++i) { + if (typeof object.ops[i] !== "object") + throw TypeError(".tendermint.crypto.ProofOps.ops: object expected"); + message.ops[i] = $root.tendermint.crypto.ProofOp.fromObject(object.ops[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ProofOps message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.crypto.ProofOps + * @static + * @param {tendermint.crypto.ProofOps} message ProofOps + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProofOps.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.ops = []; + if (message.ops && message.ops.length) { + object.ops = []; + for (let j = 0; j < message.ops.length; ++j) + object.ops[j] = $root.tendermint.crypto.ProofOp.toObject(message.ops[j], options); + } + return object; + }; + + /** + * Converts this ProofOps to JSON. + * @function toJSON + * @memberof tendermint.crypto.ProofOps + * @instance + * @returns {Object.} JSON object + */ + ProofOps.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ProofOps; + })(crypto.ProofOps || {}); + + return crypto; + })(tendermint.crypto || {}); + + /** + * Namespace libs. + * @memberof tendermint + * @namespace + */ + + tendermint.libs = (function(libs) { + + /** + * Namespace bits. + * @memberof tendermint.libs + * @namespace + */ + + libs.bits = (function(bits) { + + bits.BitArray = (function(BitArray) { + + /** + * Properties of a BitArray. + * @memberof tendermint.libs.bits + * @interface IBitArray + * @property {number|Long|null} [bits] BitArray bits + * @property {Array.|null} [elems] BitArray elems + */ + + /** + * Constructs a new BitArray. + * @memberof tendermint.libs.bits + * @classdesc Represents a BitArray. + * @implements IBitArray + * @constructor + * @param {tendermint.libs.bits.IBitArray=} [properties] Properties to set + */ + function BitArray(properties) { + this.elems = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BitArray bits. + * @member {number|Long} bits + * @memberof tendermint.libs.bits.BitArray + * @instance + */ + BitArray.prototype.bits = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BitArray elems. + * @member {Array.} elems + * @memberof tendermint.libs.bits.BitArray + * @instance + */ + BitArray.prototype.elems = $util.emptyArray; + + /** + * Creates a new BitArray instance using the specified properties. + * @function create + * @memberof tendermint.libs.bits.BitArray + * @static + * @param {tendermint.libs.bits.IBitArray=} [properties] Properties to set + * @returns {tendermint.libs.bits.BitArray} BitArray instance + */ + BitArray.create = function create(properties) { + return new BitArray(properties); + }; + + /** + * Encodes the specified BitArray message. Does not implicitly {@link tendermint.libs.bits.BitArray.verify|verify} messages. + * @function encode + * @memberof tendermint.libs.bits.BitArray + * @static + * @param {tendermint.libs.bits.IBitArray} message BitArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BitArray.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bits != null && Object.hasOwnProperty.call(message, "bits")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.bits); + if (message.elems != null && message.elems.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (let i = 0; i < message.elems.length; ++i) + writer.uint64(message.elems[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified BitArray message, length delimited. Does not implicitly {@link tendermint.libs.bits.BitArray.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.libs.bits.BitArray + * @static + * @param {tendermint.libs.bits.IBitArray} message BitArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BitArray.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BitArray message from the specified reader or buffer. + * @function decode + * @memberof tendermint.libs.bits.BitArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.libs.bits.BitArray} BitArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BitArray.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.libs.bits.BitArray(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bits = reader.int64(); + break; + case 2: + if (!(message.elems && message.elems.length)) + message.elems = []; + if ((tag & 7) === 2) { + let end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.elems.push(reader.uint64()); + } else + message.elems.push(reader.uint64()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BitArray message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.libs.bits.BitArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.libs.bits.BitArray} BitArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BitArray.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BitArray message. + * @function verify + * @memberof tendermint.libs.bits.BitArray + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BitArray.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bits != null && message.hasOwnProperty("bits")) + if (!$util.isInteger(message.bits) && !(message.bits && $util.isInteger(message.bits.low) && $util.isInteger(message.bits.high))) + return "bits: integer|Long expected"; + if (message.elems != null && message.hasOwnProperty("elems")) { + if (!Array.isArray(message.elems)) + return "elems: array expected"; + for (let i = 0; i < message.elems.length; ++i) + if (!$util.isInteger(message.elems[i]) && !(message.elems[i] && $util.isInteger(message.elems[i].low) && $util.isInteger(message.elems[i].high))) + return "elems: integer|Long[] expected"; + } + return null; + }; + + /** + * Creates a BitArray message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.libs.bits.BitArray + * @static + * @param {Object.} object Plain object + * @returns {tendermint.libs.bits.BitArray} BitArray + */ + BitArray.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.libs.bits.BitArray) + return object; + let message = new $root.tendermint.libs.bits.BitArray(); + if (object.bits != null) + if ($util.Long) + (message.bits = $util.Long.fromValue(object.bits)).unsigned = false; + else if (typeof object.bits === "string") + message.bits = parseInt(object.bits, 10); + else if (typeof object.bits === "number") + message.bits = object.bits; + else if (typeof object.bits === "object") + message.bits = new $util.LongBits(object.bits.low >>> 0, object.bits.high >>> 0).toNumber(); + if (object.elems) { + if (!Array.isArray(object.elems)) + throw TypeError(".tendermint.libs.bits.BitArray.elems: array expected"); + message.elems = []; + for (let i = 0; i < object.elems.length; ++i) + if ($util.Long) + (message.elems[i] = $util.Long.fromValue(object.elems[i])).unsigned = true; + else if (typeof object.elems[i] === "string") + message.elems[i] = parseInt(object.elems[i], 10); + else if (typeof object.elems[i] === "number") + message.elems[i] = object.elems[i]; + else if (typeof object.elems[i] === "object") + message.elems[i] = new $util.LongBits(object.elems[i].low >>> 0, object.elems[i].high >>> 0).toNumber(true); + } + return message; + }; + + /** + * Creates a plain object from a BitArray message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.libs.bits.BitArray + * @static + * @param {tendermint.libs.bits.BitArray} message BitArray + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BitArray.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.elems = []; + if (options.defaults) + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.bits = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bits = options.longs === String ? "0" : 0; + if (message.bits != null && message.hasOwnProperty("bits")) + if (typeof message.bits === "number") + object.bits = options.longs === String ? String(message.bits) : message.bits; + else + object.bits = options.longs === String ? $util.Long.prototype.toString.call(message.bits) : options.longs === Number ? new $util.LongBits(message.bits.low >>> 0, message.bits.high >>> 0).toNumber() : message.bits; + if (message.elems && message.elems.length) { + object.elems = []; + for (let j = 0; j < message.elems.length; ++j) + if (typeof message.elems[j] === "number") + object.elems[j] = options.longs === String ? String(message.elems[j]) : message.elems[j]; + else + object.elems[j] = options.longs === String ? $util.Long.prototype.toString.call(message.elems[j]) : options.longs === Number ? new $util.LongBits(message.elems[j].low >>> 0, message.elems[j].high >>> 0).toNumber(true) : message.elems[j]; + } + return object; + }; + + /** + * Converts this BitArray to JSON. + * @function toJSON + * @memberof tendermint.libs.bits.BitArray + * @instance + * @returns {Object.} JSON object + */ + BitArray.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BitArray; + })(bits.BitArray || {}); + + return bits; + })(libs.bits || {}); + + return libs; + })(tendermint.libs || {}); + + /** + * Namespace p2p. + * @memberof tendermint + * @namespace + */ + + tendermint.p2p = (function(p2p) { + + p2p.NetAddress = (function(NetAddress) { + + /** + * Properties of a NetAddress. + * @memberof tendermint.p2p + * @interface INetAddress + * @property {string|null} [id] NetAddress id + * @property {string|null} [ip] NetAddress ip + * @property {number|null} [port] NetAddress port + */ + + /** + * Constructs a new NetAddress. + * @memberof tendermint.p2p + * @classdesc Represents a NetAddress. + * @implements INetAddress + * @constructor + * @param {tendermint.p2p.INetAddress=} [properties] Properties to set + */ + function NetAddress(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetAddress id. + * @member {string} id + * @memberof tendermint.p2p.NetAddress + * @instance + */ + NetAddress.prototype.id = ""; + + /** + * NetAddress ip. + * @member {string} ip + * @memberof tendermint.p2p.NetAddress + * @instance + */ + NetAddress.prototype.ip = ""; + + /** + * NetAddress port. + * @member {number} port + * @memberof tendermint.p2p.NetAddress + * @instance + */ + NetAddress.prototype.port = 0; + + /** + * Creates a new NetAddress instance using the specified properties. + * @function create + * @memberof tendermint.p2p.NetAddress + * @static + * @param {tendermint.p2p.INetAddress=} [properties] Properties to set + * @returns {tendermint.p2p.NetAddress} NetAddress instance + */ + NetAddress.create = function create(properties) { + return new NetAddress(properties); + }; + + /** + * Encodes the specified NetAddress message. Does not implicitly {@link tendermint.p2p.NetAddress.verify|verify} messages. + * @function encode + * @memberof tendermint.p2p.NetAddress + * @static + * @param {tendermint.p2p.INetAddress} message NetAddress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetAddress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.ip != null && Object.hasOwnProperty.call(message, "ip")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ip); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.port); + return writer; + }; + + /** + * Encodes the specified NetAddress message, length delimited. Does not implicitly {@link tendermint.p2p.NetAddress.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.p2p.NetAddress + * @static + * @param {tendermint.p2p.INetAddress} message NetAddress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetAddress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetAddress message from the specified reader or buffer. + * @function decode + * @memberof tendermint.p2p.NetAddress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.p2p.NetAddress} NetAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetAddress.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.p2p.NetAddress(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.ip = reader.string(); + break; + case 3: + message.port = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetAddress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.p2p.NetAddress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.p2p.NetAddress} NetAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetAddress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetAddress message. + * @function verify + * @memberof tendermint.p2p.NetAddress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetAddress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.ip != null && message.hasOwnProperty("ip")) + if (!$util.isString(message.ip)) + return "ip: string expected"; + if (message.port != null && message.hasOwnProperty("port")) + if (!$util.isInteger(message.port)) + return "port: integer expected"; + return null; + }; + + /** + * Creates a NetAddress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.p2p.NetAddress + * @static + * @param {Object.} object Plain object + * @returns {tendermint.p2p.NetAddress} NetAddress + */ + NetAddress.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.p2p.NetAddress) + return object; + let message = new $root.tendermint.p2p.NetAddress(); + if (object.id != null) + message.id = String(object.id); + if (object.ip != null) + message.ip = String(object.ip); + if (object.port != null) + message.port = object.port >>> 0; + return message; + }; + + /** + * Creates a plain object from a NetAddress message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.p2p.NetAddress + * @static + * @param {tendermint.p2p.NetAddress} message NetAddress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetAddress.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.id = ""; + object.ip = ""; + object.port = 0; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.ip != null && message.hasOwnProperty("ip")) + object.ip = message.ip; + if (message.port != null && message.hasOwnProperty("port")) + object.port = message.port; + return object; + }; + + /** + * Converts this NetAddress to JSON. + * @function toJSON + * @memberof tendermint.p2p.NetAddress + * @instance + * @returns {Object.} JSON object + */ + NetAddress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NetAddress; + })(p2p.NetAddress || {}); + + p2p.ProtocolVersion = (function(ProtocolVersion) { + + /** + * Properties of a ProtocolVersion. + * @memberof tendermint.p2p + * @interface IProtocolVersion + * @property {number|Long|null} [p2p] ProtocolVersion p2p + * @property {number|Long|null} [block] ProtocolVersion block + * @property {number|Long|null} [app] ProtocolVersion app + */ + + /** + * Constructs a new ProtocolVersion. + * @memberof tendermint.p2p + * @classdesc Represents a ProtocolVersion. + * @implements IProtocolVersion + * @constructor + * @param {tendermint.p2p.IProtocolVersion=} [properties] Properties to set + */ + function ProtocolVersion(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProtocolVersion p2p. + * @member {number|Long} p2p + * @memberof tendermint.p2p.ProtocolVersion + * @instance + */ + ProtocolVersion.prototype.p2p = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ProtocolVersion block. + * @member {number|Long} block + * @memberof tendermint.p2p.ProtocolVersion + * @instance + */ + ProtocolVersion.prototype.block = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ProtocolVersion app. + * @member {number|Long} app + * @memberof tendermint.p2p.ProtocolVersion + * @instance + */ + ProtocolVersion.prototype.app = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new ProtocolVersion instance using the specified properties. + * @function create + * @memberof tendermint.p2p.ProtocolVersion + * @static + * @param {tendermint.p2p.IProtocolVersion=} [properties] Properties to set + * @returns {tendermint.p2p.ProtocolVersion} ProtocolVersion instance + */ + ProtocolVersion.create = function create(properties) { + return new ProtocolVersion(properties); + }; + + /** + * Encodes the specified ProtocolVersion message. Does not implicitly {@link tendermint.p2p.ProtocolVersion.verify|verify} messages. + * @function encode + * @memberof tendermint.p2p.ProtocolVersion + * @static + * @param {tendermint.p2p.IProtocolVersion} message ProtocolVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtocolVersion.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.p2p != null && Object.hasOwnProperty.call(message, "p2p")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.p2p); + if (message.block != null && Object.hasOwnProperty.call(message, "block")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.block); + if (message.app != null && Object.hasOwnProperty.call(message, "app")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.app); + return writer; + }; + + /** + * Encodes the specified ProtocolVersion message, length delimited. Does not implicitly {@link tendermint.p2p.ProtocolVersion.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.p2p.ProtocolVersion + * @static + * @param {tendermint.p2p.IProtocolVersion} message ProtocolVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtocolVersion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProtocolVersion message from the specified reader or buffer. + * @function decode + * @memberof tendermint.p2p.ProtocolVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.p2p.ProtocolVersion} ProtocolVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtocolVersion.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.p2p.ProtocolVersion(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.p2p = reader.uint64(); + break; + case 2: + message.block = reader.uint64(); + break; + case 3: + message.app = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProtocolVersion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.p2p.ProtocolVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.p2p.ProtocolVersion} ProtocolVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtocolVersion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProtocolVersion message. + * @function verify + * @memberof tendermint.p2p.ProtocolVersion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProtocolVersion.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.p2p != null && message.hasOwnProperty("p2p")) + if (!$util.isInteger(message.p2p) && !(message.p2p && $util.isInteger(message.p2p.low) && $util.isInteger(message.p2p.high))) + return "p2p: integer|Long expected"; + if (message.block != null && message.hasOwnProperty("block")) + if (!$util.isInteger(message.block) && !(message.block && $util.isInteger(message.block.low) && $util.isInteger(message.block.high))) + return "block: integer|Long expected"; + if (message.app != null && message.hasOwnProperty("app")) + if (!$util.isInteger(message.app) && !(message.app && $util.isInteger(message.app.low) && $util.isInteger(message.app.high))) + return "app: integer|Long expected"; + return null; + }; + + /** + * Creates a ProtocolVersion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.p2p.ProtocolVersion + * @static + * @param {Object.} object Plain object + * @returns {tendermint.p2p.ProtocolVersion} ProtocolVersion + */ + ProtocolVersion.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.p2p.ProtocolVersion) + return object; + let message = new $root.tendermint.p2p.ProtocolVersion(); + if (object.p2p != null) + if ($util.Long) + (message.p2p = $util.Long.fromValue(object.p2p)).unsigned = true; + else if (typeof object.p2p === "string") + message.p2p = parseInt(object.p2p, 10); + else if (typeof object.p2p === "number") + message.p2p = object.p2p; + else if (typeof object.p2p === "object") + message.p2p = new $util.LongBits(object.p2p.low >>> 0, object.p2p.high >>> 0).toNumber(true); + if (object.block != null) + if ($util.Long) + (message.block = $util.Long.fromValue(object.block)).unsigned = true; + else if (typeof object.block === "string") + message.block = parseInt(object.block, 10); + else if (typeof object.block === "number") + message.block = object.block; + else if (typeof object.block === "object") + message.block = new $util.LongBits(object.block.low >>> 0, object.block.high >>> 0).toNumber(true); + if (object.app != null) + if ($util.Long) + (message.app = $util.Long.fromValue(object.app)).unsigned = true; + else if (typeof object.app === "string") + message.app = parseInt(object.app, 10); + else if (typeof object.app === "number") + message.app = object.app; + else if (typeof object.app === "object") + message.app = new $util.LongBits(object.app.low >>> 0, object.app.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a ProtocolVersion message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.p2p.ProtocolVersion + * @static + * @param {tendermint.p2p.ProtocolVersion} message ProtocolVersion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProtocolVersion.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.p2p = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.p2p = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.block = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.block = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.app = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.app = options.longs === String ? "0" : 0; + } + if (message.p2p != null && message.hasOwnProperty("p2p")) + if (typeof message.p2p === "number") + object.p2p = options.longs === String ? String(message.p2p) : message.p2p; + else + object.p2p = options.longs === String ? $util.Long.prototype.toString.call(message.p2p) : options.longs === Number ? new $util.LongBits(message.p2p.low >>> 0, message.p2p.high >>> 0).toNumber(true) : message.p2p; + if (message.block != null && message.hasOwnProperty("block")) + if (typeof message.block === "number") + object.block = options.longs === String ? String(message.block) : message.block; + else + object.block = options.longs === String ? $util.Long.prototype.toString.call(message.block) : options.longs === Number ? new $util.LongBits(message.block.low >>> 0, message.block.high >>> 0).toNumber(true) : message.block; + if (message.app != null && message.hasOwnProperty("app")) + if (typeof message.app === "number") + object.app = options.longs === String ? String(message.app) : message.app; + else + object.app = options.longs === String ? $util.Long.prototype.toString.call(message.app) : options.longs === Number ? new $util.LongBits(message.app.low >>> 0, message.app.high >>> 0).toNumber(true) : message.app; + return object; + }; + + /** + * Converts this ProtocolVersion to JSON. + * @function toJSON + * @memberof tendermint.p2p.ProtocolVersion + * @instance + * @returns {Object.} JSON object + */ + ProtocolVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ProtocolVersion; + })(p2p.ProtocolVersion || {}); + + p2p.DefaultNodeInfo = (function(DefaultNodeInfo) { + + /** + * Properties of a DefaultNodeInfo. + * @memberof tendermint.p2p + * @interface IDefaultNodeInfo + * @property {tendermint.p2p.IProtocolVersion|null} [protocolVersion] DefaultNodeInfo protocolVersion + * @property {string|null} [defaultNodeId] DefaultNodeInfo defaultNodeId + * @property {string|null} [listenAddr] DefaultNodeInfo listenAddr + * @property {string|null} [network] DefaultNodeInfo network + * @property {string|null} [version] DefaultNodeInfo version + * @property {Uint8Array|null} [channels] DefaultNodeInfo channels + * @property {string|null} [moniker] DefaultNodeInfo moniker + * @property {tendermint.p2p.IDefaultNodeInfoOther|null} [other] DefaultNodeInfo other + */ + + /** + * Constructs a new DefaultNodeInfo. + * @memberof tendermint.p2p + * @classdesc Represents a DefaultNodeInfo. + * @implements IDefaultNodeInfo + * @constructor + * @param {tendermint.p2p.IDefaultNodeInfo=} [properties] Properties to set + */ + function DefaultNodeInfo(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DefaultNodeInfo protocolVersion. + * @member {tendermint.p2p.IProtocolVersion|null|undefined} protocolVersion + * @memberof tendermint.p2p.DefaultNodeInfo + * @instance + */ + DefaultNodeInfo.prototype.protocolVersion = null; + + /** + * DefaultNodeInfo defaultNodeId. + * @member {string} defaultNodeId + * @memberof tendermint.p2p.DefaultNodeInfo + * @instance + */ + DefaultNodeInfo.prototype.defaultNodeId = ""; + + /** + * DefaultNodeInfo listenAddr. + * @member {string} listenAddr + * @memberof tendermint.p2p.DefaultNodeInfo + * @instance + */ + DefaultNodeInfo.prototype.listenAddr = ""; + + /** + * DefaultNodeInfo network. + * @member {string} network + * @memberof tendermint.p2p.DefaultNodeInfo + * @instance + */ + DefaultNodeInfo.prototype.network = ""; + + /** + * DefaultNodeInfo version. + * @member {string} version + * @memberof tendermint.p2p.DefaultNodeInfo + * @instance + */ + DefaultNodeInfo.prototype.version = ""; + + /** + * DefaultNodeInfo channels. + * @member {Uint8Array} channels + * @memberof tendermint.p2p.DefaultNodeInfo + * @instance + */ + DefaultNodeInfo.prototype.channels = $util.newBuffer([]); + + /** + * DefaultNodeInfo moniker. + * @member {string} moniker + * @memberof tendermint.p2p.DefaultNodeInfo + * @instance + */ + DefaultNodeInfo.prototype.moniker = ""; + + /** + * DefaultNodeInfo other. + * @member {tendermint.p2p.IDefaultNodeInfoOther|null|undefined} other + * @memberof tendermint.p2p.DefaultNodeInfo + * @instance + */ + DefaultNodeInfo.prototype.other = null; + + /** + * Creates a new DefaultNodeInfo instance using the specified properties. + * @function create + * @memberof tendermint.p2p.DefaultNodeInfo + * @static + * @param {tendermint.p2p.IDefaultNodeInfo=} [properties] Properties to set + * @returns {tendermint.p2p.DefaultNodeInfo} DefaultNodeInfo instance + */ + DefaultNodeInfo.create = function create(properties) { + return new DefaultNodeInfo(properties); + }; + + /** + * Encodes the specified DefaultNodeInfo message. Does not implicitly {@link tendermint.p2p.DefaultNodeInfo.verify|verify} messages. + * @function encode + * @memberof tendermint.p2p.DefaultNodeInfo + * @static + * @param {tendermint.p2p.IDefaultNodeInfo} message DefaultNodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DefaultNodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.protocolVersion != null && Object.hasOwnProperty.call(message, "protocolVersion")) + $root.tendermint.p2p.ProtocolVersion.encode(message.protocolVersion, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.defaultNodeId != null && Object.hasOwnProperty.call(message, "defaultNodeId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.defaultNodeId); + if (message.listenAddr != null && Object.hasOwnProperty.call(message, "listenAddr")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.listenAddr); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.network); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.version); + if (message.channels != null && Object.hasOwnProperty.call(message, "channels")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.channels); + if (message.moniker != null && Object.hasOwnProperty.call(message, "moniker")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.moniker); + if (message.other != null && Object.hasOwnProperty.call(message, "other")) + $root.tendermint.p2p.DefaultNodeInfoOther.encode(message.other, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DefaultNodeInfo message, length delimited. Does not implicitly {@link tendermint.p2p.DefaultNodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.p2p.DefaultNodeInfo + * @static + * @param {tendermint.p2p.IDefaultNodeInfo} message DefaultNodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DefaultNodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DefaultNodeInfo message from the specified reader or buffer. + * @function decode + * @memberof tendermint.p2p.DefaultNodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.p2p.DefaultNodeInfo} DefaultNodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DefaultNodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.p2p.DefaultNodeInfo(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.protocolVersion = $root.tendermint.p2p.ProtocolVersion.decode(reader, reader.uint32()); + break; + case 2: + message.defaultNodeId = reader.string(); + break; + case 3: + message.listenAddr = reader.string(); + break; + case 4: + message.network = reader.string(); + break; + case 5: + message.version = reader.string(); + break; + case 6: + message.channels = reader.bytes(); + break; + case 7: + message.moniker = reader.string(); + break; + case 8: + message.other = $root.tendermint.p2p.DefaultNodeInfoOther.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DefaultNodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.p2p.DefaultNodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.p2p.DefaultNodeInfo} DefaultNodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DefaultNodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DefaultNodeInfo message. + * @function verify + * @memberof tendermint.p2p.DefaultNodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DefaultNodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) { + let error = $root.tendermint.p2p.ProtocolVersion.verify(message.protocolVersion); + if (error) + return "protocolVersion." + error; + } + if (message.defaultNodeId != null && message.hasOwnProperty("defaultNodeId")) + if (!$util.isString(message.defaultNodeId)) + return "defaultNodeId: string expected"; + if (message.listenAddr != null && message.hasOwnProperty("listenAddr")) + if (!$util.isString(message.listenAddr)) + return "listenAddr: string expected"; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.channels != null && message.hasOwnProperty("channels")) + if (!(message.channels && typeof message.channels.length === "number" || $util.isString(message.channels))) + return "channels: buffer expected"; + if (message.moniker != null && message.hasOwnProperty("moniker")) + if (!$util.isString(message.moniker)) + return "moniker: string expected"; + if (message.other != null && message.hasOwnProperty("other")) { + let error = $root.tendermint.p2p.DefaultNodeInfoOther.verify(message.other); + if (error) + return "other." + error; + } + return null; + }; + + /** + * Creates a DefaultNodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.p2p.DefaultNodeInfo + * @static + * @param {Object.} object Plain object + * @returns {tendermint.p2p.DefaultNodeInfo} DefaultNodeInfo + */ + DefaultNodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.p2p.DefaultNodeInfo) + return object; + let message = new $root.tendermint.p2p.DefaultNodeInfo(); + if (object.protocolVersion != null) { + if (typeof object.protocolVersion !== "object") + throw TypeError(".tendermint.p2p.DefaultNodeInfo.protocolVersion: object expected"); + message.protocolVersion = $root.tendermint.p2p.ProtocolVersion.fromObject(object.protocolVersion); + } + if (object.defaultNodeId != null) + message.defaultNodeId = String(object.defaultNodeId); + if (object.listenAddr != null) + message.listenAddr = String(object.listenAddr); + if (object.network != null) + message.network = String(object.network); + if (object.version != null) + message.version = String(object.version); + if (object.channels != null) + if (typeof object.channels === "string") + $util.base64.decode(object.channels, message.channels = $util.newBuffer($util.base64.length(object.channels)), 0); + else if (object.channels.length) + message.channels = object.channels; + if (object.moniker != null) + message.moniker = String(object.moniker); + if (object.other != null) { + if (typeof object.other !== "object") + throw TypeError(".tendermint.p2p.DefaultNodeInfo.other: object expected"); + message.other = $root.tendermint.p2p.DefaultNodeInfoOther.fromObject(object.other); + } + return message; + }; + + /** + * Creates a plain object from a DefaultNodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.p2p.DefaultNodeInfo + * @static + * @param {tendermint.p2p.DefaultNodeInfo} message DefaultNodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DefaultNodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.protocolVersion = null; + object.defaultNodeId = ""; + object.listenAddr = ""; + object.network = ""; + object.version = ""; + if (options.bytes === String) + object.channels = ""; + else { + object.channels = []; + if (options.bytes !== Array) + object.channels = $util.newBuffer(object.channels); + } + object.moniker = ""; + object.other = null; + } + if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) + object.protocolVersion = $root.tendermint.p2p.ProtocolVersion.toObject(message.protocolVersion, options); + if (message.defaultNodeId != null && message.hasOwnProperty("defaultNodeId")) + object.defaultNodeId = message.defaultNodeId; + if (message.listenAddr != null && message.hasOwnProperty("listenAddr")) + object.listenAddr = message.listenAddr; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.channels != null && message.hasOwnProperty("channels")) + object.channels = options.bytes === String ? $util.base64.encode(message.channels, 0, message.channels.length) : options.bytes === Array ? Array.prototype.slice.call(message.channels) : message.channels; + if (message.moniker != null && message.hasOwnProperty("moniker")) + object.moniker = message.moniker; + if (message.other != null && message.hasOwnProperty("other")) + object.other = $root.tendermint.p2p.DefaultNodeInfoOther.toObject(message.other, options); + return object; + }; + + /** + * Converts this DefaultNodeInfo to JSON. + * @function toJSON + * @memberof tendermint.p2p.DefaultNodeInfo + * @instance + * @returns {Object.} JSON object + */ + DefaultNodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DefaultNodeInfo; + })(p2p.DefaultNodeInfo || {}); + + p2p.DefaultNodeInfoOther = (function(DefaultNodeInfoOther) { + + /** + * Properties of a DefaultNodeInfoOther. + * @memberof tendermint.p2p + * @interface IDefaultNodeInfoOther + * @property {string|null} [txIndex] DefaultNodeInfoOther txIndex + * @property {string|null} [rpcAddress] DefaultNodeInfoOther rpcAddress + */ + + /** + * Constructs a new DefaultNodeInfoOther. + * @memberof tendermint.p2p + * @classdesc Represents a DefaultNodeInfoOther. + * @implements IDefaultNodeInfoOther + * @constructor + * @param {tendermint.p2p.IDefaultNodeInfoOther=} [properties] Properties to set + */ + function DefaultNodeInfoOther(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DefaultNodeInfoOther txIndex. + * @member {string} txIndex + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @instance + */ + DefaultNodeInfoOther.prototype.txIndex = ""; + + /** + * DefaultNodeInfoOther rpcAddress. + * @member {string} rpcAddress + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @instance + */ + DefaultNodeInfoOther.prototype.rpcAddress = ""; + + /** + * Creates a new DefaultNodeInfoOther instance using the specified properties. + * @function create + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @static + * @param {tendermint.p2p.IDefaultNodeInfoOther=} [properties] Properties to set + * @returns {tendermint.p2p.DefaultNodeInfoOther} DefaultNodeInfoOther instance + */ + DefaultNodeInfoOther.create = function create(properties) { + return new DefaultNodeInfoOther(properties); + }; + + /** + * Encodes the specified DefaultNodeInfoOther message. Does not implicitly {@link tendermint.p2p.DefaultNodeInfoOther.verify|verify} messages. + * @function encode + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @static + * @param {tendermint.p2p.IDefaultNodeInfoOther} message DefaultNodeInfoOther message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DefaultNodeInfoOther.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.txIndex != null && Object.hasOwnProperty.call(message, "txIndex")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.txIndex); + if (message.rpcAddress != null && Object.hasOwnProperty.call(message, "rpcAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.rpcAddress); + return writer; + }; + + /** + * Encodes the specified DefaultNodeInfoOther message, length delimited. Does not implicitly {@link tendermint.p2p.DefaultNodeInfoOther.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @static + * @param {tendermint.p2p.IDefaultNodeInfoOther} message DefaultNodeInfoOther message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DefaultNodeInfoOther.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DefaultNodeInfoOther message from the specified reader or buffer. + * @function decode + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.p2p.DefaultNodeInfoOther} DefaultNodeInfoOther + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DefaultNodeInfoOther.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.p2p.DefaultNodeInfoOther(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txIndex = reader.string(); + break; + case 2: + message.rpcAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DefaultNodeInfoOther message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.p2p.DefaultNodeInfoOther} DefaultNodeInfoOther + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DefaultNodeInfoOther.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DefaultNodeInfoOther message. + * @function verify + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DefaultNodeInfoOther.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.txIndex != null && message.hasOwnProperty("txIndex")) + if (!$util.isString(message.txIndex)) + return "txIndex: string expected"; + if (message.rpcAddress != null && message.hasOwnProperty("rpcAddress")) + if (!$util.isString(message.rpcAddress)) + return "rpcAddress: string expected"; + return null; + }; + + /** + * Creates a DefaultNodeInfoOther message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @static + * @param {Object.} object Plain object + * @returns {tendermint.p2p.DefaultNodeInfoOther} DefaultNodeInfoOther + */ + DefaultNodeInfoOther.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.p2p.DefaultNodeInfoOther) + return object; + let message = new $root.tendermint.p2p.DefaultNodeInfoOther(); + if (object.txIndex != null) + message.txIndex = String(object.txIndex); + if (object.rpcAddress != null) + message.rpcAddress = String(object.rpcAddress); + return message; + }; + + /** + * Creates a plain object from a DefaultNodeInfoOther message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @static + * @param {tendermint.p2p.DefaultNodeInfoOther} message DefaultNodeInfoOther + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DefaultNodeInfoOther.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.txIndex = ""; + object.rpcAddress = ""; + } + if (message.txIndex != null && message.hasOwnProperty("txIndex")) + object.txIndex = message.txIndex; + if (message.rpcAddress != null && message.hasOwnProperty("rpcAddress")) + object.rpcAddress = message.rpcAddress; + return object; + }; + + /** + * Converts this DefaultNodeInfoOther to JSON. + * @function toJSON + * @memberof tendermint.p2p.DefaultNodeInfoOther + * @instance + * @returns {Object.} JSON object + */ + DefaultNodeInfoOther.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DefaultNodeInfoOther; + })(p2p.DefaultNodeInfoOther || {}); + + return p2p; + })(tendermint.p2p || {}); + + /** + * Namespace types. + * @memberof tendermint + * @namespace + */ + + tendermint.types = (function(types) { + + types.Block = (function(Block) { + + /** + * Properties of a Block. + * @memberof tendermint.types + * @interface IBlock + * @property {tendermint.types.IHeader|null} [header] Block header + * @property {tendermint.types.IData|null} [data] Block data + * @property {tendermint.types.IEvidenceList|null} [evidence] Block evidence + * @property {tendermint.types.ICommit|null} [lastCommit] Block lastCommit + */ + + /** + * Constructs a new Block. + * @memberof tendermint.types + * @classdesc Represents a Block. + * @implements IBlock + * @constructor + * @param {tendermint.types.IBlock=} [properties] Properties to set + */ + function Block(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Block header. + * @member {tendermint.types.IHeader|null|undefined} header + * @memberof tendermint.types.Block + * @instance + */ + Block.prototype.header = null; + + /** + * Block data. + * @member {tendermint.types.IData|null|undefined} data + * @memberof tendermint.types.Block + * @instance + */ + Block.prototype.data = null; + + /** + * Block evidence. + * @member {tendermint.types.IEvidenceList|null|undefined} evidence + * @memberof tendermint.types.Block + * @instance + */ + Block.prototype.evidence = null; + + /** + * Block lastCommit. + * @member {tendermint.types.ICommit|null|undefined} lastCommit + * @memberof tendermint.types.Block + * @instance + */ + Block.prototype.lastCommit = null; + + /** + * Creates a new Block instance using the specified properties. + * @function create + * @memberof tendermint.types.Block + * @static + * @param {tendermint.types.IBlock=} [properties] Properties to set + * @returns {tendermint.types.Block} Block instance + */ + Block.create = function create(properties) { + return new Block(properties); + }; + + /** + * Encodes the specified Block message. Does not implicitly {@link tendermint.types.Block.verify|verify} messages. + * @function encode + * @memberof tendermint.types.Block + * @static + * @param {tendermint.types.IBlock} message Block message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Block.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + $root.tendermint.types.Header.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + $root.tendermint.types.Data.encode(message.data, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.evidence != null && Object.hasOwnProperty.call(message, "evidence")) + $root.tendermint.types.EvidenceList.encode(message.evidence, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.lastCommit != null && Object.hasOwnProperty.call(message, "lastCommit")) + $root.tendermint.types.Commit.encode(message.lastCommit, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Block message, length delimited. Does not implicitly {@link tendermint.types.Block.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.Block + * @static + * @param {tendermint.types.IBlock} message Block message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Block.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Block message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.Block + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.Block} Block + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Block.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Block(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.header = $root.tendermint.types.Header.decode(reader, reader.uint32()); + break; + case 2: + message.data = $root.tendermint.types.Data.decode(reader, reader.uint32()); + break; + case 3: + message.evidence = $root.tendermint.types.EvidenceList.decode(reader, reader.uint32()); + break; + case 4: + message.lastCommit = $root.tendermint.types.Commit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Block message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.Block + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.Block} Block + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Block.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Block message. + * @function verify + * @memberof tendermint.types.Block + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Block.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.header != null && message.hasOwnProperty("header")) { + let error = $root.tendermint.types.Header.verify(message.header); + if (error) + return "header." + error; + } + if (message.data != null && message.hasOwnProperty("data")) { + let error = $root.tendermint.types.Data.verify(message.data); + if (error) + return "data." + error; + } + if (message.evidence != null && message.hasOwnProperty("evidence")) { + let error = $root.tendermint.types.EvidenceList.verify(message.evidence); + if (error) + return "evidence." + error; + } + if (message.lastCommit != null && message.hasOwnProperty("lastCommit")) { + let error = $root.tendermint.types.Commit.verify(message.lastCommit); + if (error) + return "lastCommit." + error; + } + return null; + }; + + /** + * Creates a Block message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.Block + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.Block} Block + */ + Block.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.Block) + return object; + let message = new $root.tendermint.types.Block(); + if (object.header != null) { + if (typeof object.header !== "object") + throw TypeError(".tendermint.types.Block.header: object expected"); + message.header = $root.tendermint.types.Header.fromObject(object.header); + } + if (object.data != null) { + if (typeof object.data !== "object") + throw TypeError(".tendermint.types.Block.data: object expected"); + message.data = $root.tendermint.types.Data.fromObject(object.data); + } + if (object.evidence != null) { + if (typeof object.evidence !== "object") + throw TypeError(".tendermint.types.Block.evidence: object expected"); + message.evidence = $root.tendermint.types.EvidenceList.fromObject(object.evidence); + } + if (object.lastCommit != null) { + if (typeof object.lastCommit !== "object") + throw TypeError(".tendermint.types.Block.lastCommit: object expected"); + message.lastCommit = $root.tendermint.types.Commit.fromObject(object.lastCommit); + } + return message; + }; + + /** + * Creates a plain object from a Block message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.Block + * @static + * @param {tendermint.types.Block} message Block + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Block.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.header = null; + object.data = null; + object.evidence = null; + object.lastCommit = null; + } + if (message.header != null && message.hasOwnProperty("header")) + object.header = $root.tendermint.types.Header.toObject(message.header, options); + if (message.data != null && message.hasOwnProperty("data")) + object.data = $root.tendermint.types.Data.toObject(message.data, options); + if (message.evidence != null && message.hasOwnProperty("evidence")) + object.evidence = $root.tendermint.types.EvidenceList.toObject(message.evidence, options); + if (message.lastCommit != null && message.hasOwnProperty("lastCommit")) + object.lastCommit = $root.tendermint.types.Commit.toObject(message.lastCommit, options); + return object; + }; + + /** + * Converts this Block to JSON. + * @function toJSON + * @memberof tendermint.types.Block + * @instance + * @returns {Object.} JSON object + */ + Block.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Block; + })(types.Block || {}); + + types.Evidence = (function(Evidence) { + + /** + * Properties of an Evidence. + * @memberof tendermint.types + * @interface IEvidence + * @property {tendermint.types.IDuplicateVoteEvidence|null} [duplicateVoteEvidence] Evidence duplicateVoteEvidence + * @property {tendermint.types.ILightClientAttackEvidence|null} [lightClientAttackEvidence] Evidence lightClientAttackEvidence + */ + + /** + * Constructs a new Evidence. + * @memberof tendermint.types + * @classdesc Represents an Evidence. + * @implements IEvidence + * @constructor + * @param {tendermint.types.IEvidence=} [properties] Properties to set + */ + function Evidence(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Evidence duplicateVoteEvidence. + * @member {tendermint.types.IDuplicateVoteEvidence|null|undefined} duplicateVoteEvidence + * @memberof tendermint.types.Evidence + * @instance + */ + Evidence.prototype.duplicateVoteEvidence = null; + + /** + * Evidence lightClientAttackEvidence. + * @member {tendermint.types.ILightClientAttackEvidence|null|undefined} lightClientAttackEvidence + * @memberof tendermint.types.Evidence + * @instance + */ + Evidence.prototype.lightClientAttackEvidence = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Evidence sum. + * @member {"duplicateVoteEvidence"|"lightClientAttackEvidence"|undefined} sum + * @memberof tendermint.types.Evidence + * @instance + */ + Object.defineProperty(Evidence.prototype, "sum", { + get: $util.oneOfGetter($oneOfFields = ["duplicateVoteEvidence", "lightClientAttackEvidence"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Evidence instance using the specified properties. + * @function create + * @memberof tendermint.types.Evidence + * @static + * @param {tendermint.types.IEvidence=} [properties] Properties to set + * @returns {tendermint.types.Evidence} Evidence instance + */ + Evidence.create = function create(properties) { + return new Evidence(properties); + }; + + /** + * Encodes the specified Evidence message. Does not implicitly {@link tendermint.types.Evidence.verify|verify} messages. + * @function encode + * @memberof tendermint.types.Evidence + * @static + * @param {tendermint.types.IEvidence} message Evidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Evidence.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.duplicateVoteEvidence != null && Object.hasOwnProperty.call(message, "duplicateVoteEvidence")) + $root.tendermint.types.DuplicateVoteEvidence.encode(message.duplicateVoteEvidence, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.lightClientAttackEvidence != null && Object.hasOwnProperty.call(message, "lightClientAttackEvidence")) + $root.tendermint.types.LightClientAttackEvidence.encode(message.lightClientAttackEvidence, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Evidence message, length delimited. Does not implicitly {@link tendermint.types.Evidence.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.Evidence + * @static + * @param {tendermint.types.IEvidence} message Evidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Evidence.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Evidence message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.Evidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.Evidence} Evidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Evidence.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Evidence(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.duplicateVoteEvidence = $root.tendermint.types.DuplicateVoteEvidence.decode(reader, reader.uint32()); + break; + case 2: + message.lightClientAttackEvidence = $root.tendermint.types.LightClientAttackEvidence.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Evidence message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.Evidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.Evidence} Evidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Evidence.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Evidence message. + * @function verify + * @memberof tendermint.types.Evidence + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Evidence.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + let properties = {}; + if (message.duplicateVoteEvidence != null && message.hasOwnProperty("duplicateVoteEvidence")) { + properties.sum = 1; + { + let error = $root.tendermint.types.DuplicateVoteEvidence.verify(message.duplicateVoteEvidence); + if (error) + return "duplicateVoteEvidence." + error; + } + } + if (message.lightClientAttackEvidence != null && message.hasOwnProperty("lightClientAttackEvidence")) { + if (properties.sum === 1) + return "sum: multiple values"; + properties.sum = 1; + { + let error = $root.tendermint.types.LightClientAttackEvidence.verify(message.lightClientAttackEvidence); + if (error) + return "lightClientAttackEvidence." + error; + } + } + return null; + }; + + /** + * Creates an Evidence message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.Evidence + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.Evidence} Evidence + */ + Evidence.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.Evidence) + return object; + let message = new $root.tendermint.types.Evidence(); + if (object.duplicateVoteEvidence != null) { + if (typeof object.duplicateVoteEvidence !== "object") + throw TypeError(".tendermint.types.Evidence.duplicateVoteEvidence: object expected"); + message.duplicateVoteEvidence = $root.tendermint.types.DuplicateVoteEvidence.fromObject(object.duplicateVoteEvidence); + } + if (object.lightClientAttackEvidence != null) { + if (typeof object.lightClientAttackEvidence !== "object") + throw TypeError(".tendermint.types.Evidence.lightClientAttackEvidence: object expected"); + message.lightClientAttackEvidence = $root.tendermint.types.LightClientAttackEvidence.fromObject(object.lightClientAttackEvidence); + } + return message; + }; + + /** + * Creates a plain object from an Evidence message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.Evidence + * @static + * @param {tendermint.types.Evidence} message Evidence + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Evidence.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.duplicateVoteEvidence != null && message.hasOwnProperty("duplicateVoteEvidence")) { + object.duplicateVoteEvidence = $root.tendermint.types.DuplicateVoteEvidence.toObject(message.duplicateVoteEvidence, options); + if (options.oneofs) + object.sum = "duplicateVoteEvidence"; + } + if (message.lightClientAttackEvidence != null && message.hasOwnProperty("lightClientAttackEvidence")) { + object.lightClientAttackEvidence = $root.tendermint.types.LightClientAttackEvidence.toObject(message.lightClientAttackEvidence, options); + if (options.oneofs) + object.sum = "lightClientAttackEvidence"; + } + return object; + }; + + /** + * Converts this Evidence to JSON. + * @function toJSON + * @memberof tendermint.types.Evidence + * @instance + * @returns {Object.} JSON object + */ + Evidence.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Evidence; + })(types.Evidence || {}); + + types.DuplicateVoteEvidence = (function(DuplicateVoteEvidence) { + + /** + * Properties of a DuplicateVoteEvidence. + * @memberof tendermint.types + * @interface IDuplicateVoteEvidence + * @property {tendermint.types.IVote|null} [voteA] DuplicateVoteEvidence voteA + * @property {tendermint.types.IVote|null} [voteB] DuplicateVoteEvidence voteB + * @property {number|Long|null} [totalVotingPower] DuplicateVoteEvidence totalVotingPower + * @property {number|Long|null} [validatorPower] DuplicateVoteEvidence validatorPower + * @property {google.protobuf.ITimestamp|null} [timestamp] DuplicateVoteEvidence timestamp + */ + + /** + * Constructs a new DuplicateVoteEvidence. + * @memberof tendermint.types + * @classdesc Represents a DuplicateVoteEvidence. + * @implements IDuplicateVoteEvidence + * @constructor + * @param {tendermint.types.IDuplicateVoteEvidence=} [properties] Properties to set + */ + function DuplicateVoteEvidence(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DuplicateVoteEvidence voteA. + * @member {tendermint.types.IVote|null|undefined} voteA + * @memberof tendermint.types.DuplicateVoteEvidence + * @instance + */ + DuplicateVoteEvidence.prototype.voteA = null; + + /** + * DuplicateVoteEvidence voteB. + * @member {tendermint.types.IVote|null|undefined} voteB + * @memberof tendermint.types.DuplicateVoteEvidence + * @instance + */ + DuplicateVoteEvidence.prototype.voteB = null; + + /** + * DuplicateVoteEvidence totalVotingPower. + * @member {number|Long} totalVotingPower + * @memberof tendermint.types.DuplicateVoteEvidence + * @instance + */ + DuplicateVoteEvidence.prototype.totalVotingPower = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DuplicateVoteEvidence validatorPower. + * @member {number|Long} validatorPower + * @memberof tendermint.types.DuplicateVoteEvidence + * @instance + */ + DuplicateVoteEvidence.prototype.validatorPower = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DuplicateVoteEvidence timestamp. + * @member {google.protobuf.ITimestamp|null|undefined} timestamp + * @memberof tendermint.types.DuplicateVoteEvidence + * @instance + */ + DuplicateVoteEvidence.prototype.timestamp = null; + + /** + * Creates a new DuplicateVoteEvidence instance using the specified properties. + * @function create + * @memberof tendermint.types.DuplicateVoteEvidence + * @static + * @param {tendermint.types.IDuplicateVoteEvidence=} [properties] Properties to set + * @returns {tendermint.types.DuplicateVoteEvidence} DuplicateVoteEvidence instance + */ + DuplicateVoteEvidence.create = function create(properties) { + return new DuplicateVoteEvidence(properties); + }; + + /** + * Encodes the specified DuplicateVoteEvidence message. Does not implicitly {@link tendermint.types.DuplicateVoteEvidence.verify|verify} messages. + * @function encode + * @memberof tendermint.types.DuplicateVoteEvidence + * @static + * @param {tendermint.types.IDuplicateVoteEvidence} message DuplicateVoteEvidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DuplicateVoteEvidence.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.voteA != null && Object.hasOwnProperty.call(message, "voteA")) + $root.tendermint.types.Vote.encode(message.voteA, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.voteB != null && Object.hasOwnProperty.call(message, "voteB")) + $root.tendermint.types.Vote.encode(message.voteB, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.totalVotingPower != null && Object.hasOwnProperty.call(message, "totalVotingPower")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.totalVotingPower); + if (message.validatorPower != null && Object.hasOwnProperty.call(message, "validatorPower")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.validatorPower); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DuplicateVoteEvidence message, length delimited. Does not implicitly {@link tendermint.types.DuplicateVoteEvidence.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.DuplicateVoteEvidence + * @static + * @param {tendermint.types.IDuplicateVoteEvidence} message DuplicateVoteEvidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DuplicateVoteEvidence.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DuplicateVoteEvidence message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.DuplicateVoteEvidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.DuplicateVoteEvidence} DuplicateVoteEvidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DuplicateVoteEvidence.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.DuplicateVoteEvidence(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.voteA = $root.tendermint.types.Vote.decode(reader, reader.uint32()); + break; + case 2: + message.voteB = $root.tendermint.types.Vote.decode(reader, reader.uint32()); + break; + case 3: + message.totalVotingPower = reader.int64(); + break; + case 4: + message.validatorPower = reader.int64(); + break; + case 5: + message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DuplicateVoteEvidence message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.DuplicateVoteEvidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.DuplicateVoteEvidence} DuplicateVoteEvidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DuplicateVoteEvidence.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DuplicateVoteEvidence message. + * @function verify + * @memberof tendermint.types.DuplicateVoteEvidence + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DuplicateVoteEvidence.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.voteA != null && message.hasOwnProperty("voteA")) { + let error = $root.tendermint.types.Vote.verify(message.voteA); + if (error) + return "voteA." + error; + } + if (message.voteB != null && message.hasOwnProperty("voteB")) { + let error = $root.tendermint.types.Vote.verify(message.voteB); + if (error) + return "voteB." + error; + } + if (message.totalVotingPower != null && message.hasOwnProperty("totalVotingPower")) + if (!$util.isInteger(message.totalVotingPower) && !(message.totalVotingPower && $util.isInteger(message.totalVotingPower.low) && $util.isInteger(message.totalVotingPower.high))) + return "totalVotingPower: integer|Long expected"; + if (message.validatorPower != null && message.hasOwnProperty("validatorPower")) + if (!$util.isInteger(message.validatorPower) && !(message.validatorPower && $util.isInteger(message.validatorPower.low) && $util.isInteger(message.validatorPower.high))) + return "validatorPower: integer|Long expected"; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) { + let error = $root.google.protobuf.Timestamp.verify(message.timestamp); + if (error) + return "timestamp." + error; + } + return null; + }; + + /** + * Creates a DuplicateVoteEvidence message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.DuplicateVoteEvidence + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.DuplicateVoteEvidence} DuplicateVoteEvidence + */ + DuplicateVoteEvidence.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.DuplicateVoteEvidence) + return object; + let message = new $root.tendermint.types.DuplicateVoteEvidence(); + if (object.voteA != null) { + if (typeof object.voteA !== "object") + throw TypeError(".tendermint.types.DuplicateVoteEvidence.voteA: object expected"); + message.voteA = $root.tendermint.types.Vote.fromObject(object.voteA); + } + if (object.voteB != null) { + if (typeof object.voteB !== "object") + throw TypeError(".tendermint.types.DuplicateVoteEvidence.voteB: object expected"); + message.voteB = $root.tendermint.types.Vote.fromObject(object.voteB); + } + if (object.totalVotingPower != null) + if ($util.Long) + (message.totalVotingPower = $util.Long.fromValue(object.totalVotingPower)).unsigned = false; + else if (typeof object.totalVotingPower === "string") + message.totalVotingPower = parseInt(object.totalVotingPower, 10); + else if (typeof object.totalVotingPower === "number") + message.totalVotingPower = object.totalVotingPower; + else if (typeof object.totalVotingPower === "object") + message.totalVotingPower = new $util.LongBits(object.totalVotingPower.low >>> 0, object.totalVotingPower.high >>> 0).toNumber(); + if (object.validatorPower != null) + if ($util.Long) + (message.validatorPower = $util.Long.fromValue(object.validatorPower)).unsigned = false; + else if (typeof object.validatorPower === "string") + message.validatorPower = parseInt(object.validatorPower, 10); + else if (typeof object.validatorPower === "number") + message.validatorPower = object.validatorPower; + else if (typeof object.validatorPower === "object") + message.validatorPower = new $util.LongBits(object.validatorPower.low >>> 0, object.validatorPower.high >>> 0).toNumber(); + if (object.timestamp != null) { + if (typeof object.timestamp !== "object") + throw TypeError(".tendermint.types.DuplicateVoteEvidence.timestamp: object expected"); + message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); + } + return message; + }; + + /** + * Creates a plain object from a DuplicateVoteEvidence message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.DuplicateVoteEvidence + * @static + * @param {tendermint.types.DuplicateVoteEvidence} message DuplicateVoteEvidence + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DuplicateVoteEvidence.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.voteA = null; + object.voteB = null; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.totalVotingPower = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalVotingPower = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.validatorPower = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.validatorPower = options.longs === String ? "0" : 0; + object.timestamp = null; + } + if (message.voteA != null && message.hasOwnProperty("voteA")) + object.voteA = $root.tendermint.types.Vote.toObject(message.voteA, options); + if (message.voteB != null && message.hasOwnProperty("voteB")) + object.voteB = $root.tendermint.types.Vote.toObject(message.voteB, options); + if (message.totalVotingPower != null && message.hasOwnProperty("totalVotingPower")) + if (typeof message.totalVotingPower === "number") + object.totalVotingPower = options.longs === String ? String(message.totalVotingPower) : message.totalVotingPower; + else + object.totalVotingPower = options.longs === String ? $util.Long.prototype.toString.call(message.totalVotingPower) : options.longs === Number ? new $util.LongBits(message.totalVotingPower.low >>> 0, message.totalVotingPower.high >>> 0).toNumber() : message.totalVotingPower; + if (message.validatorPower != null && message.hasOwnProperty("validatorPower")) + if (typeof message.validatorPower === "number") + object.validatorPower = options.longs === String ? String(message.validatorPower) : message.validatorPower; + else + object.validatorPower = options.longs === String ? $util.Long.prototype.toString.call(message.validatorPower) : options.longs === Number ? new $util.LongBits(message.validatorPower.low >>> 0, message.validatorPower.high >>> 0).toNumber() : message.validatorPower; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); + return object; + }; + + /** + * Converts this DuplicateVoteEvidence to JSON. + * @function toJSON + * @memberof tendermint.types.DuplicateVoteEvidence + * @instance + * @returns {Object.} JSON object + */ + DuplicateVoteEvidence.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DuplicateVoteEvidence; + })(types.DuplicateVoteEvidence || {}); + + types.LightClientAttackEvidence = (function(LightClientAttackEvidence) { + + /** + * Properties of a LightClientAttackEvidence. + * @memberof tendermint.types + * @interface ILightClientAttackEvidence + * @property {tendermint.types.ILightBlock|null} [conflictingBlock] LightClientAttackEvidence conflictingBlock + * @property {number|Long|null} [commonHeight] LightClientAttackEvidence commonHeight + * @property {Array.|null} [byzantineValidators] LightClientAttackEvidence byzantineValidators + * @property {number|Long|null} [totalVotingPower] LightClientAttackEvidence totalVotingPower + * @property {google.protobuf.ITimestamp|null} [timestamp] LightClientAttackEvidence timestamp + */ + + /** + * Constructs a new LightClientAttackEvidence. + * @memberof tendermint.types + * @classdesc Represents a LightClientAttackEvidence. + * @implements ILightClientAttackEvidence + * @constructor + * @param {tendermint.types.ILightClientAttackEvidence=} [properties] Properties to set + */ + function LightClientAttackEvidence(properties) { + this.byzantineValidators = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LightClientAttackEvidence conflictingBlock. + * @member {tendermint.types.ILightBlock|null|undefined} conflictingBlock + * @memberof tendermint.types.LightClientAttackEvidence + * @instance + */ + LightClientAttackEvidence.prototype.conflictingBlock = null; + + /** + * LightClientAttackEvidence commonHeight. + * @member {number|Long} commonHeight + * @memberof tendermint.types.LightClientAttackEvidence + * @instance + */ + LightClientAttackEvidence.prototype.commonHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * LightClientAttackEvidence byzantineValidators. + * @member {Array.} byzantineValidators + * @memberof tendermint.types.LightClientAttackEvidence + * @instance + */ + LightClientAttackEvidence.prototype.byzantineValidators = $util.emptyArray; + + /** + * LightClientAttackEvidence totalVotingPower. + * @member {number|Long} totalVotingPower + * @memberof tendermint.types.LightClientAttackEvidence + * @instance + */ + LightClientAttackEvidence.prototype.totalVotingPower = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * LightClientAttackEvidence timestamp. + * @member {google.protobuf.ITimestamp|null|undefined} timestamp + * @memberof tendermint.types.LightClientAttackEvidence + * @instance + */ + LightClientAttackEvidence.prototype.timestamp = null; + + /** + * Creates a new LightClientAttackEvidence instance using the specified properties. + * @function create + * @memberof tendermint.types.LightClientAttackEvidence + * @static + * @param {tendermint.types.ILightClientAttackEvidence=} [properties] Properties to set + * @returns {tendermint.types.LightClientAttackEvidence} LightClientAttackEvidence instance + */ + LightClientAttackEvidence.create = function create(properties) { + return new LightClientAttackEvidence(properties); + }; + + /** + * Encodes the specified LightClientAttackEvidence message. Does not implicitly {@link tendermint.types.LightClientAttackEvidence.verify|verify} messages. + * @function encode + * @memberof tendermint.types.LightClientAttackEvidence + * @static + * @param {tendermint.types.ILightClientAttackEvidence} message LightClientAttackEvidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LightClientAttackEvidence.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conflictingBlock != null && Object.hasOwnProperty.call(message, "conflictingBlock")) + $root.tendermint.types.LightBlock.encode(message.conflictingBlock, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.commonHeight != null && Object.hasOwnProperty.call(message, "commonHeight")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.commonHeight); + if (message.byzantineValidators != null && message.byzantineValidators.length) + for (let i = 0; i < message.byzantineValidators.length; ++i) + $root.tendermint.types.Validator.encode(message.byzantineValidators[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalVotingPower != null && Object.hasOwnProperty.call(message, "totalVotingPower")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.totalVotingPower); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LightClientAttackEvidence message, length delimited. Does not implicitly {@link tendermint.types.LightClientAttackEvidence.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.LightClientAttackEvidence + * @static + * @param {tendermint.types.ILightClientAttackEvidence} message LightClientAttackEvidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LightClientAttackEvidence.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LightClientAttackEvidence message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.LightClientAttackEvidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.LightClientAttackEvidence} LightClientAttackEvidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LightClientAttackEvidence.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.LightClientAttackEvidence(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.conflictingBlock = $root.tendermint.types.LightBlock.decode(reader, reader.uint32()); + break; + case 2: + message.commonHeight = reader.int64(); + break; + case 3: + if (!(message.byzantineValidators && message.byzantineValidators.length)) + message.byzantineValidators = []; + message.byzantineValidators.push($root.tendermint.types.Validator.decode(reader, reader.uint32())); + break; + case 4: + message.totalVotingPower = reader.int64(); + break; + case 5: + message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LightClientAttackEvidence message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.LightClientAttackEvidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.LightClientAttackEvidence} LightClientAttackEvidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LightClientAttackEvidence.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LightClientAttackEvidence message. + * @function verify + * @memberof tendermint.types.LightClientAttackEvidence + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LightClientAttackEvidence.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conflictingBlock != null && message.hasOwnProperty("conflictingBlock")) { + let error = $root.tendermint.types.LightBlock.verify(message.conflictingBlock); + if (error) + return "conflictingBlock." + error; + } + if (message.commonHeight != null && message.hasOwnProperty("commonHeight")) + if (!$util.isInteger(message.commonHeight) && !(message.commonHeight && $util.isInteger(message.commonHeight.low) && $util.isInteger(message.commonHeight.high))) + return "commonHeight: integer|Long expected"; + if (message.byzantineValidators != null && message.hasOwnProperty("byzantineValidators")) { + if (!Array.isArray(message.byzantineValidators)) + return "byzantineValidators: array expected"; + for (let i = 0; i < message.byzantineValidators.length; ++i) { + let error = $root.tendermint.types.Validator.verify(message.byzantineValidators[i]); + if (error) + return "byzantineValidators." + error; + } + } + if (message.totalVotingPower != null && message.hasOwnProperty("totalVotingPower")) + if (!$util.isInteger(message.totalVotingPower) && !(message.totalVotingPower && $util.isInteger(message.totalVotingPower.low) && $util.isInteger(message.totalVotingPower.high))) + return "totalVotingPower: integer|Long expected"; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) { + let error = $root.google.protobuf.Timestamp.verify(message.timestamp); + if (error) + return "timestamp." + error; + } + return null; + }; + + /** + * Creates a LightClientAttackEvidence message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.LightClientAttackEvidence + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.LightClientAttackEvidence} LightClientAttackEvidence + */ + LightClientAttackEvidence.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.LightClientAttackEvidence) + return object; + let message = new $root.tendermint.types.LightClientAttackEvidence(); + if (object.conflictingBlock != null) { + if (typeof object.conflictingBlock !== "object") + throw TypeError(".tendermint.types.LightClientAttackEvidence.conflictingBlock: object expected"); + message.conflictingBlock = $root.tendermint.types.LightBlock.fromObject(object.conflictingBlock); + } + if (object.commonHeight != null) + if ($util.Long) + (message.commonHeight = $util.Long.fromValue(object.commonHeight)).unsigned = false; + else if (typeof object.commonHeight === "string") + message.commonHeight = parseInt(object.commonHeight, 10); + else if (typeof object.commonHeight === "number") + message.commonHeight = object.commonHeight; + else if (typeof object.commonHeight === "object") + message.commonHeight = new $util.LongBits(object.commonHeight.low >>> 0, object.commonHeight.high >>> 0).toNumber(); + if (object.byzantineValidators) { + if (!Array.isArray(object.byzantineValidators)) + throw TypeError(".tendermint.types.LightClientAttackEvidence.byzantineValidators: array expected"); + message.byzantineValidators = []; + for (let i = 0; i < object.byzantineValidators.length; ++i) { + if (typeof object.byzantineValidators[i] !== "object") + throw TypeError(".tendermint.types.LightClientAttackEvidence.byzantineValidators: object expected"); + message.byzantineValidators[i] = $root.tendermint.types.Validator.fromObject(object.byzantineValidators[i]); + } + } + if (object.totalVotingPower != null) + if ($util.Long) + (message.totalVotingPower = $util.Long.fromValue(object.totalVotingPower)).unsigned = false; + else if (typeof object.totalVotingPower === "string") + message.totalVotingPower = parseInt(object.totalVotingPower, 10); + else if (typeof object.totalVotingPower === "number") + message.totalVotingPower = object.totalVotingPower; + else if (typeof object.totalVotingPower === "object") + message.totalVotingPower = new $util.LongBits(object.totalVotingPower.low >>> 0, object.totalVotingPower.high >>> 0).toNumber(); + if (object.timestamp != null) { + if (typeof object.timestamp !== "object") + throw TypeError(".tendermint.types.LightClientAttackEvidence.timestamp: object expected"); + message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); + } + return message; + }; + + /** + * Creates a plain object from a LightClientAttackEvidence message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.LightClientAttackEvidence + * @static + * @param {tendermint.types.LightClientAttackEvidence} message LightClientAttackEvidence + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LightClientAttackEvidence.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.byzantineValidators = []; + if (options.defaults) { + object.conflictingBlock = null; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.commonHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.commonHeight = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.totalVotingPower = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalVotingPower = options.longs === String ? "0" : 0; + object.timestamp = null; + } + if (message.conflictingBlock != null && message.hasOwnProperty("conflictingBlock")) + object.conflictingBlock = $root.tendermint.types.LightBlock.toObject(message.conflictingBlock, options); + if (message.commonHeight != null && message.hasOwnProperty("commonHeight")) + if (typeof message.commonHeight === "number") + object.commonHeight = options.longs === String ? String(message.commonHeight) : message.commonHeight; + else + object.commonHeight = options.longs === String ? $util.Long.prototype.toString.call(message.commonHeight) : options.longs === Number ? new $util.LongBits(message.commonHeight.low >>> 0, message.commonHeight.high >>> 0).toNumber() : message.commonHeight; + if (message.byzantineValidators && message.byzantineValidators.length) { + object.byzantineValidators = []; + for (let j = 0; j < message.byzantineValidators.length; ++j) + object.byzantineValidators[j] = $root.tendermint.types.Validator.toObject(message.byzantineValidators[j], options); + } + if (message.totalVotingPower != null && message.hasOwnProperty("totalVotingPower")) + if (typeof message.totalVotingPower === "number") + object.totalVotingPower = options.longs === String ? String(message.totalVotingPower) : message.totalVotingPower; + else + object.totalVotingPower = options.longs === String ? $util.Long.prototype.toString.call(message.totalVotingPower) : options.longs === Number ? new $util.LongBits(message.totalVotingPower.low >>> 0, message.totalVotingPower.high >>> 0).toNumber() : message.totalVotingPower; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); + return object; + }; + + /** + * Converts this LightClientAttackEvidence to JSON. + * @function toJSON + * @memberof tendermint.types.LightClientAttackEvidence + * @instance + * @returns {Object.} JSON object + */ + LightClientAttackEvidence.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LightClientAttackEvidence; + })(types.LightClientAttackEvidence || {}); + + types.EvidenceList = (function(EvidenceList) { + + /** + * Properties of an EvidenceList. + * @memberof tendermint.types + * @interface IEvidenceList + * @property {Array.|null} [evidence] EvidenceList evidence + */ + + /** + * Constructs a new EvidenceList. + * @memberof tendermint.types + * @classdesc Represents an EvidenceList. + * @implements IEvidenceList + * @constructor + * @param {tendermint.types.IEvidenceList=} [properties] Properties to set + */ + function EvidenceList(properties) { + this.evidence = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvidenceList evidence. + * @member {Array.} evidence + * @memberof tendermint.types.EvidenceList + * @instance + */ + EvidenceList.prototype.evidence = $util.emptyArray; + + /** + * Creates a new EvidenceList instance using the specified properties. + * @function create + * @memberof tendermint.types.EvidenceList + * @static + * @param {tendermint.types.IEvidenceList=} [properties] Properties to set + * @returns {tendermint.types.EvidenceList} EvidenceList instance + */ + EvidenceList.create = function create(properties) { + return new EvidenceList(properties); + }; + + /** + * Encodes the specified EvidenceList message. Does not implicitly {@link tendermint.types.EvidenceList.verify|verify} messages. + * @function encode + * @memberof tendermint.types.EvidenceList + * @static + * @param {tendermint.types.IEvidenceList} message EvidenceList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvidenceList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evidence != null && message.evidence.length) + for (let i = 0; i < message.evidence.length; ++i) + $root.tendermint.types.Evidence.encode(message.evidence[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EvidenceList message, length delimited. Does not implicitly {@link tendermint.types.EvidenceList.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.EvidenceList + * @static + * @param {tendermint.types.IEvidenceList} message EvidenceList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvidenceList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvidenceList message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.EvidenceList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.EvidenceList} EvidenceList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvidenceList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.EvidenceList(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.evidence && message.evidence.length)) + message.evidence = []; + message.evidence.push($root.tendermint.types.Evidence.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvidenceList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.EvidenceList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.EvidenceList} EvidenceList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvidenceList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvidenceList message. + * @function verify + * @memberof tendermint.types.EvidenceList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvidenceList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evidence != null && message.hasOwnProperty("evidence")) { + if (!Array.isArray(message.evidence)) + return "evidence: array expected"; + for (let i = 0; i < message.evidence.length; ++i) { + let error = $root.tendermint.types.Evidence.verify(message.evidence[i]); + if (error) + return "evidence." + error; + } + } + return null; + }; + + /** + * Creates an EvidenceList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.EvidenceList + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.EvidenceList} EvidenceList + */ + EvidenceList.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.EvidenceList) + return object; + let message = new $root.tendermint.types.EvidenceList(); + if (object.evidence) { + if (!Array.isArray(object.evidence)) + throw TypeError(".tendermint.types.EvidenceList.evidence: array expected"); + message.evidence = []; + for (let i = 0; i < object.evidence.length; ++i) { + if (typeof object.evidence[i] !== "object") + throw TypeError(".tendermint.types.EvidenceList.evidence: object expected"); + message.evidence[i] = $root.tendermint.types.Evidence.fromObject(object.evidence[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EvidenceList message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.EvidenceList + * @static + * @param {tendermint.types.EvidenceList} message EvidenceList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvidenceList.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.evidence = []; + if (message.evidence && message.evidence.length) { + object.evidence = []; + for (let j = 0; j < message.evidence.length; ++j) + object.evidence[j] = $root.tendermint.types.Evidence.toObject(message.evidence[j], options); + } + return object; + }; + + /** + * Converts this EvidenceList to JSON. + * @function toJSON + * @memberof tendermint.types.EvidenceList + * @instance + * @returns {Object.} JSON object + */ + EvidenceList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EvidenceList; + })(types.EvidenceList || {}); + + types.ConsensusParams = (function(ConsensusParams) { + + /** + * Properties of a ConsensusParams. + * @memberof tendermint.types + * @interface IConsensusParams + * @property {tendermint.types.IBlockParams|null} [block] ConsensusParams block + * @property {tendermint.types.IEvidenceParams|null} [evidence] ConsensusParams evidence + * @property {tendermint.types.IValidatorParams|null} [validator] ConsensusParams validator + * @property {tendermint.types.IVersionParams|null} [version] ConsensusParams version + */ + + /** + * Constructs a new ConsensusParams. + * @memberof tendermint.types + * @classdesc Represents a ConsensusParams. + * @implements IConsensusParams + * @constructor + * @param {tendermint.types.IConsensusParams=} [properties] Properties to set + */ + function ConsensusParams(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConsensusParams block. + * @member {tendermint.types.IBlockParams|null|undefined} block + * @memberof tendermint.types.ConsensusParams + * @instance + */ + ConsensusParams.prototype.block = null; + + /** + * ConsensusParams evidence. + * @member {tendermint.types.IEvidenceParams|null|undefined} evidence + * @memberof tendermint.types.ConsensusParams + * @instance + */ + ConsensusParams.prototype.evidence = null; + + /** + * ConsensusParams validator. + * @member {tendermint.types.IValidatorParams|null|undefined} validator + * @memberof tendermint.types.ConsensusParams + * @instance + */ + ConsensusParams.prototype.validator = null; + + /** + * ConsensusParams version. + * @member {tendermint.types.IVersionParams|null|undefined} version + * @memberof tendermint.types.ConsensusParams + * @instance + */ + ConsensusParams.prototype.version = null; + + /** + * Creates a new ConsensusParams instance using the specified properties. + * @function create + * @memberof tendermint.types.ConsensusParams + * @static + * @param {tendermint.types.IConsensusParams=} [properties] Properties to set + * @returns {tendermint.types.ConsensusParams} ConsensusParams instance + */ + ConsensusParams.create = function create(properties) { + return new ConsensusParams(properties); + }; + + /** + * Encodes the specified ConsensusParams message. Does not implicitly {@link tendermint.types.ConsensusParams.verify|verify} messages. + * @function encode + * @memberof tendermint.types.ConsensusParams + * @static + * @param {tendermint.types.IConsensusParams} message ConsensusParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.block != null && Object.hasOwnProperty.call(message, "block")) + $root.tendermint.types.BlockParams.encode(message.block, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.evidence != null && Object.hasOwnProperty.call(message, "evidence")) + $root.tendermint.types.EvidenceParams.encode(message.evidence, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.validator != null && Object.hasOwnProperty.call(message, "validator")) + $root.tendermint.types.ValidatorParams.encode(message.validator, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + $root.tendermint.types.VersionParams.encode(message.version, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConsensusParams message, length delimited. Does not implicitly {@link tendermint.types.ConsensusParams.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.ConsensusParams + * @static + * @param {tendermint.types.IConsensusParams} message ConsensusParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConsensusParams message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.ConsensusParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.ConsensusParams} ConsensusParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.ConsensusParams(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.block = $root.tendermint.types.BlockParams.decode(reader, reader.uint32()); + break; + case 2: + message.evidence = $root.tendermint.types.EvidenceParams.decode(reader, reader.uint32()); + break; + case 3: + message.validator = $root.tendermint.types.ValidatorParams.decode(reader, reader.uint32()); + break; + case 4: + message.version = $root.tendermint.types.VersionParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConsensusParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.ConsensusParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.ConsensusParams} ConsensusParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConsensusParams message. + * @function verify + * @memberof tendermint.types.ConsensusParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConsensusParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.block != null && message.hasOwnProperty("block")) { + let error = $root.tendermint.types.BlockParams.verify(message.block); + if (error) + return "block." + error; + } + if (message.evidence != null && message.hasOwnProperty("evidence")) { + let error = $root.tendermint.types.EvidenceParams.verify(message.evidence); + if (error) + return "evidence." + error; + } + if (message.validator != null && message.hasOwnProperty("validator")) { + let error = $root.tendermint.types.ValidatorParams.verify(message.validator); + if (error) + return "validator." + error; + } + if (message.version != null && message.hasOwnProperty("version")) { + let error = $root.tendermint.types.VersionParams.verify(message.version); + if (error) + return "version." + error; + } + return null; + }; + + /** + * Creates a ConsensusParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.ConsensusParams + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.ConsensusParams} ConsensusParams + */ + ConsensusParams.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.ConsensusParams) + return object; + let message = new $root.tendermint.types.ConsensusParams(); + if (object.block != null) { + if (typeof object.block !== "object") + throw TypeError(".tendermint.types.ConsensusParams.block: object expected"); + message.block = $root.tendermint.types.BlockParams.fromObject(object.block); + } + if (object.evidence != null) { + if (typeof object.evidence !== "object") + throw TypeError(".tendermint.types.ConsensusParams.evidence: object expected"); + message.evidence = $root.tendermint.types.EvidenceParams.fromObject(object.evidence); + } + if (object.validator != null) { + if (typeof object.validator !== "object") + throw TypeError(".tendermint.types.ConsensusParams.validator: object expected"); + message.validator = $root.tendermint.types.ValidatorParams.fromObject(object.validator); + } + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".tendermint.types.ConsensusParams.version: object expected"); + message.version = $root.tendermint.types.VersionParams.fromObject(object.version); + } + return message; + }; + + /** + * Creates a plain object from a ConsensusParams message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.ConsensusParams + * @static + * @param {tendermint.types.ConsensusParams} message ConsensusParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConsensusParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.block = null; + object.evidence = null; + object.validator = null; + object.version = null; + } + if (message.block != null && message.hasOwnProperty("block")) + object.block = $root.tendermint.types.BlockParams.toObject(message.block, options); + if (message.evidence != null && message.hasOwnProperty("evidence")) + object.evidence = $root.tendermint.types.EvidenceParams.toObject(message.evidence, options); + if (message.validator != null && message.hasOwnProperty("validator")) + object.validator = $root.tendermint.types.ValidatorParams.toObject(message.validator, options); + if (message.version != null && message.hasOwnProperty("version")) + object.version = $root.tendermint.types.VersionParams.toObject(message.version, options); + return object; + }; + + /** + * Converts this ConsensusParams to JSON. + * @function toJSON + * @memberof tendermint.types.ConsensusParams + * @instance + * @returns {Object.} JSON object + */ + ConsensusParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ConsensusParams; + })(types.ConsensusParams || {}); + + types.BlockParams = (function(BlockParams) { + + /** + * Properties of a BlockParams. + * @memberof tendermint.types + * @interface IBlockParams + * @property {number|Long|null} [maxBytes] BlockParams maxBytes + * @property {number|Long|null} [maxGas] BlockParams maxGas + * @property {number|Long|null} [timeIotaMs] BlockParams timeIotaMs + */ + + /** + * Constructs a new BlockParams. + * @memberof tendermint.types + * @classdesc Represents a BlockParams. + * @implements IBlockParams + * @constructor + * @param {tendermint.types.IBlockParams=} [properties] Properties to set + */ + function BlockParams(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BlockParams maxBytes. + * @member {number|Long} maxBytes + * @memberof tendermint.types.BlockParams + * @instance + */ + BlockParams.prototype.maxBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BlockParams maxGas. + * @member {number|Long} maxGas + * @memberof tendermint.types.BlockParams + * @instance + */ + BlockParams.prototype.maxGas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BlockParams timeIotaMs. + * @member {number|Long} timeIotaMs + * @memberof tendermint.types.BlockParams + * @instance + */ + BlockParams.prototype.timeIotaMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new BlockParams instance using the specified properties. + * @function create + * @memberof tendermint.types.BlockParams + * @static + * @param {tendermint.types.IBlockParams=} [properties] Properties to set + * @returns {tendermint.types.BlockParams} BlockParams instance + */ + BlockParams.create = function create(properties) { + return new BlockParams(properties); + }; + + /** + * Encodes the specified BlockParams message. Does not implicitly {@link tendermint.types.BlockParams.verify|verify} messages. + * @function encode + * @memberof tendermint.types.BlockParams + * @static + * @param {tendermint.types.IBlockParams} message BlockParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlockParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxBytes != null && Object.hasOwnProperty.call(message, "maxBytes")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.maxBytes); + if (message.maxGas != null && Object.hasOwnProperty.call(message, "maxGas")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.maxGas); + if (message.timeIotaMs != null && Object.hasOwnProperty.call(message, "timeIotaMs")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.timeIotaMs); + return writer; + }; + + /** + * Encodes the specified BlockParams message, length delimited. Does not implicitly {@link tendermint.types.BlockParams.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.BlockParams + * @static + * @param {tendermint.types.IBlockParams} message BlockParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlockParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BlockParams message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.BlockParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.BlockParams} BlockParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlockParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.BlockParams(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxBytes = reader.int64(); + break; + case 2: + message.maxGas = reader.int64(); + break; + case 3: + message.timeIotaMs = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BlockParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.BlockParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.BlockParams} BlockParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlockParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BlockParams message. + * @function verify + * @memberof tendermint.types.BlockParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BlockParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + if (!$util.isInteger(message.maxBytes) && !(message.maxBytes && $util.isInteger(message.maxBytes.low) && $util.isInteger(message.maxBytes.high))) + return "maxBytes: integer|Long expected"; + if (message.maxGas != null && message.hasOwnProperty("maxGas")) + if (!$util.isInteger(message.maxGas) && !(message.maxGas && $util.isInteger(message.maxGas.low) && $util.isInteger(message.maxGas.high))) + return "maxGas: integer|Long expected"; + if (message.timeIotaMs != null && message.hasOwnProperty("timeIotaMs")) + if (!$util.isInteger(message.timeIotaMs) && !(message.timeIotaMs && $util.isInteger(message.timeIotaMs.low) && $util.isInteger(message.timeIotaMs.high))) + return "timeIotaMs: integer|Long expected"; + return null; + }; + + /** + * Creates a BlockParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.BlockParams + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.BlockParams} BlockParams + */ + BlockParams.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.BlockParams) + return object; + let message = new $root.tendermint.types.BlockParams(); + if (object.maxBytes != null) + if ($util.Long) + (message.maxBytes = $util.Long.fromValue(object.maxBytes)).unsigned = false; + else if (typeof object.maxBytes === "string") + message.maxBytes = parseInt(object.maxBytes, 10); + else if (typeof object.maxBytes === "number") + message.maxBytes = object.maxBytes; + else if (typeof object.maxBytes === "object") + message.maxBytes = new $util.LongBits(object.maxBytes.low >>> 0, object.maxBytes.high >>> 0).toNumber(); + if (object.maxGas != null) + if ($util.Long) + (message.maxGas = $util.Long.fromValue(object.maxGas)).unsigned = false; + else if (typeof object.maxGas === "string") + message.maxGas = parseInt(object.maxGas, 10); + else if (typeof object.maxGas === "number") + message.maxGas = object.maxGas; + else if (typeof object.maxGas === "object") + message.maxGas = new $util.LongBits(object.maxGas.low >>> 0, object.maxGas.high >>> 0).toNumber(); + if (object.timeIotaMs != null) + if ($util.Long) + (message.timeIotaMs = $util.Long.fromValue(object.timeIotaMs)).unsigned = false; + else if (typeof object.timeIotaMs === "string") + message.timeIotaMs = parseInt(object.timeIotaMs, 10); + else if (typeof object.timeIotaMs === "number") + message.timeIotaMs = object.timeIotaMs; + else if (typeof object.timeIotaMs === "object") + message.timeIotaMs = new $util.LongBits(object.timeIotaMs.low >>> 0, object.timeIotaMs.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a BlockParams message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.BlockParams + * @static + * @param {tendermint.types.BlockParams} message BlockParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BlockParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.maxBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxBytes = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.maxGas = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxGas = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.timeIotaMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timeIotaMs = options.longs === String ? "0" : 0; + } + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + if (typeof message.maxBytes === "number") + object.maxBytes = options.longs === String ? String(message.maxBytes) : message.maxBytes; + else + object.maxBytes = options.longs === String ? $util.Long.prototype.toString.call(message.maxBytes) : options.longs === Number ? new $util.LongBits(message.maxBytes.low >>> 0, message.maxBytes.high >>> 0).toNumber() : message.maxBytes; + if (message.maxGas != null && message.hasOwnProperty("maxGas")) + if (typeof message.maxGas === "number") + object.maxGas = options.longs === String ? String(message.maxGas) : message.maxGas; + else + object.maxGas = options.longs === String ? $util.Long.prototype.toString.call(message.maxGas) : options.longs === Number ? new $util.LongBits(message.maxGas.low >>> 0, message.maxGas.high >>> 0).toNumber() : message.maxGas; + if (message.timeIotaMs != null && message.hasOwnProperty("timeIotaMs")) + if (typeof message.timeIotaMs === "number") + object.timeIotaMs = options.longs === String ? String(message.timeIotaMs) : message.timeIotaMs; + else + object.timeIotaMs = options.longs === String ? $util.Long.prototype.toString.call(message.timeIotaMs) : options.longs === Number ? new $util.LongBits(message.timeIotaMs.low >>> 0, message.timeIotaMs.high >>> 0).toNumber() : message.timeIotaMs; + return object; + }; + + /** + * Converts this BlockParams to JSON. + * @function toJSON + * @memberof tendermint.types.BlockParams + * @instance + * @returns {Object.} JSON object + */ + BlockParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BlockParams; + })(types.BlockParams || {}); + + types.EvidenceParams = (function(EvidenceParams) { + + /** + * Properties of an EvidenceParams. + * @memberof tendermint.types + * @interface IEvidenceParams + * @property {number|Long|null} [maxAgeNumBlocks] EvidenceParams maxAgeNumBlocks + * @property {google.protobuf.IDuration|null} [maxAgeDuration] EvidenceParams maxAgeDuration + * @property {number|Long|null} [maxBytes] EvidenceParams maxBytes + */ + + /** + * Constructs a new EvidenceParams. + * @memberof tendermint.types + * @classdesc Represents an EvidenceParams. + * @implements IEvidenceParams + * @constructor + * @param {tendermint.types.IEvidenceParams=} [properties] Properties to set + */ + function EvidenceParams(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvidenceParams maxAgeNumBlocks. + * @member {number|Long} maxAgeNumBlocks + * @memberof tendermint.types.EvidenceParams + * @instance + */ + EvidenceParams.prototype.maxAgeNumBlocks = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * EvidenceParams maxAgeDuration. + * @member {google.protobuf.IDuration|null|undefined} maxAgeDuration + * @memberof tendermint.types.EvidenceParams + * @instance + */ + EvidenceParams.prototype.maxAgeDuration = null; + + /** + * EvidenceParams maxBytes. + * @member {number|Long} maxBytes + * @memberof tendermint.types.EvidenceParams + * @instance + */ + EvidenceParams.prototype.maxBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new EvidenceParams instance using the specified properties. + * @function create + * @memberof tendermint.types.EvidenceParams + * @static + * @param {tendermint.types.IEvidenceParams=} [properties] Properties to set + * @returns {tendermint.types.EvidenceParams} EvidenceParams instance + */ + EvidenceParams.create = function create(properties) { + return new EvidenceParams(properties); + }; + + /** + * Encodes the specified EvidenceParams message. Does not implicitly {@link tendermint.types.EvidenceParams.verify|verify} messages. + * @function encode + * @memberof tendermint.types.EvidenceParams + * @static + * @param {tendermint.types.IEvidenceParams} message EvidenceParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvidenceParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxAgeNumBlocks != null && Object.hasOwnProperty.call(message, "maxAgeNumBlocks")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.maxAgeNumBlocks); + if (message.maxAgeDuration != null && Object.hasOwnProperty.call(message, "maxAgeDuration")) + $root.google.protobuf.Duration.encode(message.maxAgeDuration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.maxBytes != null && Object.hasOwnProperty.call(message, "maxBytes")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.maxBytes); + return writer; + }; + + /** + * Encodes the specified EvidenceParams message, length delimited. Does not implicitly {@link tendermint.types.EvidenceParams.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.EvidenceParams + * @static + * @param {tendermint.types.IEvidenceParams} message EvidenceParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvidenceParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvidenceParams message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.EvidenceParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.EvidenceParams} EvidenceParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvidenceParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.EvidenceParams(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxAgeNumBlocks = reader.int64(); + break; + case 2: + message.maxAgeDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 3: + message.maxBytes = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvidenceParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.EvidenceParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.EvidenceParams} EvidenceParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvidenceParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvidenceParams message. + * @function verify + * @memberof tendermint.types.EvidenceParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvidenceParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maxAgeNumBlocks != null && message.hasOwnProperty("maxAgeNumBlocks")) + if (!$util.isInteger(message.maxAgeNumBlocks) && !(message.maxAgeNumBlocks && $util.isInteger(message.maxAgeNumBlocks.low) && $util.isInteger(message.maxAgeNumBlocks.high))) + return "maxAgeNumBlocks: integer|Long expected"; + if (message.maxAgeDuration != null && message.hasOwnProperty("maxAgeDuration")) { + let error = $root.google.protobuf.Duration.verify(message.maxAgeDuration); + if (error) + return "maxAgeDuration." + error; + } + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + if (!$util.isInteger(message.maxBytes) && !(message.maxBytes && $util.isInteger(message.maxBytes.low) && $util.isInteger(message.maxBytes.high))) + return "maxBytes: integer|Long expected"; + return null; + }; + + /** + * Creates an EvidenceParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.EvidenceParams + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.EvidenceParams} EvidenceParams + */ + EvidenceParams.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.EvidenceParams) + return object; + let message = new $root.tendermint.types.EvidenceParams(); + if (object.maxAgeNumBlocks != null) + if ($util.Long) + (message.maxAgeNumBlocks = $util.Long.fromValue(object.maxAgeNumBlocks)).unsigned = false; + else if (typeof object.maxAgeNumBlocks === "string") + message.maxAgeNumBlocks = parseInt(object.maxAgeNumBlocks, 10); + else if (typeof object.maxAgeNumBlocks === "number") + message.maxAgeNumBlocks = object.maxAgeNumBlocks; + else if (typeof object.maxAgeNumBlocks === "object") + message.maxAgeNumBlocks = new $util.LongBits(object.maxAgeNumBlocks.low >>> 0, object.maxAgeNumBlocks.high >>> 0).toNumber(); + if (object.maxAgeDuration != null) { + if (typeof object.maxAgeDuration !== "object") + throw TypeError(".tendermint.types.EvidenceParams.maxAgeDuration: object expected"); + message.maxAgeDuration = $root.google.protobuf.Duration.fromObject(object.maxAgeDuration); + } + if (object.maxBytes != null) + if ($util.Long) + (message.maxBytes = $util.Long.fromValue(object.maxBytes)).unsigned = false; + else if (typeof object.maxBytes === "string") + message.maxBytes = parseInt(object.maxBytes, 10); + else if (typeof object.maxBytes === "number") + message.maxBytes = object.maxBytes; + else if (typeof object.maxBytes === "object") + message.maxBytes = new $util.LongBits(object.maxBytes.low >>> 0, object.maxBytes.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an EvidenceParams message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.EvidenceParams + * @static + * @param {tendermint.types.EvidenceParams} message EvidenceParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvidenceParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.maxAgeNumBlocks = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxAgeNumBlocks = options.longs === String ? "0" : 0; + object.maxAgeDuration = null; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.maxBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxBytes = options.longs === String ? "0" : 0; + } + if (message.maxAgeNumBlocks != null && message.hasOwnProperty("maxAgeNumBlocks")) + if (typeof message.maxAgeNumBlocks === "number") + object.maxAgeNumBlocks = options.longs === String ? String(message.maxAgeNumBlocks) : message.maxAgeNumBlocks; + else + object.maxAgeNumBlocks = options.longs === String ? $util.Long.prototype.toString.call(message.maxAgeNumBlocks) : options.longs === Number ? new $util.LongBits(message.maxAgeNumBlocks.low >>> 0, message.maxAgeNumBlocks.high >>> 0).toNumber() : message.maxAgeNumBlocks; + if (message.maxAgeDuration != null && message.hasOwnProperty("maxAgeDuration")) + object.maxAgeDuration = $root.google.protobuf.Duration.toObject(message.maxAgeDuration, options); + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + if (typeof message.maxBytes === "number") + object.maxBytes = options.longs === String ? String(message.maxBytes) : message.maxBytes; + else + object.maxBytes = options.longs === String ? $util.Long.prototype.toString.call(message.maxBytes) : options.longs === Number ? new $util.LongBits(message.maxBytes.low >>> 0, message.maxBytes.high >>> 0).toNumber() : message.maxBytes; + return object; + }; + + /** + * Converts this EvidenceParams to JSON. + * @function toJSON + * @memberof tendermint.types.EvidenceParams + * @instance + * @returns {Object.} JSON object + */ + EvidenceParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EvidenceParams; + })(types.EvidenceParams || {}); + + types.ValidatorParams = (function(ValidatorParams) { + + /** + * Properties of a ValidatorParams. + * @memberof tendermint.types + * @interface IValidatorParams + * @property {Array.|null} [pubKeyTypes] ValidatorParams pubKeyTypes + */ + + /** + * Constructs a new ValidatorParams. + * @memberof tendermint.types + * @classdesc Represents a ValidatorParams. + * @implements IValidatorParams + * @constructor + * @param {tendermint.types.IValidatorParams=} [properties] Properties to set + */ + function ValidatorParams(properties) { + this.pubKeyTypes = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidatorParams pubKeyTypes. + * @member {Array.} pubKeyTypes + * @memberof tendermint.types.ValidatorParams + * @instance + */ + ValidatorParams.prototype.pubKeyTypes = $util.emptyArray; + + /** + * Creates a new ValidatorParams instance using the specified properties. + * @function create + * @memberof tendermint.types.ValidatorParams + * @static + * @param {tendermint.types.IValidatorParams=} [properties] Properties to set + * @returns {tendermint.types.ValidatorParams} ValidatorParams instance + */ + ValidatorParams.create = function create(properties) { + return new ValidatorParams(properties); + }; + + /** + * Encodes the specified ValidatorParams message. Does not implicitly {@link tendermint.types.ValidatorParams.verify|verify} messages. + * @function encode + * @memberof tendermint.types.ValidatorParams + * @static + * @param {tendermint.types.IValidatorParams} message ValidatorParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pubKeyTypes != null && message.pubKeyTypes.length) + for (let i = 0; i < message.pubKeyTypes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pubKeyTypes[i]); + return writer; + }; + + /** + * Encodes the specified ValidatorParams message, length delimited. Does not implicitly {@link tendermint.types.ValidatorParams.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.ValidatorParams + * @static + * @param {tendermint.types.IValidatorParams} message ValidatorParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidatorParams message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.ValidatorParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.ValidatorParams} ValidatorParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.ValidatorParams(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.pubKeyTypes && message.pubKeyTypes.length)) + message.pubKeyTypes = []; + message.pubKeyTypes.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidatorParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.ValidatorParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.ValidatorParams} ValidatorParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidatorParams message. + * @function verify + * @memberof tendermint.types.ValidatorParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidatorParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pubKeyTypes != null && message.hasOwnProperty("pubKeyTypes")) { + if (!Array.isArray(message.pubKeyTypes)) + return "pubKeyTypes: array expected"; + for (let i = 0; i < message.pubKeyTypes.length; ++i) + if (!$util.isString(message.pubKeyTypes[i])) + return "pubKeyTypes: string[] expected"; + } + return null; + }; + + /** + * Creates a ValidatorParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.ValidatorParams + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.ValidatorParams} ValidatorParams + */ + ValidatorParams.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.ValidatorParams) + return object; + let message = new $root.tendermint.types.ValidatorParams(); + if (object.pubKeyTypes) { + if (!Array.isArray(object.pubKeyTypes)) + throw TypeError(".tendermint.types.ValidatorParams.pubKeyTypes: array expected"); + message.pubKeyTypes = []; + for (let i = 0; i < object.pubKeyTypes.length; ++i) + message.pubKeyTypes[i] = String(object.pubKeyTypes[i]); + } + return message; + }; + + /** + * Creates a plain object from a ValidatorParams message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.ValidatorParams + * @static + * @param {tendermint.types.ValidatorParams} message ValidatorParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidatorParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.pubKeyTypes = []; + if (message.pubKeyTypes && message.pubKeyTypes.length) { + object.pubKeyTypes = []; + for (let j = 0; j < message.pubKeyTypes.length; ++j) + object.pubKeyTypes[j] = message.pubKeyTypes[j]; + } + return object; + }; + + /** + * Converts this ValidatorParams to JSON. + * @function toJSON + * @memberof tendermint.types.ValidatorParams + * @instance + * @returns {Object.} JSON object + */ + ValidatorParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidatorParams; + })(types.ValidatorParams || {}); + + types.VersionParams = (function(VersionParams) { + + /** + * Properties of a VersionParams. + * @memberof tendermint.types + * @interface IVersionParams + * @property {number|Long|null} [appVersion] VersionParams appVersion + */ + + /** + * Constructs a new VersionParams. + * @memberof tendermint.types + * @classdesc Represents a VersionParams. + * @implements IVersionParams + * @constructor + * @param {tendermint.types.IVersionParams=} [properties] Properties to set + */ + function VersionParams(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VersionParams appVersion. + * @member {number|Long} appVersion + * @memberof tendermint.types.VersionParams + * @instance + */ + VersionParams.prototype.appVersion = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new VersionParams instance using the specified properties. + * @function create + * @memberof tendermint.types.VersionParams + * @static + * @param {tendermint.types.IVersionParams=} [properties] Properties to set + * @returns {tendermint.types.VersionParams} VersionParams instance + */ + VersionParams.create = function create(properties) { + return new VersionParams(properties); + }; + + /** + * Encodes the specified VersionParams message. Does not implicitly {@link tendermint.types.VersionParams.verify|verify} messages. + * @function encode + * @memberof tendermint.types.VersionParams + * @static + * @param {tendermint.types.IVersionParams} message VersionParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.appVersion); + return writer; + }; + + /** + * Encodes the specified VersionParams message, length delimited. Does not implicitly {@link tendermint.types.VersionParams.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.VersionParams + * @static + * @param {tendermint.types.IVersionParams} message VersionParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VersionParams message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.VersionParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.VersionParams} VersionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.VersionParams(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.appVersion = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VersionParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.VersionParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.VersionParams} VersionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VersionParams message. + * @function verify + * @memberof tendermint.types.VersionParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VersionParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + if (!$util.isInteger(message.appVersion) && !(message.appVersion && $util.isInteger(message.appVersion.low) && $util.isInteger(message.appVersion.high))) + return "appVersion: integer|Long expected"; + return null; + }; + + /** + * Creates a VersionParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.VersionParams + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.VersionParams} VersionParams + */ + VersionParams.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.VersionParams) + return object; + let message = new $root.tendermint.types.VersionParams(); + if (object.appVersion != null) + if ($util.Long) + (message.appVersion = $util.Long.fromValue(object.appVersion)).unsigned = true; + else if (typeof object.appVersion === "string") + message.appVersion = parseInt(object.appVersion, 10); + else if (typeof object.appVersion === "number") + message.appVersion = object.appVersion; + else if (typeof object.appVersion === "object") + message.appVersion = new $util.LongBits(object.appVersion.low >>> 0, object.appVersion.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a VersionParams message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.VersionParams + * @static + * @param {tendermint.types.VersionParams} message VersionParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VersionParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.appVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.appVersion = options.longs === String ? "0" : 0; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + if (typeof message.appVersion === "number") + object.appVersion = options.longs === String ? String(message.appVersion) : message.appVersion; + else + object.appVersion = options.longs === String ? $util.Long.prototype.toString.call(message.appVersion) : options.longs === Number ? new $util.LongBits(message.appVersion.low >>> 0, message.appVersion.high >>> 0).toNumber(true) : message.appVersion; + return object; + }; + + /** + * Converts this VersionParams to JSON. + * @function toJSON + * @memberof tendermint.types.VersionParams + * @instance + * @returns {Object.} JSON object + */ + VersionParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VersionParams; + })(types.VersionParams || {}); + + types.HashedParams = (function(HashedParams) { + + /** + * Properties of a HashedParams. + * @memberof tendermint.types + * @interface IHashedParams + * @property {number|Long|null} [blockMaxBytes] HashedParams blockMaxBytes + * @property {number|Long|null} [blockMaxGas] HashedParams blockMaxGas + */ + + /** + * Constructs a new HashedParams. + * @memberof tendermint.types + * @classdesc Represents a HashedParams. + * @implements IHashedParams + * @constructor + * @param {tendermint.types.IHashedParams=} [properties] Properties to set + */ + function HashedParams(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HashedParams blockMaxBytes. + * @member {number|Long} blockMaxBytes + * @memberof tendermint.types.HashedParams + * @instance + */ + HashedParams.prototype.blockMaxBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * HashedParams blockMaxGas. + * @member {number|Long} blockMaxGas + * @memberof tendermint.types.HashedParams + * @instance + */ + HashedParams.prototype.blockMaxGas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new HashedParams instance using the specified properties. + * @function create + * @memberof tendermint.types.HashedParams + * @static + * @param {tendermint.types.IHashedParams=} [properties] Properties to set + * @returns {tendermint.types.HashedParams} HashedParams instance + */ + HashedParams.create = function create(properties) { + return new HashedParams(properties); + }; + + /** + * Encodes the specified HashedParams message. Does not implicitly {@link tendermint.types.HashedParams.verify|verify} messages. + * @function encode + * @memberof tendermint.types.HashedParams + * @static + * @param {tendermint.types.IHashedParams} message HashedParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HashedParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.blockMaxBytes != null && Object.hasOwnProperty.call(message, "blockMaxBytes")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.blockMaxBytes); + if (message.blockMaxGas != null && Object.hasOwnProperty.call(message, "blockMaxGas")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.blockMaxGas); + return writer; + }; + + /** + * Encodes the specified HashedParams message, length delimited. Does not implicitly {@link tendermint.types.HashedParams.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.HashedParams + * @static + * @param {tendermint.types.IHashedParams} message HashedParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HashedParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HashedParams message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.HashedParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.HashedParams} HashedParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HashedParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.HashedParams(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockMaxBytes = reader.int64(); + break; + case 2: + message.blockMaxGas = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HashedParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.HashedParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.HashedParams} HashedParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HashedParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HashedParams message. + * @function verify + * @memberof tendermint.types.HashedParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HashedParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.blockMaxBytes != null && message.hasOwnProperty("blockMaxBytes")) + if (!$util.isInteger(message.blockMaxBytes) && !(message.blockMaxBytes && $util.isInteger(message.blockMaxBytes.low) && $util.isInteger(message.blockMaxBytes.high))) + return "blockMaxBytes: integer|Long expected"; + if (message.blockMaxGas != null && message.hasOwnProperty("blockMaxGas")) + if (!$util.isInteger(message.blockMaxGas) && !(message.blockMaxGas && $util.isInteger(message.blockMaxGas.low) && $util.isInteger(message.blockMaxGas.high))) + return "blockMaxGas: integer|Long expected"; + return null; + }; + + /** + * Creates a HashedParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.HashedParams + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.HashedParams} HashedParams + */ + HashedParams.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.HashedParams) + return object; + let message = new $root.tendermint.types.HashedParams(); + if (object.blockMaxBytes != null) + if ($util.Long) + (message.blockMaxBytes = $util.Long.fromValue(object.blockMaxBytes)).unsigned = false; + else if (typeof object.blockMaxBytes === "string") + message.blockMaxBytes = parseInt(object.blockMaxBytes, 10); + else if (typeof object.blockMaxBytes === "number") + message.blockMaxBytes = object.blockMaxBytes; + else if (typeof object.blockMaxBytes === "object") + message.blockMaxBytes = new $util.LongBits(object.blockMaxBytes.low >>> 0, object.blockMaxBytes.high >>> 0).toNumber(); + if (object.blockMaxGas != null) + if ($util.Long) + (message.blockMaxGas = $util.Long.fromValue(object.blockMaxGas)).unsigned = false; + else if (typeof object.blockMaxGas === "string") + message.blockMaxGas = parseInt(object.blockMaxGas, 10); + else if (typeof object.blockMaxGas === "number") + message.blockMaxGas = object.blockMaxGas; + else if (typeof object.blockMaxGas === "object") + message.blockMaxGas = new $util.LongBits(object.blockMaxGas.low >>> 0, object.blockMaxGas.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a HashedParams message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.HashedParams + * @static + * @param {tendermint.types.HashedParams} message HashedParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HashedParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.blockMaxBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.blockMaxBytes = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.blockMaxGas = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.blockMaxGas = options.longs === String ? "0" : 0; + } + if (message.blockMaxBytes != null && message.hasOwnProperty("blockMaxBytes")) + if (typeof message.blockMaxBytes === "number") + object.blockMaxBytes = options.longs === String ? String(message.blockMaxBytes) : message.blockMaxBytes; + else + object.blockMaxBytes = options.longs === String ? $util.Long.prototype.toString.call(message.blockMaxBytes) : options.longs === Number ? new $util.LongBits(message.blockMaxBytes.low >>> 0, message.blockMaxBytes.high >>> 0).toNumber() : message.blockMaxBytes; + if (message.blockMaxGas != null && message.hasOwnProperty("blockMaxGas")) + if (typeof message.blockMaxGas === "number") + object.blockMaxGas = options.longs === String ? String(message.blockMaxGas) : message.blockMaxGas; + else + object.blockMaxGas = options.longs === String ? $util.Long.prototype.toString.call(message.blockMaxGas) : options.longs === Number ? new $util.LongBits(message.blockMaxGas.low >>> 0, message.blockMaxGas.high >>> 0).toNumber() : message.blockMaxGas; + return object; + }; + + /** + * Converts this HashedParams to JSON. + * @function toJSON + * @memberof tendermint.types.HashedParams + * @instance + * @returns {Object.} JSON object + */ + HashedParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HashedParams; + })(types.HashedParams || {}); + + /** + * BlockIDFlag enum. + * @name tendermint.types.BlockIDFlag + * @enum {string} + * @property {number} BLOCK_ID_FLAG_UNKNOWN=0 BLOCK_ID_FLAG_UNKNOWN value + * @property {number} BLOCK_ID_FLAG_ABSENT=1 BLOCK_ID_FLAG_ABSENT value + * @property {number} BLOCK_ID_FLAG_COMMIT=2 BLOCK_ID_FLAG_COMMIT value + * @property {number} BLOCK_ID_FLAG_NIL=3 BLOCK_ID_FLAG_NIL value + */ + types.BlockIDFlag = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BLOCK_ID_FLAG_UNKNOWN"] = 0; + values[valuesById[1] = "BLOCK_ID_FLAG_ABSENT"] = 1; + values[valuesById[2] = "BLOCK_ID_FLAG_COMMIT"] = 2; + values[valuesById[3] = "BLOCK_ID_FLAG_NIL"] = 3; + return values; + })(); + + /** + * SignedMsgType enum. + * @name tendermint.types.SignedMsgType + * @enum {string} + * @property {number} SIGNED_MSG_TYPE_UNKNOWN=0 SIGNED_MSG_TYPE_UNKNOWN value + * @property {number} SIGNED_MSG_TYPE_PREVOTE=1 SIGNED_MSG_TYPE_PREVOTE value + * @property {number} SIGNED_MSG_TYPE_PRECOMMIT=2 SIGNED_MSG_TYPE_PRECOMMIT value + * @property {number} SIGNED_MSG_TYPE_PROPOSAL=32 SIGNED_MSG_TYPE_PROPOSAL value + */ + types.SignedMsgType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SIGNED_MSG_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "SIGNED_MSG_TYPE_PREVOTE"] = 1; + values[valuesById[2] = "SIGNED_MSG_TYPE_PRECOMMIT"] = 2; + values[valuesById[32] = "SIGNED_MSG_TYPE_PROPOSAL"] = 32; + return values; + })(); + + types.PartSetHeader = (function(PartSetHeader) { + + /** + * Properties of a PartSetHeader. + * @memberof tendermint.types + * @interface IPartSetHeader + * @property {number|null} [total] PartSetHeader total + * @property {Uint8Array|null} [hash] PartSetHeader hash + */ + + /** + * Constructs a new PartSetHeader. + * @memberof tendermint.types + * @classdesc Represents a PartSetHeader. + * @implements IPartSetHeader + * @constructor + * @param {tendermint.types.IPartSetHeader=} [properties] Properties to set + */ + function PartSetHeader(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartSetHeader total. + * @member {number} total + * @memberof tendermint.types.PartSetHeader + * @instance + */ + PartSetHeader.prototype.total = 0; + + /** + * PartSetHeader hash. + * @member {Uint8Array} hash + * @memberof tendermint.types.PartSetHeader + * @instance + */ + PartSetHeader.prototype.hash = $util.newBuffer([]); + + /** + * Creates a new PartSetHeader instance using the specified properties. + * @function create + * @memberof tendermint.types.PartSetHeader + * @static + * @param {tendermint.types.IPartSetHeader=} [properties] Properties to set + * @returns {tendermint.types.PartSetHeader} PartSetHeader instance + */ + PartSetHeader.create = function create(properties) { + return new PartSetHeader(properties); + }; + + /** + * Encodes the specified PartSetHeader message. Does not implicitly {@link tendermint.types.PartSetHeader.verify|verify} messages. + * @function encode + * @memberof tendermint.types.PartSetHeader + * @static + * @param {tendermint.types.IPartSetHeader} message PartSetHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartSetHeader.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.total != null && Object.hasOwnProperty.call(message, "total")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.total); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.hash); + return writer; + }; + + /** + * Encodes the specified PartSetHeader message, length delimited. Does not implicitly {@link tendermint.types.PartSetHeader.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.PartSetHeader + * @static + * @param {tendermint.types.IPartSetHeader} message PartSetHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartSetHeader.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartSetHeader message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.PartSetHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.PartSetHeader} PartSetHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartSetHeader.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.PartSetHeader(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.total = reader.uint32(); + break; + case 2: + message.hash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartSetHeader message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.PartSetHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.PartSetHeader} PartSetHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartSetHeader.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartSetHeader message. + * @function verify + * @memberof tendermint.types.PartSetHeader + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartSetHeader.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.total != null && message.hasOwnProperty("total")) + if (!$util.isInteger(message.total)) + return "total: integer expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash))) + return "hash: buffer expected"; + return null; + }; + + /** + * Creates a PartSetHeader message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.PartSetHeader + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.PartSetHeader} PartSetHeader + */ + PartSetHeader.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.PartSetHeader) + return object; + let message = new $root.tendermint.types.PartSetHeader(); + if (object.total != null) + message.total = object.total >>> 0; + if (object.hash != null) + if (typeof object.hash === "string") + $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0); + else if (object.hash.length) + message.hash = object.hash; + return message; + }; + + /** + * Creates a plain object from a PartSetHeader message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.PartSetHeader + * @static + * @param {tendermint.types.PartSetHeader} message PartSetHeader + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartSetHeader.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.total = 0; + if (options.bytes === String) + object.hash = ""; + else { + object.hash = []; + if (options.bytes !== Array) + object.hash = $util.newBuffer(object.hash); + } + } + if (message.total != null && message.hasOwnProperty("total")) + object.total = message.total; + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash; + return object; + }; + + /** + * Converts this PartSetHeader to JSON. + * @function toJSON + * @memberof tendermint.types.PartSetHeader + * @instance + * @returns {Object.} JSON object + */ + PartSetHeader.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PartSetHeader; + })(types.PartSetHeader || {}); + + types.Part = (function(Part) { + + /** + * Properties of a Part. + * @memberof tendermint.types + * @interface IPart + * @property {number|null} [index] Part index + * @property {Uint8Array|null} [bytes] Part bytes + * @property {tendermint.crypto.IProof|null} [proof] Part proof + */ + + /** + * Constructs a new Part. + * @memberof tendermint.types + * @classdesc Represents a Part. + * @implements IPart + * @constructor + * @param {tendermint.types.IPart=} [properties] Properties to set + */ + function Part(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Part index. + * @member {number} index + * @memberof tendermint.types.Part + * @instance + */ + Part.prototype.index = 0; + + /** + * Part bytes. + * @member {Uint8Array} bytes + * @memberof tendermint.types.Part + * @instance + */ + Part.prototype.bytes = $util.newBuffer([]); + + /** + * Part proof. + * @member {tendermint.crypto.IProof|null|undefined} proof + * @memberof tendermint.types.Part + * @instance + */ + Part.prototype.proof = null; + + /** + * Creates a new Part instance using the specified properties. + * @function create + * @memberof tendermint.types.Part + * @static + * @param {tendermint.types.IPart=} [properties] Properties to set + * @returns {tendermint.types.Part} Part instance + */ + Part.create = function create(properties) { + return new Part(properties); + }; + + /** + * Encodes the specified Part message. Does not implicitly {@link tendermint.types.Part.verify|verify} messages. + * @function encode + * @memberof tendermint.types.Part + * @static + * @param {tendermint.types.IPart} message Part message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Part.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.index); + if (message.bytes != null && Object.hasOwnProperty.call(message, "bytes")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.bytes); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.tendermint.crypto.Proof.encode(message.proof, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Part message, length delimited. Does not implicitly {@link tendermint.types.Part.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.Part + * @static + * @param {tendermint.types.IPart} message Part message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Part.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Part message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.Part + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.Part} Part + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Part.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Part(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.uint32(); + break; + case 2: + message.bytes = reader.bytes(); + break; + case 3: + message.proof = $root.tendermint.crypto.Proof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Part message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.Part + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.Part} Part + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Part.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Part message. + * @function verify + * @memberof tendermint.types.Part + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Part.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index)) + return "index: integer expected"; + if (message.bytes != null && message.hasOwnProperty("bytes")) + if (!(message.bytes && typeof message.bytes.length === "number" || $util.isString(message.bytes))) + return "bytes: buffer expected"; + if (message.proof != null && message.hasOwnProperty("proof")) { + let error = $root.tendermint.crypto.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + return null; + }; + + /** + * Creates a Part message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.Part + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.Part} Part + */ + Part.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.Part) + return object; + let message = new $root.tendermint.types.Part(); + if (object.index != null) + message.index = object.index >>> 0; + if (object.bytes != null) + if (typeof object.bytes === "string") + $util.base64.decode(object.bytes, message.bytes = $util.newBuffer($util.base64.length(object.bytes)), 0); + else if (object.bytes.length) + message.bytes = object.bytes; + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".tendermint.types.Part.proof: object expected"); + message.proof = $root.tendermint.crypto.Proof.fromObject(object.proof); + } + return message; + }; + + /** + * Creates a plain object from a Part message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.Part + * @static + * @param {tendermint.types.Part} message Part + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Part.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.index = 0; + if (options.bytes === String) + object.bytes = ""; + else { + object.bytes = []; + if (options.bytes !== Array) + object.bytes = $util.newBuffer(object.bytes); + } + object.proof = null; + } + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + if (message.bytes != null && message.hasOwnProperty("bytes")) + object.bytes = options.bytes === String ? $util.base64.encode(message.bytes, 0, message.bytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.bytes) : message.bytes; + if (message.proof != null && message.hasOwnProperty("proof")) + object.proof = $root.tendermint.crypto.Proof.toObject(message.proof, options); + return object; + }; + + /** + * Converts this Part to JSON. + * @function toJSON + * @memberof tendermint.types.Part + * @instance + * @returns {Object.} JSON object + */ + Part.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Part; + })(types.Part || {}); + + types.BlockID = (function(BlockID) { + + /** + * Properties of a BlockID. + * @memberof tendermint.types + * @interface IBlockID + * @property {Uint8Array|null} [hash] BlockID hash + * @property {tendermint.types.IPartSetHeader|null} [partSetHeader] BlockID partSetHeader + */ + + /** + * Constructs a new BlockID. + * @memberof tendermint.types + * @classdesc Represents a BlockID. + * @implements IBlockID + * @constructor + * @param {tendermint.types.IBlockID=} [properties] Properties to set + */ + function BlockID(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BlockID hash. + * @member {Uint8Array} hash + * @memberof tendermint.types.BlockID + * @instance + */ + BlockID.prototype.hash = $util.newBuffer([]); + + /** + * BlockID partSetHeader. + * @member {tendermint.types.IPartSetHeader|null|undefined} partSetHeader + * @memberof tendermint.types.BlockID + * @instance + */ + BlockID.prototype.partSetHeader = null; + + /** + * Creates a new BlockID instance using the specified properties. + * @function create + * @memberof tendermint.types.BlockID + * @static + * @param {tendermint.types.IBlockID=} [properties] Properties to set + * @returns {tendermint.types.BlockID} BlockID instance + */ + BlockID.create = function create(properties) { + return new BlockID(properties); + }; + + /** + * Encodes the specified BlockID message. Does not implicitly {@link tendermint.types.BlockID.verify|verify} messages. + * @function encode + * @memberof tendermint.types.BlockID + * @static + * @param {tendermint.types.IBlockID} message BlockID message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlockID.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.hash); + if (message.partSetHeader != null && Object.hasOwnProperty.call(message, "partSetHeader")) + $root.tendermint.types.PartSetHeader.encode(message.partSetHeader, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BlockID message, length delimited. Does not implicitly {@link tendermint.types.BlockID.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.BlockID + * @static + * @param {tendermint.types.IBlockID} message BlockID message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlockID.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BlockID message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.BlockID + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.BlockID} BlockID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlockID.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.BlockID(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.bytes(); + break; + case 2: + message.partSetHeader = $root.tendermint.types.PartSetHeader.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BlockID message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.BlockID + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.BlockID} BlockID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlockID.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BlockID message. + * @function verify + * @memberof tendermint.types.BlockID + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BlockID.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash))) + return "hash: buffer expected"; + if (message.partSetHeader != null && message.hasOwnProperty("partSetHeader")) { + let error = $root.tendermint.types.PartSetHeader.verify(message.partSetHeader); + if (error) + return "partSetHeader." + error; + } + return null; + }; + + /** + * Creates a BlockID message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.BlockID + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.BlockID} BlockID + */ + BlockID.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.BlockID) + return object; + let message = new $root.tendermint.types.BlockID(); + if (object.hash != null) + if (typeof object.hash === "string") + $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0); + else if (object.hash.length) + message.hash = object.hash; + if (object.partSetHeader != null) { + if (typeof object.partSetHeader !== "object") + throw TypeError(".tendermint.types.BlockID.partSetHeader: object expected"); + message.partSetHeader = $root.tendermint.types.PartSetHeader.fromObject(object.partSetHeader); + } + return message; + }; + + /** + * Creates a plain object from a BlockID message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.BlockID + * @static + * @param {tendermint.types.BlockID} message BlockID + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BlockID.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if (options.bytes === String) + object.hash = ""; + else { + object.hash = []; + if (options.bytes !== Array) + object.hash = $util.newBuffer(object.hash); + } + object.partSetHeader = null; + } + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash; + if (message.partSetHeader != null && message.hasOwnProperty("partSetHeader")) + object.partSetHeader = $root.tendermint.types.PartSetHeader.toObject(message.partSetHeader, options); + return object; + }; + + /** + * Converts this BlockID to JSON. + * @function toJSON + * @memberof tendermint.types.BlockID + * @instance + * @returns {Object.} JSON object + */ + BlockID.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BlockID; + })(types.BlockID || {}); + + types.Header = (function(Header) { + + /** + * Properties of a Header. + * @memberof tendermint.types + * @interface IHeader + * @property {tendermint.version.IConsensus|null} [version] Header version + * @property {string|null} [chainId] Header chainId + * @property {number|Long|null} [height] Header height + * @property {google.protobuf.ITimestamp|null} [time] Header time + * @property {tendermint.types.IBlockID|null} [lastBlockId] Header lastBlockId + * @property {Uint8Array|null} [lastCommitHash] Header lastCommitHash + * @property {Uint8Array|null} [dataHash] Header dataHash + * @property {Uint8Array|null} [validatorsHash] Header validatorsHash + * @property {Uint8Array|null} [nextValidatorsHash] Header nextValidatorsHash + * @property {Uint8Array|null} [consensusHash] Header consensusHash + * @property {Uint8Array|null} [appHash] Header appHash + * @property {Uint8Array|null} [lastResultsHash] Header lastResultsHash + * @property {Uint8Array|null} [evidenceHash] Header evidenceHash + * @property {Uint8Array|null} [proposerAddress] Header proposerAddress + */ + + /** + * Constructs a new Header. + * @memberof tendermint.types + * @classdesc Represents a Header. + * @implements IHeader + * @constructor + * @param {tendermint.types.IHeader=} [properties] Properties to set + */ + function Header(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Header version. + * @member {tendermint.version.IConsensus|null|undefined} version + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.version = null; + + /** + * Header chainId. + * @member {string} chainId + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.chainId = ""; + + /** + * Header height. + * @member {number|Long} height + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Header time. + * @member {google.protobuf.ITimestamp|null|undefined} time + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.time = null; + + /** + * Header lastBlockId. + * @member {tendermint.types.IBlockID|null|undefined} lastBlockId + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.lastBlockId = null; + + /** + * Header lastCommitHash. + * @member {Uint8Array} lastCommitHash + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.lastCommitHash = $util.newBuffer([]); + + /** + * Header dataHash. + * @member {Uint8Array} dataHash + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.dataHash = $util.newBuffer([]); + + /** + * Header validatorsHash. + * @member {Uint8Array} validatorsHash + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.validatorsHash = $util.newBuffer([]); + + /** + * Header nextValidatorsHash. + * @member {Uint8Array} nextValidatorsHash + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.nextValidatorsHash = $util.newBuffer([]); + + /** + * Header consensusHash. + * @member {Uint8Array} consensusHash + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.consensusHash = $util.newBuffer([]); + + /** + * Header appHash. + * @member {Uint8Array} appHash + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.appHash = $util.newBuffer([]); + + /** + * Header lastResultsHash. + * @member {Uint8Array} lastResultsHash + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.lastResultsHash = $util.newBuffer([]); + + /** + * Header evidenceHash. + * @member {Uint8Array} evidenceHash + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.evidenceHash = $util.newBuffer([]); + + /** + * Header proposerAddress. + * @member {Uint8Array} proposerAddress + * @memberof tendermint.types.Header + * @instance + */ + Header.prototype.proposerAddress = $util.newBuffer([]); + + /** + * Creates a new Header instance using the specified properties. + * @function create + * @memberof tendermint.types.Header + * @static + * @param {tendermint.types.IHeader=} [properties] Properties to set + * @returns {tendermint.types.Header} Header instance + */ + Header.create = function create(properties) { + return new Header(properties); + }; + + /** + * Encodes the specified Header message. Does not implicitly {@link tendermint.types.Header.verify|verify} messages. + * @function encode + * @memberof tendermint.types.Header + * @static + * @param {tendermint.types.IHeader} message Header message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Header.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + $root.tendermint.version.Consensus.encode(message.version, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.chainId != null && Object.hasOwnProperty.call(message, "chainId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.chainId); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.height); + if (message.time != null && Object.hasOwnProperty.call(message, "time")) + $root.google.protobuf.Timestamp.encode(message.time, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.lastBlockId != null && Object.hasOwnProperty.call(message, "lastBlockId")) + $root.tendermint.types.BlockID.encode(message.lastBlockId, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.lastCommitHash != null && Object.hasOwnProperty.call(message, "lastCommitHash")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.lastCommitHash); + if (message.dataHash != null && Object.hasOwnProperty.call(message, "dataHash")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.dataHash); + if (message.validatorsHash != null && Object.hasOwnProperty.call(message, "validatorsHash")) + writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.validatorsHash); + if (message.nextValidatorsHash != null && Object.hasOwnProperty.call(message, "nextValidatorsHash")) + writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.nextValidatorsHash); + if (message.consensusHash != null && Object.hasOwnProperty.call(message, "consensusHash")) + writer.uint32(/* id 10, wireType 2 =*/82).bytes(message.consensusHash); + if (message.appHash != null && Object.hasOwnProperty.call(message, "appHash")) + writer.uint32(/* id 11, wireType 2 =*/90).bytes(message.appHash); + if (message.lastResultsHash != null && Object.hasOwnProperty.call(message, "lastResultsHash")) + writer.uint32(/* id 12, wireType 2 =*/98).bytes(message.lastResultsHash); + if (message.evidenceHash != null && Object.hasOwnProperty.call(message, "evidenceHash")) + writer.uint32(/* id 13, wireType 2 =*/106).bytes(message.evidenceHash); + if (message.proposerAddress != null && Object.hasOwnProperty.call(message, "proposerAddress")) + writer.uint32(/* id 14, wireType 2 =*/114).bytes(message.proposerAddress); + return writer; + }; + + /** + * Encodes the specified Header message, length delimited. Does not implicitly {@link tendermint.types.Header.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.Header + * @static + * @param {tendermint.types.IHeader} message Header message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Header.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Header message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.Header + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.Header} Header + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Header.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Header(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = $root.tendermint.version.Consensus.decode(reader, reader.uint32()); + break; + case 2: + message.chainId = reader.string(); + break; + case 3: + message.height = reader.int64(); + break; + case 4: + message.time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.lastBlockId = $root.tendermint.types.BlockID.decode(reader, reader.uint32()); + break; + case 6: + message.lastCommitHash = reader.bytes(); + break; + case 7: + message.dataHash = reader.bytes(); + break; + case 8: + message.validatorsHash = reader.bytes(); + break; + case 9: + message.nextValidatorsHash = reader.bytes(); + break; + case 10: + message.consensusHash = reader.bytes(); + break; + case 11: + message.appHash = reader.bytes(); + break; + case 12: + message.lastResultsHash = reader.bytes(); + break; + case 13: + message.evidenceHash = reader.bytes(); + break; + case 14: + message.proposerAddress = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Header message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.Header + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.Header} Header + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Header.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Header message. + * @function verify + * @memberof tendermint.types.Header + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Header.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) { + let error = $root.tendermint.version.Consensus.verify(message.version); + if (error) + return "version." + error; + } + if (message.chainId != null && message.hasOwnProperty("chainId")) + if (!$util.isString(message.chainId)) + return "chainId: string expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.time != null && message.hasOwnProperty("time")) { + let error = $root.google.protobuf.Timestamp.verify(message.time); + if (error) + return "time." + error; + } + if (message.lastBlockId != null && message.hasOwnProperty("lastBlockId")) { + let error = $root.tendermint.types.BlockID.verify(message.lastBlockId); + if (error) + return "lastBlockId." + error; + } + if (message.lastCommitHash != null && message.hasOwnProperty("lastCommitHash")) + if (!(message.lastCommitHash && typeof message.lastCommitHash.length === "number" || $util.isString(message.lastCommitHash))) + return "lastCommitHash: buffer expected"; + if (message.dataHash != null && message.hasOwnProperty("dataHash")) + if (!(message.dataHash && typeof message.dataHash.length === "number" || $util.isString(message.dataHash))) + return "dataHash: buffer expected"; + if (message.validatorsHash != null && message.hasOwnProperty("validatorsHash")) + if (!(message.validatorsHash && typeof message.validatorsHash.length === "number" || $util.isString(message.validatorsHash))) + return "validatorsHash: buffer expected"; + if (message.nextValidatorsHash != null && message.hasOwnProperty("nextValidatorsHash")) + if (!(message.nextValidatorsHash && typeof message.nextValidatorsHash.length === "number" || $util.isString(message.nextValidatorsHash))) + return "nextValidatorsHash: buffer expected"; + if (message.consensusHash != null && message.hasOwnProperty("consensusHash")) + if (!(message.consensusHash && typeof message.consensusHash.length === "number" || $util.isString(message.consensusHash))) + return "consensusHash: buffer expected"; + if (message.appHash != null && message.hasOwnProperty("appHash")) + if (!(message.appHash && typeof message.appHash.length === "number" || $util.isString(message.appHash))) + return "appHash: buffer expected"; + if (message.lastResultsHash != null && message.hasOwnProperty("lastResultsHash")) + if (!(message.lastResultsHash && typeof message.lastResultsHash.length === "number" || $util.isString(message.lastResultsHash))) + return "lastResultsHash: buffer expected"; + if (message.evidenceHash != null && message.hasOwnProperty("evidenceHash")) + if (!(message.evidenceHash && typeof message.evidenceHash.length === "number" || $util.isString(message.evidenceHash))) + return "evidenceHash: buffer expected"; + if (message.proposerAddress != null && message.hasOwnProperty("proposerAddress")) + if (!(message.proposerAddress && typeof message.proposerAddress.length === "number" || $util.isString(message.proposerAddress))) + return "proposerAddress: buffer expected"; + return null; + }; + + /** + * Creates a Header message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.Header + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.Header} Header + */ + Header.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.Header) + return object; + let message = new $root.tendermint.types.Header(); + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".tendermint.types.Header.version: object expected"); + message.version = $root.tendermint.version.Consensus.fromObject(object.version); + } + if (object.chainId != null) + message.chainId = String(object.chainId); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + if (object.time != null) { + if (typeof object.time !== "object") + throw TypeError(".tendermint.types.Header.time: object expected"); + message.time = $root.google.protobuf.Timestamp.fromObject(object.time); + } + if (object.lastBlockId != null) { + if (typeof object.lastBlockId !== "object") + throw TypeError(".tendermint.types.Header.lastBlockId: object expected"); + message.lastBlockId = $root.tendermint.types.BlockID.fromObject(object.lastBlockId); + } + if (object.lastCommitHash != null) + if (typeof object.lastCommitHash === "string") + $util.base64.decode(object.lastCommitHash, message.lastCommitHash = $util.newBuffer($util.base64.length(object.lastCommitHash)), 0); + else if (object.lastCommitHash.length) + message.lastCommitHash = object.lastCommitHash; + if (object.dataHash != null) + if (typeof object.dataHash === "string") + $util.base64.decode(object.dataHash, message.dataHash = $util.newBuffer($util.base64.length(object.dataHash)), 0); + else if (object.dataHash.length) + message.dataHash = object.dataHash; + if (object.validatorsHash != null) + if (typeof object.validatorsHash === "string") + $util.base64.decode(object.validatorsHash, message.validatorsHash = $util.newBuffer($util.base64.length(object.validatorsHash)), 0); + else if (object.validatorsHash.length) + message.validatorsHash = object.validatorsHash; + if (object.nextValidatorsHash != null) + if (typeof object.nextValidatorsHash === "string") + $util.base64.decode(object.nextValidatorsHash, message.nextValidatorsHash = $util.newBuffer($util.base64.length(object.nextValidatorsHash)), 0); + else if (object.nextValidatorsHash.length) + message.nextValidatorsHash = object.nextValidatorsHash; + if (object.consensusHash != null) + if (typeof object.consensusHash === "string") + $util.base64.decode(object.consensusHash, message.consensusHash = $util.newBuffer($util.base64.length(object.consensusHash)), 0); + else if (object.consensusHash.length) + message.consensusHash = object.consensusHash; + if (object.appHash != null) + if (typeof object.appHash === "string") + $util.base64.decode(object.appHash, message.appHash = $util.newBuffer($util.base64.length(object.appHash)), 0); + else if (object.appHash.length) + message.appHash = object.appHash; + if (object.lastResultsHash != null) + if (typeof object.lastResultsHash === "string") + $util.base64.decode(object.lastResultsHash, message.lastResultsHash = $util.newBuffer($util.base64.length(object.lastResultsHash)), 0); + else if (object.lastResultsHash.length) + message.lastResultsHash = object.lastResultsHash; + if (object.evidenceHash != null) + if (typeof object.evidenceHash === "string") + $util.base64.decode(object.evidenceHash, message.evidenceHash = $util.newBuffer($util.base64.length(object.evidenceHash)), 0); + else if (object.evidenceHash.length) + message.evidenceHash = object.evidenceHash; + if (object.proposerAddress != null) + if (typeof object.proposerAddress === "string") + $util.base64.decode(object.proposerAddress, message.proposerAddress = $util.newBuffer($util.base64.length(object.proposerAddress)), 0); + else if (object.proposerAddress.length) + message.proposerAddress = object.proposerAddress; + return message; + }; + + /** + * Creates a plain object from a Header message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.Header + * @static + * @param {tendermint.types.Header} message Header + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Header.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.version = null; + object.chainId = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.time = null; + object.lastBlockId = null; + if (options.bytes === String) + object.lastCommitHash = ""; + else { + object.lastCommitHash = []; + if (options.bytes !== Array) + object.lastCommitHash = $util.newBuffer(object.lastCommitHash); + } + if (options.bytes === String) + object.dataHash = ""; + else { + object.dataHash = []; + if (options.bytes !== Array) + object.dataHash = $util.newBuffer(object.dataHash); + } + if (options.bytes === String) + object.validatorsHash = ""; + else { + object.validatorsHash = []; + if (options.bytes !== Array) + object.validatorsHash = $util.newBuffer(object.validatorsHash); + } + if (options.bytes === String) + object.nextValidatorsHash = ""; + else { + object.nextValidatorsHash = []; + if (options.bytes !== Array) + object.nextValidatorsHash = $util.newBuffer(object.nextValidatorsHash); + } + if (options.bytes === String) + object.consensusHash = ""; + else { + object.consensusHash = []; + if (options.bytes !== Array) + object.consensusHash = $util.newBuffer(object.consensusHash); + } + if (options.bytes === String) + object.appHash = ""; + else { + object.appHash = []; + if (options.bytes !== Array) + object.appHash = $util.newBuffer(object.appHash); + } + if (options.bytes === String) + object.lastResultsHash = ""; + else { + object.lastResultsHash = []; + if (options.bytes !== Array) + object.lastResultsHash = $util.newBuffer(object.lastResultsHash); + } + if (options.bytes === String) + object.evidenceHash = ""; + else { + object.evidenceHash = []; + if (options.bytes !== Array) + object.evidenceHash = $util.newBuffer(object.evidenceHash); + } + if (options.bytes === String) + object.proposerAddress = ""; + else { + object.proposerAddress = []; + if (options.bytes !== Array) + object.proposerAddress = $util.newBuffer(object.proposerAddress); + } + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = $root.tendermint.version.Consensus.toObject(message.version, options); + if (message.chainId != null && message.hasOwnProperty("chainId")) + object.chainId = message.chainId; + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + if (message.time != null && message.hasOwnProperty("time")) + object.time = $root.google.protobuf.Timestamp.toObject(message.time, options); + if (message.lastBlockId != null && message.hasOwnProperty("lastBlockId")) + object.lastBlockId = $root.tendermint.types.BlockID.toObject(message.lastBlockId, options); + if (message.lastCommitHash != null && message.hasOwnProperty("lastCommitHash")) + object.lastCommitHash = options.bytes === String ? $util.base64.encode(message.lastCommitHash, 0, message.lastCommitHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.lastCommitHash) : message.lastCommitHash; + if (message.dataHash != null && message.hasOwnProperty("dataHash")) + object.dataHash = options.bytes === String ? $util.base64.encode(message.dataHash, 0, message.dataHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.dataHash) : message.dataHash; + if (message.validatorsHash != null && message.hasOwnProperty("validatorsHash")) + object.validatorsHash = options.bytes === String ? $util.base64.encode(message.validatorsHash, 0, message.validatorsHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.validatorsHash) : message.validatorsHash; + if (message.nextValidatorsHash != null && message.hasOwnProperty("nextValidatorsHash")) + object.nextValidatorsHash = options.bytes === String ? $util.base64.encode(message.nextValidatorsHash, 0, message.nextValidatorsHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.nextValidatorsHash) : message.nextValidatorsHash; + if (message.consensusHash != null && message.hasOwnProperty("consensusHash")) + object.consensusHash = options.bytes === String ? $util.base64.encode(message.consensusHash, 0, message.consensusHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.consensusHash) : message.consensusHash; + if (message.appHash != null && message.hasOwnProperty("appHash")) + object.appHash = options.bytes === String ? $util.base64.encode(message.appHash, 0, message.appHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.appHash) : message.appHash; + if (message.lastResultsHash != null && message.hasOwnProperty("lastResultsHash")) + object.lastResultsHash = options.bytes === String ? $util.base64.encode(message.lastResultsHash, 0, message.lastResultsHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.lastResultsHash) : message.lastResultsHash; + if (message.evidenceHash != null && message.hasOwnProperty("evidenceHash")) + object.evidenceHash = options.bytes === String ? $util.base64.encode(message.evidenceHash, 0, message.evidenceHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.evidenceHash) : message.evidenceHash; + if (message.proposerAddress != null && message.hasOwnProperty("proposerAddress")) + object.proposerAddress = options.bytes === String ? $util.base64.encode(message.proposerAddress, 0, message.proposerAddress.length) : options.bytes === Array ? Array.prototype.slice.call(message.proposerAddress) : message.proposerAddress; + return object; + }; + + /** + * Converts this Header to JSON. + * @function toJSON + * @memberof tendermint.types.Header + * @instance + * @returns {Object.} JSON object + */ + Header.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Header; + })(types.Header || {}); + + types.Data = (function(Data) { + + /** + * Properties of a Data. + * @memberof tendermint.types + * @interface IData + * @property {Array.|null} [txs] Data txs + */ + + /** + * Constructs a new Data. + * @memberof tendermint.types + * @classdesc Represents a Data. + * @implements IData + * @constructor + * @param {tendermint.types.IData=} [properties] Properties to set + */ + function Data(properties) { + this.txs = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Data txs. + * @member {Array.} txs + * @memberof tendermint.types.Data + * @instance + */ + Data.prototype.txs = $util.emptyArray; + + /** + * Creates a new Data instance using the specified properties. + * @function create + * @memberof tendermint.types.Data + * @static + * @param {tendermint.types.IData=} [properties] Properties to set + * @returns {tendermint.types.Data} Data instance + */ + Data.create = function create(properties) { + return new Data(properties); + }; + + /** + * Encodes the specified Data message. Does not implicitly {@link tendermint.types.Data.verify|verify} messages. + * @function encode + * @memberof tendermint.types.Data + * @static + * @param {tendermint.types.IData} message Data message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Data.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.txs != null && message.txs.length) + for (let i = 0; i < message.txs.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.txs[i]); + return writer; + }; + + /** + * Encodes the specified Data message, length delimited. Does not implicitly {@link tendermint.types.Data.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.Data + * @static + * @param {tendermint.types.IData} message Data message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Data.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Data message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.Data + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.Data} Data + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Data.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Data(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.txs && message.txs.length)) + message.txs = []; + message.txs.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Data message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.Data + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.Data} Data + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Data.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Data message. + * @function verify + * @memberof tendermint.types.Data + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Data.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.txs != null && message.hasOwnProperty("txs")) { + if (!Array.isArray(message.txs)) + return "txs: array expected"; + for (let i = 0; i < message.txs.length; ++i) + if (!(message.txs[i] && typeof message.txs[i].length === "number" || $util.isString(message.txs[i]))) + return "txs: buffer[] expected"; + } + return null; + }; + + /** + * Creates a Data message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.Data + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.Data} Data + */ + Data.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.Data) + return object; + let message = new $root.tendermint.types.Data(); + if (object.txs) { + if (!Array.isArray(object.txs)) + throw TypeError(".tendermint.types.Data.txs: array expected"); + message.txs = []; + for (let i = 0; i < object.txs.length; ++i) + if (typeof object.txs[i] === "string") + $util.base64.decode(object.txs[i], message.txs[i] = $util.newBuffer($util.base64.length(object.txs[i])), 0); + else if (object.txs[i].length) + message.txs[i] = object.txs[i]; + } + return message; + }; + + /** + * Creates a plain object from a Data message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.Data + * @static + * @param {tendermint.types.Data} message Data + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Data.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.txs = []; + if (message.txs && message.txs.length) { + object.txs = []; + for (let j = 0; j < message.txs.length; ++j) + object.txs[j] = options.bytes === String ? $util.base64.encode(message.txs[j], 0, message.txs[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.txs[j]) : message.txs[j]; + } + return object; + }; + + /** + * Converts this Data to JSON. + * @function toJSON + * @memberof tendermint.types.Data + * @instance + * @returns {Object.} JSON object + */ + Data.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Data; + })(types.Data || {}); + + types.Vote = (function(Vote) { + + /** + * Properties of a Vote. + * @memberof tendermint.types + * @interface IVote + * @property {tendermint.types.SignedMsgType|null} [type] Vote type + * @property {number|Long|null} [height] Vote height + * @property {number|null} [round] Vote round + * @property {tendermint.types.IBlockID|null} [blockId] Vote blockId + * @property {google.protobuf.ITimestamp|null} [timestamp] Vote timestamp + * @property {Uint8Array|null} [validatorAddress] Vote validatorAddress + * @property {number|null} [validatorIndex] Vote validatorIndex + * @property {Uint8Array|null} [signature] Vote signature + */ + + /** + * Constructs a new Vote. + * @memberof tendermint.types + * @classdesc Represents a Vote. + * @implements IVote + * @constructor + * @param {tendermint.types.IVote=} [properties] Properties to set + */ + function Vote(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Vote type. + * @member {tendermint.types.SignedMsgType} type + * @memberof tendermint.types.Vote + * @instance + */ + Vote.prototype.type = 0; + + /** + * Vote height. + * @member {number|Long} height + * @memberof tendermint.types.Vote + * @instance + */ + Vote.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Vote round. + * @member {number} round + * @memberof tendermint.types.Vote + * @instance + */ + Vote.prototype.round = 0; + + /** + * Vote blockId. + * @member {tendermint.types.IBlockID|null|undefined} blockId + * @memberof tendermint.types.Vote + * @instance + */ + Vote.prototype.blockId = null; + + /** + * Vote timestamp. + * @member {google.protobuf.ITimestamp|null|undefined} timestamp + * @memberof tendermint.types.Vote + * @instance + */ + Vote.prototype.timestamp = null; + + /** + * Vote validatorAddress. + * @member {Uint8Array} validatorAddress + * @memberof tendermint.types.Vote + * @instance + */ + Vote.prototype.validatorAddress = $util.newBuffer([]); + + /** + * Vote validatorIndex. + * @member {number} validatorIndex + * @memberof tendermint.types.Vote + * @instance + */ + Vote.prototype.validatorIndex = 0; + + /** + * Vote signature. + * @member {Uint8Array} signature + * @memberof tendermint.types.Vote + * @instance + */ + Vote.prototype.signature = $util.newBuffer([]); + + /** + * Creates a new Vote instance using the specified properties. + * @function create + * @memberof tendermint.types.Vote + * @static + * @param {tendermint.types.IVote=} [properties] Properties to set + * @returns {tendermint.types.Vote} Vote instance + */ + Vote.create = function create(properties) { + return new Vote(properties); + }; + + /** + * Encodes the specified Vote message. Does not implicitly {@link tendermint.types.Vote.verify|verify} messages. + * @function encode + * @memberof tendermint.types.Vote + * @static + * @param {tendermint.types.IVote} message Vote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vote.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.height); + if (message.round != null && Object.hasOwnProperty.call(message, "round")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.round); + if (message.blockId != null && Object.hasOwnProperty.call(message, "blockId")) + $root.tendermint.types.BlockID.encode(message.blockId, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.validatorAddress); + if (message.validatorIndex != null && Object.hasOwnProperty.call(message, "validatorIndex")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.validatorIndex); + if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) + writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.signature); + return writer; + }; + + /** + * Encodes the specified Vote message, length delimited. Does not implicitly {@link tendermint.types.Vote.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.Vote + * @static + * @param {tendermint.types.IVote} message Vote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vote.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Vote message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.Vote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.Vote} Vote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vote.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Vote(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32(); + break; + case 2: + message.height = reader.int64(); + break; + case 3: + message.round = reader.int32(); + break; + case 4: + message.blockId = $root.tendermint.types.BlockID.decode(reader, reader.uint32()); + break; + case 5: + message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.validatorAddress = reader.bytes(); + break; + case 7: + message.validatorIndex = reader.int32(); + break; + case 8: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Vote message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.Vote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.Vote} Vote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vote.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Vote message. + * @function verify + * @memberof tendermint.types.Vote + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Vote.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 32: + break; + } + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.round != null && message.hasOwnProperty("round")) + if (!$util.isInteger(message.round)) + return "round: integer expected"; + if (message.blockId != null && message.hasOwnProperty("blockId")) { + let error = $root.tendermint.types.BlockID.verify(message.blockId); + if (error) + return "blockId." + error; + } + if (message.timestamp != null && message.hasOwnProperty("timestamp")) { + let error = $root.google.protobuf.Timestamp.verify(message.timestamp); + if (error) + return "timestamp." + error; + } + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!(message.validatorAddress && typeof message.validatorAddress.length === "number" || $util.isString(message.validatorAddress))) + return "validatorAddress: buffer expected"; + if (message.validatorIndex != null && message.hasOwnProperty("validatorIndex")) + if (!$util.isInteger(message.validatorIndex)) + return "validatorIndex: integer expected"; + if (message.signature != null && message.hasOwnProperty("signature")) + if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) + return "signature: buffer expected"; + return null; + }; + + /** + * Creates a Vote message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.Vote + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.Vote} Vote + */ + Vote.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.Vote) + return object; + let message = new $root.tendermint.types.Vote(); + switch (object.type) { + case "SIGNED_MSG_TYPE_UNKNOWN": + case 0: + message.type = 0; + break; + case "SIGNED_MSG_TYPE_PREVOTE": + case 1: + message.type = 1; + break; + case "SIGNED_MSG_TYPE_PRECOMMIT": + case 2: + message.type = 2; + break; + case "SIGNED_MSG_TYPE_PROPOSAL": + case 32: + message.type = 32; + break; + } + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + if (object.round != null) + message.round = object.round | 0; + if (object.blockId != null) { + if (typeof object.blockId !== "object") + throw TypeError(".tendermint.types.Vote.blockId: object expected"); + message.blockId = $root.tendermint.types.BlockID.fromObject(object.blockId); + } + if (object.timestamp != null) { + if (typeof object.timestamp !== "object") + throw TypeError(".tendermint.types.Vote.timestamp: object expected"); + message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); + } + if (object.validatorAddress != null) + if (typeof object.validatorAddress === "string") + $util.base64.decode(object.validatorAddress, message.validatorAddress = $util.newBuffer($util.base64.length(object.validatorAddress)), 0); + else if (object.validatorAddress.length) + message.validatorAddress = object.validatorAddress; + if (object.validatorIndex != null) + message.validatorIndex = object.validatorIndex | 0; + if (object.signature != null) + if (typeof object.signature === "string") + $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); + else if (object.signature.length) + message.signature = object.signature; + return message; + }; + + /** + * Creates a plain object from a Vote message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.Vote + * @static + * @param {tendermint.types.Vote} message Vote + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Vote.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.type = options.enums === String ? "SIGNED_MSG_TYPE_UNKNOWN" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.round = 0; + object.blockId = null; + object.timestamp = null; + if (options.bytes === String) + object.validatorAddress = ""; + else { + object.validatorAddress = []; + if (options.bytes !== Array) + object.validatorAddress = $util.newBuffer(object.validatorAddress); + } + object.validatorIndex = 0; + if (options.bytes === String) + object.signature = ""; + else { + object.signature = []; + if (options.bytes !== Array) + object.signature = $util.newBuffer(object.signature); + } + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.tendermint.types.SignedMsgType[message.type] : message.type; + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + if (message.round != null && message.hasOwnProperty("round")) + object.round = message.round; + if (message.blockId != null && message.hasOwnProperty("blockId")) + object.blockId = $root.tendermint.types.BlockID.toObject(message.blockId, options); + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = options.bytes === String ? $util.base64.encode(message.validatorAddress, 0, message.validatorAddress.length) : options.bytes === Array ? Array.prototype.slice.call(message.validatorAddress) : message.validatorAddress; + if (message.validatorIndex != null && message.hasOwnProperty("validatorIndex")) + object.validatorIndex = message.validatorIndex; + if (message.signature != null && message.hasOwnProperty("signature")) + object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; + return object; + }; + + /** + * Converts this Vote to JSON. + * @function toJSON + * @memberof tendermint.types.Vote + * @instance + * @returns {Object.} JSON object + */ + Vote.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Vote; + })(types.Vote || {}); + + types.Commit = (function(Commit) { + + /** + * Properties of a Commit. + * @memberof tendermint.types + * @interface ICommit + * @property {number|Long|null} [height] Commit height + * @property {number|null} [round] Commit round + * @property {tendermint.types.IBlockID|null} [blockId] Commit blockId + * @property {Array.|null} [signatures] Commit signatures + */ + + /** + * Constructs a new Commit. + * @memberof tendermint.types + * @classdesc Represents a Commit. + * @implements ICommit + * @constructor + * @param {tendermint.types.ICommit=} [properties] Properties to set + */ + function Commit(properties) { + this.signatures = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Commit height. + * @member {number|Long} height + * @memberof tendermint.types.Commit + * @instance + */ + Commit.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Commit round. + * @member {number} round + * @memberof tendermint.types.Commit + * @instance + */ + Commit.prototype.round = 0; + + /** + * Commit blockId. + * @member {tendermint.types.IBlockID|null|undefined} blockId + * @memberof tendermint.types.Commit + * @instance + */ + Commit.prototype.blockId = null; + + /** + * Commit signatures. + * @member {Array.} signatures + * @memberof tendermint.types.Commit + * @instance + */ + Commit.prototype.signatures = $util.emptyArray; + + /** + * Creates a new Commit instance using the specified properties. + * @function create + * @memberof tendermint.types.Commit + * @static + * @param {tendermint.types.ICommit=} [properties] Properties to set + * @returns {tendermint.types.Commit} Commit instance + */ + Commit.create = function create(properties) { + return new Commit(properties); + }; + + /** + * Encodes the specified Commit message. Does not implicitly {@link tendermint.types.Commit.verify|verify} messages. + * @function encode + * @memberof tendermint.types.Commit + * @static + * @param {tendermint.types.ICommit} message Commit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Commit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.height); + if (message.round != null && Object.hasOwnProperty.call(message, "round")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.round); + if (message.blockId != null && Object.hasOwnProperty.call(message, "blockId")) + $root.tendermint.types.BlockID.encode(message.blockId, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.signatures != null && message.signatures.length) + for (let i = 0; i < message.signatures.length; ++i) + $root.tendermint.types.CommitSig.encode(message.signatures[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Commit message, length delimited. Does not implicitly {@link tendermint.types.Commit.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.Commit + * @static + * @param {tendermint.types.ICommit} message Commit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Commit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Commit message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.Commit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.Commit} Commit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Commit.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Commit(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + case 2: + message.round = reader.int32(); + break; + case 3: + message.blockId = $root.tendermint.types.BlockID.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.signatures && message.signatures.length)) + message.signatures = []; + message.signatures.push($root.tendermint.types.CommitSig.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Commit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.Commit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.Commit} Commit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Commit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Commit message. + * @function verify + * @memberof tendermint.types.Commit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Commit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.round != null && message.hasOwnProperty("round")) + if (!$util.isInteger(message.round)) + return "round: integer expected"; + if (message.blockId != null && message.hasOwnProperty("blockId")) { + let error = $root.tendermint.types.BlockID.verify(message.blockId); + if (error) + return "blockId." + error; + } + if (message.signatures != null && message.hasOwnProperty("signatures")) { + if (!Array.isArray(message.signatures)) + return "signatures: array expected"; + for (let i = 0; i < message.signatures.length; ++i) { + let error = $root.tendermint.types.CommitSig.verify(message.signatures[i]); + if (error) + return "signatures." + error; + } + } + return null; + }; + + /** + * Creates a Commit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.Commit + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.Commit} Commit + */ + Commit.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.Commit) + return object; + let message = new $root.tendermint.types.Commit(); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + if (object.round != null) + message.round = object.round | 0; + if (object.blockId != null) { + if (typeof object.blockId !== "object") + throw TypeError(".tendermint.types.Commit.blockId: object expected"); + message.blockId = $root.tendermint.types.BlockID.fromObject(object.blockId); + } + if (object.signatures) { + if (!Array.isArray(object.signatures)) + throw TypeError(".tendermint.types.Commit.signatures: array expected"); + message.signatures = []; + for (let i = 0; i < object.signatures.length; ++i) { + if (typeof object.signatures[i] !== "object") + throw TypeError(".tendermint.types.Commit.signatures: object expected"); + message.signatures[i] = $root.tendermint.types.CommitSig.fromObject(object.signatures[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Commit message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.Commit + * @static + * @param {tendermint.types.Commit} message Commit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Commit.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.signatures = []; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.round = 0; + object.blockId = null; + } + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + if (message.round != null && message.hasOwnProperty("round")) + object.round = message.round; + if (message.blockId != null && message.hasOwnProperty("blockId")) + object.blockId = $root.tendermint.types.BlockID.toObject(message.blockId, options); + if (message.signatures && message.signatures.length) { + object.signatures = []; + for (let j = 0; j < message.signatures.length; ++j) + object.signatures[j] = $root.tendermint.types.CommitSig.toObject(message.signatures[j], options); + } + return object; + }; + + /** + * Converts this Commit to JSON. + * @function toJSON + * @memberof tendermint.types.Commit + * @instance + * @returns {Object.} JSON object + */ + Commit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Commit; + })(types.Commit || {}); + + types.CommitSig = (function(CommitSig) { + + /** + * Properties of a CommitSig. + * @memberof tendermint.types + * @interface ICommitSig + * @property {tendermint.types.BlockIDFlag|null} [blockIdFlag] CommitSig blockIdFlag + * @property {Uint8Array|null} [validatorAddress] CommitSig validatorAddress + * @property {google.protobuf.ITimestamp|null} [timestamp] CommitSig timestamp + * @property {Uint8Array|null} [signature] CommitSig signature + */ + + /** + * Constructs a new CommitSig. + * @memberof tendermint.types + * @classdesc Represents a CommitSig. + * @implements ICommitSig + * @constructor + * @param {tendermint.types.ICommitSig=} [properties] Properties to set + */ + function CommitSig(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommitSig blockIdFlag. + * @member {tendermint.types.BlockIDFlag} blockIdFlag + * @memberof tendermint.types.CommitSig + * @instance + */ + CommitSig.prototype.blockIdFlag = 0; + + /** + * CommitSig validatorAddress. + * @member {Uint8Array} validatorAddress + * @memberof tendermint.types.CommitSig + * @instance + */ + CommitSig.prototype.validatorAddress = $util.newBuffer([]); + + /** + * CommitSig timestamp. + * @member {google.protobuf.ITimestamp|null|undefined} timestamp + * @memberof tendermint.types.CommitSig + * @instance + */ + CommitSig.prototype.timestamp = null; + + /** + * CommitSig signature. + * @member {Uint8Array} signature + * @memberof tendermint.types.CommitSig + * @instance + */ + CommitSig.prototype.signature = $util.newBuffer([]); + + /** + * Creates a new CommitSig instance using the specified properties. + * @function create + * @memberof tendermint.types.CommitSig + * @static + * @param {tendermint.types.ICommitSig=} [properties] Properties to set + * @returns {tendermint.types.CommitSig} CommitSig instance + */ + CommitSig.create = function create(properties) { + return new CommitSig(properties); + }; + + /** + * Encodes the specified CommitSig message. Does not implicitly {@link tendermint.types.CommitSig.verify|verify} messages. + * @function encode + * @memberof tendermint.types.CommitSig + * @static + * @param {tendermint.types.ICommitSig} message CommitSig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitSig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.blockIdFlag != null && Object.hasOwnProperty.call(message, "blockIdFlag")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.blockIdFlag); + if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.validatorAddress); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.signature); + return writer; + }; + + /** + * Encodes the specified CommitSig message, length delimited. Does not implicitly {@link tendermint.types.CommitSig.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.CommitSig + * @static + * @param {tendermint.types.ICommitSig} message CommitSig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitSig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommitSig message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.CommitSig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.CommitSig} CommitSig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitSig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.CommitSig(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockIdFlag = reader.int32(); + break; + case 2: + message.validatorAddress = reader.bytes(); + break; + case 3: + message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 4: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommitSig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.CommitSig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.CommitSig} CommitSig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitSig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommitSig message. + * @function verify + * @memberof tendermint.types.CommitSig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommitSig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.blockIdFlag != null && message.hasOwnProperty("blockIdFlag")) + switch (message.blockIdFlag) { + default: + return "blockIdFlag: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + if (!(message.validatorAddress && typeof message.validatorAddress.length === "number" || $util.isString(message.validatorAddress))) + return "validatorAddress: buffer expected"; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) { + let error = $root.google.protobuf.Timestamp.verify(message.timestamp); + if (error) + return "timestamp." + error; + } + if (message.signature != null && message.hasOwnProperty("signature")) + if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) + return "signature: buffer expected"; + return null; + }; + + /** + * Creates a CommitSig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.CommitSig + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.CommitSig} CommitSig + */ + CommitSig.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.CommitSig) + return object; + let message = new $root.tendermint.types.CommitSig(); + switch (object.blockIdFlag) { + case "BLOCK_ID_FLAG_UNKNOWN": + case 0: + message.blockIdFlag = 0; + break; + case "BLOCK_ID_FLAG_ABSENT": + case 1: + message.blockIdFlag = 1; + break; + case "BLOCK_ID_FLAG_COMMIT": + case 2: + message.blockIdFlag = 2; + break; + case "BLOCK_ID_FLAG_NIL": + case 3: + message.blockIdFlag = 3; + break; + } + if (object.validatorAddress != null) + if (typeof object.validatorAddress === "string") + $util.base64.decode(object.validatorAddress, message.validatorAddress = $util.newBuffer($util.base64.length(object.validatorAddress)), 0); + else if (object.validatorAddress.length) + message.validatorAddress = object.validatorAddress; + if (object.timestamp != null) { + if (typeof object.timestamp !== "object") + throw TypeError(".tendermint.types.CommitSig.timestamp: object expected"); + message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); + } + if (object.signature != null) + if (typeof object.signature === "string") + $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); + else if (object.signature.length) + message.signature = object.signature; + return message; + }; + + /** + * Creates a plain object from a CommitSig message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.CommitSig + * @static + * @param {tendermint.types.CommitSig} message CommitSig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommitSig.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.blockIdFlag = options.enums === String ? "BLOCK_ID_FLAG_UNKNOWN" : 0; + if (options.bytes === String) + object.validatorAddress = ""; + else { + object.validatorAddress = []; + if (options.bytes !== Array) + object.validatorAddress = $util.newBuffer(object.validatorAddress); + } + object.timestamp = null; + if (options.bytes === String) + object.signature = ""; + else { + object.signature = []; + if (options.bytes !== Array) + object.signature = $util.newBuffer(object.signature); + } + } + if (message.blockIdFlag != null && message.hasOwnProperty("blockIdFlag")) + object.blockIdFlag = options.enums === String ? $root.tendermint.types.BlockIDFlag[message.blockIdFlag] : message.blockIdFlag; + if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress")) + object.validatorAddress = options.bytes === String ? $util.base64.encode(message.validatorAddress, 0, message.validatorAddress.length) : options.bytes === Array ? Array.prototype.slice.call(message.validatorAddress) : message.validatorAddress; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); + if (message.signature != null && message.hasOwnProperty("signature")) + object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; + return object; + }; + + /** + * Converts this CommitSig to JSON. + * @function toJSON + * @memberof tendermint.types.CommitSig + * @instance + * @returns {Object.} JSON object + */ + CommitSig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CommitSig; + })(types.CommitSig || {}); + + types.Proposal = (function(Proposal) { + + /** + * Properties of a Proposal. + * @memberof tendermint.types + * @interface IProposal + * @property {tendermint.types.SignedMsgType|null} [type] Proposal type + * @property {number|Long|null} [height] Proposal height + * @property {number|null} [round] Proposal round + * @property {number|null} [polRound] Proposal polRound + * @property {tendermint.types.IBlockID|null} [blockId] Proposal blockId + * @property {google.protobuf.ITimestamp|null} [timestamp] Proposal timestamp + * @property {Uint8Array|null} [signature] Proposal signature + */ + + /** + * Constructs a new Proposal. + * @memberof tendermint.types + * @classdesc Represents a Proposal. + * @implements IProposal + * @constructor + * @param {tendermint.types.IProposal=} [properties] Properties to set + */ + function Proposal(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Proposal type. + * @member {tendermint.types.SignedMsgType} type + * @memberof tendermint.types.Proposal + * @instance + */ + Proposal.prototype.type = 0; + + /** + * Proposal height. + * @member {number|Long} height + * @memberof tendermint.types.Proposal + * @instance + */ + Proposal.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Proposal round. + * @member {number} round + * @memberof tendermint.types.Proposal + * @instance + */ + Proposal.prototype.round = 0; + + /** + * Proposal polRound. + * @member {number} polRound + * @memberof tendermint.types.Proposal + * @instance + */ + Proposal.prototype.polRound = 0; + + /** + * Proposal blockId. + * @member {tendermint.types.IBlockID|null|undefined} blockId + * @memberof tendermint.types.Proposal + * @instance + */ + Proposal.prototype.blockId = null; + + /** + * Proposal timestamp. + * @member {google.protobuf.ITimestamp|null|undefined} timestamp + * @memberof tendermint.types.Proposal + * @instance + */ + Proposal.prototype.timestamp = null; + + /** + * Proposal signature. + * @member {Uint8Array} signature + * @memberof tendermint.types.Proposal + * @instance + */ + Proposal.prototype.signature = $util.newBuffer([]); + + /** + * Creates a new Proposal instance using the specified properties. + * @function create + * @memberof tendermint.types.Proposal + * @static + * @param {tendermint.types.IProposal=} [properties] Properties to set + * @returns {tendermint.types.Proposal} Proposal instance + */ + Proposal.create = function create(properties) { + return new Proposal(properties); + }; + + /** + * Encodes the specified Proposal message. Does not implicitly {@link tendermint.types.Proposal.verify|verify} messages. + * @function encode + * @memberof tendermint.types.Proposal + * @static + * @param {tendermint.types.IProposal} message Proposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proposal.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.height); + if (message.round != null && Object.hasOwnProperty.call(message, "round")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.round); + if (message.polRound != null && Object.hasOwnProperty.call(message, "polRound")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.polRound); + if (message.blockId != null && Object.hasOwnProperty.call(message, "blockId")) + $root.tendermint.types.BlockID.encode(message.blockId, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.signature); + return writer; + }; + + /** + * Encodes the specified Proposal message, length delimited. Does not implicitly {@link tendermint.types.Proposal.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.Proposal + * @static + * @param {tendermint.types.IProposal} message Proposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proposal.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Proposal message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.Proposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.Proposal} Proposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proposal.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Proposal(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32(); + break; + case 2: + message.height = reader.int64(); + break; + case 3: + message.round = reader.int32(); + break; + case 4: + message.polRound = reader.int32(); + break; + case 5: + message.blockId = $root.tendermint.types.BlockID.decode(reader, reader.uint32()); + break; + case 6: + message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 7: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Proposal message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.Proposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.Proposal} Proposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proposal.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Proposal message. + * @function verify + * @memberof tendermint.types.Proposal + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Proposal.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 32: + break; + } + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.round != null && message.hasOwnProperty("round")) + if (!$util.isInteger(message.round)) + return "round: integer expected"; + if (message.polRound != null && message.hasOwnProperty("polRound")) + if (!$util.isInteger(message.polRound)) + return "polRound: integer expected"; + if (message.blockId != null && message.hasOwnProperty("blockId")) { + let error = $root.tendermint.types.BlockID.verify(message.blockId); + if (error) + return "blockId." + error; + } + if (message.timestamp != null && message.hasOwnProperty("timestamp")) { + let error = $root.google.protobuf.Timestamp.verify(message.timestamp); + if (error) + return "timestamp." + error; + } + if (message.signature != null && message.hasOwnProperty("signature")) + if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) + return "signature: buffer expected"; + return null; + }; + + /** + * Creates a Proposal message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.Proposal + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.Proposal} Proposal + */ + Proposal.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.Proposal) + return object; + let message = new $root.tendermint.types.Proposal(); + switch (object.type) { + case "SIGNED_MSG_TYPE_UNKNOWN": + case 0: + message.type = 0; + break; + case "SIGNED_MSG_TYPE_PREVOTE": + case 1: + message.type = 1; + break; + case "SIGNED_MSG_TYPE_PRECOMMIT": + case 2: + message.type = 2; + break; + case "SIGNED_MSG_TYPE_PROPOSAL": + case 32: + message.type = 32; + break; + } + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + if (object.round != null) + message.round = object.round | 0; + if (object.polRound != null) + message.polRound = object.polRound | 0; + if (object.blockId != null) { + if (typeof object.blockId !== "object") + throw TypeError(".tendermint.types.Proposal.blockId: object expected"); + message.blockId = $root.tendermint.types.BlockID.fromObject(object.blockId); + } + if (object.timestamp != null) { + if (typeof object.timestamp !== "object") + throw TypeError(".tendermint.types.Proposal.timestamp: object expected"); + message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); + } + if (object.signature != null) + if (typeof object.signature === "string") + $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); + else if (object.signature.length) + message.signature = object.signature; + return message; + }; + + /** + * Creates a plain object from a Proposal message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.Proposal + * @static + * @param {tendermint.types.Proposal} message Proposal + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Proposal.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.type = options.enums === String ? "SIGNED_MSG_TYPE_UNKNOWN" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.round = 0; + object.polRound = 0; + object.blockId = null; + object.timestamp = null; + if (options.bytes === String) + object.signature = ""; + else { + object.signature = []; + if (options.bytes !== Array) + object.signature = $util.newBuffer(object.signature); + } + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.tendermint.types.SignedMsgType[message.type] : message.type; + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + if (message.round != null && message.hasOwnProperty("round")) + object.round = message.round; + if (message.polRound != null && message.hasOwnProperty("polRound")) + object.polRound = message.polRound; + if (message.blockId != null && message.hasOwnProperty("blockId")) + object.blockId = $root.tendermint.types.BlockID.toObject(message.blockId, options); + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); + if (message.signature != null && message.hasOwnProperty("signature")) + object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; + return object; + }; + + /** + * Converts this Proposal to JSON. + * @function toJSON + * @memberof tendermint.types.Proposal + * @instance + * @returns {Object.} JSON object + */ + Proposal.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Proposal; + })(types.Proposal || {}); + + types.SignedHeader = (function(SignedHeader) { + + /** + * Properties of a SignedHeader. + * @memberof tendermint.types + * @interface ISignedHeader + * @property {tendermint.types.IHeader|null} [header] SignedHeader header + * @property {tendermint.types.ICommit|null} [commit] SignedHeader commit + */ + + /** + * Constructs a new SignedHeader. + * @memberof tendermint.types + * @classdesc Represents a SignedHeader. + * @implements ISignedHeader + * @constructor + * @param {tendermint.types.ISignedHeader=} [properties] Properties to set + */ + function SignedHeader(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SignedHeader header. + * @member {tendermint.types.IHeader|null|undefined} header + * @memberof tendermint.types.SignedHeader + * @instance + */ + SignedHeader.prototype.header = null; + + /** + * SignedHeader commit. + * @member {tendermint.types.ICommit|null|undefined} commit + * @memberof tendermint.types.SignedHeader + * @instance + */ + SignedHeader.prototype.commit = null; + + /** + * Creates a new SignedHeader instance using the specified properties. + * @function create + * @memberof tendermint.types.SignedHeader + * @static + * @param {tendermint.types.ISignedHeader=} [properties] Properties to set + * @returns {tendermint.types.SignedHeader} SignedHeader instance + */ + SignedHeader.create = function create(properties) { + return new SignedHeader(properties); + }; + + /** + * Encodes the specified SignedHeader message. Does not implicitly {@link tendermint.types.SignedHeader.verify|verify} messages. + * @function encode + * @memberof tendermint.types.SignedHeader + * @static + * @param {tendermint.types.ISignedHeader} message SignedHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignedHeader.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + $root.tendermint.types.Header.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.commit != null && Object.hasOwnProperty.call(message, "commit")) + $root.tendermint.types.Commit.encode(message.commit, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SignedHeader message, length delimited. Does not implicitly {@link tendermint.types.SignedHeader.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.SignedHeader + * @static + * @param {tendermint.types.ISignedHeader} message SignedHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignedHeader.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SignedHeader message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.SignedHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.SignedHeader} SignedHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignedHeader.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.SignedHeader(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.header = $root.tendermint.types.Header.decode(reader, reader.uint32()); + break; + case 2: + message.commit = $root.tendermint.types.Commit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SignedHeader message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.SignedHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.SignedHeader} SignedHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignedHeader.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SignedHeader message. + * @function verify + * @memberof tendermint.types.SignedHeader + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SignedHeader.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.header != null && message.hasOwnProperty("header")) { + let error = $root.tendermint.types.Header.verify(message.header); + if (error) + return "header." + error; + } + if (message.commit != null && message.hasOwnProperty("commit")) { + let error = $root.tendermint.types.Commit.verify(message.commit); + if (error) + return "commit." + error; + } + return null; + }; + + /** + * Creates a SignedHeader message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.SignedHeader + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.SignedHeader} SignedHeader + */ + SignedHeader.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.SignedHeader) + return object; + let message = new $root.tendermint.types.SignedHeader(); + if (object.header != null) { + if (typeof object.header !== "object") + throw TypeError(".tendermint.types.SignedHeader.header: object expected"); + message.header = $root.tendermint.types.Header.fromObject(object.header); + } + if (object.commit != null) { + if (typeof object.commit !== "object") + throw TypeError(".tendermint.types.SignedHeader.commit: object expected"); + message.commit = $root.tendermint.types.Commit.fromObject(object.commit); + } + return message; + }; + + /** + * Creates a plain object from a SignedHeader message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.SignedHeader + * @static + * @param {tendermint.types.SignedHeader} message SignedHeader + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SignedHeader.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.header = null; + object.commit = null; + } + if (message.header != null && message.hasOwnProperty("header")) + object.header = $root.tendermint.types.Header.toObject(message.header, options); + if (message.commit != null && message.hasOwnProperty("commit")) + object.commit = $root.tendermint.types.Commit.toObject(message.commit, options); + return object; + }; + + /** + * Converts this SignedHeader to JSON. + * @function toJSON + * @memberof tendermint.types.SignedHeader + * @instance + * @returns {Object.} JSON object + */ + SignedHeader.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SignedHeader; + })(types.SignedHeader || {}); + + types.LightBlock = (function(LightBlock) { + + /** + * Properties of a LightBlock. + * @memberof tendermint.types + * @interface ILightBlock + * @property {tendermint.types.ISignedHeader|null} [signedHeader] LightBlock signedHeader + * @property {tendermint.types.IValidatorSet|null} [validatorSet] LightBlock validatorSet + */ + + /** + * Constructs a new LightBlock. + * @memberof tendermint.types + * @classdesc Represents a LightBlock. + * @implements ILightBlock + * @constructor + * @param {tendermint.types.ILightBlock=} [properties] Properties to set + */ + function LightBlock(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LightBlock signedHeader. + * @member {tendermint.types.ISignedHeader|null|undefined} signedHeader + * @memberof tendermint.types.LightBlock + * @instance + */ + LightBlock.prototype.signedHeader = null; + + /** + * LightBlock validatorSet. + * @member {tendermint.types.IValidatorSet|null|undefined} validatorSet + * @memberof tendermint.types.LightBlock + * @instance + */ + LightBlock.prototype.validatorSet = null; + + /** + * Creates a new LightBlock instance using the specified properties. + * @function create + * @memberof tendermint.types.LightBlock + * @static + * @param {tendermint.types.ILightBlock=} [properties] Properties to set + * @returns {tendermint.types.LightBlock} LightBlock instance + */ + LightBlock.create = function create(properties) { + return new LightBlock(properties); + }; + + /** + * Encodes the specified LightBlock message. Does not implicitly {@link tendermint.types.LightBlock.verify|verify} messages. + * @function encode + * @memberof tendermint.types.LightBlock + * @static + * @param {tendermint.types.ILightBlock} message LightBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LightBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.signedHeader != null && Object.hasOwnProperty.call(message, "signedHeader")) + $root.tendermint.types.SignedHeader.encode(message.signedHeader, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.validatorSet != null && Object.hasOwnProperty.call(message, "validatorSet")) + $root.tendermint.types.ValidatorSet.encode(message.validatorSet, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LightBlock message, length delimited. Does not implicitly {@link tendermint.types.LightBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.LightBlock + * @static + * @param {tendermint.types.ILightBlock} message LightBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LightBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LightBlock message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.LightBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.LightBlock} LightBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LightBlock.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.LightBlock(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signedHeader = $root.tendermint.types.SignedHeader.decode(reader, reader.uint32()); + break; + case 2: + message.validatorSet = $root.tendermint.types.ValidatorSet.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LightBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.LightBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.LightBlock} LightBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LightBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LightBlock message. + * @function verify + * @memberof tendermint.types.LightBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LightBlock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.signedHeader != null && message.hasOwnProperty("signedHeader")) { + let error = $root.tendermint.types.SignedHeader.verify(message.signedHeader); + if (error) + return "signedHeader." + error; + } + if (message.validatorSet != null && message.hasOwnProperty("validatorSet")) { + let error = $root.tendermint.types.ValidatorSet.verify(message.validatorSet); + if (error) + return "validatorSet." + error; + } + return null; + }; + + /** + * Creates a LightBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.LightBlock + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.LightBlock} LightBlock + */ + LightBlock.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.LightBlock) + return object; + let message = new $root.tendermint.types.LightBlock(); + if (object.signedHeader != null) { + if (typeof object.signedHeader !== "object") + throw TypeError(".tendermint.types.LightBlock.signedHeader: object expected"); + message.signedHeader = $root.tendermint.types.SignedHeader.fromObject(object.signedHeader); + } + if (object.validatorSet != null) { + if (typeof object.validatorSet !== "object") + throw TypeError(".tendermint.types.LightBlock.validatorSet: object expected"); + message.validatorSet = $root.tendermint.types.ValidatorSet.fromObject(object.validatorSet); + } + return message; + }; + + /** + * Creates a plain object from a LightBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.LightBlock + * @static + * @param {tendermint.types.LightBlock} message LightBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LightBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.signedHeader = null; + object.validatorSet = null; + } + if (message.signedHeader != null && message.hasOwnProperty("signedHeader")) + object.signedHeader = $root.tendermint.types.SignedHeader.toObject(message.signedHeader, options); + if (message.validatorSet != null && message.hasOwnProperty("validatorSet")) + object.validatorSet = $root.tendermint.types.ValidatorSet.toObject(message.validatorSet, options); + return object; + }; + + /** + * Converts this LightBlock to JSON. + * @function toJSON + * @memberof tendermint.types.LightBlock + * @instance + * @returns {Object.} JSON object + */ + LightBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LightBlock; + })(types.LightBlock || {}); + + types.BlockMeta = (function(BlockMeta) { + + /** + * Properties of a BlockMeta. + * @memberof tendermint.types + * @interface IBlockMeta + * @property {tendermint.types.IBlockID|null} [blockId] BlockMeta blockId + * @property {number|Long|null} [blockSize] BlockMeta blockSize + * @property {tendermint.types.IHeader|null} [header] BlockMeta header + * @property {number|Long|null} [numTxs] BlockMeta numTxs + */ + + /** + * Constructs a new BlockMeta. + * @memberof tendermint.types + * @classdesc Represents a BlockMeta. + * @implements IBlockMeta + * @constructor + * @param {tendermint.types.IBlockMeta=} [properties] Properties to set + */ + function BlockMeta(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BlockMeta blockId. + * @member {tendermint.types.IBlockID|null|undefined} blockId + * @memberof tendermint.types.BlockMeta + * @instance + */ + BlockMeta.prototype.blockId = null; + + /** + * BlockMeta blockSize. + * @member {number|Long} blockSize + * @memberof tendermint.types.BlockMeta + * @instance + */ + BlockMeta.prototype.blockSize = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BlockMeta header. + * @member {tendermint.types.IHeader|null|undefined} header + * @memberof tendermint.types.BlockMeta + * @instance + */ + BlockMeta.prototype.header = null; + + /** + * BlockMeta numTxs. + * @member {number|Long} numTxs + * @memberof tendermint.types.BlockMeta + * @instance + */ + BlockMeta.prototype.numTxs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new BlockMeta instance using the specified properties. + * @function create + * @memberof tendermint.types.BlockMeta + * @static + * @param {tendermint.types.IBlockMeta=} [properties] Properties to set + * @returns {tendermint.types.BlockMeta} BlockMeta instance + */ + BlockMeta.create = function create(properties) { + return new BlockMeta(properties); + }; + + /** + * Encodes the specified BlockMeta message. Does not implicitly {@link tendermint.types.BlockMeta.verify|verify} messages. + * @function encode + * @memberof tendermint.types.BlockMeta + * @static + * @param {tendermint.types.IBlockMeta} message BlockMeta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlockMeta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.blockId != null && Object.hasOwnProperty.call(message, "blockId")) + $root.tendermint.types.BlockID.encode(message.blockId, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.blockSize != null && Object.hasOwnProperty.call(message, "blockSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.blockSize); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + $root.tendermint.types.Header.encode(message.header, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.numTxs != null && Object.hasOwnProperty.call(message, "numTxs")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.numTxs); + return writer; + }; + + /** + * Encodes the specified BlockMeta message, length delimited. Does not implicitly {@link tendermint.types.BlockMeta.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.BlockMeta + * @static + * @param {tendermint.types.IBlockMeta} message BlockMeta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlockMeta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BlockMeta message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.BlockMeta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.BlockMeta} BlockMeta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlockMeta.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.BlockMeta(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockId = $root.tendermint.types.BlockID.decode(reader, reader.uint32()); + break; + case 2: + message.blockSize = reader.int64(); + break; + case 3: + message.header = $root.tendermint.types.Header.decode(reader, reader.uint32()); + break; + case 4: + message.numTxs = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BlockMeta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.BlockMeta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.BlockMeta} BlockMeta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlockMeta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BlockMeta message. + * @function verify + * @memberof tendermint.types.BlockMeta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BlockMeta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.blockId != null && message.hasOwnProperty("blockId")) { + let error = $root.tendermint.types.BlockID.verify(message.blockId); + if (error) + return "blockId." + error; + } + if (message.blockSize != null && message.hasOwnProperty("blockSize")) + if (!$util.isInteger(message.blockSize) && !(message.blockSize && $util.isInteger(message.blockSize.low) && $util.isInteger(message.blockSize.high))) + return "blockSize: integer|Long expected"; + if (message.header != null && message.hasOwnProperty("header")) { + let error = $root.tendermint.types.Header.verify(message.header); + if (error) + return "header." + error; + } + if (message.numTxs != null && message.hasOwnProperty("numTxs")) + if (!$util.isInteger(message.numTxs) && !(message.numTxs && $util.isInteger(message.numTxs.low) && $util.isInteger(message.numTxs.high))) + return "numTxs: integer|Long expected"; + return null; + }; + + /** + * Creates a BlockMeta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.BlockMeta + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.BlockMeta} BlockMeta + */ + BlockMeta.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.BlockMeta) + return object; + let message = new $root.tendermint.types.BlockMeta(); + if (object.blockId != null) { + if (typeof object.blockId !== "object") + throw TypeError(".tendermint.types.BlockMeta.blockId: object expected"); + message.blockId = $root.tendermint.types.BlockID.fromObject(object.blockId); + } + if (object.blockSize != null) + if ($util.Long) + (message.blockSize = $util.Long.fromValue(object.blockSize)).unsigned = false; + else if (typeof object.blockSize === "string") + message.blockSize = parseInt(object.blockSize, 10); + else if (typeof object.blockSize === "number") + message.blockSize = object.blockSize; + else if (typeof object.blockSize === "object") + message.blockSize = new $util.LongBits(object.blockSize.low >>> 0, object.blockSize.high >>> 0).toNumber(); + if (object.header != null) { + if (typeof object.header !== "object") + throw TypeError(".tendermint.types.BlockMeta.header: object expected"); + message.header = $root.tendermint.types.Header.fromObject(object.header); + } + if (object.numTxs != null) + if ($util.Long) + (message.numTxs = $util.Long.fromValue(object.numTxs)).unsigned = false; + else if (typeof object.numTxs === "string") + message.numTxs = parseInt(object.numTxs, 10); + else if (typeof object.numTxs === "number") + message.numTxs = object.numTxs; + else if (typeof object.numTxs === "object") + message.numTxs = new $util.LongBits(object.numTxs.low >>> 0, object.numTxs.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a BlockMeta message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.BlockMeta + * @static + * @param {tendermint.types.BlockMeta} message BlockMeta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BlockMeta.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.blockId = null; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.blockSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.blockSize = options.longs === String ? "0" : 0; + object.header = null; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.numTxs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.numTxs = options.longs === String ? "0" : 0; + } + if (message.blockId != null && message.hasOwnProperty("blockId")) + object.blockId = $root.tendermint.types.BlockID.toObject(message.blockId, options); + if (message.blockSize != null && message.hasOwnProperty("blockSize")) + if (typeof message.blockSize === "number") + object.blockSize = options.longs === String ? String(message.blockSize) : message.blockSize; + else + object.blockSize = options.longs === String ? $util.Long.prototype.toString.call(message.blockSize) : options.longs === Number ? new $util.LongBits(message.blockSize.low >>> 0, message.blockSize.high >>> 0).toNumber() : message.blockSize; + if (message.header != null && message.hasOwnProperty("header")) + object.header = $root.tendermint.types.Header.toObject(message.header, options); + if (message.numTxs != null && message.hasOwnProperty("numTxs")) + if (typeof message.numTxs === "number") + object.numTxs = options.longs === String ? String(message.numTxs) : message.numTxs; + else + object.numTxs = options.longs === String ? $util.Long.prototype.toString.call(message.numTxs) : options.longs === Number ? new $util.LongBits(message.numTxs.low >>> 0, message.numTxs.high >>> 0).toNumber() : message.numTxs; + return object; + }; + + /** + * Converts this BlockMeta to JSON. + * @function toJSON + * @memberof tendermint.types.BlockMeta + * @instance + * @returns {Object.} JSON object + */ + BlockMeta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BlockMeta; + })(types.BlockMeta || {}); + + types.TxProof = (function(TxProof) { + + /** + * Properties of a TxProof. + * @memberof tendermint.types + * @interface ITxProof + * @property {Uint8Array|null} [rootHash] TxProof rootHash + * @property {Uint8Array|null} [data] TxProof data + * @property {tendermint.crypto.IProof|null} [proof] TxProof proof + */ + + /** + * Constructs a new TxProof. + * @memberof tendermint.types + * @classdesc Represents a TxProof. + * @implements ITxProof + * @constructor + * @param {tendermint.types.ITxProof=} [properties] Properties to set + */ + function TxProof(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TxProof rootHash. + * @member {Uint8Array} rootHash + * @memberof tendermint.types.TxProof + * @instance + */ + TxProof.prototype.rootHash = $util.newBuffer([]); + + /** + * TxProof data. + * @member {Uint8Array} data + * @memberof tendermint.types.TxProof + * @instance + */ + TxProof.prototype.data = $util.newBuffer([]); + + /** + * TxProof proof. + * @member {tendermint.crypto.IProof|null|undefined} proof + * @memberof tendermint.types.TxProof + * @instance + */ + TxProof.prototype.proof = null; + + /** + * Creates a new TxProof instance using the specified properties. + * @function create + * @memberof tendermint.types.TxProof + * @static + * @param {tendermint.types.ITxProof=} [properties] Properties to set + * @returns {tendermint.types.TxProof} TxProof instance + */ + TxProof.create = function create(properties) { + return new TxProof(properties); + }; + + /** + * Encodes the specified TxProof message. Does not implicitly {@link tendermint.types.TxProof.verify|verify} messages. + * @function encode + * @memberof tendermint.types.TxProof + * @static + * @param {tendermint.types.ITxProof} message TxProof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TxProof.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rootHash != null && Object.hasOwnProperty.call(message, "rootHash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.rootHash); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.tendermint.crypto.Proof.encode(message.proof, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TxProof message, length delimited. Does not implicitly {@link tendermint.types.TxProof.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.TxProof + * @static + * @param {tendermint.types.ITxProof} message TxProof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TxProof.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TxProof message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.TxProof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.TxProof} TxProof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TxProof.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.TxProof(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rootHash = reader.bytes(); + break; + case 2: + message.data = reader.bytes(); + break; + case 3: + message.proof = $root.tendermint.crypto.Proof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TxProof message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.TxProof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.TxProof} TxProof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TxProof.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TxProof message. + * @function verify + * @memberof tendermint.types.TxProof + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TxProof.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rootHash != null && message.hasOwnProperty("rootHash")) + if (!(message.rootHash && typeof message.rootHash.length === "number" || $util.isString(message.rootHash))) + return "rootHash: buffer expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + if (message.proof != null && message.hasOwnProperty("proof")) { + let error = $root.tendermint.crypto.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + return null; + }; + + /** + * Creates a TxProof message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.TxProof + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.TxProof} TxProof + */ + TxProof.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.TxProof) + return object; + let message = new $root.tendermint.types.TxProof(); + if (object.rootHash != null) + if (typeof object.rootHash === "string") + $util.base64.decode(object.rootHash, message.rootHash = $util.newBuffer($util.base64.length(object.rootHash)), 0); + else if (object.rootHash.length) + message.rootHash = object.rootHash; + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length) + message.data = object.data; + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".tendermint.types.TxProof.proof: object expected"); + message.proof = $root.tendermint.crypto.Proof.fromObject(object.proof); + } + return message; + }; + + /** + * Creates a plain object from a TxProof message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.TxProof + * @static + * @param {tendermint.types.TxProof} message TxProof + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TxProof.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if (options.bytes === String) + object.rootHash = ""; + else { + object.rootHash = []; + if (options.bytes !== Array) + object.rootHash = $util.newBuffer(object.rootHash); + } + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + object.proof = null; + } + if (message.rootHash != null && message.hasOwnProperty("rootHash")) + object.rootHash = options.bytes === String ? $util.base64.encode(message.rootHash, 0, message.rootHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.rootHash) : message.rootHash; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + if (message.proof != null && message.hasOwnProperty("proof")) + object.proof = $root.tendermint.crypto.Proof.toObject(message.proof, options); + return object; + }; + + /** + * Converts this TxProof to JSON. + * @function toJSON + * @memberof tendermint.types.TxProof + * @instance + * @returns {Object.} JSON object + */ + TxProof.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TxProof; + })(types.TxProof || {}); + + types.ValidatorSet = (function(ValidatorSet) { + + /** + * Properties of a ValidatorSet. + * @memberof tendermint.types + * @interface IValidatorSet + * @property {Array.|null} [validators] ValidatorSet validators + * @property {tendermint.types.IValidator|null} [proposer] ValidatorSet proposer + * @property {number|Long|null} [totalVotingPower] ValidatorSet totalVotingPower + */ + + /** + * Constructs a new ValidatorSet. + * @memberof tendermint.types + * @classdesc Represents a ValidatorSet. + * @implements IValidatorSet + * @constructor + * @param {tendermint.types.IValidatorSet=} [properties] Properties to set + */ + function ValidatorSet(properties) { + this.validators = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidatorSet validators. + * @member {Array.} validators + * @memberof tendermint.types.ValidatorSet + * @instance + */ + ValidatorSet.prototype.validators = $util.emptyArray; + + /** + * ValidatorSet proposer. + * @member {tendermint.types.IValidator|null|undefined} proposer + * @memberof tendermint.types.ValidatorSet + * @instance + */ + ValidatorSet.prototype.proposer = null; + + /** + * ValidatorSet totalVotingPower. + * @member {number|Long} totalVotingPower + * @memberof tendermint.types.ValidatorSet + * @instance + */ + ValidatorSet.prototype.totalVotingPower = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ValidatorSet instance using the specified properties. + * @function create + * @memberof tendermint.types.ValidatorSet + * @static + * @param {tendermint.types.IValidatorSet=} [properties] Properties to set + * @returns {tendermint.types.ValidatorSet} ValidatorSet instance + */ + ValidatorSet.create = function create(properties) { + return new ValidatorSet(properties); + }; + + /** + * Encodes the specified ValidatorSet message. Does not implicitly {@link tendermint.types.ValidatorSet.verify|verify} messages. + * @function encode + * @memberof tendermint.types.ValidatorSet + * @static + * @param {tendermint.types.IValidatorSet} message ValidatorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validators != null && message.validators.length) + for (let i = 0; i < message.validators.length; ++i) + $root.tendermint.types.Validator.encode(message.validators[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proposer != null && Object.hasOwnProperty.call(message, "proposer")) + $root.tendermint.types.Validator.encode(message.proposer, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.totalVotingPower != null && Object.hasOwnProperty.call(message, "totalVotingPower")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.totalVotingPower); + return writer; + }; + + /** + * Encodes the specified ValidatorSet message, length delimited. Does not implicitly {@link tendermint.types.ValidatorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.ValidatorSet + * @static + * @param {tendermint.types.IValidatorSet} message ValidatorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidatorSet message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.ValidatorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.ValidatorSet} ValidatorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.ValidatorSet(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.validators && message.validators.length)) + message.validators = []; + message.validators.push($root.tendermint.types.Validator.decode(reader, reader.uint32())); + break; + case 2: + message.proposer = $root.tendermint.types.Validator.decode(reader, reader.uint32()); + break; + case 3: + message.totalVotingPower = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidatorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.ValidatorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.ValidatorSet} ValidatorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidatorSet message. + * @function verify + * @memberof tendermint.types.ValidatorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidatorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validators != null && message.hasOwnProperty("validators")) { + if (!Array.isArray(message.validators)) + return "validators: array expected"; + for (let i = 0; i < message.validators.length; ++i) { + let error = $root.tendermint.types.Validator.verify(message.validators[i]); + if (error) + return "validators." + error; + } + } + if (message.proposer != null && message.hasOwnProperty("proposer")) { + let error = $root.tendermint.types.Validator.verify(message.proposer); + if (error) + return "proposer." + error; + } + if (message.totalVotingPower != null && message.hasOwnProperty("totalVotingPower")) + if (!$util.isInteger(message.totalVotingPower) && !(message.totalVotingPower && $util.isInteger(message.totalVotingPower.low) && $util.isInteger(message.totalVotingPower.high))) + return "totalVotingPower: integer|Long expected"; + return null; + }; + + /** + * Creates a ValidatorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.ValidatorSet + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.ValidatorSet} ValidatorSet + */ + ValidatorSet.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.ValidatorSet) + return object; + let message = new $root.tendermint.types.ValidatorSet(); + if (object.validators) { + if (!Array.isArray(object.validators)) + throw TypeError(".tendermint.types.ValidatorSet.validators: array expected"); + message.validators = []; + for (let i = 0; i < object.validators.length; ++i) { + if (typeof object.validators[i] !== "object") + throw TypeError(".tendermint.types.ValidatorSet.validators: object expected"); + message.validators[i] = $root.tendermint.types.Validator.fromObject(object.validators[i]); + } + } + if (object.proposer != null) { + if (typeof object.proposer !== "object") + throw TypeError(".tendermint.types.ValidatorSet.proposer: object expected"); + message.proposer = $root.tendermint.types.Validator.fromObject(object.proposer); + } + if (object.totalVotingPower != null) + if ($util.Long) + (message.totalVotingPower = $util.Long.fromValue(object.totalVotingPower)).unsigned = false; + else if (typeof object.totalVotingPower === "string") + message.totalVotingPower = parseInt(object.totalVotingPower, 10); + else if (typeof object.totalVotingPower === "number") + message.totalVotingPower = object.totalVotingPower; + else if (typeof object.totalVotingPower === "object") + message.totalVotingPower = new $util.LongBits(object.totalVotingPower.low >>> 0, object.totalVotingPower.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ValidatorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.ValidatorSet + * @static + * @param {tendermint.types.ValidatorSet} message ValidatorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidatorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.validators = []; + if (options.defaults) { + object.proposer = null; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.totalVotingPower = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalVotingPower = options.longs === String ? "0" : 0; + } + if (message.validators && message.validators.length) { + object.validators = []; + for (let j = 0; j < message.validators.length; ++j) + object.validators[j] = $root.tendermint.types.Validator.toObject(message.validators[j], options); + } + if (message.proposer != null && message.hasOwnProperty("proposer")) + object.proposer = $root.tendermint.types.Validator.toObject(message.proposer, options); + if (message.totalVotingPower != null && message.hasOwnProperty("totalVotingPower")) + if (typeof message.totalVotingPower === "number") + object.totalVotingPower = options.longs === String ? String(message.totalVotingPower) : message.totalVotingPower; + else + object.totalVotingPower = options.longs === String ? $util.Long.prototype.toString.call(message.totalVotingPower) : options.longs === Number ? new $util.LongBits(message.totalVotingPower.low >>> 0, message.totalVotingPower.high >>> 0).toNumber() : message.totalVotingPower; + return object; + }; + + /** + * Converts this ValidatorSet to JSON. + * @function toJSON + * @memberof tendermint.types.ValidatorSet + * @instance + * @returns {Object.} JSON object + */ + ValidatorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidatorSet; + })(types.ValidatorSet || {}); + + types.Validator = (function(Validator) { + + /** + * Properties of a Validator. + * @memberof tendermint.types + * @interface IValidator + * @property {Uint8Array|null} [address] Validator address + * @property {tendermint.crypto.IPublicKey|null} [pubKey] Validator pubKey + * @property {number|Long|null} [votingPower] Validator votingPower + * @property {number|Long|null} [proposerPriority] Validator proposerPriority + */ + + /** + * Constructs a new Validator. + * @memberof tendermint.types + * @classdesc Represents a Validator. + * @implements IValidator + * @constructor + * @param {tendermint.types.IValidator=} [properties] Properties to set + */ + function Validator(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Validator address. + * @member {Uint8Array} address + * @memberof tendermint.types.Validator + * @instance + */ + Validator.prototype.address = $util.newBuffer([]); + + /** + * Validator pubKey. + * @member {tendermint.crypto.IPublicKey|null|undefined} pubKey + * @memberof tendermint.types.Validator + * @instance + */ + Validator.prototype.pubKey = null; + + /** + * Validator votingPower. + * @member {number|Long} votingPower + * @memberof tendermint.types.Validator + * @instance + */ + Validator.prototype.votingPower = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Validator proposerPriority. + * @member {number|Long} proposerPriority + * @memberof tendermint.types.Validator + * @instance + */ + Validator.prototype.proposerPriority = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Validator instance using the specified properties. + * @function create + * @memberof tendermint.types.Validator + * @static + * @param {tendermint.types.IValidator=} [properties] Properties to set + * @returns {tendermint.types.Validator} Validator instance + */ + Validator.create = function create(properties) { + return new Validator(properties); + }; + + /** + * Encodes the specified Validator message. Does not implicitly {@link tendermint.types.Validator.verify|verify} messages. + * @function encode + * @memberof tendermint.types.Validator + * @static + * @param {tendermint.types.IValidator} message Validator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Validator.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.address); + if (message.pubKey != null && Object.hasOwnProperty.call(message, "pubKey")) + $root.tendermint.crypto.PublicKey.encode(message.pubKey, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.votingPower != null && Object.hasOwnProperty.call(message, "votingPower")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.votingPower); + if (message.proposerPriority != null && Object.hasOwnProperty.call(message, "proposerPriority")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.proposerPriority); + return writer; + }; + + /** + * Encodes the specified Validator message, length delimited. Does not implicitly {@link tendermint.types.Validator.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.Validator + * @static + * @param {tendermint.types.IValidator} message Validator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Validator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Validator message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.Validator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.Validator} Validator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Validator.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Validator(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.bytes(); + break; + case 2: + message.pubKey = $root.tendermint.crypto.PublicKey.decode(reader, reader.uint32()); + break; + case 3: + message.votingPower = reader.int64(); + break; + case 4: + message.proposerPriority = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Validator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.Validator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.Validator} Validator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Validator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Validator message. + * @function verify + * @memberof tendermint.types.Validator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Validator.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!(message.address && typeof message.address.length === "number" || $util.isString(message.address))) + return "address: buffer expected"; + if (message.pubKey != null && message.hasOwnProperty("pubKey")) { + let error = $root.tendermint.crypto.PublicKey.verify(message.pubKey); + if (error) + return "pubKey." + error; + } + if (message.votingPower != null && message.hasOwnProperty("votingPower")) + if (!$util.isInteger(message.votingPower) && !(message.votingPower && $util.isInteger(message.votingPower.low) && $util.isInteger(message.votingPower.high))) + return "votingPower: integer|Long expected"; + if (message.proposerPriority != null && message.hasOwnProperty("proposerPriority")) + if (!$util.isInteger(message.proposerPriority) && !(message.proposerPriority && $util.isInteger(message.proposerPriority.low) && $util.isInteger(message.proposerPriority.high))) + return "proposerPriority: integer|Long expected"; + return null; + }; + + /** + * Creates a Validator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.Validator + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.Validator} Validator + */ + Validator.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.Validator) + return object; + let message = new $root.tendermint.types.Validator(); + if (object.address != null) + if (typeof object.address === "string") + $util.base64.decode(object.address, message.address = $util.newBuffer($util.base64.length(object.address)), 0); + else if (object.address.length) + message.address = object.address; + if (object.pubKey != null) { + if (typeof object.pubKey !== "object") + throw TypeError(".tendermint.types.Validator.pubKey: object expected"); + message.pubKey = $root.tendermint.crypto.PublicKey.fromObject(object.pubKey); + } + if (object.votingPower != null) + if ($util.Long) + (message.votingPower = $util.Long.fromValue(object.votingPower)).unsigned = false; + else if (typeof object.votingPower === "string") + message.votingPower = parseInt(object.votingPower, 10); + else if (typeof object.votingPower === "number") + message.votingPower = object.votingPower; + else if (typeof object.votingPower === "object") + message.votingPower = new $util.LongBits(object.votingPower.low >>> 0, object.votingPower.high >>> 0).toNumber(); + if (object.proposerPriority != null) + if ($util.Long) + (message.proposerPriority = $util.Long.fromValue(object.proposerPriority)).unsigned = false; + else if (typeof object.proposerPriority === "string") + message.proposerPriority = parseInt(object.proposerPriority, 10); + else if (typeof object.proposerPriority === "number") + message.proposerPriority = object.proposerPriority; + else if (typeof object.proposerPriority === "object") + message.proposerPriority = new $util.LongBits(object.proposerPriority.low >>> 0, object.proposerPriority.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a Validator message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.Validator + * @static + * @param {tendermint.types.Validator} message Validator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Validator.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if (options.bytes === String) + object.address = ""; + else { + object.address = []; + if (options.bytes !== Array) + object.address = $util.newBuffer(object.address); + } + object.pubKey = null; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.votingPower = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.votingPower = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.proposerPriority = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.proposerPriority = options.longs === String ? "0" : 0; + } + if (message.address != null && message.hasOwnProperty("address")) + object.address = options.bytes === String ? $util.base64.encode(message.address, 0, message.address.length) : options.bytes === Array ? Array.prototype.slice.call(message.address) : message.address; + if (message.pubKey != null && message.hasOwnProperty("pubKey")) + object.pubKey = $root.tendermint.crypto.PublicKey.toObject(message.pubKey, options); + if (message.votingPower != null && message.hasOwnProperty("votingPower")) + if (typeof message.votingPower === "number") + object.votingPower = options.longs === String ? String(message.votingPower) : message.votingPower; + else + object.votingPower = options.longs === String ? $util.Long.prototype.toString.call(message.votingPower) : options.longs === Number ? new $util.LongBits(message.votingPower.low >>> 0, message.votingPower.high >>> 0).toNumber() : message.votingPower; + if (message.proposerPriority != null && message.hasOwnProperty("proposerPriority")) + if (typeof message.proposerPriority === "number") + object.proposerPriority = options.longs === String ? String(message.proposerPriority) : message.proposerPriority; + else + object.proposerPriority = options.longs === String ? $util.Long.prototype.toString.call(message.proposerPriority) : options.longs === Number ? new $util.LongBits(message.proposerPriority.low >>> 0, message.proposerPriority.high >>> 0).toNumber() : message.proposerPriority; + return object; + }; + + /** + * Converts this Validator to JSON. + * @function toJSON + * @memberof tendermint.types.Validator + * @instance + * @returns {Object.} JSON object + */ + Validator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Validator; + })(types.Validator || {}); + + types.SimpleValidator = (function(SimpleValidator) { + + /** + * Properties of a SimpleValidator. + * @memberof tendermint.types + * @interface ISimpleValidator + * @property {tendermint.crypto.IPublicKey|null} [pubKey] SimpleValidator pubKey + * @property {number|Long|null} [votingPower] SimpleValidator votingPower + */ + + /** + * Constructs a new SimpleValidator. + * @memberof tendermint.types + * @classdesc Represents a SimpleValidator. + * @implements ISimpleValidator + * @constructor + * @param {tendermint.types.ISimpleValidator=} [properties] Properties to set + */ + function SimpleValidator(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SimpleValidator pubKey. + * @member {tendermint.crypto.IPublicKey|null|undefined} pubKey + * @memberof tendermint.types.SimpleValidator + * @instance + */ + SimpleValidator.prototype.pubKey = null; + + /** + * SimpleValidator votingPower. + * @member {number|Long} votingPower + * @memberof tendermint.types.SimpleValidator + * @instance + */ + SimpleValidator.prototype.votingPower = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new SimpleValidator instance using the specified properties. + * @function create + * @memberof tendermint.types.SimpleValidator + * @static + * @param {tendermint.types.ISimpleValidator=} [properties] Properties to set + * @returns {tendermint.types.SimpleValidator} SimpleValidator instance + */ + SimpleValidator.create = function create(properties) { + return new SimpleValidator(properties); + }; + + /** + * Encodes the specified SimpleValidator message. Does not implicitly {@link tendermint.types.SimpleValidator.verify|verify} messages. + * @function encode + * @memberof tendermint.types.SimpleValidator + * @static + * @param {tendermint.types.ISimpleValidator} message SimpleValidator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SimpleValidator.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pubKey != null && Object.hasOwnProperty.call(message, "pubKey")) + $root.tendermint.crypto.PublicKey.encode(message.pubKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.votingPower != null && Object.hasOwnProperty.call(message, "votingPower")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.votingPower); + return writer; + }; + + /** + * Encodes the specified SimpleValidator message, length delimited. Does not implicitly {@link tendermint.types.SimpleValidator.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.types.SimpleValidator + * @static + * @param {tendermint.types.ISimpleValidator} message SimpleValidator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SimpleValidator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SimpleValidator message from the specified reader or buffer. + * @function decode + * @memberof tendermint.types.SimpleValidator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.types.SimpleValidator} SimpleValidator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SimpleValidator.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.SimpleValidator(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pubKey = $root.tendermint.crypto.PublicKey.decode(reader, reader.uint32()); + break; + case 2: + message.votingPower = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SimpleValidator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.types.SimpleValidator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.types.SimpleValidator} SimpleValidator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SimpleValidator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SimpleValidator message. + * @function verify + * @memberof tendermint.types.SimpleValidator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SimpleValidator.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pubKey != null && message.hasOwnProperty("pubKey")) { + let error = $root.tendermint.crypto.PublicKey.verify(message.pubKey); + if (error) + return "pubKey." + error; + } + if (message.votingPower != null && message.hasOwnProperty("votingPower")) + if (!$util.isInteger(message.votingPower) && !(message.votingPower && $util.isInteger(message.votingPower.low) && $util.isInteger(message.votingPower.high))) + return "votingPower: integer|Long expected"; + return null; + }; + + /** + * Creates a SimpleValidator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.types.SimpleValidator + * @static + * @param {Object.} object Plain object + * @returns {tendermint.types.SimpleValidator} SimpleValidator + */ + SimpleValidator.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.types.SimpleValidator) + return object; + let message = new $root.tendermint.types.SimpleValidator(); + if (object.pubKey != null) { + if (typeof object.pubKey !== "object") + throw TypeError(".tendermint.types.SimpleValidator.pubKey: object expected"); + message.pubKey = $root.tendermint.crypto.PublicKey.fromObject(object.pubKey); + } + if (object.votingPower != null) + if ($util.Long) + (message.votingPower = $util.Long.fromValue(object.votingPower)).unsigned = false; + else if (typeof object.votingPower === "string") + message.votingPower = parseInt(object.votingPower, 10); + else if (typeof object.votingPower === "number") + message.votingPower = object.votingPower; + else if (typeof object.votingPower === "object") + message.votingPower = new $util.LongBits(object.votingPower.low >>> 0, object.votingPower.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a SimpleValidator message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.types.SimpleValidator + * @static + * @param {tendermint.types.SimpleValidator} message SimpleValidator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SimpleValidator.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.pubKey = null; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.votingPower = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.votingPower = options.longs === String ? "0" : 0; + } + if (message.pubKey != null && message.hasOwnProperty("pubKey")) + object.pubKey = $root.tendermint.crypto.PublicKey.toObject(message.pubKey, options); + if (message.votingPower != null && message.hasOwnProperty("votingPower")) + if (typeof message.votingPower === "number") + object.votingPower = options.longs === String ? String(message.votingPower) : message.votingPower; + else + object.votingPower = options.longs === String ? $util.Long.prototype.toString.call(message.votingPower) : options.longs === Number ? new $util.LongBits(message.votingPower.low >>> 0, message.votingPower.high >>> 0).toNumber() : message.votingPower; + return object; + }; + + /** + * Converts this SimpleValidator to JSON. + * @function toJSON + * @memberof tendermint.types.SimpleValidator + * @instance + * @returns {Object.} JSON object + */ + SimpleValidator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SimpleValidator; + })(types.SimpleValidator || {}); + + return types; + })(tendermint.types || {}); + + /** + * Namespace version. + * @memberof tendermint + * @namespace + */ + + tendermint.version = (function(version) { + + version.App = (function(App) { + + /** + * Properties of an App. + * @memberof tendermint.version + * @interface IApp + * @property {number|Long|null} [protocol] App protocol + * @property {string|null} [software] App software + */ + + /** + * Constructs a new App. + * @memberof tendermint.version + * @classdesc Represents an App. + * @implements IApp + * @constructor + * @param {tendermint.version.IApp=} [properties] Properties to set + */ + function App(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * App protocol. + * @member {number|Long} protocol + * @memberof tendermint.version.App + * @instance + */ + App.prototype.protocol = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * App software. + * @member {string} software + * @memberof tendermint.version.App + * @instance + */ + App.prototype.software = ""; + + /** + * Creates a new App instance using the specified properties. + * @function create + * @memberof tendermint.version.App + * @static + * @param {tendermint.version.IApp=} [properties] Properties to set + * @returns {tendermint.version.App} App instance + */ + App.create = function create(properties) { + return new App(properties); + }; + + /** + * Encodes the specified App message. Does not implicitly {@link tendermint.version.App.verify|verify} messages. + * @function encode + * @memberof tendermint.version.App + * @static + * @param {tendermint.version.IApp} message App message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + App.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.protocol != null && Object.hasOwnProperty.call(message, "protocol")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.protocol); + if (message.software != null && Object.hasOwnProperty.call(message, "software")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.software); + return writer; + }; + + /** + * Encodes the specified App message, length delimited. Does not implicitly {@link tendermint.version.App.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.version.App + * @static + * @param {tendermint.version.IApp} message App message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + App.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an App message from the specified reader or buffer. + * @function decode + * @memberof tendermint.version.App + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.version.App} App + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + App.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.version.App(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.protocol = reader.uint64(); + break; + case 2: + message.software = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an App message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.version.App + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.version.App} App + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + App.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an App message. + * @function verify + * @memberof tendermint.version.App + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + App.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.protocol != null && message.hasOwnProperty("protocol")) + if (!$util.isInteger(message.protocol) && !(message.protocol && $util.isInteger(message.protocol.low) && $util.isInteger(message.protocol.high))) + return "protocol: integer|Long expected"; + if (message.software != null && message.hasOwnProperty("software")) + if (!$util.isString(message.software)) + return "software: string expected"; + return null; + }; + + /** + * Creates an App message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.version.App + * @static + * @param {Object.} object Plain object + * @returns {tendermint.version.App} App + */ + App.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.version.App) + return object; + let message = new $root.tendermint.version.App(); + if (object.protocol != null) + if ($util.Long) + (message.protocol = $util.Long.fromValue(object.protocol)).unsigned = true; + else if (typeof object.protocol === "string") + message.protocol = parseInt(object.protocol, 10); + else if (typeof object.protocol === "number") + message.protocol = object.protocol; + else if (typeof object.protocol === "object") + message.protocol = new $util.LongBits(object.protocol.low >>> 0, object.protocol.high >>> 0).toNumber(true); + if (object.software != null) + message.software = String(object.software); + return message; + }; + + /** + * Creates a plain object from an App message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.version.App + * @static + * @param {tendermint.version.App} message App + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + App.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.protocol = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.protocol = options.longs === String ? "0" : 0; + object.software = ""; + } + if (message.protocol != null && message.hasOwnProperty("protocol")) + if (typeof message.protocol === "number") + object.protocol = options.longs === String ? String(message.protocol) : message.protocol; + else + object.protocol = options.longs === String ? $util.Long.prototype.toString.call(message.protocol) : options.longs === Number ? new $util.LongBits(message.protocol.low >>> 0, message.protocol.high >>> 0).toNumber(true) : message.protocol; + if (message.software != null && message.hasOwnProperty("software")) + object.software = message.software; + return object; + }; + + /** + * Converts this App to JSON. + * @function toJSON + * @memberof tendermint.version.App + * @instance + * @returns {Object.} JSON object + */ + App.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return App; + })(version.App || {}); + + version.Consensus = (function(Consensus) { + + /** + * Properties of a Consensus. + * @memberof tendermint.version + * @interface IConsensus + * @property {number|Long|null} [block] Consensus block + * @property {number|Long|null} [app] Consensus app + */ + + /** + * Constructs a new Consensus. + * @memberof tendermint.version + * @classdesc Represents a Consensus. + * @implements IConsensus + * @constructor + * @param {tendermint.version.IConsensus=} [properties] Properties to set + */ + function Consensus(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Consensus block. + * @member {number|Long} block + * @memberof tendermint.version.Consensus + * @instance + */ + Consensus.prototype.block = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Consensus app. + * @member {number|Long} app + * @memberof tendermint.version.Consensus + * @instance + */ + Consensus.prototype.app = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new Consensus instance using the specified properties. + * @function create + * @memberof tendermint.version.Consensus + * @static + * @param {tendermint.version.IConsensus=} [properties] Properties to set + * @returns {tendermint.version.Consensus} Consensus instance + */ + Consensus.create = function create(properties) { + return new Consensus(properties); + }; + + /** + * Encodes the specified Consensus message. Does not implicitly {@link tendermint.version.Consensus.verify|verify} messages. + * @function encode + * @memberof tendermint.version.Consensus + * @static + * @param {tendermint.version.IConsensus} message Consensus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Consensus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.block != null && Object.hasOwnProperty.call(message, "block")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.block); + if (message.app != null && Object.hasOwnProperty.call(message, "app")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.app); + return writer; + }; + + /** + * Encodes the specified Consensus message, length delimited. Does not implicitly {@link tendermint.version.Consensus.verify|verify} messages. + * @function encodeDelimited + * @memberof tendermint.version.Consensus + * @static + * @param {tendermint.version.IConsensus} message Consensus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Consensus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Consensus message from the specified reader or buffer. + * @function decode + * @memberof tendermint.version.Consensus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tendermint.version.Consensus} Consensus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Consensus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.version.Consensus(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.block = reader.uint64(); + break; + case 2: + message.app = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Consensus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tendermint.version.Consensus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tendermint.version.Consensus} Consensus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Consensus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Consensus message. + * @function verify + * @memberof tendermint.version.Consensus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Consensus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.block != null && message.hasOwnProperty("block")) + if (!$util.isInteger(message.block) && !(message.block && $util.isInteger(message.block.low) && $util.isInteger(message.block.high))) + return "block: integer|Long expected"; + if (message.app != null && message.hasOwnProperty("app")) + if (!$util.isInteger(message.app) && !(message.app && $util.isInteger(message.app.low) && $util.isInteger(message.app.high))) + return "app: integer|Long expected"; + return null; + }; + + /** + * Creates a Consensus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tendermint.version.Consensus + * @static + * @param {Object.} object Plain object + * @returns {tendermint.version.Consensus} Consensus + */ + Consensus.fromObject = function fromObject(object) { + if (object instanceof $root.tendermint.version.Consensus) + return object; + let message = new $root.tendermint.version.Consensus(); + if (object.block != null) + if ($util.Long) + (message.block = $util.Long.fromValue(object.block)).unsigned = true; + else if (typeof object.block === "string") + message.block = parseInt(object.block, 10); + else if (typeof object.block === "number") + message.block = object.block; + else if (typeof object.block === "object") + message.block = new $util.LongBits(object.block.low >>> 0, object.block.high >>> 0).toNumber(true); + if (object.app != null) + if ($util.Long) + (message.app = $util.Long.fromValue(object.app)).unsigned = true; + else if (typeof object.app === "string") + message.app = parseInt(object.app, 10); + else if (typeof object.app === "number") + message.app = object.app; + else if (typeof object.app === "object") + message.app = new $util.LongBits(object.app.low >>> 0, object.app.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a Consensus message. Also converts values to other types if specified. + * @function toObject + * @memberof tendermint.version.Consensus + * @static + * @param {tendermint.version.Consensus} message Consensus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Consensus.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.block = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.block = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.app = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.app = options.longs === String ? "0" : 0; + } + if (message.block != null && message.hasOwnProperty("block")) + if (typeof message.block === "number") + object.block = options.longs === String ? String(message.block) : message.block; + else + object.block = options.longs === String ? $util.Long.prototype.toString.call(message.block) : options.longs === Number ? new $util.LongBits(message.block.low >>> 0, message.block.high >>> 0).toNumber(true) : message.block; + if (message.app != null && message.hasOwnProperty("app")) + if (typeof message.app === "number") + object.app = options.longs === String ? String(message.app) : message.app; + else + object.app = options.longs === String ? $util.Long.prototype.toString.call(message.app) : options.longs === Number ? new $util.LongBits(message.app.low >>> 0, message.app.high >>> 0).toNumber(true) : message.app; + return object; + }; + + /** + * Converts this Consensus to JSON. + * @function toJSON + * @memberof tendermint.version.Consensus + * @instance + * @returns {Object.} JSON object + */ + Consensus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Consensus; + })(version.Consensus || {}); + + return version; + })(tendermint.version || {}); + + return tendermint; +})($root.tendermint || {}); + +/** + * Namespace ics23. + * @exports ics23 + * @namespace + */ + +export const ics23 = $root.ics23 = ((ics23) => { + + /** + * HashOp enum. + * @name ics23.HashOp + * @enum {string} + * @property {number} NO_HASH=0 NO_HASH value + * @property {number} SHA256=1 SHA256 value + * @property {number} SHA512=2 SHA512 value + * @property {number} KECCAK=3 KECCAK value + * @property {number} RIPEMD160=4 RIPEMD160 value + * @property {number} BITCOIN=5 BITCOIN value + */ + ics23.HashOp = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NO_HASH"] = 0; + values[valuesById[1] = "SHA256"] = 1; + values[valuesById[2] = "SHA512"] = 2; + values[valuesById[3] = "KECCAK"] = 3; + values[valuesById[4] = "RIPEMD160"] = 4; + values[valuesById[5] = "BITCOIN"] = 5; + return values; + })(); + + /** + * LengthOp defines how to process the key and value of the LeafOp + * to include length information. After encoding the length with the given + * algorithm, the length will be prepended to the key and value bytes. + * (Each one with it's own encoded length) + * @name ics23.LengthOp + * @enum {string} + * @property {number} NO_PREFIX=0 NO_PREFIX value + * @property {number} VAR_PROTO=1 VAR_PROTO value + * @property {number} VAR_RLP=2 VAR_RLP value + * @property {number} FIXED32_BIG=3 FIXED32_BIG value + * @property {number} FIXED32_LITTLE=4 FIXED32_LITTLE value + * @property {number} FIXED64_BIG=5 FIXED64_BIG value + * @property {number} FIXED64_LITTLE=6 FIXED64_LITTLE value + * @property {number} REQUIRE_32_BYTES=7 REQUIRE_32_BYTES value + * @property {number} REQUIRE_64_BYTES=8 REQUIRE_64_BYTES value + */ + ics23.LengthOp = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NO_PREFIX"] = 0; + values[valuesById[1] = "VAR_PROTO"] = 1; + values[valuesById[2] = "VAR_RLP"] = 2; + values[valuesById[3] = "FIXED32_BIG"] = 3; + values[valuesById[4] = "FIXED32_LITTLE"] = 4; + values[valuesById[5] = "FIXED64_BIG"] = 5; + values[valuesById[6] = "FIXED64_LITTLE"] = 6; + values[valuesById[7] = "REQUIRE_32_BYTES"] = 7; + values[valuesById[8] = "REQUIRE_64_BYTES"] = 8; + return values; + })(); + + ics23.ExistenceProof = (function(ExistenceProof) { + + /** + * Properties of an ExistenceProof. + * @memberof ics23 + * @interface IExistenceProof + * @property {Uint8Array|null} [key] ExistenceProof key + * @property {Uint8Array|null} [value] ExistenceProof value + * @property {ics23.ILeafOp|null} [leaf] ExistenceProof leaf + * @property {Array.|null} [path] ExistenceProof path + */ + + /** + * Constructs a new ExistenceProof. + * @memberof ics23 + * @classdesc 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 can + * be compared to the value in a header. + * + * Since it is computationally infeasible to produce a hash collission for any of the used + * cryptographic hash functions, if someone can provide a series of operations to transform + * a given key and value into a root hash that matches some trusted root, these key and values + * must 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 = CHOICE + * and + * prefix = F, key = OOBAR, value = CHOICE + * would produce the same value. + * + * With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field + * in the ProofSpec is valuable to prevent this mutability. And why all trees should + * length-prefix the data before hashing it. + * @implements IExistenceProof + * @constructor + * @param {ics23.IExistenceProof=} [properties] Properties to set + */ + function ExistenceProof(properties) { + this.path = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExistenceProof key. + * @member {Uint8Array} key + * @memberof ics23.ExistenceProof + * @instance + */ + ExistenceProof.prototype.key = $util.newBuffer([]); + + /** + * ExistenceProof value. + * @member {Uint8Array} value + * @memberof ics23.ExistenceProof + * @instance + */ + ExistenceProof.prototype.value = $util.newBuffer([]); + + /** + * ExistenceProof leaf. + * @member {ics23.ILeafOp|null|undefined} leaf + * @memberof ics23.ExistenceProof + * @instance + */ + ExistenceProof.prototype.leaf = null; + + /** + * ExistenceProof path. + * @member {Array.} path + * @memberof ics23.ExistenceProof + * @instance + */ + ExistenceProof.prototype.path = $util.emptyArray; + + /** + * Creates a new ExistenceProof instance using the specified properties. + * @function create + * @memberof ics23.ExistenceProof + * @static + * @param {ics23.IExistenceProof=} [properties] Properties to set + * @returns {ics23.ExistenceProof} ExistenceProof instance + */ + ExistenceProof.create = function create(properties) { + return new ExistenceProof(properties); + }; + + /** + * Encodes the specified ExistenceProof message. Does not implicitly {@link ics23.ExistenceProof.verify|verify} messages. + * @function encode + * @memberof ics23.ExistenceProof + * @static + * @param {ics23.IExistenceProof} message ExistenceProof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExistenceProof.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + if (message.leaf != null && Object.hasOwnProperty.call(message, "leaf")) + $root.ics23.LeafOp.encode(message.leaf, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.path != null && message.path.length) + for (let i = 0; i < message.path.length; ++i) + $root.ics23.InnerOp.encode(message.path[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExistenceProof message, length delimited. Does not implicitly {@link ics23.ExistenceProof.verify|verify} messages. + * @function encodeDelimited + * @memberof ics23.ExistenceProof + * @static + * @param {ics23.IExistenceProof} message ExistenceProof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExistenceProof.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExistenceProof message from the specified reader or buffer. + * @function decode + * @memberof ics23.ExistenceProof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ics23.ExistenceProof} ExistenceProof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExistenceProof.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.ExistenceProof(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + case 3: + message.leaf = $root.ics23.LeafOp.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.path && message.path.length)) + message.path = []; + message.path.push($root.ics23.InnerOp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExistenceProof message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ics23.ExistenceProof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ics23.ExistenceProof} ExistenceProof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExistenceProof.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExistenceProof message. + * @function verify + * @memberof ics23.ExistenceProof + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExistenceProof.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + if (message.leaf != null && message.hasOwnProperty("leaf")) { + let error = $root.ics23.LeafOp.verify(message.leaf); + if (error) + return "leaf." + error; + } + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (let i = 0; i < message.path.length; ++i) { + let error = $root.ics23.InnerOp.verify(message.path[i]); + if (error) + return "path." + error; + } + } + return null; + }; + + /** + * Creates an ExistenceProof message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ics23.ExistenceProof + * @static + * @param {Object.} object Plain object + * @returns {ics23.ExistenceProof} ExistenceProof + */ + ExistenceProof.fromObject = function fromObject(object) { + if (object instanceof $root.ics23.ExistenceProof) + return object; + let message = new $root.ics23.ExistenceProof(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length) + message.key = object.key; + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length) + message.value = object.value; + if (object.leaf != null) { + if (typeof object.leaf !== "object") + throw TypeError(".ics23.ExistenceProof.leaf: object expected"); + message.leaf = $root.ics23.LeafOp.fromObject(object.leaf); + } + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".ics23.ExistenceProof.path: array expected"); + message.path = []; + for (let i = 0; i < object.path.length; ++i) { + if (typeof object.path[i] !== "object") + throw TypeError(".ics23.ExistenceProof.path: object expected"); + message.path[i] = $root.ics23.InnerOp.fromObject(object.path[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExistenceProof message. Also converts values to other types if specified. + * @function toObject + * @memberof ics23.ExistenceProof + * @static + * @param {ics23.ExistenceProof} message ExistenceProof + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExistenceProof.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + object.leaf = null; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + if (message.leaf != null && message.hasOwnProperty("leaf")) + object.leaf = $root.ics23.LeafOp.toObject(message.leaf, options); + if (message.path && message.path.length) { + object.path = []; + for (let j = 0; j < message.path.length; ++j) + object.path[j] = $root.ics23.InnerOp.toObject(message.path[j], options); + } + return object; + }; + + /** + * Converts this ExistenceProof to JSON. + * @function toJSON + * @memberof ics23.ExistenceProof + * @instance + * @returns {Object.} JSON object + */ + ExistenceProof.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExistenceProof; + })(ics23.ExistenceProof || {}); + + ics23.NonExistenceProof = (function(NonExistenceProof) { + + /** + * Properties of a NonExistenceProof. + * @memberof ics23 + * @interface INonExistenceProof + * @property {Uint8Array|null} [key] NonExistenceProof key + * @property {ics23.IExistenceProof|null} [left] NonExistenceProof left + * @property {ics23.IExistenceProof|null} [right] NonExistenceProof right + */ + + /** + * Constructs a new NonExistenceProof. + * @memberof ics23 + * @classdesc Represents a NonExistenceProof. + * @implements INonExistenceProof + * @constructor + * @param {ics23.INonExistenceProof=} [properties] Properties to set + */ + function NonExistenceProof(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NonExistenceProof key. + * @member {Uint8Array} key + * @memberof ics23.NonExistenceProof + * @instance + */ + NonExistenceProof.prototype.key = $util.newBuffer([]); + + /** + * NonExistenceProof left. + * @member {ics23.IExistenceProof|null|undefined} left + * @memberof ics23.NonExistenceProof + * @instance + */ + NonExistenceProof.prototype.left = null; + + /** + * NonExistenceProof right. + * @member {ics23.IExistenceProof|null|undefined} right + * @memberof ics23.NonExistenceProof + * @instance + */ + NonExistenceProof.prototype.right = null; + + /** + * Creates a new NonExistenceProof instance using the specified properties. + * @function create + * @memberof ics23.NonExistenceProof + * @static + * @param {ics23.INonExistenceProof=} [properties] Properties to set + * @returns {ics23.NonExistenceProof} NonExistenceProof instance + */ + NonExistenceProof.create = function create(properties) { + return new NonExistenceProof(properties); + }; + + /** + * Encodes the specified NonExistenceProof message. Does not implicitly {@link ics23.NonExistenceProof.verify|verify} messages. + * @function encode + * @memberof ics23.NonExistenceProof + * @static + * @param {ics23.INonExistenceProof} message NonExistenceProof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NonExistenceProof.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); + if (message.left != null && Object.hasOwnProperty.call(message, "left")) + $root.ics23.ExistenceProof.encode(message.left, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.right != null && Object.hasOwnProperty.call(message, "right")) + $root.ics23.ExistenceProof.encode(message.right, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NonExistenceProof message, length delimited. Does not implicitly {@link ics23.NonExistenceProof.verify|verify} messages. + * @function encodeDelimited + * @memberof ics23.NonExistenceProof + * @static + * @param {ics23.INonExistenceProof} message NonExistenceProof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NonExistenceProof.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NonExistenceProof message from the specified reader or buffer. + * @function decode + * @memberof ics23.NonExistenceProof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ics23.NonExistenceProof} NonExistenceProof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NonExistenceProof.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.NonExistenceProof(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.left = $root.ics23.ExistenceProof.decode(reader, reader.uint32()); + break; + case 3: + message.right = $root.ics23.ExistenceProof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NonExistenceProof message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ics23.NonExistenceProof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ics23.NonExistenceProof} NonExistenceProof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NonExistenceProof.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NonExistenceProof message. + * @function verify + * @memberof ics23.NonExistenceProof + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NonExistenceProof.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + if (message.left != null && message.hasOwnProperty("left")) { + let error = $root.ics23.ExistenceProof.verify(message.left); + if (error) + return "left." + error; + } + if (message.right != null && message.hasOwnProperty("right")) { + let error = $root.ics23.ExistenceProof.verify(message.right); + if (error) + return "right." + error; + } + return null; + }; + + /** + * Creates a NonExistenceProof message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ics23.NonExistenceProof + * @static + * @param {Object.} object Plain object + * @returns {ics23.NonExistenceProof} NonExistenceProof + */ + NonExistenceProof.fromObject = function fromObject(object) { + if (object instanceof $root.ics23.NonExistenceProof) + return object; + let message = new $root.ics23.NonExistenceProof(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length) + message.key = object.key; + if (object.left != null) { + if (typeof object.left !== "object") + throw TypeError(".ics23.NonExistenceProof.left: object expected"); + message.left = $root.ics23.ExistenceProof.fromObject(object.left); + } + if (object.right != null) { + if (typeof object.right !== "object") + throw TypeError(".ics23.NonExistenceProof.right: object expected"); + message.right = $root.ics23.ExistenceProof.fromObject(object.right); + } + return message; + }; + + /** + * Creates a plain object from a NonExistenceProof message. Also converts values to other types if specified. + * @function toObject + * @memberof ics23.NonExistenceProof + * @static + * @param {ics23.NonExistenceProof} message NonExistenceProof + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NonExistenceProof.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + object.left = null; + object.right = null; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.left != null && message.hasOwnProperty("left")) + object.left = $root.ics23.ExistenceProof.toObject(message.left, options); + if (message.right != null && message.hasOwnProperty("right")) + object.right = $root.ics23.ExistenceProof.toObject(message.right, options); + return object; + }; + + /** + * Converts this NonExistenceProof to JSON. + * @function toJSON + * @memberof ics23.NonExistenceProof + * @instance + * @returns {Object.} JSON object + */ + NonExistenceProof.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NonExistenceProof; + })(ics23.NonExistenceProof || {}); + + ics23.CommitmentProof = (function(CommitmentProof) { + + /** + * Properties of a CommitmentProof. + * @memberof ics23 + * @interface ICommitmentProof + * @property {ics23.IExistenceProof|null} [exist] CommitmentProof exist + * @property {ics23.INonExistenceProof|null} [nonexist] CommitmentProof nonexist + * @property {ics23.IBatchProof|null} [batch] CommitmentProof batch + * @property {ics23.ICompressedBatchProof|null} [compressed] CommitmentProof compressed + */ + + /** + * Constructs a new CommitmentProof. + * @memberof ics23 + * @classdesc Represents a CommitmentProof. + * @implements ICommitmentProof + * @constructor + * @param {ics23.ICommitmentProof=} [properties] Properties to set + */ + function CommitmentProof(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommitmentProof exist. + * @member {ics23.IExistenceProof|null|undefined} exist + * @memberof ics23.CommitmentProof + * @instance + */ + CommitmentProof.prototype.exist = null; + + /** + * CommitmentProof nonexist. + * @member {ics23.INonExistenceProof|null|undefined} nonexist + * @memberof ics23.CommitmentProof + * @instance + */ + CommitmentProof.prototype.nonexist = null; + + /** + * CommitmentProof batch. + * @member {ics23.IBatchProof|null|undefined} batch + * @memberof ics23.CommitmentProof + * @instance + */ + CommitmentProof.prototype.batch = null; + + /** + * CommitmentProof compressed. + * @member {ics23.ICompressedBatchProof|null|undefined} compressed + * @memberof ics23.CommitmentProof + * @instance + */ + CommitmentProof.prototype.compressed = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CommitmentProof proof. + * @member {"exist"|"nonexist"|"batch"|"compressed"|undefined} proof + * @memberof ics23.CommitmentProof + * @instance + */ + Object.defineProperty(CommitmentProof.prototype, "proof", { + get: $util.oneOfGetter($oneOfFields = ["exist", "nonexist", "batch", "compressed"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CommitmentProof instance using the specified properties. + * @function create + * @memberof ics23.CommitmentProof + * @static + * @param {ics23.ICommitmentProof=} [properties] Properties to set + * @returns {ics23.CommitmentProof} CommitmentProof instance + */ + CommitmentProof.create = function create(properties) { + return new CommitmentProof(properties); + }; + + /** + * Encodes the specified CommitmentProof message. Does not implicitly {@link ics23.CommitmentProof.verify|verify} messages. + * @function encode + * @memberof ics23.CommitmentProof + * @static + * @param {ics23.ICommitmentProof} message CommitmentProof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitmentProof.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.exist != null && Object.hasOwnProperty.call(message, "exist")) + $root.ics23.ExistenceProof.encode(message.exist, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nonexist != null && Object.hasOwnProperty.call(message, "nonexist")) + $root.ics23.NonExistenceProof.encode(message.nonexist, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.batch != null && Object.hasOwnProperty.call(message, "batch")) + $root.ics23.BatchProof.encode(message.batch, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.compressed != null && Object.hasOwnProperty.call(message, "compressed")) + $root.ics23.CompressedBatchProof.encode(message.compressed, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CommitmentProof message, length delimited. Does not implicitly {@link ics23.CommitmentProof.verify|verify} messages. + * @function encodeDelimited + * @memberof ics23.CommitmentProof + * @static + * @param {ics23.ICommitmentProof} message CommitmentProof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitmentProof.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommitmentProof message from the specified reader or buffer. + * @function decode + * @memberof ics23.CommitmentProof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ics23.CommitmentProof} CommitmentProof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitmentProof.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.CommitmentProof(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exist = $root.ics23.ExistenceProof.decode(reader, reader.uint32()); + break; + case 2: + message.nonexist = $root.ics23.NonExistenceProof.decode(reader, reader.uint32()); + break; + case 3: + message.batch = $root.ics23.BatchProof.decode(reader, reader.uint32()); + break; + case 4: + message.compressed = $root.ics23.CompressedBatchProof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommitmentProof message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ics23.CommitmentProof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ics23.CommitmentProof} CommitmentProof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitmentProof.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommitmentProof message. + * @function verify + * @memberof ics23.CommitmentProof + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommitmentProof.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + let properties = {}; + if (message.exist != null && message.hasOwnProperty("exist")) { + properties.proof = 1; + { + let error = $root.ics23.ExistenceProof.verify(message.exist); + if (error) + return "exist." + error; + } + } + if (message.nonexist != null && message.hasOwnProperty("nonexist")) { + if (properties.proof === 1) + return "proof: multiple values"; + properties.proof = 1; + { + let error = $root.ics23.NonExistenceProof.verify(message.nonexist); + if (error) + return "nonexist." + error; + } + } + if (message.batch != null && message.hasOwnProperty("batch")) { + if (properties.proof === 1) + return "proof: multiple values"; + properties.proof = 1; + { + let error = $root.ics23.BatchProof.verify(message.batch); + if (error) + return "batch." + error; + } + } + if (message.compressed != null && message.hasOwnProperty("compressed")) { + if (properties.proof === 1) + return "proof: multiple values"; + properties.proof = 1; + { + let error = $root.ics23.CompressedBatchProof.verify(message.compressed); + if (error) + return "compressed." + error; + } + } + return null; + }; + + /** + * Creates a CommitmentProof message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ics23.CommitmentProof + * @static + * @param {Object.} object Plain object + * @returns {ics23.CommitmentProof} CommitmentProof + */ + CommitmentProof.fromObject = function fromObject(object) { + if (object instanceof $root.ics23.CommitmentProof) + return object; + let message = new $root.ics23.CommitmentProof(); + if (object.exist != null) { + if (typeof object.exist !== "object") + throw TypeError(".ics23.CommitmentProof.exist: object expected"); + message.exist = $root.ics23.ExistenceProof.fromObject(object.exist); + } + if (object.nonexist != null) { + if (typeof object.nonexist !== "object") + throw TypeError(".ics23.CommitmentProof.nonexist: object expected"); + message.nonexist = $root.ics23.NonExistenceProof.fromObject(object.nonexist); + } + if (object.batch != null) { + if (typeof object.batch !== "object") + throw TypeError(".ics23.CommitmentProof.batch: object expected"); + message.batch = $root.ics23.BatchProof.fromObject(object.batch); + } + if (object.compressed != null) { + if (typeof object.compressed !== "object") + throw TypeError(".ics23.CommitmentProof.compressed: object expected"); + message.compressed = $root.ics23.CompressedBatchProof.fromObject(object.compressed); + } + return message; + }; + + /** + * Creates a plain object from a CommitmentProof message. Also converts values to other types if specified. + * @function toObject + * @memberof ics23.CommitmentProof + * @static + * @param {ics23.CommitmentProof} message CommitmentProof + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommitmentProof.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.exist != null && message.hasOwnProperty("exist")) { + object.exist = $root.ics23.ExistenceProof.toObject(message.exist, options); + if (options.oneofs) + object.proof = "exist"; + } + if (message.nonexist != null && message.hasOwnProperty("nonexist")) { + object.nonexist = $root.ics23.NonExistenceProof.toObject(message.nonexist, options); + if (options.oneofs) + object.proof = "nonexist"; + } + if (message.batch != null && message.hasOwnProperty("batch")) { + object.batch = $root.ics23.BatchProof.toObject(message.batch, options); + if (options.oneofs) + object.proof = "batch"; + } + if (message.compressed != null && message.hasOwnProperty("compressed")) { + object.compressed = $root.ics23.CompressedBatchProof.toObject(message.compressed, options); + if (options.oneofs) + object.proof = "compressed"; + } + return object; + }; + + /** + * Converts this CommitmentProof to JSON. + * @function toJSON + * @memberof ics23.CommitmentProof + * @instance + * @returns {Object.} JSON object + */ + CommitmentProof.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CommitmentProof; + })(ics23.CommitmentProof || {}); + + ics23.LeafOp = (function(LeafOp) { + + /** + * Properties of a LeafOp. + * @memberof ics23 + * @interface ILeafOp + * @property {ics23.HashOp|null} [hash] LeafOp hash + * @property {ics23.HashOp|null} [prehashKey] LeafOp prehashKey + * @property {ics23.HashOp|null} [prehashValue] LeafOp prehashValue + * @property {ics23.LengthOp|null} [length] LeafOp length + * @property {Uint8Array|null} [prefix] LeafOp prefix + */ + + /** + * Constructs a new LeafOp. + * @memberof ics23 + * @classdesc LeafOp represents the raw key-value data we wish to prove, and + * must be flexible to represent the internal transformation from + * the original key-value pairs into the basis hash, for many existing + * merkle trees. + * + * key and value are passed in. So that the signature of this operation is: + * leafOp(key, value) -> output + * + * To 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 it + * output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) + * @implements ILeafOp + * @constructor + * @param {ics23.ILeafOp=} [properties] Properties to set + */ + function LeafOp(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LeafOp hash. + * @member {ics23.HashOp} hash + * @memberof ics23.LeafOp + * @instance + */ + LeafOp.prototype.hash = 0; + + /** + * LeafOp prehashKey. + * @member {ics23.HashOp} prehashKey + * @memberof ics23.LeafOp + * @instance + */ + LeafOp.prototype.prehashKey = 0; + + /** + * LeafOp prehashValue. + * @member {ics23.HashOp} prehashValue + * @memberof ics23.LeafOp + * @instance + */ + LeafOp.prototype.prehashValue = 0; + + /** + * LeafOp length. + * @member {ics23.LengthOp} length + * @memberof ics23.LeafOp + * @instance + */ + LeafOp.prototype.length = 0; + + /** + * LeafOp prefix. + * @member {Uint8Array} prefix + * @memberof ics23.LeafOp + * @instance + */ + LeafOp.prototype.prefix = $util.newBuffer([]); + + /** + * Creates a new LeafOp instance using the specified properties. + * @function create + * @memberof ics23.LeafOp + * @static + * @param {ics23.ILeafOp=} [properties] Properties to set + * @returns {ics23.LeafOp} LeafOp instance + */ + LeafOp.create = function create(properties) { + return new LeafOp(properties); + }; + + /** + * Encodes the specified LeafOp message. Does not implicitly {@link ics23.LeafOp.verify|verify} messages. + * @function encode + * @memberof ics23.LeafOp + * @static + * @param {ics23.ILeafOp} message LeafOp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LeafOp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.hash); + if (message.prehashKey != null && Object.hasOwnProperty.call(message, "prehashKey")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.prehashKey); + if (message.prehashValue != null && Object.hasOwnProperty.call(message, "prehashValue")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.prehashValue); + if (message.length != null && Object.hasOwnProperty.call(message, "length")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.length); + if (message.prefix != null && Object.hasOwnProperty.call(message, "prefix")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.prefix); + return writer; + }; + + /** + * Encodes the specified LeafOp message, length delimited. Does not implicitly {@link ics23.LeafOp.verify|verify} messages. + * @function encodeDelimited + * @memberof ics23.LeafOp + * @static + * @param {ics23.ILeafOp} message LeafOp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LeafOp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LeafOp message from the specified reader or buffer. + * @function decode + * @memberof ics23.LeafOp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ics23.LeafOp} LeafOp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LeafOp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.LeafOp(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.int32(); + break; + case 2: + message.prehashKey = reader.int32(); + break; + case 3: + message.prehashValue = reader.int32(); + break; + case 4: + message.length = reader.int32(); + break; + case 5: + message.prefix = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LeafOp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ics23.LeafOp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ics23.LeafOp} LeafOp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LeafOp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LeafOp message. + * @function verify + * @memberof ics23.LeafOp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LeafOp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + switch (message.hash) { + default: + return "hash: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.prehashKey != null && message.hasOwnProperty("prehashKey")) + switch (message.prehashKey) { + default: + return "prehashKey: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.prehashValue != null && message.hasOwnProperty("prehashValue")) + switch (message.prehashValue) { + default: + return "prehashValue: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.length != null && message.hasOwnProperty("length")) + switch (message.length) { + default: + return "length: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.prefix != null && message.hasOwnProperty("prefix")) + if (!(message.prefix && typeof message.prefix.length === "number" || $util.isString(message.prefix))) + return "prefix: buffer expected"; + return null; + }; + + /** + * Creates a LeafOp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ics23.LeafOp + * @static + * @param {Object.} object Plain object + * @returns {ics23.LeafOp} LeafOp + */ + LeafOp.fromObject = function fromObject(object) { + if (object instanceof $root.ics23.LeafOp) + return object; + let message = new $root.ics23.LeafOp(); + switch (object.hash) { + case "NO_HASH": + case 0: + message.hash = 0; + break; + case "SHA256": + case 1: + message.hash = 1; + break; + case "SHA512": + case 2: + message.hash = 2; + break; + case "KECCAK": + case 3: + message.hash = 3; + break; + case "RIPEMD160": + case 4: + message.hash = 4; + break; + case "BITCOIN": + case 5: + message.hash = 5; + break; + } + switch (object.prehashKey) { + case "NO_HASH": + case 0: + message.prehashKey = 0; + break; + case "SHA256": + case 1: + message.prehashKey = 1; + break; + case "SHA512": + case 2: + message.prehashKey = 2; + break; + case "KECCAK": + case 3: + message.prehashKey = 3; + break; + case "RIPEMD160": + case 4: + message.prehashKey = 4; + break; + case "BITCOIN": + case 5: + message.prehashKey = 5; + break; + } + switch (object.prehashValue) { + case "NO_HASH": + case 0: + message.prehashValue = 0; + break; + case "SHA256": + case 1: + message.prehashValue = 1; + break; + case "SHA512": + case 2: + message.prehashValue = 2; + break; + case "KECCAK": + case 3: + message.prehashValue = 3; + break; + case "RIPEMD160": + case 4: + message.prehashValue = 4; + break; + case "BITCOIN": + case 5: + message.prehashValue = 5; + break; + } + switch (object.length) { + case "NO_PREFIX": + case 0: + message.length = 0; + break; + case "VAR_PROTO": + case 1: + message.length = 1; + break; + case "VAR_RLP": + case 2: + message.length = 2; + break; + case "FIXED32_BIG": + case 3: + message.length = 3; + break; + case "FIXED32_LITTLE": + case 4: + message.length = 4; + break; + case "FIXED64_BIG": + case 5: + message.length = 5; + break; + case "FIXED64_LITTLE": + case 6: + message.length = 6; + break; + case "REQUIRE_32_BYTES": + case 7: + message.length = 7; + break; + case "REQUIRE_64_BYTES": + case 8: + message.length = 8; + break; + } + if (object.prefix != null) + if (typeof object.prefix === "string") + $util.base64.decode(object.prefix, message.prefix = $util.newBuffer($util.base64.length(object.prefix)), 0); + else if (object.prefix.length) + message.prefix = object.prefix; + return message; + }; + + /** + * Creates a plain object from a LeafOp message. Also converts values to other types if specified. + * @function toObject + * @memberof ics23.LeafOp + * @static + * @param {ics23.LeafOp} message LeafOp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LeafOp.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.hash = options.enums === String ? "NO_HASH" : 0; + object.prehashKey = options.enums === String ? "NO_HASH" : 0; + object.prehashValue = options.enums === String ? "NO_HASH" : 0; + object.length = options.enums === String ? "NO_PREFIX" : 0; + if (options.bytes === String) + object.prefix = ""; + else { + object.prefix = []; + if (options.bytes !== Array) + object.prefix = $util.newBuffer(object.prefix); + } + } + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = options.enums === String ? $root.ics23.HashOp[message.hash] : message.hash; + if (message.prehashKey != null && message.hasOwnProperty("prehashKey")) + object.prehashKey = options.enums === String ? $root.ics23.HashOp[message.prehashKey] : message.prehashKey; + if (message.prehashValue != null && message.hasOwnProperty("prehashValue")) + object.prehashValue = options.enums === String ? $root.ics23.HashOp[message.prehashValue] : message.prehashValue; + if (message.length != null && message.hasOwnProperty("length")) + object.length = options.enums === String ? $root.ics23.LengthOp[message.length] : message.length; + if (message.prefix != null && message.hasOwnProperty("prefix")) + object.prefix = options.bytes === String ? $util.base64.encode(message.prefix, 0, message.prefix.length) : options.bytes === Array ? Array.prototype.slice.call(message.prefix) : message.prefix; + return object; + }; + + /** + * Converts this LeafOp to JSON. + * @function toJSON + * @memberof ics23.LeafOp + * @instance + * @returns {Object.} JSON object + */ + LeafOp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LeafOp; + })(ics23.LeafOp || {}); + + ics23.InnerOp = (function(InnerOp) { + + /** + * Properties of an InnerOp. + * @memberof ics23 + * @interface IInnerOp + * @property {ics23.HashOp|null} [hash] InnerOp hash + * @property {Uint8Array|null} [prefix] InnerOp prefix + * @property {Uint8Array|null} [suffix] InnerOp suffix + */ + + /** + * Constructs a new InnerOp. + * @memberof ics23 + * @classdesc 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) -> output + * + * The 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 with + * some 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 + * @implements IInnerOp + * @constructor + * @param {ics23.IInnerOp=} [properties] Properties to set + */ + function InnerOp(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InnerOp hash. + * @member {ics23.HashOp} hash + * @memberof ics23.InnerOp + * @instance + */ + InnerOp.prototype.hash = 0; + + /** + * InnerOp prefix. + * @member {Uint8Array} prefix + * @memberof ics23.InnerOp + * @instance + */ + InnerOp.prototype.prefix = $util.newBuffer([]); + + /** + * InnerOp suffix. + * @member {Uint8Array} suffix + * @memberof ics23.InnerOp + * @instance + */ + InnerOp.prototype.suffix = $util.newBuffer([]); + + /** + * Creates a new InnerOp instance using the specified properties. + * @function create + * @memberof ics23.InnerOp + * @static + * @param {ics23.IInnerOp=} [properties] Properties to set + * @returns {ics23.InnerOp} InnerOp instance + */ + InnerOp.create = function create(properties) { + return new InnerOp(properties); + }; + + /** + * Encodes the specified InnerOp message. Does not implicitly {@link ics23.InnerOp.verify|verify} messages. + * @function encode + * @memberof ics23.InnerOp + * @static + * @param {ics23.IInnerOp} message InnerOp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InnerOp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.hash); + if (message.prefix != null && Object.hasOwnProperty.call(message, "prefix")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.prefix); + if (message.suffix != null && Object.hasOwnProperty.call(message, "suffix")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.suffix); + return writer; + }; + + /** + * Encodes the specified InnerOp message, length delimited. Does not implicitly {@link ics23.InnerOp.verify|verify} messages. + * @function encodeDelimited + * @memberof ics23.InnerOp + * @static + * @param {ics23.IInnerOp} message InnerOp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InnerOp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InnerOp message from the specified reader or buffer. + * @function decode + * @memberof ics23.InnerOp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ics23.InnerOp} InnerOp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InnerOp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.InnerOp(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.int32(); + break; + case 2: + message.prefix = reader.bytes(); + break; + case 3: + message.suffix = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InnerOp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ics23.InnerOp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ics23.InnerOp} InnerOp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InnerOp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InnerOp message. + * @function verify + * @memberof ics23.InnerOp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InnerOp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + switch (message.hash) { + default: + return "hash: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.prefix != null && message.hasOwnProperty("prefix")) + if (!(message.prefix && typeof message.prefix.length === "number" || $util.isString(message.prefix))) + return "prefix: buffer expected"; + if (message.suffix != null && message.hasOwnProperty("suffix")) + if (!(message.suffix && typeof message.suffix.length === "number" || $util.isString(message.suffix))) + return "suffix: buffer expected"; + return null; + }; + + /** + * Creates an InnerOp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ics23.InnerOp + * @static + * @param {Object.} object Plain object + * @returns {ics23.InnerOp} InnerOp + */ + InnerOp.fromObject = function fromObject(object) { + if (object instanceof $root.ics23.InnerOp) + return object; + let message = new $root.ics23.InnerOp(); + switch (object.hash) { + case "NO_HASH": + case 0: + message.hash = 0; + break; + case "SHA256": + case 1: + message.hash = 1; + break; + case "SHA512": + case 2: + message.hash = 2; + break; + case "KECCAK": + case 3: + message.hash = 3; + break; + case "RIPEMD160": + case 4: + message.hash = 4; + break; + case "BITCOIN": + case 5: + message.hash = 5; + break; + } + if (object.prefix != null) + if (typeof object.prefix === "string") + $util.base64.decode(object.prefix, message.prefix = $util.newBuffer($util.base64.length(object.prefix)), 0); + else if (object.prefix.length) + message.prefix = object.prefix; + if (object.suffix != null) + if (typeof object.suffix === "string") + $util.base64.decode(object.suffix, message.suffix = $util.newBuffer($util.base64.length(object.suffix)), 0); + else if (object.suffix.length) + message.suffix = object.suffix; + return message; + }; + + /** + * Creates a plain object from an InnerOp message. Also converts values to other types if specified. + * @function toObject + * @memberof ics23.InnerOp + * @static + * @param {ics23.InnerOp} message InnerOp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InnerOp.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.hash = options.enums === String ? "NO_HASH" : 0; + if (options.bytes === String) + object.prefix = ""; + else { + object.prefix = []; + if (options.bytes !== Array) + object.prefix = $util.newBuffer(object.prefix); + } + if (options.bytes === String) + object.suffix = ""; + else { + object.suffix = []; + if (options.bytes !== Array) + object.suffix = $util.newBuffer(object.suffix); + } + } + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = options.enums === String ? $root.ics23.HashOp[message.hash] : message.hash; + if (message.prefix != null && message.hasOwnProperty("prefix")) + object.prefix = options.bytes === String ? $util.base64.encode(message.prefix, 0, message.prefix.length) : options.bytes === Array ? Array.prototype.slice.call(message.prefix) : message.prefix; + if (message.suffix != null && message.hasOwnProperty("suffix")) + object.suffix = options.bytes === String ? $util.base64.encode(message.suffix, 0, message.suffix.length) : options.bytes === Array ? Array.prototype.slice.call(message.suffix) : message.suffix; + return object; + }; + + /** + * Converts this InnerOp to JSON. + * @function toJSON + * @memberof ics23.InnerOp + * @instance + * @returns {Object.} JSON object + */ + InnerOp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InnerOp; + })(ics23.InnerOp || {}); + + ics23.ProofSpec = (function(ProofSpec) { + + /** + * Properties of a ProofSpec. + * @memberof ics23 + * @interface IProofSpec + * @property {ics23.ILeafOp|null} [leafSpec] ProofSpec leafSpec + * @property {ics23.IInnerSpec|null} [innerSpec] ProofSpec innerSpec + * @property {number|null} [maxDepth] ProofSpec maxDepth + * @property {number|null} [minDepth] ProofSpec minDepth + */ + + /** + * Constructs a new ProofSpec. + * @memberof ics23 + * @classdesc 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 | Error + * + * As demonstrated in tests, if we don't fix the algorithm used to calculate the + * LeafHash for a given tree, there are many possible key-value pairs that can + * generate a given hash (by interpretting the preimage differently). + * We need this for proper security, requires client knows a priori what + * tree format server uses. But not in code, rather a configuration object. + * @implements IProofSpec + * @constructor + * @param {ics23.IProofSpec=} [properties] Properties to set + */ + function ProofSpec(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProofSpec leafSpec. + * @member {ics23.ILeafOp|null|undefined} leafSpec + * @memberof ics23.ProofSpec + * @instance + */ + ProofSpec.prototype.leafSpec = null; + + /** + * ProofSpec innerSpec. + * @member {ics23.IInnerSpec|null|undefined} innerSpec + * @memberof ics23.ProofSpec + * @instance + */ + ProofSpec.prototype.innerSpec = null; + + /** + * ProofSpec maxDepth. + * @member {number} maxDepth + * @memberof ics23.ProofSpec + * @instance + */ + ProofSpec.prototype.maxDepth = 0; + + /** + * ProofSpec minDepth. + * @member {number} minDepth + * @memberof ics23.ProofSpec + * @instance + */ + ProofSpec.prototype.minDepth = 0; + + /** + * Creates a new ProofSpec instance using the specified properties. + * @function create + * @memberof ics23.ProofSpec + * @static + * @param {ics23.IProofSpec=} [properties] Properties to set + * @returns {ics23.ProofSpec} ProofSpec instance + */ + ProofSpec.create = function create(properties) { + return new ProofSpec(properties); + }; + + /** + * Encodes the specified ProofSpec message. Does not implicitly {@link ics23.ProofSpec.verify|verify} messages. + * @function encode + * @memberof ics23.ProofSpec + * @static + * @param {ics23.IProofSpec} message ProofSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProofSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.leafSpec != null && Object.hasOwnProperty.call(message, "leafSpec")) + $root.ics23.LeafOp.encode(message.leafSpec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.innerSpec != null && Object.hasOwnProperty.call(message, "innerSpec")) + $root.ics23.InnerSpec.encode(message.innerSpec, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.maxDepth != null && Object.hasOwnProperty.call(message, "maxDepth")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxDepth); + if (message.minDepth != null && Object.hasOwnProperty.call(message, "minDepth")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minDepth); + return writer; + }; + + /** + * Encodes the specified ProofSpec message, length delimited. Does not implicitly {@link ics23.ProofSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof ics23.ProofSpec + * @static + * @param {ics23.IProofSpec} message ProofSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProofSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProofSpec message from the specified reader or buffer. + * @function decode + * @memberof ics23.ProofSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ics23.ProofSpec} ProofSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProofSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.ProofSpec(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.leafSpec = $root.ics23.LeafOp.decode(reader, reader.uint32()); + break; + case 2: + message.innerSpec = $root.ics23.InnerSpec.decode(reader, reader.uint32()); + break; + case 3: + message.maxDepth = reader.int32(); + break; + case 4: + message.minDepth = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProofSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ics23.ProofSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ics23.ProofSpec} ProofSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProofSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProofSpec message. + * @function verify + * @memberof ics23.ProofSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProofSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.leafSpec != null && message.hasOwnProperty("leafSpec")) { + let error = $root.ics23.LeafOp.verify(message.leafSpec); + if (error) + return "leafSpec." + error; + } + if (message.innerSpec != null && message.hasOwnProperty("innerSpec")) { + let error = $root.ics23.InnerSpec.verify(message.innerSpec); + if (error) + return "innerSpec." + error; + } + if (message.maxDepth != null && message.hasOwnProperty("maxDepth")) + if (!$util.isInteger(message.maxDepth)) + return "maxDepth: integer expected"; + if (message.minDepth != null && message.hasOwnProperty("minDepth")) + if (!$util.isInteger(message.minDepth)) + return "minDepth: integer expected"; + return null; + }; + + /** + * Creates a ProofSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ics23.ProofSpec + * @static + * @param {Object.} object Plain object + * @returns {ics23.ProofSpec} ProofSpec + */ + ProofSpec.fromObject = function fromObject(object) { + if (object instanceof $root.ics23.ProofSpec) + return object; + let message = new $root.ics23.ProofSpec(); + if (object.leafSpec != null) { + if (typeof object.leafSpec !== "object") + throw TypeError(".ics23.ProofSpec.leafSpec: object expected"); + message.leafSpec = $root.ics23.LeafOp.fromObject(object.leafSpec); + } + if (object.innerSpec != null) { + if (typeof object.innerSpec !== "object") + throw TypeError(".ics23.ProofSpec.innerSpec: object expected"); + message.innerSpec = $root.ics23.InnerSpec.fromObject(object.innerSpec); + } + if (object.maxDepth != null) + message.maxDepth = object.maxDepth | 0; + if (object.minDepth != null) + message.minDepth = object.minDepth | 0; + return message; + }; + + /** + * Creates a plain object from a ProofSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof ics23.ProofSpec + * @static + * @param {ics23.ProofSpec} message ProofSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProofSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.leafSpec = null; + object.innerSpec = null; + object.maxDepth = 0; + object.minDepth = 0; + } + if (message.leafSpec != null && message.hasOwnProperty("leafSpec")) + object.leafSpec = $root.ics23.LeafOp.toObject(message.leafSpec, options); + if (message.innerSpec != null && message.hasOwnProperty("innerSpec")) + object.innerSpec = $root.ics23.InnerSpec.toObject(message.innerSpec, options); + if (message.maxDepth != null && message.hasOwnProperty("maxDepth")) + object.maxDepth = message.maxDepth; + if (message.minDepth != null && message.hasOwnProperty("minDepth")) + object.minDepth = message.minDepth; + return object; + }; + + /** + * Converts this ProofSpec to JSON. + * @function toJSON + * @memberof ics23.ProofSpec + * @instance + * @returns {Object.} JSON object + */ + ProofSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ProofSpec; + })(ics23.ProofSpec || {}); + + ics23.InnerSpec = (function(InnerSpec) { + + /** + * Properties of an InnerSpec. + * @memberof ics23 + * @interface IInnerSpec + * @property {Array.|null} [childOrder] InnerSpec childOrder + * @property {number|null} [childSize] InnerSpec childSize + * @property {number|null} [minPrefixLength] InnerSpec minPrefixLength + * @property {number|null} [maxPrefixLength] InnerSpec maxPrefixLength + * @property {Uint8Array|null} [emptyChild] InnerSpec emptyChild + * @property {ics23.HashOp|null} [hash] InnerSpec hash + */ + + /** + * Constructs a new InnerSpec. + * @memberof ics23 + * @classdesc Represents an InnerSpec. + * @implements IInnerSpec + * @constructor + * @param {ics23.IInnerSpec=} [properties] Properties to set + */ + function InnerSpec(properties) { + this.childOrder = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InnerSpec childOrder. + * @member {Array.} childOrder + * @memberof ics23.InnerSpec + * @instance + */ + InnerSpec.prototype.childOrder = $util.emptyArray; + + /** + * InnerSpec childSize. + * @member {number} childSize + * @memberof ics23.InnerSpec + * @instance + */ + InnerSpec.prototype.childSize = 0; + + /** + * InnerSpec minPrefixLength. + * @member {number} minPrefixLength + * @memberof ics23.InnerSpec + * @instance + */ + InnerSpec.prototype.minPrefixLength = 0; + + /** + * InnerSpec maxPrefixLength. + * @member {number} maxPrefixLength + * @memberof ics23.InnerSpec + * @instance + */ + InnerSpec.prototype.maxPrefixLength = 0; + + /** + * InnerSpec emptyChild. + * @member {Uint8Array} emptyChild + * @memberof ics23.InnerSpec + * @instance + */ + InnerSpec.prototype.emptyChild = $util.newBuffer([]); + + /** + * InnerSpec hash. + * @member {ics23.HashOp} hash + * @memberof ics23.InnerSpec + * @instance + */ + InnerSpec.prototype.hash = 0; + + /** + * Creates a new InnerSpec instance using the specified properties. + * @function create + * @memberof ics23.InnerSpec + * @static + * @param {ics23.IInnerSpec=} [properties] Properties to set + * @returns {ics23.InnerSpec} InnerSpec instance + */ + InnerSpec.create = function create(properties) { + return new InnerSpec(properties); + }; + + /** + * Encodes the specified InnerSpec message. Does not implicitly {@link ics23.InnerSpec.verify|verify} messages. + * @function encode + * @memberof ics23.InnerSpec + * @static + * @param {ics23.IInnerSpec} message InnerSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InnerSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.childOrder != null && message.childOrder.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (let i = 0; i < message.childOrder.length; ++i) + writer.int32(message.childOrder[i]); + writer.ldelim(); + } + if (message.childSize != null && Object.hasOwnProperty.call(message, "childSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.childSize); + if (message.minPrefixLength != null && Object.hasOwnProperty.call(message, "minPrefixLength")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.minPrefixLength); + if (message.maxPrefixLength != null && Object.hasOwnProperty.call(message, "maxPrefixLength")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.maxPrefixLength); + if (message.emptyChild != null && Object.hasOwnProperty.call(message, "emptyChild")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.emptyChild); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.hash); + return writer; + }; + + /** + * Encodes the specified InnerSpec message, length delimited. Does not implicitly {@link ics23.InnerSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof ics23.InnerSpec + * @static + * @param {ics23.IInnerSpec} message InnerSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InnerSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InnerSpec message from the specified reader or buffer. + * @function decode + * @memberof ics23.InnerSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ics23.InnerSpec} InnerSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InnerSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.InnerSpec(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.childOrder && message.childOrder.length)) + message.childOrder = []; + if ((tag & 7) === 2) { + let end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.childOrder.push(reader.int32()); + } else + message.childOrder.push(reader.int32()); + break; + case 2: + message.childSize = reader.int32(); + break; + case 3: + message.minPrefixLength = reader.int32(); + break; + case 4: + message.maxPrefixLength = reader.int32(); + break; + case 5: + message.emptyChild = reader.bytes(); + break; + case 6: + message.hash = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InnerSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ics23.InnerSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ics23.InnerSpec} InnerSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InnerSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InnerSpec message. + * @function verify + * @memberof ics23.InnerSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InnerSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.childOrder != null && message.hasOwnProperty("childOrder")) { + if (!Array.isArray(message.childOrder)) + return "childOrder: array expected"; + for (let i = 0; i < message.childOrder.length; ++i) + if (!$util.isInteger(message.childOrder[i])) + return "childOrder: integer[] expected"; + } + if (message.childSize != null && message.hasOwnProperty("childSize")) + if (!$util.isInteger(message.childSize)) + return "childSize: integer expected"; + if (message.minPrefixLength != null && message.hasOwnProperty("minPrefixLength")) + if (!$util.isInteger(message.minPrefixLength)) + return "minPrefixLength: integer expected"; + if (message.maxPrefixLength != null && message.hasOwnProperty("maxPrefixLength")) + if (!$util.isInteger(message.maxPrefixLength)) + return "maxPrefixLength: integer expected"; + if (message.emptyChild != null && message.hasOwnProperty("emptyChild")) + if (!(message.emptyChild && typeof message.emptyChild.length === "number" || $util.isString(message.emptyChild))) + return "emptyChild: buffer expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + switch (message.hash) { + default: + return "hash: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates an InnerSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ics23.InnerSpec + * @static + * @param {Object.} object Plain object + * @returns {ics23.InnerSpec} InnerSpec + */ + InnerSpec.fromObject = function fromObject(object) { + if (object instanceof $root.ics23.InnerSpec) + return object; + let message = new $root.ics23.InnerSpec(); + if (object.childOrder) { + if (!Array.isArray(object.childOrder)) + throw TypeError(".ics23.InnerSpec.childOrder: array expected"); + message.childOrder = []; + for (let i = 0; i < object.childOrder.length; ++i) + message.childOrder[i] = object.childOrder[i] | 0; + } + if (object.childSize != null) + message.childSize = object.childSize | 0; + if (object.minPrefixLength != null) + message.minPrefixLength = object.minPrefixLength | 0; + if (object.maxPrefixLength != null) + message.maxPrefixLength = object.maxPrefixLength | 0; + if (object.emptyChild != null) + if (typeof object.emptyChild === "string") + $util.base64.decode(object.emptyChild, message.emptyChild = $util.newBuffer($util.base64.length(object.emptyChild)), 0); + else if (object.emptyChild.length) + message.emptyChild = object.emptyChild; + switch (object.hash) { + case "NO_HASH": + case 0: + message.hash = 0; + break; + case "SHA256": + case 1: + message.hash = 1; + break; + case "SHA512": + case 2: + message.hash = 2; + break; + case "KECCAK": + case 3: + message.hash = 3; + break; + case "RIPEMD160": + case 4: + message.hash = 4; + break; + case "BITCOIN": + case 5: + message.hash = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from an InnerSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof ics23.InnerSpec + * @static + * @param {ics23.InnerSpec} message InnerSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InnerSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.childOrder = []; + if (options.defaults) { + object.childSize = 0; + object.minPrefixLength = 0; + object.maxPrefixLength = 0; + if (options.bytes === String) + object.emptyChild = ""; + else { + object.emptyChild = []; + if (options.bytes !== Array) + object.emptyChild = $util.newBuffer(object.emptyChild); + } + object.hash = options.enums === String ? "NO_HASH" : 0; + } + if (message.childOrder && message.childOrder.length) { + object.childOrder = []; + for (let j = 0; j < message.childOrder.length; ++j) + object.childOrder[j] = message.childOrder[j]; + } + if (message.childSize != null && message.hasOwnProperty("childSize")) + object.childSize = message.childSize; + if (message.minPrefixLength != null && message.hasOwnProperty("minPrefixLength")) + object.minPrefixLength = message.minPrefixLength; + if (message.maxPrefixLength != null && message.hasOwnProperty("maxPrefixLength")) + object.maxPrefixLength = message.maxPrefixLength; + if (message.emptyChild != null && message.hasOwnProperty("emptyChild")) + object.emptyChild = options.bytes === String ? $util.base64.encode(message.emptyChild, 0, message.emptyChild.length) : options.bytes === Array ? Array.prototype.slice.call(message.emptyChild) : message.emptyChild; + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = options.enums === String ? $root.ics23.HashOp[message.hash] : message.hash; + return object; + }; + + /** + * Converts this InnerSpec to JSON. + * @function toJSON + * @memberof ics23.InnerSpec + * @instance + * @returns {Object.} JSON object + */ + InnerSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InnerSpec; + })(ics23.InnerSpec || {}); + + ics23.BatchProof = (function(BatchProof) { + + /** + * Properties of a BatchProof. + * @memberof ics23 + * @interface IBatchProof + * @property {Array.|null} [entries] BatchProof entries + */ + + /** + * Constructs a new BatchProof. + * @memberof ics23 + * @classdesc Represents a BatchProof. + * @implements IBatchProof + * @constructor + * @param {ics23.IBatchProof=} [properties] Properties to set + */ + function BatchProof(properties) { + this.entries = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchProof entries. + * @member {Array.} entries + * @memberof ics23.BatchProof + * @instance + */ + BatchProof.prototype.entries = $util.emptyArray; + + /** + * Creates a new BatchProof instance using the specified properties. + * @function create + * @memberof ics23.BatchProof + * @static + * @param {ics23.IBatchProof=} [properties] Properties to set + * @returns {ics23.BatchProof} BatchProof instance + */ + BatchProof.create = function create(properties) { + return new BatchProof(properties); + }; + + /** + * Encodes the specified BatchProof message. Does not implicitly {@link ics23.BatchProof.verify|verify} messages. + * @function encode + * @memberof ics23.BatchProof + * @static + * @param {ics23.IBatchProof} message BatchProof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchProof.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entries != null && message.entries.length) + for (let i = 0; i < message.entries.length; ++i) + $root.ics23.BatchEntry.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchProof message, length delimited. Does not implicitly {@link ics23.BatchProof.verify|verify} messages. + * @function encodeDelimited + * @memberof ics23.BatchProof + * @static + * @param {ics23.IBatchProof} message BatchProof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchProof.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchProof message from the specified reader or buffer. + * @function decode + * @memberof ics23.BatchProof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ics23.BatchProof} BatchProof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchProof.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.BatchProof(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.ics23.BatchEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchProof message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ics23.BatchProof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ics23.BatchProof} BatchProof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchProof.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchProof message. + * @function verify + * @memberof ics23.BatchProof + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchProof.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (let i = 0; i < message.entries.length; ++i) { + let error = $root.ics23.BatchEntry.verify(message.entries[i]); + if (error) + return "entries." + error; + } + } + return null; + }; + + /** + * Creates a BatchProof message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ics23.BatchProof + * @static + * @param {Object.} object Plain object + * @returns {ics23.BatchProof} BatchProof + */ + BatchProof.fromObject = function fromObject(object) { + if (object instanceof $root.ics23.BatchProof) + return object; + let message = new $root.ics23.BatchProof(); + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".ics23.BatchProof.entries: array expected"); + message.entries = []; + for (let i = 0; i < object.entries.length; ++i) { + if (typeof object.entries[i] !== "object") + throw TypeError(".ics23.BatchProof.entries: object expected"); + message.entries[i] = $root.ics23.BatchEntry.fromObject(object.entries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchProof message. Also converts values to other types if specified. + * @function toObject + * @memberof ics23.BatchProof + * @static + * @param {ics23.BatchProof} message BatchProof + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchProof.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (message.entries && message.entries.length) { + object.entries = []; + for (let j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.ics23.BatchEntry.toObject(message.entries[j], options); + } + return object; + }; + + /** + * Converts this BatchProof to JSON. + * @function toJSON + * @memberof ics23.BatchProof + * @instance + * @returns {Object.} JSON object + */ + BatchProof.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchProof; + })(ics23.BatchProof || {}); + + ics23.BatchEntry = (function(BatchEntry) { + + /** + * Properties of a BatchEntry. + * @memberof ics23 + * @interface IBatchEntry + * @property {ics23.IExistenceProof|null} [exist] BatchEntry exist + * @property {ics23.INonExistenceProof|null} [nonexist] BatchEntry nonexist + */ + + /** + * Constructs a new BatchEntry. + * @memberof ics23 + * @classdesc Represents a BatchEntry. + * @implements IBatchEntry + * @constructor + * @param {ics23.IBatchEntry=} [properties] Properties to set + */ + function BatchEntry(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchEntry exist. + * @member {ics23.IExistenceProof|null|undefined} exist + * @memberof ics23.BatchEntry + * @instance + */ + BatchEntry.prototype.exist = null; + + /** + * BatchEntry nonexist. + * @member {ics23.INonExistenceProof|null|undefined} nonexist + * @memberof ics23.BatchEntry + * @instance + */ + BatchEntry.prototype.nonexist = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * BatchEntry proof. + * @member {"exist"|"nonexist"|undefined} proof + * @memberof ics23.BatchEntry + * @instance + */ + Object.defineProperty(BatchEntry.prototype, "proof", { + get: $util.oneOfGetter($oneOfFields = ["exist", "nonexist"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BatchEntry instance using the specified properties. + * @function create + * @memberof ics23.BatchEntry + * @static + * @param {ics23.IBatchEntry=} [properties] Properties to set + * @returns {ics23.BatchEntry} BatchEntry instance + */ + BatchEntry.create = function create(properties) { + return new BatchEntry(properties); + }; + + /** + * Encodes the specified BatchEntry message. Does not implicitly {@link ics23.BatchEntry.verify|verify} messages. + * @function encode + * @memberof ics23.BatchEntry + * @static + * @param {ics23.IBatchEntry} message BatchEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.exist != null && Object.hasOwnProperty.call(message, "exist")) + $root.ics23.ExistenceProof.encode(message.exist, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nonexist != null && Object.hasOwnProperty.call(message, "nonexist")) + $root.ics23.NonExistenceProof.encode(message.nonexist, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchEntry message, length delimited. Does not implicitly {@link ics23.BatchEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof ics23.BatchEntry + * @static + * @param {ics23.IBatchEntry} message BatchEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchEntry message from the specified reader or buffer. + * @function decode + * @memberof ics23.BatchEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ics23.BatchEntry} BatchEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.BatchEntry(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exist = $root.ics23.ExistenceProof.decode(reader, reader.uint32()); + break; + case 2: + message.nonexist = $root.ics23.NonExistenceProof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ics23.BatchEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ics23.BatchEntry} BatchEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchEntry message. + * @function verify + * @memberof ics23.BatchEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + let properties = {}; + if (message.exist != null && message.hasOwnProperty("exist")) { + properties.proof = 1; + { + let error = $root.ics23.ExistenceProof.verify(message.exist); + if (error) + return "exist." + error; + } + } + if (message.nonexist != null && message.hasOwnProperty("nonexist")) { + if (properties.proof === 1) + return "proof: multiple values"; + properties.proof = 1; + { + let error = $root.ics23.NonExistenceProof.verify(message.nonexist); + if (error) + return "nonexist." + error; + } + } + return null; + }; + + /** + * Creates a BatchEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ics23.BatchEntry + * @static + * @param {Object.} object Plain object + * @returns {ics23.BatchEntry} BatchEntry + */ + BatchEntry.fromObject = function fromObject(object) { + if (object instanceof $root.ics23.BatchEntry) + return object; + let message = new $root.ics23.BatchEntry(); + if (object.exist != null) { + if (typeof object.exist !== "object") + throw TypeError(".ics23.BatchEntry.exist: object expected"); + message.exist = $root.ics23.ExistenceProof.fromObject(object.exist); + } + if (object.nonexist != null) { + if (typeof object.nonexist !== "object") + throw TypeError(".ics23.BatchEntry.nonexist: object expected"); + message.nonexist = $root.ics23.NonExistenceProof.fromObject(object.nonexist); + } + return message; + }; + + /** + * Creates a plain object from a BatchEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof ics23.BatchEntry + * @static + * @param {ics23.BatchEntry} message BatchEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.exist != null && message.hasOwnProperty("exist")) { + object.exist = $root.ics23.ExistenceProof.toObject(message.exist, options); + if (options.oneofs) + object.proof = "exist"; + } + if (message.nonexist != null && message.hasOwnProperty("nonexist")) { + object.nonexist = $root.ics23.NonExistenceProof.toObject(message.nonexist, options); + if (options.oneofs) + object.proof = "nonexist"; + } + return object; + }; + + /** + * Converts this BatchEntry to JSON. + * @function toJSON + * @memberof ics23.BatchEntry + * @instance + * @returns {Object.} JSON object + */ + BatchEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchEntry; + })(ics23.BatchEntry || {}); + + ics23.CompressedBatchProof = (function(CompressedBatchProof) { + + /** + * Properties of a CompressedBatchProof. + * @memberof ics23 + * @interface ICompressedBatchProof + * @property {Array.|null} [entries] CompressedBatchProof entries + * @property {Array.|null} [lookupInners] CompressedBatchProof lookupInners + */ + + /** + * Constructs a new CompressedBatchProof. + * @memberof ics23 + * @classdesc Represents a CompressedBatchProof. + * @implements ICompressedBatchProof + * @constructor + * @param {ics23.ICompressedBatchProof=} [properties] Properties to set + */ + function CompressedBatchProof(properties) { + this.entries = []; + this.lookupInners = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompressedBatchProof entries. + * @member {Array.} entries + * @memberof ics23.CompressedBatchProof + * @instance + */ + CompressedBatchProof.prototype.entries = $util.emptyArray; + + /** + * CompressedBatchProof lookupInners. + * @member {Array.} lookupInners + * @memberof ics23.CompressedBatchProof + * @instance + */ + CompressedBatchProof.prototype.lookupInners = $util.emptyArray; + + /** + * Creates a new CompressedBatchProof instance using the specified properties. + * @function create + * @memberof ics23.CompressedBatchProof + * @static + * @param {ics23.ICompressedBatchProof=} [properties] Properties to set + * @returns {ics23.CompressedBatchProof} CompressedBatchProof instance + */ + CompressedBatchProof.create = function create(properties) { + return new CompressedBatchProof(properties); + }; + + /** + * Encodes the specified CompressedBatchProof message. Does not implicitly {@link ics23.CompressedBatchProof.verify|verify} messages. + * @function encode + * @memberof ics23.CompressedBatchProof + * @static + * @param {ics23.ICompressedBatchProof} message CompressedBatchProof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompressedBatchProof.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entries != null && message.entries.length) + for (let i = 0; i < message.entries.length; ++i) + $root.ics23.CompressedBatchEntry.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.lookupInners != null && message.lookupInners.length) + for (let i = 0; i < message.lookupInners.length; ++i) + $root.ics23.InnerOp.encode(message.lookupInners[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CompressedBatchProof message, length delimited. Does not implicitly {@link ics23.CompressedBatchProof.verify|verify} messages. + * @function encodeDelimited + * @memberof ics23.CompressedBatchProof + * @static + * @param {ics23.ICompressedBatchProof} message CompressedBatchProof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompressedBatchProof.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompressedBatchProof message from the specified reader or buffer. + * @function decode + * @memberof ics23.CompressedBatchProof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ics23.CompressedBatchProof} CompressedBatchProof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompressedBatchProof.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.CompressedBatchProof(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.ics23.CompressedBatchEntry.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.lookupInners && message.lookupInners.length)) + message.lookupInners = []; + message.lookupInners.push($root.ics23.InnerOp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompressedBatchProof message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ics23.CompressedBatchProof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ics23.CompressedBatchProof} CompressedBatchProof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompressedBatchProof.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompressedBatchProof message. + * @function verify + * @memberof ics23.CompressedBatchProof + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompressedBatchProof.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (let i = 0; i < message.entries.length; ++i) { + let error = $root.ics23.CompressedBatchEntry.verify(message.entries[i]); + if (error) + return "entries." + error; + } + } + if (message.lookupInners != null && message.hasOwnProperty("lookupInners")) { + if (!Array.isArray(message.lookupInners)) + return "lookupInners: array expected"; + for (let i = 0; i < message.lookupInners.length; ++i) { + let error = $root.ics23.InnerOp.verify(message.lookupInners[i]); + if (error) + return "lookupInners." + error; + } + } + return null; + }; + + /** + * Creates a CompressedBatchProof message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ics23.CompressedBatchProof + * @static + * @param {Object.} object Plain object + * @returns {ics23.CompressedBatchProof} CompressedBatchProof + */ + CompressedBatchProof.fromObject = function fromObject(object) { + if (object instanceof $root.ics23.CompressedBatchProof) + return object; + let message = new $root.ics23.CompressedBatchProof(); + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".ics23.CompressedBatchProof.entries: array expected"); + message.entries = []; + for (let i = 0; i < object.entries.length; ++i) { + if (typeof object.entries[i] !== "object") + throw TypeError(".ics23.CompressedBatchProof.entries: object expected"); + message.entries[i] = $root.ics23.CompressedBatchEntry.fromObject(object.entries[i]); + } + } + if (object.lookupInners) { + if (!Array.isArray(object.lookupInners)) + throw TypeError(".ics23.CompressedBatchProof.lookupInners: array expected"); + message.lookupInners = []; + for (let i = 0; i < object.lookupInners.length; ++i) { + if (typeof object.lookupInners[i] !== "object") + throw TypeError(".ics23.CompressedBatchProof.lookupInners: object expected"); + message.lookupInners[i] = $root.ics23.InnerOp.fromObject(object.lookupInners[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CompressedBatchProof message. Also converts values to other types if specified. + * @function toObject + * @memberof ics23.CompressedBatchProof + * @static + * @param {ics23.CompressedBatchProof} message CompressedBatchProof + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompressedBatchProof.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) { + object.entries = []; + object.lookupInners = []; + } + if (message.entries && message.entries.length) { + object.entries = []; + for (let j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.ics23.CompressedBatchEntry.toObject(message.entries[j], options); + } + if (message.lookupInners && message.lookupInners.length) { + object.lookupInners = []; + for (let j = 0; j < message.lookupInners.length; ++j) + object.lookupInners[j] = $root.ics23.InnerOp.toObject(message.lookupInners[j], options); + } + return object; + }; + + /** + * Converts this CompressedBatchProof to JSON. + * @function toJSON + * @memberof ics23.CompressedBatchProof + * @instance + * @returns {Object.} JSON object + */ + CompressedBatchProof.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CompressedBatchProof; + })(ics23.CompressedBatchProof || {}); + + ics23.CompressedBatchEntry = (function(CompressedBatchEntry) { + + /** + * Properties of a CompressedBatchEntry. + * @memberof ics23 + * @interface ICompressedBatchEntry + * @property {ics23.ICompressedExistenceProof|null} [exist] CompressedBatchEntry exist + * @property {ics23.ICompressedNonExistenceProof|null} [nonexist] CompressedBatchEntry nonexist + */ + + /** + * Constructs a new CompressedBatchEntry. + * @memberof ics23 + * @classdesc Represents a CompressedBatchEntry. + * @implements ICompressedBatchEntry + * @constructor + * @param {ics23.ICompressedBatchEntry=} [properties] Properties to set + */ + function CompressedBatchEntry(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompressedBatchEntry exist. + * @member {ics23.ICompressedExistenceProof|null|undefined} exist + * @memberof ics23.CompressedBatchEntry + * @instance + */ + CompressedBatchEntry.prototype.exist = null; + + /** + * CompressedBatchEntry nonexist. + * @member {ics23.ICompressedNonExistenceProof|null|undefined} nonexist + * @memberof ics23.CompressedBatchEntry + * @instance + */ + CompressedBatchEntry.prototype.nonexist = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CompressedBatchEntry proof. + * @member {"exist"|"nonexist"|undefined} proof + * @memberof ics23.CompressedBatchEntry + * @instance + */ + Object.defineProperty(CompressedBatchEntry.prototype, "proof", { + get: $util.oneOfGetter($oneOfFields = ["exist", "nonexist"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CompressedBatchEntry instance using the specified properties. + * @function create + * @memberof ics23.CompressedBatchEntry + * @static + * @param {ics23.ICompressedBatchEntry=} [properties] Properties to set + * @returns {ics23.CompressedBatchEntry} CompressedBatchEntry instance + */ + CompressedBatchEntry.create = function create(properties) { + return new CompressedBatchEntry(properties); + }; + + /** + * Encodes the specified CompressedBatchEntry message. Does not implicitly {@link ics23.CompressedBatchEntry.verify|verify} messages. + * @function encode + * @memberof ics23.CompressedBatchEntry + * @static + * @param {ics23.ICompressedBatchEntry} message CompressedBatchEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompressedBatchEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.exist != null && Object.hasOwnProperty.call(message, "exist")) + $root.ics23.CompressedExistenceProof.encode(message.exist, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nonexist != null && Object.hasOwnProperty.call(message, "nonexist")) + $root.ics23.CompressedNonExistenceProof.encode(message.nonexist, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CompressedBatchEntry message, length delimited. Does not implicitly {@link ics23.CompressedBatchEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof ics23.CompressedBatchEntry + * @static + * @param {ics23.ICompressedBatchEntry} message CompressedBatchEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompressedBatchEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompressedBatchEntry message from the specified reader or buffer. + * @function decode + * @memberof ics23.CompressedBatchEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ics23.CompressedBatchEntry} CompressedBatchEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompressedBatchEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.CompressedBatchEntry(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exist = $root.ics23.CompressedExistenceProof.decode(reader, reader.uint32()); + break; + case 2: + message.nonexist = $root.ics23.CompressedNonExistenceProof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompressedBatchEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ics23.CompressedBatchEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ics23.CompressedBatchEntry} CompressedBatchEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompressedBatchEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompressedBatchEntry message. + * @function verify + * @memberof ics23.CompressedBatchEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompressedBatchEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + let properties = {}; + if (message.exist != null && message.hasOwnProperty("exist")) { + properties.proof = 1; + { + let error = $root.ics23.CompressedExistenceProof.verify(message.exist); + if (error) + return "exist." + error; + } + } + if (message.nonexist != null && message.hasOwnProperty("nonexist")) { + if (properties.proof === 1) + return "proof: multiple values"; + properties.proof = 1; + { + let error = $root.ics23.CompressedNonExistenceProof.verify(message.nonexist); + if (error) + return "nonexist." + error; + } + } + return null; + }; + + /** + * Creates a CompressedBatchEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ics23.CompressedBatchEntry + * @static + * @param {Object.} object Plain object + * @returns {ics23.CompressedBatchEntry} CompressedBatchEntry + */ + CompressedBatchEntry.fromObject = function fromObject(object) { + if (object instanceof $root.ics23.CompressedBatchEntry) + return object; + let message = new $root.ics23.CompressedBatchEntry(); + if (object.exist != null) { + if (typeof object.exist !== "object") + throw TypeError(".ics23.CompressedBatchEntry.exist: object expected"); + message.exist = $root.ics23.CompressedExistenceProof.fromObject(object.exist); + } + if (object.nonexist != null) { + if (typeof object.nonexist !== "object") + throw TypeError(".ics23.CompressedBatchEntry.nonexist: object expected"); + message.nonexist = $root.ics23.CompressedNonExistenceProof.fromObject(object.nonexist); + } + return message; + }; + + /** + * Creates a plain object from a CompressedBatchEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof ics23.CompressedBatchEntry + * @static + * @param {ics23.CompressedBatchEntry} message CompressedBatchEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompressedBatchEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.exist != null && message.hasOwnProperty("exist")) { + object.exist = $root.ics23.CompressedExistenceProof.toObject(message.exist, options); + if (options.oneofs) + object.proof = "exist"; + } + if (message.nonexist != null && message.hasOwnProperty("nonexist")) { + object.nonexist = $root.ics23.CompressedNonExistenceProof.toObject(message.nonexist, options); + if (options.oneofs) + object.proof = "nonexist"; + } + return object; + }; + + /** + * Converts this CompressedBatchEntry to JSON. + * @function toJSON + * @memberof ics23.CompressedBatchEntry + * @instance + * @returns {Object.} JSON object + */ + CompressedBatchEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CompressedBatchEntry; + })(ics23.CompressedBatchEntry || {}); + + ics23.CompressedExistenceProof = (function(CompressedExistenceProof) { + + /** + * Properties of a CompressedExistenceProof. + * @memberof ics23 + * @interface ICompressedExistenceProof + * @property {Uint8Array|null} [key] CompressedExistenceProof key + * @property {Uint8Array|null} [value] CompressedExistenceProof value + * @property {ics23.ILeafOp|null} [leaf] CompressedExistenceProof leaf + * @property {Array.|null} [path] CompressedExistenceProof path + */ + + /** + * Constructs a new CompressedExistenceProof. + * @memberof ics23 + * @classdesc Represents a CompressedExistenceProof. + * @implements ICompressedExistenceProof + * @constructor + * @param {ics23.ICompressedExistenceProof=} [properties] Properties to set + */ + function CompressedExistenceProof(properties) { + this.path = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompressedExistenceProof key. + * @member {Uint8Array} key + * @memberof ics23.CompressedExistenceProof + * @instance + */ + CompressedExistenceProof.prototype.key = $util.newBuffer([]); + + /** + * CompressedExistenceProof value. + * @member {Uint8Array} value + * @memberof ics23.CompressedExistenceProof + * @instance + */ + CompressedExistenceProof.prototype.value = $util.newBuffer([]); + + /** + * CompressedExistenceProof leaf. + * @member {ics23.ILeafOp|null|undefined} leaf + * @memberof ics23.CompressedExistenceProof + * @instance + */ + CompressedExistenceProof.prototype.leaf = null; + + /** + * CompressedExistenceProof path. + * @member {Array.} path + * @memberof ics23.CompressedExistenceProof + * @instance + */ + CompressedExistenceProof.prototype.path = $util.emptyArray; + + /** + * Creates a new CompressedExistenceProof instance using the specified properties. + * @function create + * @memberof ics23.CompressedExistenceProof + * @static + * @param {ics23.ICompressedExistenceProof=} [properties] Properties to set + * @returns {ics23.CompressedExistenceProof} CompressedExistenceProof instance + */ + CompressedExistenceProof.create = function create(properties) { + return new CompressedExistenceProof(properties); + }; + + /** + * Encodes the specified CompressedExistenceProof message. Does not implicitly {@link ics23.CompressedExistenceProof.verify|verify} messages. + * @function encode + * @memberof ics23.CompressedExistenceProof + * @static + * @param {ics23.ICompressedExistenceProof} message CompressedExistenceProof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompressedExistenceProof.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + if (message.leaf != null && Object.hasOwnProperty.call(message, "leaf")) + $root.ics23.LeafOp.encode(message.leaf, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 4, wireType 2 =*/34).fork(); + for (let i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CompressedExistenceProof message, length delimited. Does not implicitly {@link ics23.CompressedExistenceProof.verify|verify} messages. + * @function encodeDelimited + * @memberof ics23.CompressedExistenceProof + * @static + * @param {ics23.ICompressedExistenceProof} message CompressedExistenceProof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompressedExistenceProof.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompressedExistenceProof message from the specified reader or buffer. + * @function decode + * @memberof ics23.CompressedExistenceProof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ics23.CompressedExistenceProof} CompressedExistenceProof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompressedExistenceProof.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.CompressedExistenceProof(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + case 3: + message.leaf = $root.ics23.LeafOp.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + let end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompressedExistenceProof message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ics23.CompressedExistenceProof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ics23.CompressedExistenceProof} CompressedExistenceProof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompressedExistenceProof.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompressedExistenceProof message. + * @function verify + * @memberof ics23.CompressedExistenceProof + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompressedExistenceProof.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + if (message.leaf != null && message.hasOwnProperty("leaf")) { + let error = $root.ics23.LeafOp.verify(message.leaf); + if (error) + return "leaf." + error; + } + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (let i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + return null; + }; + + /** + * Creates a CompressedExistenceProof message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ics23.CompressedExistenceProof + * @static + * @param {Object.} object Plain object + * @returns {ics23.CompressedExistenceProof} CompressedExistenceProof + */ + CompressedExistenceProof.fromObject = function fromObject(object) { + if (object instanceof $root.ics23.CompressedExistenceProof) + return object; + let message = new $root.ics23.CompressedExistenceProof(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length) + message.key = object.key; + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length) + message.value = object.value; + if (object.leaf != null) { + if (typeof object.leaf !== "object") + throw TypeError(".ics23.CompressedExistenceProof.leaf: object expected"); + message.leaf = $root.ics23.LeafOp.fromObject(object.leaf); + } + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".ics23.CompressedExistenceProof.path: array expected"); + message.path = []; + for (let i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + return message; + }; + + /** + * Creates a plain object from a CompressedExistenceProof message. Also converts values to other types if specified. + * @function toObject + * @memberof ics23.CompressedExistenceProof + * @static + * @param {ics23.CompressedExistenceProof} message CompressedExistenceProof + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompressedExistenceProof.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + object.leaf = null; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + if (message.leaf != null && message.hasOwnProperty("leaf")) + object.leaf = $root.ics23.LeafOp.toObject(message.leaf, options); + if (message.path && message.path.length) { + object.path = []; + for (let j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + return object; + }; + + /** + * Converts this CompressedExistenceProof to JSON. + * @function toJSON + * @memberof ics23.CompressedExistenceProof + * @instance + * @returns {Object.} JSON object + */ + CompressedExistenceProof.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CompressedExistenceProof; + })(ics23.CompressedExistenceProof || {}); + + ics23.CompressedNonExistenceProof = (function(CompressedNonExistenceProof) { + + /** + * Properties of a CompressedNonExistenceProof. + * @memberof ics23 + * @interface ICompressedNonExistenceProof + * @property {Uint8Array|null} [key] CompressedNonExistenceProof key + * @property {ics23.ICompressedExistenceProof|null} [left] CompressedNonExistenceProof left + * @property {ics23.ICompressedExistenceProof|null} [right] CompressedNonExistenceProof right + */ + + /** + * Constructs a new CompressedNonExistenceProof. + * @memberof ics23 + * @classdesc Represents a CompressedNonExistenceProof. + * @implements ICompressedNonExistenceProof + * @constructor + * @param {ics23.ICompressedNonExistenceProof=} [properties] Properties to set + */ + function CompressedNonExistenceProof(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompressedNonExistenceProof key. + * @member {Uint8Array} key + * @memberof ics23.CompressedNonExistenceProof + * @instance + */ + CompressedNonExistenceProof.prototype.key = $util.newBuffer([]); + + /** + * CompressedNonExistenceProof left. + * @member {ics23.ICompressedExistenceProof|null|undefined} left + * @memberof ics23.CompressedNonExistenceProof + * @instance + */ + CompressedNonExistenceProof.prototype.left = null; + + /** + * CompressedNonExistenceProof right. + * @member {ics23.ICompressedExistenceProof|null|undefined} right + * @memberof ics23.CompressedNonExistenceProof + * @instance + */ + CompressedNonExistenceProof.prototype.right = null; + + /** + * Creates a new CompressedNonExistenceProof instance using the specified properties. + * @function create + * @memberof ics23.CompressedNonExistenceProof + * @static + * @param {ics23.ICompressedNonExistenceProof=} [properties] Properties to set + * @returns {ics23.CompressedNonExistenceProof} CompressedNonExistenceProof instance + */ + CompressedNonExistenceProof.create = function create(properties) { + return new CompressedNonExistenceProof(properties); + }; + + /** + * Encodes the specified CompressedNonExistenceProof message. Does not implicitly {@link ics23.CompressedNonExistenceProof.verify|verify} messages. + * @function encode + * @memberof ics23.CompressedNonExistenceProof + * @static + * @param {ics23.ICompressedNonExistenceProof} message CompressedNonExistenceProof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompressedNonExistenceProof.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); + if (message.left != null && Object.hasOwnProperty.call(message, "left")) + $root.ics23.CompressedExistenceProof.encode(message.left, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.right != null && Object.hasOwnProperty.call(message, "right")) + $root.ics23.CompressedExistenceProof.encode(message.right, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CompressedNonExistenceProof message, length delimited. Does not implicitly {@link ics23.CompressedNonExistenceProof.verify|verify} messages. + * @function encodeDelimited + * @memberof ics23.CompressedNonExistenceProof + * @static + * @param {ics23.ICompressedNonExistenceProof} message CompressedNonExistenceProof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompressedNonExistenceProof.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompressedNonExistenceProof message from the specified reader or buffer. + * @function decode + * @memberof ics23.CompressedNonExistenceProof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ics23.CompressedNonExistenceProof} CompressedNonExistenceProof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompressedNonExistenceProof.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.CompressedNonExistenceProof(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.left = $root.ics23.CompressedExistenceProof.decode(reader, reader.uint32()); + break; + case 3: + message.right = $root.ics23.CompressedExistenceProof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompressedNonExistenceProof message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ics23.CompressedNonExistenceProof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ics23.CompressedNonExistenceProof} CompressedNonExistenceProof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompressedNonExistenceProof.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompressedNonExistenceProof message. + * @function verify + * @memberof ics23.CompressedNonExistenceProof + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompressedNonExistenceProof.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + if (message.left != null && message.hasOwnProperty("left")) { + let error = $root.ics23.CompressedExistenceProof.verify(message.left); + if (error) + return "left." + error; + } + if (message.right != null && message.hasOwnProperty("right")) { + let error = $root.ics23.CompressedExistenceProof.verify(message.right); + if (error) + return "right." + error; + } + return null; + }; + + /** + * Creates a CompressedNonExistenceProof message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ics23.CompressedNonExistenceProof + * @static + * @param {Object.} object Plain object + * @returns {ics23.CompressedNonExistenceProof} CompressedNonExistenceProof + */ + CompressedNonExistenceProof.fromObject = function fromObject(object) { + if (object instanceof $root.ics23.CompressedNonExistenceProof) + return object; + let message = new $root.ics23.CompressedNonExistenceProof(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length) + message.key = object.key; + if (object.left != null) { + if (typeof object.left !== "object") + throw TypeError(".ics23.CompressedNonExistenceProof.left: object expected"); + message.left = $root.ics23.CompressedExistenceProof.fromObject(object.left); + } + if (object.right != null) { + if (typeof object.right !== "object") + throw TypeError(".ics23.CompressedNonExistenceProof.right: object expected"); + message.right = $root.ics23.CompressedExistenceProof.fromObject(object.right); + } + return message; + }; + + /** + * Creates a plain object from a CompressedNonExistenceProof message. Also converts values to other types if specified. + * @function toObject + * @memberof ics23.CompressedNonExistenceProof + * @static + * @param {ics23.CompressedNonExistenceProof} message CompressedNonExistenceProof + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompressedNonExistenceProof.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + object.left = null; + object.right = null; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.left != null && message.hasOwnProperty("left")) + object.left = $root.ics23.CompressedExistenceProof.toObject(message.left, options); + if (message.right != null && message.hasOwnProperty("right")) + object.right = $root.ics23.CompressedExistenceProof.toObject(message.right, options); + return object; + }; + + /** + * Converts this CompressedNonExistenceProof to JSON. + * @function toJSON + * @memberof ics23.CompressedNonExistenceProof + * @instance + * @returns {Object.} JSON object + */ + CompressedNonExistenceProof.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CompressedNonExistenceProof; + })(ics23.CompressedNonExistenceProof || {}); + + return ics23; +})($root.ics23 || {}); + +export { $root as default }; diff --git a/src/libs/ibc.js b/src/libs/ibc.js new file mode 100644 index 00000000..71906d71 --- /dev/null +++ b/src/libs/ibc.js @@ -0,0 +1,8731 @@ +/* eslint-disable */ +import * as $protobuf from "protobufjs-dbx/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); + +/** + * Namespace ibc. + * @exports ibc + * @namespace + */ + +export const ibc = $root.ibc = ((ibc) => { + + /** + * Namespace applications. + * @memberof ibc + * @namespace + */ + + ibc.applications = (function(applications) { + + /** + * Namespace transfer. + * @memberof ibc.applications + * @namespace + */ + + applications.transfer = (function(transfer) { + + /** + * Namespace v1. + * @memberof ibc.applications.transfer + * @namespace + */ + + transfer.v1 = (function(v1) { + + v1.Msg = (function(Msg) { + + /** + * Constructs a new Msg service. + * @memberof ibc.applications.transfer.v1 + * @classdesc Represents a Msg + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Msg(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; + + /** + * Creates new Msg service using the specified rpc implementation. + * @function create + * @memberof ibc.applications.transfer.v1.Msg + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Msg} RPC service. Useful where requests and/or responses are streamed. + */ + Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link ibc.applications.transfer.v1.Msg#transfer}. + * @memberof ibc.applications.transfer.v1.Msg + * @typedef TransferCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.applications.transfer.v1.IMsgTransferResponse} [response] MsgTransferResponse + */ + + /** + * Calls Transfer. + * @function transfer + * @memberof ibc.applications.transfer.v1.Msg + * @instance + * @param {ibc.applications.transfer.v1.IMsgTransfer} request MsgTransfer message or plain object + * @param {ibc.applications.transfer.v1.Msg.TransferCallback} callback Node-style callback called with the error, if any, and MsgTransferResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.transfer = function transfer(request, callback) { + return this.rpcCall(transfer, $root.ibc.applications.transfer.v1.MsgTransfer, $root.ibc.applications.transfer.v1.MsgTransferResponse, request, callback); + }, "name", { value: "Transfer" }); + + /** + * Calls Transfer. + * @function transfer + * @memberof ibc.applications.transfer.v1.Msg + * @instance + * @param {ibc.applications.transfer.v1.IMsgTransfer} request MsgTransfer message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Msg; + })(v1.Msg || {}); + + v1.MsgTransfer = (function(MsgTransfer) { + + /** + * Properties of a MsgTransfer. + * @memberof ibc.applications.transfer.v1 + * @interface IMsgTransfer + * @property {string|null} [sourcePort] MsgTransfer sourcePort + * @property {string|null} [sourceChannel] MsgTransfer sourceChannel + * @property {cosmos.base.v1beta1.ICoin|null} [token] MsgTransfer token + * @property {string|null} [sender] MsgTransfer sender + * @property {string|null} [receiver] MsgTransfer receiver + * @property {ibc.core.client.v1.IHeight|null} [timeoutHeight] MsgTransfer timeoutHeight + * @property {number|Long|null} [timeoutTimestamp] MsgTransfer timeoutTimestamp + */ + + /** + * Constructs a new MsgTransfer. + * @memberof ibc.applications.transfer.v1 + * @classdesc Represents a MsgTransfer. + * @implements IMsgTransfer + * @constructor + * @param {ibc.applications.transfer.v1.IMsgTransfer=} [properties] Properties to set + */ + function MsgTransfer(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgTransfer sourcePort. + * @member {string} sourcePort + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @instance + */ + MsgTransfer.prototype.sourcePort = ""; + + /** + * MsgTransfer sourceChannel. + * @member {string} sourceChannel + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @instance + */ + MsgTransfer.prototype.sourceChannel = ""; + + /** + * MsgTransfer token. + * @member {cosmos.base.v1beta1.ICoin|null|undefined} token + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @instance + */ + MsgTransfer.prototype.token = null; + + /** + * MsgTransfer sender. + * @member {string} sender + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @instance + */ + MsgTransfer.prototype.sender = ""; + + /** + * MsgTransfer receiver. + * @member {string} receiver + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @instance + */ + MsgTransfer.prototype.receiver = ""; + + /** + * MsgTransfer timeoutHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} timeoutHeight + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @instance + */ + MsgTransfer.prototype.timeoutHeight = null; + + /** + * MsgTransfer timeoutTimestamp. + * @member {number|Long} timeoutTimestamp + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @instance + */ + MsgTransfer.prototype.timeoutTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new MsgTransfer instance using the specified properties. + * @function create + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @static + * @param {ibc.applications.transfer.v1.IMsgTransfer=} [properties] Properties to set + * @returns {ibc.applications.transfer.v1.MsgTransfer} MsgTransfer instance + */ + MsgTransfer.create = function create(properties) { + return new MsgTransfer(properties); + }; + + /** + * Encodes the specified MsgTransfer message. Does not implicitly {@link ibc.applications.transfer.v1.MsgTransfer.verify|verify} messages. + * @function encode + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @static + * @param {ibc.applications.transfer.v1.IMsgTransfer} message MsgTransfer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgTransfer.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourcePort != null && Object.hasOwnProperty.call(message, "sourcePort")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourcePort); + if (message.sourceChannel != null && Object.hasOwnProperty.call(message, "sourceChannel")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceChannel); + if (message.token != null && Object.hasOwnProperty.call(message, "token")) + $root.cosmos.base.v1beta1.Coin.encode(message.token, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.sender != null && Object.hasOwnProperty.call(message, "sender")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.sender); + if (message.receiver != null && Object.hasOwnProperty.call(message, "receiver")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.receiver); + if (message.timeoutHeight != null && Object.hasOwnProperty.call(message, "timeoutHeight")) + $root.ibc.core.client.v1.Height.encode(message.timeoutHeight, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.timeoutTimestamp != null && Object.hasOwnProperty.call(message, "timeoutTimestamp")) + writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.timeoutTimestamp); + return writer; + }; + + /** + * Encodes the specified MsgTransfer message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.MsgTransfer.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @static + * @param {ibc.applications.transfer.v1.IMsgTransfer} message MsgTransfer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgTransfer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgTransfer message from the specified reader or buffer. + * @function decode + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.applications.transfer.v1.MsgTransfer} MsgTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgTransfer.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.MsgTransfer(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sourcePort = reader.string(); + break; + case 2: + message.sourceChannel = reader.string(); + break; + case 3: + message.token = $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()); + break; + case 4: + message.sender = reader.string(); + break; + case 5: + message.receiver = reader.string(); + break; + case 6: + message.timeoutHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + case 7: + message.timeoutTimestamp = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgTransfer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.applications.transfer.v1.MsgTransfer} MsgTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgTransfer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgTransfer message. + * @function verify + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgTransfer.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sourcePort != null && message.hasOwnProperty("sourcePort")) + if (!$util.isString(message.sourcePort)) + return "sourcePort: string expected"; + if (message.sourceChannel != null && message.hasOwnProperty("sourceChannel")) + if (!$util.isString(message.sourceChannel)) + return "sourceChannel: string expected"; + if (message.token != null && message.hasOwnProperty("token")) { + let error = $root.cosmos.base.v1beta1.Coin.verify(message.token); + if (error) + return "token." + error; + } + if (message.sender != null && message.hasOwnProperty("sender")) + if (!$util.isString(message.sender)) + return "sender: string expected"; + if (message.receiver != null && message.hasOwnProperty("receiver")) + if (!$util.isString(message.receiver)) + return "receiver: string expected"; + if (message.timeoutHeight != null && message.hasOwnProperty("timeoutHeight")) { + let error = $root.ibc.core.client.v1.Height.verify(message.timeoutHeight); + if (error) + return "timeoutHeight." + error; + } + if (message.timeoutTimestamp != null && message.hasOwnProperty("timeoutTimestamp")) + if (!$util.isInteger(message.timeoutTimestamp) && !(message.timeoutTimestamp && $util.isInteger(message.timeoutTimestamp.low) && $util.isInteger(message.timeoutTimestamp.high))) + return "timeoutTimestamp: integer|Long expected"; + return null; + }; + + /** + * Creates a MsgTransfer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @static + * @param {Object.} object Plain object + * @returns {ibc.applications.transfer.v1.MsgTransfer} MsgTransfer + */ + MsgTransfer.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.applications.transfer.v1.MsgTransfer) + return object; + let message = new $root.ibc.applications.transfer.v1.MsgTransfer(); + if (object.sourcePort != null) + message.sourcePort = String(object.sourcePort); + if (object.sourceChannel != null) + message.sourceChannel = String(object.sourceChannel); + if (object.token != null) { + if (typeof object.token !== "object") + throw TypeError(".ibc.applications.transfer.v1.MsgTransfer.token: object expected"); + message.token = $root.cosmos.base.v1beta1.Coin.fromObject(object.token); + } + if (object.sender != null) + message.sender = String(object.sender); + if (object.receiver != null) + message.receiver = String(object.receiver); + if (object.timeoutHeight != null) { + if (typeof object.timeoutHeight !== "object") + throw TypeError(".ibc.applications.transfer.v1.MsgTransfer.timeoutHeight: object expected"); + message.timeoutHeight = $root.ibc.core.client.v1.Height.fromObject(object.timeoutHeight); + } + if (object.timeoutTimestamp != null) + if ($util.Long) + (message.timeoutTimestamp = $util.Long.fromValue(object.timeoutTimestamp)).unsigned = true; + else if (typeof object.timeoutTimestamp === "string") + message.timeoutTimestamp = parseInt(object.timeoutTimestamp, 10); + else if (typeof object.timeoutTimestamp === "number") + message.timeoutTimestamp = object.timeoutTimestamp; + else if (typeof object.timeoutTimestamp === "object") + message.timeoutTimestamp = new $util.LongBits(object.timeoutTimestamp.low >>> 0, object.timeoutTimestamp.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a MsgTransfer message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @static + * @param {ibc.applications.transfer.v1.MsgTransfer} message MsgTransfer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgTransfer.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.sourcePort = ""; + object.sourceChannel = ""; + object.token = null; + object.sender = ""; + object.receiver = ""; + object.timeoutHeight = null; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.timeoutTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timeoutTimestamp = options.longs === String ? "0" : 0; + } + if (message.sourcePort != null && message.hasOwnProperty("sourcePort")) + object.sourcePort = message.sourcePort; + if (message.sourceChannel != null && message.hasOwnProperty("sourceChannel")) + object.sourceChannel = message.sourceChannel; + if (message.token != null && message.hasOwnProperty("token")) + object.token = $root.cosmos.base.v1beta1.Coin.toObject(message.token, options); + if (message.sender != null && message.hasOwnProperty("sender")) + object.sender = message.sender; + if (message.receiver != null && message.hasOwnProperty("receiver")) + object.receiver = message.receiver; + if (message.timeoutHeight != null && message.hasOwnProperty("timeoutHeight")) + object.timeoutHeight = $root.ibc.core.client.v1.Height.toObject(message.timeoutHeight, options); + if (message.timeoutTimestamp != null && message.hasOwnProperty("timeoutTimestamp")) + if (typeof message.timeoutTimestamp === "number") + object.timeoutTimestamp = options.longs === String ? String(message.timeoutTimestamp) : message.timeoutTimestamp; + else + object.timeoutTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timeoutTimestamp) : options.longs === Number ? new $util.LongBits(message.timeoutTimestamp.low >>> 0, message.timeoutTimestamp.high >>> 0).toNumber(true) : message.timeoutTimestamp; + return object; + }; + + /** + * Converts this MsgTransfer to JSON. + * @function toJSON + * @memberof ibc.applications.transfer.v1.MsgTransfer + * @instance + * @returns {Object.} JSON object + */ + MsgTransfer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgTransfer; + })(v1.MsgTransfer || {}); + + v1.MsgTransferResponse = (function(MsgTransferResponse) { + + /** + * Properties of a MsgTransferResponse. + * @memberof ibc.applications.transfer.v1 + * @interface IMsgTransferResponse + */ + + /** + * Constructs a new MsgTransferResponse. + * @memberof ibc.applications.transfer.v1 + * @classdesc Represents a MsgTransferResponse. + * @implements IMsgTransferResponse + * @constructor + * @param {ibc.applications.transfer.v1.IMsgTransferResponse=} [properties] Properties to set + */ + function MsgTransferResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgTransferResponse instance using the specified properties. + * @function create + * @memberof ibc.applications.transfer.v1.MsgTransferResponse + * @static + * @param {ibc.applications.transfer.v1.IMsgTransferResponse=} [properties] Properties to set + * @returns {ibc.applications.transfer.v1.MsgTransferResponse} MsgTransferResponse instance + */ + MsgTransferResponse.create = function create(properties) { + return new MsgTransferResponse(properties); + }; + + /** + * Encodes the specified MsgTransferResponse message. Does not implicitly {@link ibc.applications.transfer.v1.MsgTransferResponse.verify|verify} messages. + * @function encode + * @memberof ibc.applications.transfer.v1.MsgTransferResponse + * @static + * @param {ibc.applications.transfer.v1.IMsgTransferResponse} message MsgTransferResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgTransferResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgTransferResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.MsgTransferResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.applications.transfer.v1.MsgTransferResponse + * @static + * @param {ibc.applications.transfer.v1.IMsgTransferResponse} message MsgTransferResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgTransferResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgTransferResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.applications.transfer.v1.MsgTransferResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.applications.transfer.v1.MsgTransferResponse} MsgTransferResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgTransferResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.MsgTransferResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgTransferResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.applications.transfer.v1.MsgTransferResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.applications.transfer.v1.MsgTransferResponse} MsgTransferResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgTransferResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgTransferResponse message. + * @function verify + * @memberof ibc.applications.transfer.v1.MsgTransferResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgTransferResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgTransferResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.applications.transfer.v1.MsgTransferResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.applications.transfer.v1.MsgTransferResponse} MsgTransferResponse + */ + MsgTransferResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.applications.transfer.v1.MsgTransferResponse) + return object; + return new $root.ibc.applications.transfer.v1.MsgTransferResponse(); + }; + + /** + * Creates a plain object from a MsgTransferResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.applications.transfer.v1.MsgTransferResponse + * @static + * @param {ibc.applications.transfer.v1.MsgTransferResponse} message MsgTransferResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgTransferResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgTransferResponse to JSON. + * @function toJSON + * @memberof ibc.applications.transfer.v1.MsgTransferResponse + * @instance + * @returns {Object.} JSON object + */ + MsgTransferResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgTransferResponse; + })(v1.MsgTransferResponse || {}); + + return v1; + })(transfer.v1 || {}); + + return transfer; + })(applications.transfer || {}); + + return applications; + })(ibc.applications || {}); + + /** + * Namespace core. + * @memberof ibc + * @namespace + */ + + ibc.core = (function(core) { + + /** + * Namespace client. + * @memberof ibc.core + * @namespace + */ + + core.client = (function(client) { + + /** + * Namespace v1. + * @memberof ibc.core.client + * @namespace + */ + + client.v1 = (function(v1) { + + v1.IdentifiedClientState = (function(IdentifiedClientState) { + + /** + * Properties of an IdentifiedClientState. + * @memberof ibc.core.client.v1 + * @interface IIdentifiedClientState + * @property {string|null} [clientId] IdentifiedClientState clientId + * @property {google.protobuf.IAny|null} [clientState] IdentifiedClientState clientState + */ + + /** + * Constructs a new IdentifiedClientState. + * @memberof ibc.core.client.v1 + * @classdesc Represents an IdentifiedClientState. + * @implements IIdentifiedClientState + * @constructor + * @param {ibc.core.client.v1.IIdentifiedClientState=} [properties] Properties to set + */ + function IdentifiedClientState(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IdentifiedClientState clientId. + * @member {string} clientId + * @memberof ibc.core.client.v1.IdentifiedClientState + * @instance + */ + IdentifiedClientState.prototype.clientId = ""; + + /** + * IdentifiedClientState clientState. + * @member {google.protobuf.IAny|null|undefined} clientState + * @memberof ibc.core.client.v1.IdentifiedClientState + * @instance + */ + IdentifiedClientState.prototype.clientState = null; + + /** + * Creates a new IdentifiedClientState instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.IdentifiedClientState + * @static + * @param {ibc.core.client.v1.IIdentifiedClientState=} [properties] Properties to set + * @returns {ibc.core.client.v1.IdentifiedClientState} IdentifiedClientState instance + */ + IdentifiedClientState.create = function create(properties) { + return new IdentifiedClientState(properties); + }; + + /** + * Encodes the specified IdentifiedClientState message. Does not implicitly {@link ibc.core.client.v1.IdentifiedClientState.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.IdentifiedClientState + * @static + * @param {ibc.core.client.v1.IIdentifiedClientState} message IdentifiedClientState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentifiedClientState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.clientState != null && Object.hasOwnProperty.call(message, "clientState")) + $root.google.protobuf.Any.encode(message.clientState, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IdentifiedClientState message, length delimited. Does not implicitly {@link ibc.core.client.v1.IdentifiedClientState.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.IdentifiedClientState + * @static + * @param {ibc.core.client.v1.IIdentifiedClientState} message IdentifiedClientState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentifiedClientState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentifiedClientState message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.IdentifiedClientState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.IdentifiedClientState} IdentifiedClientState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentifiedClientState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.IdentifiedClientState(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.clientState = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentifiedClientState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.IdentifiedClientState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.IdentifiedClientState} IdentifiedClientState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentifiedClientState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentifiedClientState message. + * @function verify + * @memberof ibc.core.client.v1.IdentifiedClientState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentifiedClientState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.clientState != null && message.hasOwnProperty("clientState")) { + let error = $root.google.protobuf.Any.verify(message.clientState); + if (error) + return "clientState." + error; + } + return null; + }; + + /** + * Creates an IdentifiedClientState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.IdentifiedClientState + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.IdentifiedClientState} IdentifiedClientState + */ + IdentifiedClientState.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.IdentifiedClientState) + return object; + let message = new $root.ibc.core.client.v1.IdentifiedClientState(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.clientState != null) { + if (typeof object.clientState !== "object") + throw TypeError(".ibc.core.client.v1.IdentifiedClientState.clientState: object expected"); + message.clientState = $root.google.protobuf.Any.fromObject(object.clientState); + } + return message; + }; + + /** + * Creates a plain object from an IdentifiedClientState message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.IdentifiedClientState + * @static + * @param {ibc.core.client.v1.IdentifiedClientState} message IdentifiedClientState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentifiedClientState.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.clientId = ""; + object.clientState = null; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.clientState != null && message.hasOwnProperty("clientState")) + object.clientState = $root.google.protobuf.Any.toObject(message.clientState, options); + return object; + }; + + /** + * Converts this IdentifiedClientState to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.IdentifiedClientState + * @instance + * @returns {Object.} JSON object + */ + IdentifiedClientState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentifiedClientState; + })(v1.IdentifiedClientState || {}); + + v1.ConsensusStateWithHeight = (function(ConsensusStateWithHeight) { + + /** + * Properties of a ConsensusStateWithHeight. + * @memberof ibc.core.client.v1 + * @interface IConsensusStateWithHeight + * @property {ibc.core.client.v1.IHeight|null} [height] ConsensusStateWithHeight height + * @property {google.protobuf.IAny|null} [consensusState] ConsensusStateWithHeight consensusState + */ + + /** + * Constructs a new ConsensusStateWithHeight. + * @memberof ibc.core.client.v1 + * @classdesc Represents a ConsensusStateWithHeight. + * @implements IConsensusStateWithHeight + * @constructor + * @param {ibc.core.client.v1.IConsensusStateWithHeight=} [properties] Properties to set + */ + function ConsensusStateWithHeight(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConsensusStateWithHeight height. + * @member {ibc.core.client.v1.IHeight|null|undefined} height + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @instance + */ + ConsensusStateWithHeight.prototype.height = null; + + /** + * ConsensusStateWithHeight consensusState. + * @member {google.protobuf.IAny|null|undefined} consensusState + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @instance + */ + ConsensusStateWithHeight.prototype.consensusState = null; + + /** + * Creates a new ConsensusStateWithHeight instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @static + * @param {ibc.core.client.v1.IConsensusStateWithHeight=} [properties] Properties to set + * @returns {ibc.core.client.v1.ConsensusStateWithHeight} ConsensusStateWithHeight instance + */ + ConsensusStateWithHeight.create = function create(properties) { + return new ConsensusStateWithHeight(properties); + }; + + /** + * Encodes the specified ConsensusStateWithHeight message. Does not implicitly {@link ibc.core.client.v1.ConsensusStateWithHeight.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @static + * @param {ibc.core.client.v1.IConsensusStateWithHeight} message ConsensusStateWithHeight message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusStateWithHeight.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + $root.ibc.core.client.v1.Height.encode(message.height, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.consensusState != null && Object.hasOwnProperty.call(message, "consensusState")) + $root.google.protobuf.Any.encode(message.consensusState, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConsensusStateWithHeight message, length delimited. Does not implicitly {@link ibc.core.client.v1.ConsensusStateWithHeight.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @static + * @param {ibc.core.client.v1.IConsensusStateWithHeight} message ConsensusStateWithHeight message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusStateWithHeight.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConsensusStateWithHeight message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.ConsensusStateWithHeight} ConsensusStateWithHeight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusStateWithHeight.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.ConsensusStateWithHeight(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + case 2: + message.consensusState = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConsensusStateWithHeight message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.ConsensusStateWithHeight} ConsensusStateWithHeight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusStateWithHeight.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConsensusStateWithHeight message. + * @function verify + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConsensusStateWithHeight.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) { + let error = $root.ibc.core.client.v1.Height.verify(message.height); + if (error) + return "height." + error; + } + if (message.consensusState != null && message.hasOwnProperty("consensusState")) { + let error = $root.google.protobuf.Any.verify(message.consensusState); + if (error) + return "consensusState." + error; + } + return null; + }; + + /** + * Creates a ConsensusStateWithHeight message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.ConsensusStateWithHeight} ConsensusStateWithHeight + */ + ConsensusStateWithHeight.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.ConsensusStateWithHeight) + return object; + let message = new $root.ibc.core.client.v1.ConsensusStateWithHeight(); + if (object.height != null) { + if (typeof object.height !== "object") + throw TypeError(".ibc.core.client.v1.ConsensusStateWithHeight.height: object expected"); + message.height = $root.ibc.core.client.v1.Height.fromObject(object.height); + } + if (object.consensusState != null) { + if (typeof object.consensusState !== "object") + throw TypeError(".ibc.core.client.v1.ConsensusStateWithHeight.consensusState: object expected"); + message.consensusState = $root.google.protobuf.Any.fromObject(object.consensusState); + } + return message; + }; + + /** + * Creates a plain object from a ConsensusStateWithHeight message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @static + * @param {ibc.core.client.v1.ConsensusStateWithHeight} message ConsensusStateWithHeight + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConsensusStateWithHeight.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.height = null; + object.consensusState = null; + } + if (message.height != null && message.hasOwnProperty("height")) + object.height = $root.ibc.core.client.v1.Height.toObject(message.height, options); + if (message.consensusState != null && message.hasOwnProperty("consensusState")) + object.consensusState = $root.google.protobuf.Any.toObject(message.consensusState, options); + return object; + }; + + /** + * Converts this ConsensusStateWithHeight to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.ConsensusStateWithHeight + * @instance + * @returns {Object.} JSON object + */ + ConsensusStateWithHeight.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ConsensusStateWithHeight; + })(v1.ConsensusStateWithHeight || {}); + + v1.ClientConsensusStates = (function(ClientConsensusStates) { + + /** + * Properties of a ClientConsensusStates. + * @memberof ibc.core.client.v1 + * @interface IClientConsensusStates + * @property {string|null} [clientId] ClientConsensusStates clientId + * @property {Array.|null} [consensusStates] ClientConsensusStates consensusStates + */ + + /** + * Constructs a new ClientConsensusStates. + * @memberof ibc.core.client.v1 + * @classdesc Represents a ClientConsensusStates. + * @implements IClientConsensusStates + * @constructor + * @param {ibc.core.client.v1.IClientConsensusStates=} [properties] Properties to set + */ + function ClientConsensusStates(properties) { + this.consensusStates = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientConsensusStates clientId. + * @member {string} clientId + * @memberof ibc.core.client.v1.ClientConsensusStates + * @instance + */ + ClientConsensusStates.prototype.clientId = ""; + + /** + * ClientConsensusStates consensusStates. + * @member {Array.} consensusStates + * @memberof ibc.core.client.v1.ClientConsensusStates + * @instance + */ + ClientConsensusStates.prototype.consensusStates = $util.emptyArray; + + /** + * Creates a new ClientConsensusStates instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.ClientConsensusStates + * @static + * @param {ibc.core.client.v1.IClientConsensusStates=} [properties] Properties to set + * @returns {ibc.core.client.v1.ClientConsensusStates} ClientConsensusStates instance + */ + ClientConsensusStates.create = function create(properties) { + return new ClientConsensusStates(properties); + }; + + /** + * Encodes the specified ClientConsensusStates message. Does not implicitly {@link ibc.core.client.v1.ClientConsensusStates.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.ClientConsensusStates + * @static + * @param {ibc.core.client.v1.IClientConsensusStates} message ClientConsensusStates message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientConsensusStates.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.consensusStates != null && message.consensusStates.length) + for (let i = 0; i < message.consensusStates.length; ++i) + $root.ibc.core.client.v1.ConsensusStateWithHeight.encode(message.consensusStates[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientConsensusStates message, length delimited. Does not implicitly {@link ibc.core.client.v1.ClientConsensusStates.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.ClientConsensusStates + * @static + * @param {ibc.core.client.v1.IClientConsensusStates} message ClientConsensusStates message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientConsensusStates.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientConsensusStates message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.ClientConsensusStates + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.ClientConsensusStates} ClientConsensusStates + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientConsensusStates.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.ClientConsensusStates(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + if (!(message.consensusStates && message.consensusStates.length)) + message.consensusStates = []; + message.consensusStates.push($root.ibc.core.client.v1.ConsensusStateWithHeight.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientConsensusStates message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.ClientConsensusStates + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.ClientConsensusStates} ClientConsensusStates + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientConsensusStates.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientConsensusStates message. + * @function verify + * @memberof ibc.core.client.v1.ClientConsensusStates + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientConsensusStates.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.consensusStates != null && message.hasOwnProperty("consensusStates")) { + if (!Array.isArray(message.consensusStates)) + return "consensusStates: array expected"; + for (let i = 0; i < message.consensusStates.length; ++i) { + let error = $root.ibc.core.client.v1.ConsensusStateWithHeight.verify(message.consensusStates[i]); + if (error) + return "consensusStates." + error; + } + } + return null; + }; + + /** + * Creates a ClientConsensusStates message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.ClientConsensusStates + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.ClientConsensusStates} ClientConsensusStates + */ + ClientConsensusStates.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.ClientConsensusStates) + return object; + let message = new $root.ibc.core.client.v1.ClientConsensusStates(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.consensusStates) { + if (!Array.isArray(object.consensusStates)) + throw TypeError(".ibc.core.client.v1.ClientConsensusStates.consensusStates: array expected"); + message.consensusStates = []; + for (let i = 0; i < object.consensusStates.length; ++i) { + if (typeof object.consensusStates[i] !== "object") + throw TypeError(".ibc.core.client.v1.ClientConsensusStates.consensusStates: object expected"); + message.consensusStates[i] = $root.ibc.core.client.v1.ConsensusStateWithHeight.fromObject(object.consensusStates[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ClientConsensusStates message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.ClientConsensusStates + * @static + * @param {ibc.core.client.v1.ClientConsensusStates} message ClientConsensusStates + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientConsensusStates.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.consensusStates = []; + if (options.defaults) + object.clientId = ""; + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.consensusStates && message.consensusStates.length) { + object.consensusStates = []; + for (let j = 0; j < message.consensusStates.length; ++j) + object.consensusStates[j] = $root.ibc.core.client.v1.ConsensusStateWithHeight.toObject(message.consensusStates[j], options); + } + return object; + }; + + /** + * Converts this ClientConsensusStates to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.ClientConsensusStates + * @instance + * @returns {Object.} JSON object + */ + ClientConsensusStates.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ClientConsensusStates; + })(v1.ClientConsensusStates || {}); + + v1.ClientUpdateProposal = (function(ClientUpdateProposal) { + + /** + * Properties of a ClientUpdateProposal. + * @memberof ibc.core.client.v1 + * @interface IClientUpdateProposal + * @property {string|null} [title] ClientUpdateProposal title + * @property {string|null} [description] ClientUpdateProposal description + * @property {string|null} [clientId] ClientUpdateProposal clientId + * @property {google.protobuf.IAny|null} [header] ClientUpdateProposal header + */ + + /** + * Constructs a new ClientUpdateProposal. + * @memberof ibc.core.client.v1 + * @classdesc Represents a ClientUpdateProposal. + * @implements IClientUpdateProposal + * @constructor + * @param {ibc.core.client.v1.IClientUpdateProposal=} [properties] Properties to set + */ + function ClientUpdateProposal(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientUpdateProposal title. + * @member {string} title + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @instance + */ + ClientUpdateProposal.prototype.title = ""; + + /** + * ClientUpdateProposal description. + * @member {string} description + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @instance + */ + ClientUpdateProposal.prototype.description = ""; + + /** + * ClientUpdateProposal clientId. + * @member {string} clientId + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @instance + */ + ClientUpdateProposal.prototype.clientId = ""; + + /** + * ClientUpdateProposal header. + * @member {google.protobuf.IAny|null|undefined} header + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @instance + */ + ClientUpdateProposal.prototype.header = null; + + /** + * Creates a new ClientUpdateProposal instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @static + * @param {ibc.core.client.v1.IClientUpdateProposal=} [properties] Properties to set + * @returns {ibc.core.client.v1.ClientUpdateProposal} ClientUpdateProposal instance + */ + ClientUpdateProposal.create = function create(properties) { + return new ClientUpdateProposal(properties); + }; + + /** + * Encodes the specified ClientUpdateProposal message. Does not implicitly {@link ibc.core.client.v1.ClientUpdateProposal.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @static + * @param {ibc.core.client.v1.IClientUpdateProposal} message ClientUpdateProposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientUpdateProposal.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.clientId); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + $root.google.protobuf.Any.encode(message.header, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientUpdateProposal message, length delimited. Does not implicitly {@link ibc.core.client.v1.ClientUpdateProposal.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @static + * @param {ibc.core.client.v1.IClientUpdateProposal} message ClientUpdateProposal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientUpdateProposal.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientUpdateProposal message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.ClientUpdateProposal} ClientUpdateProposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientUpdateProposal.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.ClientUpdateProposal(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.clientId = reader.string(); + break; + case 4: + message.header = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientUpdateProposal message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.ClientUpdateProposal} ClientUpdateProposal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientUpdateProposal.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientUpdateProposal message. + * @function verify + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientUpdateProposal.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.header != null && message.hasOwnProperty("header")) { + let error = $root.google.protobuf.Any.verify(message.header); + if (error) + return "header." + error; + } + return null; + }; + + /** + * Creates a ClientUpdateProposal message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.ClientUpdateProposal} ClientUpdateProposal + */ + ClientUpdateProposal.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.ClientUpdateProposal) + return object; + let message = new $root.ibc.core.client.v1.ClientUpdateProposal(); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.header != null) { + if (typeof object.header !== "object") + throw TypeError(".ibc.core.client.v1.ClientUpdateProposal.header: object expected"); + message.header = $root.google.protobuf.Any.fromObject(object.header); + } + return message; + }; + + /** + * Creates a plain object from a ClientUpdateProposal message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @static + * @param {ibc.core.client.v1.ClientUpdateProposal} message ClientUpdateProposal + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientUpdateProposal.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.title = ""; + object.description = ""; + object.clientId = ""; + object.header = null; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.header != null && message.hasOwnProperty("header")) + object.header = $root.google.protobuf.Any.toObject(message.header, options); + return object; + }; + + /** + * Converts this ClientUpdateProposal to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.ClientUpdateProposal + * @instance + * @returns {Object.} JSON object + */ + ClientUpdateProposal.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ClientUpdateProposal; + })(v1.ClientUpdateProposal || {}); + + v1.Height = (function(Height) { + + /** + * Properties of an Height. + * @memberof ibc.core.client.v1 + * @interface IHeight + * @property {number|Long|null} [revisionNumber] Height revisionNumber + * @property {number|Long|null} [revisionHeight] Height revisionHeight + */ + + /** + * Constructs a new Height. + * @memberof ibc.core.client.v1 + * @classdesc Represents an Height. + * @implements IHeight + * @constructor + * @param {ibc.core.client.v1.IHeight=} [properties] Properties to set + */ + function Height(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Height revisionNumber. + * @member {number|Long} revisionNumber + * @memberof ibc.core.client.v1.Height + * @instance + */ + Height.prototype.revisionNumber = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Height revisionHeight. + * @member {number|Long} revisionHeight + * @memberof ibc.core.client.v1.Height + * @instance + */ + Height.prototype.revisionHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new Height instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.Height + * @static + * @param {ibc.core.client.v1.IHeight=} [properties] Properties to set + * @returns {ibc.core.client.v1.Height} Height instance + */ + Height.create = function create(properties) { + return new Height(properties); + }; + + /** + * Encodes the specified Height message. Does not implicitly {@link ibc.core.client.v1.Height.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.Height + * @static + * @param {ibc.core.client.v1.IHeight} message Height message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Height.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.revisionNumber != null && Object.hasOwnProperty.call(message, "revisionNumber")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.revisionNumber); + if (message.revisionHeight != null && Object.hasOwnProperty.call(message, "revisionHeight")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.revisionHeight); + return writer; + }; + + /** + * Encodes the specified Height message, length delimited. Does not implicitly {@link ibc.core.client.v1.Height.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.Height + * @static + * @param {ibc.core.client.v1.IHeight} message Height message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Height.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Height message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.Height + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.Height} Height + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Height.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.Height(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.revisionNumber = reader.uint64(); + break; + case 2: + message.revisionHeight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Height message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.Height + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.Height} Height + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Height.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Height message. + * @function verify + * @memberof ibc.core.client.v1.Height + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Height.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) + if (!$util.isInteger(message.revisionNumber) && !(message.revisionNumber && $util.isInteger(message.revisionNumber.low) && $util.isInteger(message.revisionNumber.high))) + return "revisionNumber: integer|Long expected"; + if (message.revisionHeight != null && message.hasOwnProperty("revisionHeight")) + if (!$util.isInteger(message.revisionHeight) && !(message.revisionHeight && $util.isInteger(message.revisionHeight.low) && $util.isInteger(message.revisionHeight.high))) + return "revisionHeight: integer|Long expected"; + return null; + }; + + /** + * Creates an Height message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.Height + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.Height} Height + */ + Height.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.Height) + return object; + let message = new $root.ibc.core.client.v1.Height(); + if (object.revisionNumber != null) + if ($util.Long) + (message.revisionNumber = $util.Long.fromValue(object.revisionNumber)).unsigned = true; + else if (typeof object.revisionNumber === "string") + message.revisionNumber = parseInt(object.revisionNumber, 10); + else if (typeof object.revisionNumber === "number") + message.revisionNumber = object.revisionNumber; + else if (typeof object.revisionNumber === "object") + message.revisionNumber = new $util.LongBits(object.revisionNumber.low >>> 0, object.revisionNumber.high >>> 0).toNumber(true); + if (object.revisionHeight != null) + if ($util.Long) + (message.revisionHeight = $util.Long.fromValue(object.revisionHeight)).unsigned = true; + else if (typeof object.revisionHeight === "string") + message.revisionHeight = parseInt(object.revisionHeight, 10); + else if (typeof object.revisionHeight === "number") + message.revisionHeight = object.revisionHeight; + else if (typeof object.revisionHeight === "object") + message.revisionHeight = new $util.LongBits(object.revisionHeight.low >>> 0, object.revisionHeight.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from an Height message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.Height + * @static + * @param {ibc.core.client.v1.Height} message Height + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Height.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.revisionNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.revisionNumber = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.revisionHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.revisionHeight = options.longs === String ? "0" : 0; + } + if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) + if (typeof message.revisionNumber === "number") + object.revisionNumber = options.longs === String ? String(message.revisionNumber) : message.revisionNumber; + else + object.revisionNumber = options.longs === String ? $util.Long.prototype.toString.call(message.revisionNumber) : options.longs === Number ? new $util.LongBits(message.revisionNumber.low >>> 0, message.revisionNumber.high >>> 0).toNumber(true) : message.revisionNumber; + if (message.revisionHeight != null && message.hasOwnProperty("revisionHeight")) + if (typeof message.revisionHeight === "number") + object.revisionHeight = options.longs === String ? String(message.revisionHeight) : message.revisionHeight; + else + object.revisionHeight = options.longs === String ? $util.Long.prototype.toString.call(message.revisionHeight) : options.longs === Number ? new $util.LongBits(message.revisionHeight.low >>> 0, message.revisionHeight.high >>> 0).toNumber(true) : message.revisionHeight; + return object; + }; + + /** + * Converts this Height to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.Height + * @instance + * @returns {Object.} JSON object + */ + Height.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Height; + })(v1.Height || {}); + + v1.Params = (function(Params) { + + /** + * Properties of a Params. + * @memberof ibc.core.client.v1 + * @interface IParams + * @property {Array.|null} [allowedClients] Params allowedClients + */ + + /** + * Constructs a new Params. + * @memberof ibc.core.client.v1 + * @classdesc Represents a Params. + * @implements IParams + * @constructor + * @param {ibc.core.client.v1.IParams=} [properties] Properties to set + */ + function Params(properties) { + this.allowedClients = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Params allowedClients. + * @member {Array.} allowedClients + * @memberof ibc.core.client.v1.Params + * @instance + */ + Params.prototype.allowedClients = $util.emptyArray; + + /** + * Creates a new Params instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.Params + * @static + * @param {ibc.core.client.v1.IParams=} [properties] Properties to set + * @returns {ibc.core.client.v1.Params} Params instance + */ + Params.create = function create(properties) { + return new Params(properties); + }; + + /** + * Encodes the specified Params message. Does not implicitly {@link ibc.core.client.v1.Params.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.Params + * @static + * @param {ibc.core.client.v1.IParams} message Params message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Params.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedClients != null && message.allowedClients.length) + for (let i = 0; i < message.allowedClients.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedClients[i]); + return writer; + }; + + /** + * Encodes the specified Params message, length delimited. Does not implicitly {@link ibc.core.client.v1.Params.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.Params + * @static + * @param {ibc.core.client.v1.IParams} message Params message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Params.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Params message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.Params + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.Params} Params + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Params.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.Params(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.allowedClients && message.allowedClients.length)) + message.allowedClients = []; + message.allowedClients.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Params message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.Params + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.Params} Params + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Params.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Params message. + * @function verify + * @memberof ibc.core.client.v1.Params + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Params.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedClients != null && message.hasOwnProperty("allowedClients")) { + if (!Array.isArray(message.allowedClients)) + return "allowedClients: array expected"; + for (let i = 0; i < message.allowedClients.length; ++i) + if (!$util.isString(message.allowedClients[i])) + return "allowedClients: string[] expected"; + } + return null; + }; + + /** + * Creates a Params message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.Params + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.Params} Params + */ + Params.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.Params) + return object; + let message = new $root.ibc.core.client.v1.Params(); + if (object.allowedClients) { + if (!Array.isArray(object.allowedClients)) + throw TypeError(".ibc.core.client.v1.Params.allowedClients: array expected"); + message.allowedClients = []; + for (let i = 0; i < object.allowedClients.length; ++i) + message.allowedClients[i] = String(object.allowedClients[i]); + } + return message; + }; + + /** + * Creates a plain object from a Params message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.Params + * @static + * @param {ibc.core.client.v1.Params} message Params + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Params.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.allowedClients = []; + if (message.allowedClients && message.allowedClients.length) { + object.allowedClients = []; + for (let j = 0; j < message.allowedClients.length; ++j) + object.allowedClients[j] = message.allowedClients[j]; + } + return object; + }; + + /** + * Converts this Params to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.Params + * @instance + * @returns {Object.} JSON object + */ + Params.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Params; + })(v1.Params || {}); + + v1.GenesisState = (function(GenesisState) { + + /** + * Properties of a GenesisState. + * @memberof ibc.core.client.v1 + * @interface IGenesisState + * @property {Array.|null} [clients] GenesisState clients + * @property {Array.|null} [clientsConsensus] GenesisState clientsConsensus + * @property {Array.|null} [clientsMetadata] GenesisState clientsMetadata + * @property {ibc.core.client.v1.IParams|null} [params] GenesisState params + * @property {boolean|null} [createLocalhost] GenesisState createLocalhost + * @property {number|Long|null} [nextClientSequence] GenesisState nextClientSequence + */ + + /** + * Constructs a new GenesisState. + * @memberof ibc.core.client.v1 + * @classdesc Represents a GenesisState. + * @implements IGenesisState + * @constructor + * @param {ibc.core.client.v1.IGenesisState=} [properties] Properties to set + */ + function GenesisState(properties) { + this.clients = []; + this.clientsConsensus = []; + this.clientsMetadata = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenesisState clients. + * @member {Array.} clients + * @memberof ibc.core.client.v1.GenesisState + * @instance + */ + GenesisState.prototype.clients = $util.emptyArray; + + /** + * GenesisState clientsConsensus. + * @member {Array.} clientsConsensus + * @memberof ibc.core.client.v1.GenesisState + * @instance + */ + GenesisState.prototype.clientsConsensus = $util.emptyArray; + + /** + * GenesisState clientsMetadata. + * @member {Array.} clientsMetadata + * @memberof ibc.core.client.v1.GenesisState + * @instance + */ + GenesisState.prototype.clientsMetadata = $util.emptyArray; + + /** + * GenesisState params. + * @member {ibc.core.client.v1.IParams|null|undefined} params + * @memberof ibc.core.client.v1.GenesisState + * @instance + */ + GenesisState.prototype.params = null; + + /** + * GenesisState createLocalhost. + * @member {boolean} createLocalhost + * @memberof ibc.core.client.v1.GenesisState + * @instance + */ + GenesisState.prototype.createLocalhost = false; + + /** + * GenesisState nextClientSequence. + * @member {number|Long} nextClientSequence + * @memberof ibc.core.client.v1.GenesisState + * @instance + */ + GenesisState.prototype.nextClientSequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new GenesisState instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.GenesisState + * @static + * @param {ibc.core.client.v1.IGenesisState=} [properties] Properties to set + * @returns {ibc.core.client.v1.GenesisState} GenesisState instance + */ + GenesisState.create = function create(properties) { + return new GenesisState(properties); + }; + + /** + * Encodes the specified GenesisState message. Does not implicitly {@link ibc.core.client.v1.GenesisState.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.GenesisState + * @static + * @param {ibc.core.client.v1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clients != null && message.clients.length) + for (let i = 0; i < message.clients.length; ++i) + $root.ibc.core.client.v1.IdentifiedClientState.encode(message.clients[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.clientsConsensus != null && message.clientsConsensus.length) + for (let i = 0; i < message.clientsConsensus.length; ++i) + $root.ibc.core.client.v1.ClientConsensusStates.encode(message.clientsConsensus[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.clientsMetadata != null && message.clientsMetadata.length) + for (let i = 0; i < message.clientsMetadata.length; ++i) + $root.ibc.core.client.v1.IdentifiedGenesisMetadata.encode(message.clientsMetadata[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.ibc.core.client.v1.Params.encode(message.params, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.createLocalhost != null && Object.hasOwnProperty.call(message, "createLocalhost")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.createLocalhost); + if (message.nextClientSequence != null && Object.hasOwnProperty.call(message, "nextClientSequence")) + writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.nextClientSequence); + return writer; + }; + + /** + * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link ibc.core.client.v1.GenesisState.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.GenesisState + * @static + * @param {ibc.core.client.v1.IGenesisState} message GenesisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.GenesisState(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.clients && message.clients.length)) + message.clients = []; + message.clients.push($root.ibc.core.client.v1.IdentifiedClientState.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.clientsConsensus && message.clientsConsensus.length)) + message.clientsConsensus = []; + message.clientsConsensus.push($root.ibc.core.client.v1.ClientConsensusStates.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.clientsMetadata && message.clientsMetadata.length)) + message.clientsMetadata = []; + message.clientsMetadata.push($root.ibc.core.client.v1.IdentifiedGenesisMetadata.decode(reader, reader.uint32())); + break; + case 4: + message.params = $root.ibc.core.client.v1.Params.decode(reader, reader.uint32()); + break; + case 5: + message.createLocalhost = reader.bool(); + break; + case 6: + message.nextClientSequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenesisState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.GenesisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.GenesisState} GenesisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenesisState message. + * @function verify + * @memberof ibc.core.client.v1.GenesisState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenesisState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clients != null && message.hasOwnProperty("clients")) { + if (!Array.isArray(message.clients)) + return "clients: array expected"; + for (let i = 0; i < message.clients.length; ++i) { + let error = $root.ibc.core.client.v1.IdentifiedClientState.verify(message.clients[i]); + if (error) + return "clients." + error; + } + } + if (message.clientsConsensus != null && message.hasOwnProperty("clientsConsensus")) { + if (!Array.isArray(message.clientsConsensus)) + return "clientsConsensus: array expected"; + for (let i = 0; i < message.clientsConsensus.length; ++i) { + let error = $root.ibc.core.client.v1.ClientConsensusStates.verify(message.clientsConsensus[i]); + if (error) + return "clientsConsensus." + error; + } + } + if (message.clientsMetadata != null && message.hasOwnProperty("clientsMetadata")) { + if (!Array.isArray(message.clientsMetadata)) + return "clientsMetadata: array expected"; + for (let i = 0; i < message.clientsMetadata.length; ++i) { + let error = $root.ibc.core.client.v1.IdentifiedGenesisMetadata.verify(message.clientsMetadata[i]); + if (error) + return "clientsMetadata." + error; + } + } + if (message.params != null && message.hasOwnProperty("params")) { + let error = $root.ibc.core.client.v1.Params.verify(message.params); + if (error) + return "params." + error; + } + if (message.createLocalhost != null && message.hasOwnProperty("createLocalhost")) + if (typeof message.createLocalhost !== "boolean") + return "createLocalhost: boolean expected"; + if (message.nextClientSequence != null && message.hasOwnProperty("nextClientSequence")) + if (!$util.isInteger(message.nextClientSequence) && !(message.nextClientSequence && $util.isInteger(message.nextClientSequence.low) && $util.isInteger(message.nextClientSequence.high))) + return "nextClientSequence: integer|Long expected"; + return null; + }; + + /** + * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.GenesisState + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.GenesisState} GenesisState + */ + GenesisState.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.GenesisState) + return object; + let message = new $root.ibc.core.client.v1.GenesisState(); + if (object.clients) { + if (!Array.isArray(object.clients)) + throw TypeError(".ibc.core.client.v1.GenesisState.clients: array expected"); + message.clients = []; + for (let i = 0; i < object.clients.length; ++i) { + if (typeof object.clients[i] !== "object") + throw TypeError(".ibc.core.client.v1.GenesisState.clients: object expected"); + message.clients[i] = $root.ibc.core.client.v1.IdentifiedClientState.fromObject(object.clients[i]); + } + } + if (object.clientsConsensus) { + if (!Array.isArray(object.clientsConsensus)) + throw TypeError(".ibc.core.client.v1.GenesisState.clientsConsensus: array expected"); + message.clientsConsensus = []; + for (let i = 0; i < object.clientsConsensus.length; ++i) { + if (typeof object.clientsConsensus[i] !== "object") + throw TypeError(".ibc.core.client.v1.GenesisState.clientsConsensus: object expected"); + message.clientsConsensus[i] = $root.ibc.core.client.v1.ClientConsensusStates.fromObject(object.clientsConsensus[i]); + } + } + if (object.clientsMetadata) { + if (!Array.isArray(object.clientsMetadata)) + throw TypeError(".ibc.core.client.v1.GenesisState.clientsMetadata: array expected"); + message.clientsMetadata = []; + for (let i = 0; i < object.clientsMetadata.length; ++i) { + if (typeof object.clientsMetadata[i] !== "object") + throw TypeError(".ibc.core.client.v1.GenesisState.clientsMetadata: object expected"); + message.clientsMetadata[i] = $root.ibc.core.client.v1.IdentifiedGenesisMetadata.fromObject(object.clientsMetadata[i]); + } + } + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".ibc.core.client.v1.GenesisState.params: object expected"); + message.params = $root.ibc.core.client.v1.Params.fromObject(object.params); + } + if (object.createLocalhost != null) + message.createLocalhost = Boolean(object.createLocalhost); + if (object.nextClientSequence != null) + if ($util.Long) + (message.nextClientSequence = $util.Long.fromValue(object.nextClientSequence)).unsigned = true; + else if (typeof object.nextClientSequence === "string") + message.nextClientSequence = parseInt(object.nextClientSequence, 10); + else if (typeof object.nextClientSequence === "number") + message.nextClientSequence = object.nextClientSequence; + else if (typeof object.nextClientSequence === "object") + message.nextClientSequence = new $util.LongBits(object.nextClientSequence.low >>> 0, object.nextClientSequence.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a GenesisState message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.GenesisState + * @static + * @param {ibc.core.client.v1.GenesisState} message GenesisState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenesisState.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) { + object.clients = []; + object.clientsConsensus = []; + object.clientsMetadata = []; + } + if (options.defaults) { + object.params = null; + object.createLocalhost = false; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.nextClientSequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nextClientSequence = options.longs === String ? "0" : 0; + } + if (message.clients && message.clients.length) { + object.clients = []; + for (let j = 0; j < message.clients.length; ++j) + object.clients[j] = $root.ibc.core.client.v1.IdentifiedClientState.toObject(message.clients[j], options); + } + if (message.clientsConsensus && message.clientsConsensus.length) { + object.clientsConsensus = []; + for (let j = 0; j < message.clientsConsensus.length; ++j) + object.clientsConsensus[j] = $root.ibc.core.client.v1.ClientConsensusStates.toObject(message.clientsConsensus[j], options); + } + if (message.clientsMetadata && message.clientsMetadata.length) { + object.clientsMetadata = []; + for (let j = 0; j < message.clientsMetadata.length; ++j) + object.clientsMetadata[j] = $root.ibc.core.client.v1.IdentifiedGenesisMetadata.toObject(message.clientsMetadata[j], options); + } + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.ibc.core.client.v1.Params.toObject(message.params, options); + if (message.createLocalhost != null && message.hasOwnProperty("createLocalhost")) + object.createLocalhost = message.createLocalhost; + if (message.nextClientSequence != null && message.hasOwnProperty("nextClientSequence")) + if (typeof message.nextClientSequence === "number") + object.nextClientSequence = options.longs === String ? String(message.nextClientSequence) : message.nextClientSequence; + else + object.nextClientSequence = options.longs === String ? $util.Long.prototype.toString.call(message.nextClientSequence) : options.longs === Number ? new $util.LongBits(message.nextClientSequence.low >>> 0, message.nextClientSequence.high >>> 0).toNumber(true) : message.nextClientSequence; + return object; + }; + + /** + * Converts this GenesisState to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.GenesisState + * @instance + * @returns {Object.} JSON object + */ + GenesisState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GenesisState; + })(v1.GenesisState || {}); + + v1.GenesisMetadata = (function(GenesisMetadata) { + + /** + * Properties of a GenesisMetadata. + * @memberof ibc.core.client.v1 + * @interface IGenesisMetadata + * @property {Uint8Array|null} [key] GenesisMetadata key + * @property {Uint8Array|null} [value] GenesisMetadata value + */ + + /** + * Constructs a new GenesisMetadata. + * @memberof ibc.core.client.v1 + * @classdesc Represents a GenesisMetadata. + * @implements IGenesisMetadata + * @constructor + * @param {ibc.core.client.v1.IGenesisMetadata=} [properties] Properties to set + */ + function GenesisMetadata(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenesisMetadata key. + * @member {Uint8Array} key + * @memberof ibc.core.client.v1.GenesisMetadata + * @instance + */ + GenesisMetadata.prototype.key = $util.newBuffer([]); + + /** + * GenesisMetadata value. + * @member {Uint8Array} value + * @memberof ibc.core.client.v1.GenesisMetadata + * @instance + */ + GenesisMetadata.prototype.value = $util.newBuffer([]); + + /** + * Creates a new GenesisMetadata instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.GenesisMetadata + * @static + * @param {ibc.core.client.v1.IGenesisMetadata=} [properties] Properties to set + * @returns {ibc.core.client.v1.GenesisMetadata} GenesisMetadata instance + */ + GenesisMetadata.create = function create(properties) { + return new GenesisMetadata(properties); + }; + + /** + * Encodes the specified GenesisMetadata message. Does not implicitly {@link ibc.core.client.v1.GenesisMetadata.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.GenesisMetadata + * @static + * @param {ibc.core.client.v1.IGenesisMetadata} message GenesisMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified GenesisMetadata message, length delimited. Does not implicitly {@link ibc.core.client.v1.GenesisMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.GenesisMetadata + * @static + * @param {ibc.core.client.v1.IGenesisMetadata} message GenesisMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenesisMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenesisMetadata message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.GenesisMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.GenesisMetadata} GenesisMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.GenesisMetadata(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenesisMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.GenesisMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.GenesisMetadata} GenesisMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenesisMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenesisMetadata message. + * @function verify + * @memberof ibc.core.client.v1.GenesisMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenesisMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a GenesisMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.GenesisMetadata + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.GenesisMetadata} GenesisMetadata + */ + GenesisMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.GenesisMetadata) + return object; + let message = new $root.ibc.core.client.v1.GenesisMetadata(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length) + message.key = object.key; + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a GenesisMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.GenesisMetadata + * @static + * @param {ibc.core.client.v1.GenesisMetadata} message GenesisMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenesisMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this GenesisMetadata to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.GenesisMetadata + * @instance + * @returns {Object.} JSON object + */ + GenesisMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GenesisMetadata; + })(v1.GenesisMetadata || {}); + + v1.IdentifiedGenesisMetadata = (function(IdentifiedGenesisMetadata) { + + /** + * Properties of an IdentifiedGenesisMetadata. + * @memberof ibc.core.client.v1 + * @interface IIdentifiedGenesisMetadata + * @property {string|null} [clientId] IdentifiedGenesisMetadata clientId + * @property {Array.|null} [clientMetadata] IdentifiedGenesisMetadata clientMetadata + */ + + /** + * Constructs a new IdentifiedGenesisMetadata. + * @memberof ibc.core.client.v1 + * @classdesc Represents an IdentifiedGenesisMetadata. + * @implements IIdentifiedGenesisMetadata + * @constructor + * @param {ibc.core.client.v1.IIdentifiedGenesisMetadata=} [properties] Properties to set + */ + function IdentifiedGenesisMetadata(properties) { + this.clientMetadata = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IdentifiedGenesisMetadata clientId. + * @member {string} clientId + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @instance + */ + IdentifiedGenesisMetadata.prototype.clientId = ""; + + /** + * IdentifiedGenesisMetadata clientMetadata. + * @member {Array.} clientMetadata + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @instance + */ + IdentifiedGenesisMetadata.prototype.clientMetadata = $util.emptyArray; + + /** + * Creates a new IdentifiedGenesisMetadata instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @static + * @param {ibc.core.client.v1.IIdentifiedGenesisMetadata=} [properties] Properties to set + * @returns {ibc.core.client.v1.IdentifiedGenesisMetadata} IdentifiedGenesisMetadata instance + */ + IdentifiedGenesisMetadata.create = function create(properties) { + return new IdentifiedGenesisMetadata(properties); + }; + + /** + * Encodes the specified IdentifiedGenesisMetadata message. Does not implicitly {@link ibc.core.client.v1.IdentifiedGenesisMetadata.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @static + * @param {ibc.core.client.v1.IIdentifiedGenesisMetadata} message IdentifiedGenesisMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentifiedGenesisMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.clientMetadata != null && message.clientMetadata.length) + for (let i = 0; i < message.clientMetadata.length; ++i) + $root.ibc.core.client.v1.GenesisMetadata.encode(message.clientMetadata[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IdentifiedGenesisMetadata message, length delimited. Does not implicitly {@link ibc.core.client.v1.IdentifiedGenesisMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @static + * @param {ibc.core.client.v1.IIdentifiedGenesisMetadata} message IdentifiedGenesisMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentifiedGenesisMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentifiedGenesisMetadata message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.IdentifiedGenesisMetadata} IdentifiedGenesisMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentifiedGenesisMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.IdentifiedGenesisMetadata(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + if (!(message.clientMetadata && message.clientMetadata.length)) + message.clientMetadata = []; + message.clientMetadata.push($root.ibc.core.client.v1.GenesisMetadata.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentifiedGenesisMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.IdentifiedGenesisMetadata} IdentifiedGenesisMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentifiedGenesisMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentifiedGenesisMetadata message. + * @function verify + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentifiedGenesisMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.clientMetadata != null && message.hasOwnProperty("clientMetadata")) { + if (!Array.isArray(message.clientMetadata)) + return "clientMetadata: array expected"; + for (let i = 0; i < message.clientMetadata.length; ++i) { + let error = $root.ibc.core.client.v1.GenesisMetadata.verify(message.clientMetadata[i]); + if (error) + return "clientMetadata." + error; + } + } + return null; + }; + + /** + * Creates an IdentifiedGenesisMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.IdentifiedGenesisMetadata} IdentifiedGenesisMetadata + */ + IdentifiedGenesisMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.IdentifiedGenesisMetadata) + return object; + let message = new $root.ibc.core.client.v1.IdentifiedGenesisMetadata(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.clientMetadata) { + if (!Array.isArray(object.clientMetadata)) + throw TypeError(".ibc.core.client.v1.IdentifiedGenesisMetadata.clientMetadata: array expected"); + message.clientMetadata = []; + for (let i = 0; i < object.clientMetadata.length; ++i) { + if (typeof object.clientMetadata[i] !== "object") + throw TypeError(".ibc.core.client.v1.IdentifiedGenesisMetadata.clientMetadata: object expected"); + message.clientMetadata[i] = $root.ibc.core.client.v1.GenesisMetadata.fromObject(object.clientMetadata[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an IdentifiedGenesisMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @static + * @param {ibc.core.client.v1.IdentifiedGenesisMetadata} message IdentifiedGenesisMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentifiedGenesisMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.clientMetadata = []; + if (options.defaults) + object.clientId = ""; + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.clientMetadata && message.clientMetadata.length) { + object.clientMetadata = []; + for (let j = 0; j < message.clientMetadata.length; ++j) + object.clientMetadata[j] = $root.ibc.core.client.v1.GenesisMetadata.toObject(message.clientMetadata[j], options); + } + return object; + }; + + /** + * Converts this IdentifiedGenesisMetadata to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata + * @instance + * @returns {Object.} JSON object + */ + IdentifiedGenesisMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentifiedGenesisMetadata; + })(v1.IdentifiedGenesisMetadata || {}); + + v1.Query = (function(Query) { + + /** + * Constructs a new Query service. + * @memberof ibc.core.client.v1 + * @classdesc Represents a Query + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Query(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; + + /** + * Creates new Query service using the specified rpc implementation. + * @function create + * @memberof ibc.core.client.v1.Query + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Query} RPC service. Useful where requests and/or responses are streamed. + */ + Query.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link ibc.core.client.v1.Query#clientState}. + * @memberof ibc.core.client.v1.Query + * @typedef ClientStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.client.v1.IQueryClientStateResponse} [response] QueryClientStateResponse + */ + + /** + * Calls ClientState. + * @function clientState + * @memberof ibc.core.client.v1.Query + * @instance + * @param {ibc.core.client.v1.IQueryClientStateRequest} request QueryClientStateRequest message or plain object + * @param {ibc.core.client.v1.Query.ClientStateCallback} callback Node-style callback called with the error, if any, and QueryClientStateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.clientState = function clientState(request, callback) { + return this.rpcCall(clientState, $root.ibc.core.client.v1.QueryClientStateRequest, $root.ibc.core.client.v1.QueryClientStateResponse, request, callback); + }, "name", { value: "ClientState" }); + + /** + * Calls ClientState. + * @function clientState + * @memberof ibc.core.client.v1.Query + * @instance + * @param {ibc.core.client.v1.IQueryClientStateRequest} request QueryClientStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.client.v1.Query#clientStates}. + * @memberof ibc.core.client.v1.Query + * @typedef ClientStatesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.client.v1.IQueryClientStatesResponse} [response] QueryClientStatesResponse + */ + + /** + * Calls ClientStates. + * @function clientStates + * @memberof ibc.core.client.v1.Query + * @instance + * @param {ibc.core.client.v1.IQueryClientStatesRequest} request QueryClientStatesRequest message or plain object + * @param {ibc.core.client.v1.Query.ClientStatesCallback} callback Node-style callback called with the error, if any, and QueryClientStatesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.clientStates = function clientStates(request, callback) { + return this.rpcCall(clientStates, $root.ibc.core.client.v1.QueryClientStatesRequest, $root.ibc.core.client.v1.QueryClientStatesResponse, request, callback); + }, "name", { value: "ClientStates" }); + + /** + * Calls ClientStates. + * @function clientStates + * @memberof ibc.core.client.v1.Query + * @instance + * @param {ibc.core.client.v1.IQueryClientStatesRequest} request QueryClientStatesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.client.v1.Query#consensusState}. + * @memberof ibc.core.client.v1.Query + * @typedef ConsensusStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.client.v1.IQueryConsensusStateResponse} [response] QueryConsensusStateResponse + */ + + /** + * Calls ConsensusState. + * @function consensusState + * @memberof ibc.core.client.v1.Query + * @instance + * @param {ibc.core.client.v1.IQueryConsensusStateRequest} request QueryConsensusStateRequest message or plain object + * @param {ibc.core.client.v1.Query.ConsensusStateCallback} callback Node-style callback called with the error, if any, and QueryConsensusStateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.consensusState = function consensusState(request, callback) { + return this.rpcCall(consensusState, $root.ibc.core.client.v1.QueryConsensusStateRequest, $root.ibc.core.client.v1.QueryConsensusStateResponse, request, callback); + }, "name", { value: "ConsensusState" }); + + /** + * Calls ConsensusState. + * @function consensusState + * @memberof ibc.core.client.v1.Query + * @instance + * @param {ibc.core.client.v1.IQueryConsensusStateRequest} request QueryConsensusStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.client.v1.Query#consensusStates}. + * @memberof ibc.core.client.v1.Query + * @typedef ConsensusStatesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.client.v1.IQueryConsensusStatesResponse} [response] QueryConsensusStatesResponse + */ + + /** + * Calls ConsensusStates. + * @function consensusStates + * @memberof ibc.core.client.v1.Query + * @instance + * @param {ibc.core.client.v1.IQueryConsensusStatesRequest} request QueryConsensusStatesRequest message or plain object + * @param {ibc.core.client.v1.Query.ConsensusStatesCallback} callback Node-style callback called with the error, if any, and QueryConsensusStatesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.consensusStates = function consensusStates(request, callback) { + return this.rpcCall(consensusStates, $root.ibc.core.client.v1.QueryConsensusStatesRequest, $root.ibc.core.client.v1.QueryConsensusStatesResponse, request, callback); + }, "name", { value: "ConsensusStates" }); + + /** + * Calls ConsensusStates. + * @function consensusStates + * @memberof ibc.core.client.v1.Query + * @instance + * @param {ibc.core.client.v1.IQueryConsensusStatesRequest} request QueryConsensusStatesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.client.v1.Query#clientParams}. + * @memberof ibc.core.client.v1.Query + * @typedef ClientParamsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.client.v1.IQueryClientParamsResponse} [response] QueryClientParamsResponse + */ + + /** + * Calls ClientParams. + * @function clientParams + * @memberof ibc.core.client.v1.Query + * @instance + * @param {ibc.core.client.v1.IQueryClientParamsRequest} request QueryClientParamsRequest message or plain object + * @param {ibc.core.client.v1.Query.ClientParamsCallback} callback Node-style callback called with the error, if any, and QueryClientParamsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Query.prototype.clientParams = function clientParams(request, callback) { + return this.rpcCall(clientParams, $root.ibc.core.client.v1.QueryClientParamsRequest, $root.ibc.core.client.v1.QueryClientParamsResponse, request, callback); + }, "name", { value: "ClientParams" }); + + /** + * Calls ClientParams. + * @function clientParams + * @memberof ibc.core.client.v1.Query + * @instance + * @param {ibc.core.client.v1.IQueryClientParamsRequest} request QueryClientParamsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Query; + })(v1.Query || {}); + + v1.QueryClientStateRequest = (function(QueryClientStateRequest) { + + /** + * Properties of a QueryClientStateRequest. + * @memberof ibc.core.client.v1 + * @interface IQueryClientStateRequest + * @property {string|null} [clientId] QueryClientStateRequest clientId + */ + + /** + * Constructs a new QueryClientStateRequest. + * @memberof ibc.core.client.v1 + * @classdesc Represents a QueryClientStateRequest. + * @implements IQueryClientStateRequest + * @constructor + * @param {ibc.core.client.v1.IQueryClientStateRequest=} [properties] Properties to set + */ + function QueryClientStateRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryClientStateRequest clientId. + * @member {string} clientId + * @memberof ibc.core.client.v1.QueryClientStateRequest + * @instance + */ + QueryClientStateRequest.prototype.clientId = ""; + + /** + * Creates a new QueryClientStateRequest instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.QueryClientStateRequest + * @static + * @param {ibc.core.client.v1.IQueryClientStateRequest=} [properties] Properties to set + * @returns {ibc.core.client.v1.QueryClientStateRequest} QueryClientStateRequest instance + */ + QueryClientStateRequest.create = function create(properties) { + return new QueryClientStateRequest(properties); + }; + + /** + * Encodes the specified QueryClientStateRequest message. Does not implicitly {@link ibc.core.client.v1.QueryClientStateRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.QueryClientStateRequest + * @static + * @param {ibc.core.client.v1.IQueryClientStateRequest} message QueryClientStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientStateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + return writer; + }; + + /** + * Encodes the specified QueryClientStateRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.QueryClientStateRequest + * @static + * @param {ibc.core.client.v1.IQueryClientStateRequest} message QueryClientStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryClientStateRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.QueryClientStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.QueryClientStateRequest} QueryClientStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientStateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientStateRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryClientStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.QueryClientStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.QueryClientStateRequest} QueryClientStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryClientStateRequest message. + * @function verify + * @memberof ibc.core.client.v1.QueryClientStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryClientStateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + return null; + }; + + /** + * Creates a QueryClientStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.QueryClientStateRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.QueryClientStateRequest} QueryClientStateRequest + */ + QueryClientStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.QueryClientStateRequest) + return object; + let message = new $root.ibc.core.client.v1.QueryClientStateRequest(); + if (object.clientId != null) + message.clientId = String(object.clientId); + return message; + }; + + /** + * Creates a plain object from a QueryClientStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.QueryClientStateRequest + * @static + * @param {ibc.core.client.v1.QueryClientStateRequest} message QueryClientStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryClientStateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.clientId = ""; + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + return object; + }; + + /** + * Converts this QueryClientStateRequest to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.QueryClientStateRequest + * @instance + * @returns {Object.} JSON object + */ + QueryClientStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryClientStateRequest; + })(v1.QueryClientStateRequest || {}); + + v1.QueryClientStateResponse = (function(QueryClientStateResponse) { + + /** + * Properties of a QueryClientStateResponse. + * @memberof ibc.core.client.v1 + * @interface IQueryClientStateResponse + * @property {google.protobuf.IAny|null} [clientState] QueryClientStateResponse clientState + * @property {Uint8Array|null} [proof] QueryClientStateResponse proof + * @property {ibc.core.client.v1.IHeight|null} [proofHeight] QueryClientStateResponse proofHeight + */ + + /** + * Constructs a new QueryClientStateResponse. + * @memberof ibc.core.client.v1 + * @classdesc Represents a QueryClientStateResponse. + * @implements IQueryClientStateResponse + * @constructor + * @param {ibc.core.client.v1.IQueryClientStateResponse=} [properties] Properties to set + */ + function QueryClientStateResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryClientStateResponse clientState. + * @member {google.protobuf.IAny|null|undefined} clientState + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @instance + */ + QueryClientStateResponse.prototype.clientState = null; + + /** + * QueryClientStateResponse proof. + * @member {Uint8Array} proof + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @instance + */ + QueryClientStateResponse.prototype.proof = $util.newBuffer([]); + + /** + * QueryClientStateResponse proofHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} proofHeight + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @instance + */ + QueryClientStateResponse.prototype.proofHeight = null; + + /** + * Creates a new QueryClientStateResponse instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @static + * @param {ibc.core.client.v1.IQueryClientStateResponse=} [properties] Properties to set + * @returns {ibc.core.client.v1.QueryClientStateResponse} QueryClientStateResponse instance + */ + QueryClientStateResponse.create = function create(properties) { + return new QueryClientStateResponse(properties); + }; + + /** + * Encodes the specified QueryClientStateResponse message. Does not implicitly {@link ibc.core.client.v1.QueryClientStateResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @static + * @param {ibc.core.client.v1.IQueryClientStateResponse} message QueryClientStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientStateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientState != null && Object.hasOwnProperty.call(message, "clientState")) + $root.google.protobuf.Any.encode(message.clientState, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); + if (message.proofHeight != null && Object.hasOwnProperty.call(message, "proofHeight")) + $root.ibc.core.client.v1.Height.encode(message.proofHeight, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryClientStateResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientStateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @static + * @param {ibc.core.client.v1.IQueryClientStateResponse} message QueryClientStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientStateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryClientStateResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.QueryClientStateResponse} QueryClientStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientStateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientStateResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientState = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryClientStateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.QueryClientStateResponse} QueryClientStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientStateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryClientStateResponse message. + * @function verify + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryClientStateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientState != null && message.hasOwnProperty("clientState")) { + let error = $root.google.protobuf.Any.verify(message.clientState); + if (error) + return "clientState." + error; + } + if (message.proof != null && message.hasOwnProperty("proof")) + if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) + return "proof: buffer expected"; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) { + let error = $root.ibc.core.client.v1.Height.verify(message.proofHeight); + if (error) + return "proofHeight." + error; + } + return null; + }; + + /** + * Creates a QueryClientStateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.QueryClientStateResponse} QueryClientStateResponse + */ + QueryClientStateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.QueryClientStateResponse) + return object; + let message = new $root.ibc.core.client.v1.QueryClientStateResponse(); + if (object.clientState != null) { + if (typeof object.clientState !== "object") + throw TypeError(".ibc.core.client.v1.QueryClientStateResponse.clientState: object expected"); + message.clientState = $root.google.protobuf.Any.fromObject(object.clientState); + } + if (object.proof != null) + if (typeof object.proof === "string") + $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); + else if (object.proof.length) + message.proof = object.proof; + if (object.proofHeight != null) { + if (typeof object.proofHeight !== "object") + throw TypeError(".ibc.core.client.v1.QueryClientStateResponse.proofHeight: object expected"); + message.proofHeight = $root.ibc.core.client.v1.Height.fromObject(object.proofHeight); + } + return message; + }; + + /** + * Creates a plain object from a QueryClientStateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @static + * @param {ibc.core.client.v1.QueryClientStateResponse} message QueryClientStateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryClientStateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.clientState = null; + if (options.bytes === String) + object.proof = ""; + else { + object.proof = []; + if (options.bytes !== Array) + object.proof = $util.newBuffer(object.proof); + } + object.proofHeight = null; + } + if (message.clientState != null && message.hasOwnProperty("clientState")) + object.clientState = $root.google.protobuf.Any.toObject(message.clientState, options); + if (message.proof != null && message.hasOwnProperty("proof")) + object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) + object.proofHeight = $root.ibc.core.client.v1.Height.toObject(message.proofHeight, options); + return object; + }; + + /** + * Converts this QueryClientStateResponse to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.QueryClientStateResponse + * @instance + * @returns {Object.} JSON object + */ + QueryClientStateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryClientStateResponse; + })(v1.QueryClientStateResponse || {}); + + v1.QueryClientStatesRequest = (function(QueryClientStatesRequest) { + + /** + * Properties of a QueryClientStatesRequest. + * @memberof ibc.core.client.v1 + * @interface IQueryClientStatesRequest + * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryClientStatesRequest pagination + */ + + /** + * Constructs a new QueryClientStatesRequest. + * @memberof ibc.core.client.v1 + * @classdesc Represents a QueryClientStatesRequest. + * @implements IQueryClientStatesRequest + * @constructor + * @param {ibc.core.client.v1.IQueryClientStatesRequest=} [properties] Properties to set + */ + function QueryClientStatesRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryClientStatesRequest pagination. + * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination + * @memberof ibc.core.client.v1.QueryClientStatesRequest + * @instance + */ + QueryClientStatesRequest.prototype.pagination = null; + + /** + * Creates a new QueryClientStatesRequest instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.QueryClientStatesRequest + * @static + * @param {ibc.core.client.v1.IQueryClientStatesRequest=} [properties] Properties to set + * @returns {ibc.core.client.v1.QueryClientStatesRequest} QueryClientStatesRequest instance + */ + QueryClientStatesRequest.create = function create(properties) { + return new QueryClientStatesRequest(properties); + }; + + /** + * Encodes the specified QueryClientStatesRequest message. Does not implicitly {@link ibc.core.client.v1.QueryClientStatesRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.QueryClientStatesRequest + * @static + * @param {ibc.core.client.v1.IQueryClientStatesRequest} message QueryClientStatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientStatesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryClientStatesRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientStatesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.QueryClientStatesRequest + * @static + * @param {ibc.core.client.v1.IQueryClientStatesRequest} message QueryClientStatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientStatesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryClientStatesRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.QueryClientStatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.QueryClientStatesRequest} QueryClientStatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientStatesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientStatesRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryClientStatesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.QueryClientStatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.QueryClientStatesRequest} QueryClientStatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientStatesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryClientStatesRequest message. + * @function verify + * @memberof ibc.core.client.v1.QueryClientStatesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryClientStatesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryClientStatesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.QueryClientStatesRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.QueryClientStatesRequest} QueryClientStatesRequest + */ + QueryClientStatesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.QueryClientStatesRequest) + return object; + let message = new $root.ibc.core.client.v1.QueryClientStatesRequest(); + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".ibc.core.client.v1.QueryClientStatesRequest.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryClientStatesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.QueryClientStatesRequest + * @static + * @param {ibc.core.client.v1.QueryClientStatesRequest} message QueryClientStatesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryClientStatesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.pagination = null; + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryClientStatesRequest to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.QueryClientStatesRequest + * @instance + * @returns {Object.} JSON object + */ + QueryClientStatesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryClientStatesRequest; + })(v1.QueryClientStatesRequest || {}); + + v1.QueryClientStatesResponse = (function(QueryClientStatesResponse) { + + /** + * Properties of a QueryClientStatesResponse. + * @memberof ibc.core.client.v1 + * @interface IQueryClientStatesResponse + * @property {Array.|null} [clientStates] QueryClientStatesResponse clientStates + * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryClientStatesResponse pagination + */ + + /** + * Constructs a new QueryClientStatesResponse. + * @memberof ibc.core.client.v1 + * @classdesc Represents a QueryClientStatesResponse. + * @implements IQueryClientStatesResponse + * @constructor + * @param {ibc.core.client.v1.IQueryClientStatesResponse=} [properties] Properties to set + */ + function QueryClientStatesResponse(properties) { + this.clientStates = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryClientStatesResponse clientStates. + * @member {Array.} clientStates + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @instance + */ + QueryClientStatesResponse.prototype.clientStates = $util.emptyArray; + + /** + * QueryClientStatesResponse pagination. + * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @instance + */ + QueryClientStatesResponse.prototype.pagination = null; + + /** + * Creates a new QueryClientStatesResponse instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @static + * @param {ibc.core.client.v1.IQueryClientStatesResponse=} [properties] Properties to set + * @returns {ibc.core.client.v1.QueryClientStatesResponse} QueryClientStatesResponse instance + */ + QueryClientStatesResponse.create = function create(properties) { + return new QueryClientStatesResponse(properties); + }; + + /** + * Encodes the specified QueryClientStatesResponse message. Does not implicitly {@link ibc.core.client.v1.QueryClientStatesResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @static + * @param {ibc.core.client.v1.IQueryClientStatesResponse} message QueryClientStatesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientStatesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientStates != null && message.clientStates.length) + for (let i = 0; i < message.clientStates.length; ++i) + $root.ibc.core.client.v1.IdentifiedClientState.encode(message.clientStates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryClientStatesResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientStatesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @static + * @param {ibc.core.client.v1.IQueryClientStatesResponse} message QueryClientStatesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientStatesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryClientStatesResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.QueryClientStatesResponse} QueryClientStatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientStatesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientStatesResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.clientStates && message.clientStates.length)) + message.clientStates = []; + message.clientStates.push($root.ibc.core.client.v1.IdentifiedClientState.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryClientStatesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.QueryClientStatesResponse} QueryClientStatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientStatesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryClientStatesResponse message. + * @function verify + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryClientStatesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientStates != null && message.hasOwnProperty("clientStates")) { + if (!Array.isArray(message.clientStates)) + return "clientStates: array expected"; + for (let i = 0; i < message.clientStates.length; ++i) { + let error = $root.ibc.core.client.v1.IdentifiedClientState.verify(message.clientStates[i]); + if (error) + return "clientStates." + error; + } + } + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryClientStatesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.QueryClientStatesResponse} QueryClientStatesResponse + */ + QueryClientStatesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.QueryClientStatesResponse) + return object; + let message = new $root.ibc.core.client.v1.QueryClientStatesResponse(); + if (object.clientStates) { + if (!Array.isArray(object.clientStates)) + throw TypeError(".ibc.core.client.v1.QueryClientStatesResponse.clientStates: array expected"); + message.clientStates = []; + for (let i = 0; i < object.clientStates.length; ++i) { + if (typeof object.clientStates[i] !== "object") + throw TypeError(".ibc.core.client.v1.QueryClientStatesResponse.clientStates: object expected"); + message.clientStates[i] = $root.ibc.core.client.v1.IdentifiedClientState.fromObject(object.clientStates[i]); + } + } + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".ibc.core.client.v1.QueryClientStatesResponse.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryClientStatesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @static + * @param {ibc.core.client.v1.QueryClientStatesResponse} message QueryClientStatesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryClientStatesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.clientStates = []; + if (options.defaults) + object.pagination = null; + if (message.clientStates && message.clientStates.length) { + object.clientStates = []; + for (let j = 0; j < message.clientStates.length; ++j) + object.clientStates[j] = $root.ibc.core.client.v1.IdentifiedClientState.toObject(message.clientStates[j], options); + } + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryClientStatesResponse to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.QueryClientStatesResponse + * @instance + * @returns {Object.} JSON object + */ + QueryClientStatesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryClientStatesResponse; + })(v1.QueryClientStatesResponse || {}); + + v1.QueryConsensusStateRequest = (function(QueryConsensusStateRequest) { + + /** + * Properties of a QueryConsensusStateRequest. + * @memberof ibc.core.client.v1 + * @interface IQueryConsensusStateRequest + * @property {string|null} [clientId] QueryConsensusStateRequest clientId + * @property {number|Long|null} [revisionNumber] QueryConsensusStateRequest revisionNumber + * @property {number|Long|null} [revisionHeight] QueryConsensusStateRequest revisionHeight + * @property {boolean|null} [latestHeight] QueryConsensusStateRequest latestHeight + */ + + /** + * Constructs a new QueryConsensusStateRequest. + * @memberof ibc.core.client.v1 + * @classdesc Represents a QueryConsensusStateRequest. + * @implements IQueryConsensusStateRequest + * @constructor + * @param {ibc.core.client.v1.IQueryConsensusStateRequest=} [properties] Properties to set + */ + function QueryConsensusStateRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryConsensusStateRequest clientId. + * @member {string} clientId + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @instance + */ + QueryConsensusStateRequest.prototype.clientId = ""; + + /** + * QueryConsensusStateRequest revisionNumber. + * @member {number|Long} revisionNumber + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @instance + */ + QueryConsensusStateRequest.prototype.revisionNumber = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * QueryConsensusStateRequest revisionHeight. + * @member {number|Long} revisionHeight + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @instance + */ + QueryConsensusStateRequest.prototype.revisionHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * QueryConsensusStateRequest latestHeight. + * @member {boolean} latestHeight + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @instance + */ + QueryConsensusStateRequest.prototype.latestHeight = false; + + /** + * Creates a new QueryConsensusStateRequest instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @static + * @param {ibc.core.client.v1.IQueryConsensusStateRequest=} [properties] Properties to set + * @returns {ibc.core.client.v1.QueryConsensusStateRequest} QueryConsensusStateRequest instance + */ + QueryConsensusStateRequest.create = function create(properties) { + return new QueryConsensusStateRequest(properties); + }; + + /** + * Encodes the specified QueryConsensusStateRequest message. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @static + * @param {ibc.core.client.v1.IQueryConsensusStateRequest} message QueryConsensusStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConsensusStateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.revisionNumber != null && Object.hasOwnProperty.call(message, "revisionNumber")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.revisionNumber); + if (message.revisionHeight != null && Object.hasOwnProperty.call(message, "revisionHeight")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.revisionHeight); + if (message.latestHeight != null && Object.hasOwnProperty.call(message, "latestHeight")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.latestHeight); + return writer; + }; + + /** + * Encodes the specified QueryConsensusStateRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @static + * @param {ibc.core.client.v1.IQueryConsensusStateRequest} message QueryConsensusStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConsensusStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryConsensusStateRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.QueryConsensusStateRequest} QueryConsensusStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConsensusStateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryConsensusStateRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.revisionNumber = reader.uint64(); + break; + case 3: + message.revisionHeight = reader.uint64(); + break; + case 4: + message.latestHeight = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryConsensusStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.QueryConsensusStateRequest} QueryConsensusStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConsensusStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryConsensusStateRequest message. + * @function verify + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryConsensusStateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) + if (!$util.isInteger(message.revisionNumber) && !(message.revisionNumber && $util.isInteger(message.revisionNumber.low) && $util.isInteger(message.revisionNumber.high))) + return "revisionNumber: integer|Long expected"; + if (message.revisionHeight != null && message.hasOwnProperty("revisionHeight")) + if (!$util.isInteger(message.revisionHeight) && !(message.revisionHeight && $util.isInteger(message.revisionHeight.low) && $util.isInteger(message.revisionHeight.high))) + return "revisionHeight: integer|Long expected"; + if (message.latestHeight != null && message.hasOwnProperty("latestHeight")) + if (typeof message.latestHeight !== "boolean") + return "latestHeight: boolean expected"; + return null; + }; + + /** + * Creates a QueryConsensusStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.QueryConsensusStateRequest} QueryConsensusStateRequest + */ + QueryConsensusStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.QueryConsensusStateRequest) + return object; + let message = new $root.ibc.core.client.v1.QueryConsensusStateRequest(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.revisionNumber != null) + if ($util.Long) + (message.revisionNumber = $util.Long.fromValue(object.revisionNumber)).unsigned = true; + else if (typeof object.revisionNumber === "string") + message.revisionNumber = parseInt(object.revisionNumber, 10); + else if (typeof object.revisionNumber === "number") + message.revisionNumber = object.revisionNumber; + else if (typeof object.revisionNumber === "object") + message.revisionNumber = new $util.LongBits(object.revisionNumber.low >>> 0, object.revisionNumber.high >>> 0).toNumber(true); + if (object.revisionHeight != null) + if ($util.Long) + (message.revisionHeight = $util.Long.fromValue(object.revisionHeight)).unsigned = true; + else if (typeof object.revisionHeight === "string") + message.revisionHeight = parseInt(object.revisionHeight, 10); + else if (typeof object.revisionHeight === "number") + message.revisionHeight = object.revisionHeight; + else if (typeof object.revisionHeight === "object") + message.revisionHeight = new $util.LongBits(object.revisionHeight.low >>> 0, object.revisionHeight.high >>> 0).toNumber(true); + if (object.latestHeight != null) + message.latestHeight = Boolean(object.latestHeight); + return message; + }; + + /** + * Creates a plain object from a QueryConsensusStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @static + * @param {ibc.core.client.v1.QueryConsensusStateRequest} message QueryConsensusStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryConsensusStateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.clientId = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.revisionNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.revisionNumber = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.revisionHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.revisionHeight = options.longs === String ? "0" : 0; + object.latestHeight = false; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) + if (typeof message.revisionNumber === "number") + object.revisionNumber = options.longs === String ? String(message.revisionNumber) : message.revisionNumber; + else + object.revisionNumber = options.longs === String ? $util.Long.prototype.toString.call(message.revisionNumber) : options.longs === Number ? new $util.LongBits(message.revisionNumber.low >>> 0, message.revisionNumber.high >>> 0).toNumber(true) : message.revisionNumber; + if (message.revisionHeight != null && message.hasOwnProperty("revisionHeight")) + if (typeof message.revisionHeight === "number") + object.revisionHeight = options.longs === String ? String(message.revisionHeight) : message.revisionHeight; + else + object.revisionHeight = options.longs === String ? $util.Long.prototype.toString.call(message.revisionHeight) : options.longs === Number ? new $util.LongBits(message.revisionHeight.low >>> 0, message.revisionHeight.high >>> 0).toNumber(true) : message.revisionHeight; + if (message.latestHeight != null && message.hasOwnProperty("latestHeight")) + object.latestHeight = message.latestHeight; + return object; + }; + + /** + * Converts this QueryConsensusStateRequest to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.QueryConsensusStateRequest + * @instance + * @returns {Object.} JSON object + */ + QueryConsensusStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryConsensusStateRequest; + })(v1.QueryConsensusStateRequest || {}); + + v1.QueryConsensusStateResponse = (function(QueryConsensusStateResponse) { + + /** + * Properties of a QueryConsensusStateResponse. + * @memberof ibc.core.client.v1 + * @interface IQueryConsensusStateResponse + * @property {google.protobuf.IAny|null} [consensusState] QueryConsensusStateResponse consensusState + * @property {Uint8Array|null} [proof] QueryConsensusStateResponse proof + * @property {ibc.core.client.v1.IHeight|null} [proofHeight] QueryConsensusStateResponse proofHeight + */ + + /** + * Constructs a new QueryConsensusStateResponse. + * @memberof ibc.core.client.v1 + * @classdesc Represents a QueryConsensusStateResponse. + * @implements IQueryConsensusStateResponse + * @constructor + * @param {ibc.core.client.v1.IQueryConsensusStateResponse=} [properties] Properties to set + */ + function QueryConsensusStateResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryConsensusStateResponse consensusState. + * @member {google.protobuf.IAny|null|undefined} consensusState + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @instance + */ + QueryConsensusStateResponse.prototype.consensusState = null; + + /** + * QueryConsensusStateResponse proof. + * @member {Uint8Array} proof + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @instance + */ + QueryConsensusStateResponse.prototype.proof = $util.newBuffer([]); + + /** + * QueryConsensusStateResponse proofHeight. + * @member {ibc.core.client.v1.IHeight|null|undefined} proofHeight + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @instance + */ + QueryConsensusStateResponse.prototype.proofHeight = null; + + /** + * Creates a new QueryConsensusStateResponse instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @static + * @param {ibc.core.client.v1.IQueryConsensusStateResponse=} [properties] Properties to set + * @returns {ibc.core.client.v1.QueryConsensusStateResponse} QueryConsensusStateResponse instance + */ + QueryConsensusStateResponse.create = function create(properties) { + return new QueryConsensusStateResponse(properties); + }; + + /** + * Encodes the specified QueryConsensusStateResponse message. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @static + * @param {ibc.core.client.v1.IQueryConsensusStateResponse} message QueryConsensusStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConsensusStateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.consensusState != null && Object.hasOwnProperty.call(message, "consensusState")) + $root.google.protobuf.Any.encode(message.consensusState, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); + if (message.proofHeight != null && Object.hasOwnProperty.call(message, "proofHeight")) + $root.ibc.core.client.v1.Height.encode(message.proofHeight, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryConsensusStateResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @static + * @param {ibc.core.client.v1.IQueryConsensusStateResponse} message QueryConsensusStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConsensusStateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryConsensusStateResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.QueryConsensusStateResponse} QueryConsensusStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConsensusStateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryConsensusStateResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consensusState = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryConsensusStateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.QueryConsensusStateResponse} QueryConsensusStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConsensusStateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryConsensusStateResponse message. + * @function verify + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryConsensusStateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.consensusState != null && message.hasOwnProperty("consensusState")) { + let error = $root.google.protobuf.Any.verify(message.consensusState); + if (error) + return "consensusState." + error; + } + if (message.proof != null && message.hasOwnProperty("proof")) + if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) + return "proof: buffer expected"; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) { + let error = $root.ibc.core.client.v1.Height.verify(message.proofHeight); + if (error) + return "proofHeight." + error; + } + return null; + }; + + /** + * Creates a QueryConsensusStateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.QueryConsensusStateResponse} QueryConsensusStateResponse + */ + QueryConsensusStateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.QueryConsensusStateResponse) + return object; + let message = new $root.ibc.core.client.v1.QueryConsensusStateResponse(); + if (object.consensusState != null) { + if (typeof object.consensusState !== "object") + throw TypeError(".ibc.core.client.v1.QueryConsensusStateResponse.consensusState: object expected"); + message.consensusState = $root.google.protobuf.Any.fromObject(object.consensusState); + } + if (object.proof != null) + if (typeof object.proof === "string") + $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); + else if (object.proof.length) + message.proof = object.proof; + if (object.proofHeight != null) { + if (typeof object.proofHeight !== "object") + throw TypeError(".ibc.core.client.v1.QueryConsensusStateResponse.proofHeight: object expected"); + message.proofHeight = $root.ibc.core.client.v1.Height.fromObject(object.proofHeight); + } + return message; + }; + + /** + * Creates a plain object from a QueryConsensusStateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @static + * @param {ibc.core.client.v1.QueryConsensusStateResponse} message QueryConsensusStateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryConsensusStateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.consensusState = null; + if (options.bytes === String) + object.proof = ""; + else { + object.proof = []; + if (options.bytes !== Array) + object.proof = $util.newBuffer(object.proof); + } + object.proofHeight = null; + } + if (message.consensusState != null && message.hasOwnProperty("consensusState")) + object.consensusState = $root.google.protobuf.Any.toObject(message.consensusState, options); + if (message.proof != null && message.hasOwnProperty("proof")) + object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; + if (message.proofHeight != null && message.hasOwnProperty("proofHeight")) + object.proofHeight = $root.ibc.core.client.v1.Height.toObject(message.proofHeight, options); + return object; + }; + + /** + * Converts this QueryConsensusStateResponse to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.QueryConsensusStateResponse + * @instance + * @returns {Object.} JSON object + */ + QueryConsensusStateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryConsensusStateResponse; + })(v1.QueryConsensusStateResponse || {}); + + v1.QueryConsensusStatesRequest = (function(QueryConsensusStatesRequest) { + + /** + * Properties of a QueryConsensusStatesRequest. + * @memberof ibc.core.client.v1 + * @interface IQueryConsensusStatesRequest + * @property {string|null} [clientId] QueryConsensusStatesRequest clientId + * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryConsensusStatesRequest pagination + */ + + /** + * Constructs a new QueryConsensusStatesRequest. + * @memberof ibc.core.client.v1 + * @classdesc Represents a QueryConsensusStatesRequest. + * @implements IQueryConsensusStatesRequest + * @constructor + * @param {ibc.core.client.v1.IQueryConsensusStatesRequest=} [properties] Properties to set + */ + function QueryConsensusStatesRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryConsensusStatesRequest clientId. + * @member {string} clientId + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @instance + */ + QueryConsensusStatesRequest.prototype.clientId = ""; + + /** + * QueryConsensusStatesRequest pagination. + * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @instance + */ + QueryConsensusStatesRequest.prototype.pagination = null; + + /** + * Creates a new QueryConsensusStatesRequest instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @static + * @param {ibc.core.client.v1.IQueryConsensusStatesRequest=} [properties] Properties to set + * @returns {ibc.core.client.v1.QueryConsensusStatesRequest} QueryConsensusStatesRequest instance + */ + QueryConsensusStatesRequest.create = function create(properties) { + return new QueryConsensusStatesRequest(properties); + }; + + /** + * Encodes the specified QueryConsensusStatesRequest message. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStatesRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @static + * @param {ibc.core.client.v1.IQueryConsensusStatesRequest} message QueryConsensusStatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConsensusStatesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryConsensusStatesRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStatesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @static + * @param {ibc.core.client.v1.IQueryConsensusStatesRequest} message QueryConsensusStatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConsensusStatesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryConsensusStatesRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.QueryConsensusStatesRequest} QueryConsensusStatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConsensusStatesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryConsensusStatesRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryConsensusStatesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.QueryConsensusStatesRequest} QueryConsensusStatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConsensusStatesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryConsensusStatesRequest message. + * @function verify + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryConsensusStatesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryConsensusStatesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.QueryConsensusStatesRequest} QueryConsensusStatesRequest + */ + QueryConsensusStatesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.QueryConsensusStatesRequest) + return object; + let message = new $root.ibc.core.client.v1.QueryConsensusStatesRequest(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".ibc.core.client.v1.QueryConsensusStatesRequest.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryConsensusStatesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @static + * @param {ibc.core.client.v1.QueryConsensusStatesRequest} message QueryConsensusStatesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryConsensusStatesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.clientId = ""; + object.pagination = null; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryConsensusStatesRequest to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.QueryConsensusStatesRequest + * @instance + * @returns {Object.} JSON object + */ + QueryConsensusStatesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryConsensusStatesRequest; + })(v1.QueryConsensusStatesRequest || {}); + + v1.QueryConsensusStatesResponse = (function(QueryConsensusStatesResponse) { + + /** + * Properties of a QueryConsensusStatesResponse. + * @memberof ibc.core.client.v1 + * @interface IQueryConsensusStatesResponse + * @property {Array.|null} [consensusStates] QueryConsensusStatesResponse consensusStates + * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryConsensusStatesResponse pagination + */ + + /** + * Constructs a new QueryConsensusStatesResponse. + * @memberof ibc.core.client.v1 + * @classdesc Represents a QueryConsensusStatesResponse. + * @implements IQueryConsensusStatesResponse + * @constructor + * @param {ibc.core.client.v1.IQueryConsensusStatesResponse=} [properties] Properties to set + */ + function QueryConsensusStatesResponse(properties) { + this.consensusStates = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryConsensusStatesResponse consensusStates. + * @member {Array.} consensusStates + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @instance + */ + QueryConsensusStatesResponse.prototype.consensusStates = $util.emptyArray; + + /** + * QueryConsensusStatesResponse pagination. + * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @instance + */ + QueryConsensusStatesResponse.prototype.pagination = null; + + /** + * Creates a new QueryConsensusStatesResponse instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @static + * @param {ibc.core.client.v1.IQueryConsensusStatesResponse=} [properties] Properties to set + * @returns {ibc.core.client.v1.QueryConsensusStatesResponse} QueryConsensusStatesResponse instance + */ + QueryConsensusStatesResponse.create = function create(properties) { + return new QueryConsensusStatesResponse(properties); + }; + + /** + * Encodes the specified QueryConsensusStatesResponse message. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStatesResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @static + * @param {ibc.core.client.v1.IQueryConsensusStatesResponse} message QueryConsensusStatesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConsensusStatesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.consensusStates != null && message.consensusStates.length) + for (let i = 0; i < message.consensusStates.length; ++i) + $root.ibc.core.client.v1.ConsensusStateWithHeight.encode(message.consensusStates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) + $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryConsensusStatesResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStatesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @static + * @param {ibc.core.client.v1.IQueryConsensusStatesResponse} message QueryConsensusStatesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryConsensusStatesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryConsensusStatesResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.QueryConsensusStatesResponse} QueryConsensusStatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConsensusStatesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryConsensusStatesResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.consensusStates && message.consensusStates.length)) + message.consensusStates = []; + message.consensusStates.push($root.ibc.core.client.v1.ConsensusStateWithHeight.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryConsensusStatesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.QueryConsensusStatesResponse} QueryConsensusStatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryConsensusStatesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryConsensusStatesResponse message. + * @function verify + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryConsensusStatesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.consensusStates != null && message.hasOwnProperty("consensusStates")) { + if (!Array.isArray(message.consensusStates)) + return "consensusStates: array expected"; + for (let i = 0; i < message.consensusStates.length; ++i) { + let error = $root.ibc.core.client.v1.ConsensusStateWithHeight.verify(message.consensusStates[i]); + if (error) + return "consensusStates." + error; + } + } + if (message.pagination != null && message.hasOwnProperty("pagination")) { + let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); + if (error) + return "pagination." + error; + } + return null; + }; + + /** + * Creates a QueryConsensusStatesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.QueryConsensusStatesResponse} QueryConsensusStatesResponse + */ + QueryConsensusStatesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.QueryConsensusStatesResponse) + return object; + let message = new $root.ibc.core.client.v1.QueryConsensusStatesResponse(); + if (object.consensusStates) { + if (!Array.isArray(object.consensusStates)) + throw TypeError(".ibc.core.client.v1.QueryConsensusStatesResponse.consensusStates: array expected"); + message.consensusStates = []; + for (let i = 0; i < object.consensusStates.length; ++i) { + if (typeof object.consensusStates[i] !== "object") + throw TypeError(".ibc.core.client.v1.QueryConsensusStatesResponse.consensusStates: object expected"); + message.consensusStates[i] = $root.ibc.core.client.v1.ConsensusStateWithHeight.fromObject(object.consensusStates[i]); + } + } + if (object.pagination != null) { + if (typeof object.pagination !== "object") + throw TypeError(".ibc.core.client.v1.QueryConsensusStatesResponse.pagination: object expected"); + message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); + } + return message; + }; + + /** + * Creates a plain object from a QueryConsensusStatesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @static + * @param {ibc.core.client.v1.QueryConsensusStatesResponse} message QueryConsensusStatesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryConsensusStatesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.consensusStates = []; + if (options.defaults) + object.pagination = null; + if (message.consensusStates && message.consensusStates.length) { + object.consensusStates = []; + for (let j = 0; j < message.consensusStates.length; ++j) + object.consensusStates[j] = $root.ibc.core.client.v1.ConsensusStateWithHeight.toObject(message.consensusStates[j], options); + } + if (message.pagination != null && message.hasOwnProperty("pagination")) + object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); + return object; + }; + + /** + * Converts this QueryConsensusStatesResponse to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.QueryConsensusStatesResponse + * @instance + * @returns {Object.} JSON object + */ + QueryConsensusStatesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryConsensusStatesResponse; + })(v1.QueryConsensusStatesResponse || {}); + + v1.QueryClientParamsRequest = (function(QueryClientParamsRequest) { + + /** + * Properties of a QueryClientParamsRequest. + * @memberof ibc.core.client.v1 + * @interface IQueryClientParamsRequest + */ + + /** + * Constructs a new QueryClientParamsRequest. + * @memberof ibc.core.client.v1 + * @classdesc Represents a QueryClientParamsRequest. + * @implements IQueryClientParamsRequest + * @constructor + * @param {ibc.core.client.v1.IQueryClientParamsRequest=} [properties] Properties to set + */ + function QueryClientParamsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new QueryClientParamsRequest instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.QueryClientParamsRequest + * @static + * @param {ibc.core.client.v1.IQueryClientParamsRequest=} [properties] Properties to set + * @returns {ibc.core.client.v1.QueryClientParamsRequest} QueryClientParamsRequest instance + */ + QueryClientParamsRequest.create = function create(properties) { + return new QueryClientParamsRequest(properties); + }; + + /** + * Encodes the specified QueryClientParamsRequest message. Does not implicitly {@link ibc.core.client.v1.QueryClientParamsRequest.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.QueryClientParamsRequest + * @static + * @param {ibc.core.client.v1.IQueryClientParamsRequest} message QueryClientParamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientParamsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified QueryClientParamsRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientParamsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.QueryClientParamsRequest + * @static + * @param {ibc.core.client.v1.IQueryClientParamsRequest} message QueryClientParamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryClientParamsRequest message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.QueryClientParamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.QueryClientParamsRequest} QueryClientParamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientParamsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientParamsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryClientParamsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.QueryClientParamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.QueryClientParamsRequest} QueryClientParamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientParamsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryClientParamsRequest message. + * @function verify + * @memberof ibc.core.client.v1.QueryClientParamsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryClientParamsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a QueryClientParamsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.QueryClientParamsRequest + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.QueryClientParamsRequest} QueryClientParamsRequest + */ + QueryClientParamsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.QueryClientParamsRequest) + return object; + return new $root.ibc.core.client.v1.QueryClientParamsRequest(); + }; + + /** + * Creates a plain object from a QueryClientParamsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.QueryClientParamsRequest + * @static + * @param {ibc.core.client.v1.QueryClientParamsRequest} message QueryClientParamsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryClientParamsRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this QueryClientParamsRequest to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.QueryClientParamsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryClientParamsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryClientParamsRequest; + })(v1.QueryClientParamsRequest || {}); + + v1.QueryClientParamsResponse = (function(QueryClientParamsResponse) { + + /** + * Properties of a QueryClientParamsResponse. + * @memberof ibc.core.client.v1 + * @interface IQueryClientParamsResponse + * @property {ibc.core.client.v1.IParams|null} [params] QueryClientParamsResponse params + */ + + /** + * Constructs a new QueryClientParamsResponse. + * @memberof ibc.core.client.v1 + * @classdesc Represents a QueryClientParamsResponse. + * @implements IQueryClientParamsResponse + * @constructor + * @param {ibc.core.client.v1.IQueryClientParamsResponse=} [properties] Properties to set + */ + function QueryClientParamsResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryClientParamsResponse params. + * @member {ibc.core.client.v1.IParams|null|undefined} params + * @memberof ibc.core.client.v1.QueryClientParamsResponse + * @instance + */ + QueryClientParamsResponse.prototype.params = null; + + /** + * Creates a new QueryClientParamsResponse instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.QueryClientParamsResponse + * @static + * @param {ibc.core.client.v1.IQueryClientParamsResponse=} [properties] Properties to set + * @returns {ibc.core.client.v1.QueryClientParamsResponse} QueryClientParamsResponse instance + */ + QueryClientParamsResponse.create = function create(properties) { + return new QueryClientParamsResponse(properties); + }; + + /** + * Encodes the specified QueryClientParamsResponse message. Does not implicitly {@link ibc.core.client.v1.QueryClientParamsResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.QueryClientParamsResponse + * @static + * @param {ibc.core.client.v1.IQueryClientParamsResponse} message QueryClientParamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientParamsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.ibc.core.client.v1.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryClientParamsResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientParamsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.QueryClientParamsResponse + * @static + * @param {ibc.core.client.v1.IQueryClientParamsResponse} message QueryClientParamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryClientParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryClientParamsResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.QueryClientParamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.QueryClientParamsResponse} QueryClientParamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientParamsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientParamsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = $root.ibc.core.client.v1.Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryClientParamsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.QueryClientParamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.QueryClientParamsResponse} QueryClientParamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryClientParamsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryClientParamsResponse message. + * @function verify + * @memberof ibc.core.client.v1.QueryClientParamsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryClientParamsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.params != null && message.hasOwnProperty("params")) { + let error = $root.ibc.core.client.v1.Params.verify(message.params); + if (error) + return "params." + error; + } + return null; + }; + + /** + * Creates a QueryClientParamsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.QueryClientParamsResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.QueryClientParamsResponse} QueryClientParamsResponse + */ + QueryClientParamsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.QueryClientParamsResponse) + return object; + let message = new $root.ibc.core.client.v1.QueryClientParamsResponse(); + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".ibc.core.client.v1.QueryClientParamsResponse.params: object expected"); + message.params = $root.ibc.core.client.v1.Params.fromObject(object.params); + } + return message; + }; + + /** + * Creates a plain object from a QueryClientParamsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.QueryClientParamsResponse + * @static + * @param {ibc.core.client.v1.QueryClientParamsResponse} message QueryClientParamsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryClientParamsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.params = null; + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.ibc.core.client.v1.Params.toObject(message.params, options); + return object; + }; + + /** + * Converts this QueryClientParamsResponse to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.QueryClientParamsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryClientParamsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryClientParamsResponse; + })(v1.QueryClientParamsResponse || {}); + + v1.Msg = (function(Msg) { + + /** + * Constructs a new Msg service. + * @memberof ibc.core.client.v1 + * @classdesc Represents a Msg + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Msg(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; + + /** + * Creates new Msg service using the specified rpc implementation. + * @function create + * @memberof ibc.core.client.v1.Msg + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Msg} RPC service. Useful where requests and/or responses are streamed. + */ + Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link ibc.core.client.v1.Msg#createClient}. + * @memberof ibc.core.client.v1.Msg + * @typedef CreateClientCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.client.v1.IMsgCreateClientResponse} [response] MsgCreateClientResponse + */ + + /** + * Calls CreateClient. + * @function createClient + * @memberof ibc.core.client.v1.Msg + * @instance + * @param {ibc.core.client.v1.IMsgCreateClient} request MsgCreateClient message or plain object + * @param {ibc.core.client.v1.Msg.CreateClientCallback} callback Node-style callback called with the error, if any, and MsgCreateClientResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.createClient = function createClient(request, callback) { + return this.rpcCall(createClient, $root.ibc.core.client.v1.MsgCreateClient, $root.ibc.core.client.v1.MsgCreateClientResponse, request, callback); + }, "name", { value: "CreateClient" }); + + /** + * Calls CreateClient. + * @function createClient + * @memberof ibc.core.client.v1.Msg + * @instance + * @param {ibc.core.client.v1.IMsgCreateClient} request MsgCreateClient message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.client.v1.Msg#updateClient}. + * @memberof ibc.core.client.v1.Msg + * @typedef UpdateClientCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.client.v1.IMsgUpdateClientResponse} [response] MsgUpdateClientResponse + */ + + /** + * Calls UpdateClient. + * @function updateClient + * @memberof ibc.core.client.v1.Msg + * @instance + * @param {ibc.core.client.v1.IMsgUpdateClient} request MsgUpdateClient message or plain object + * @param {ibc.core.client.v1.Msg.UpdateClientCallback} callback Node-style callback called with the error, if any, and MsgUpdateClientResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.updateClient = function updateClient(request, callback) { + return this.rpcCall(updateClient, $root.ibc.core.client.v1.MsgUpdateClient, $root.ibc.core.client.v1.MsgUpdateClientResponse, request, callback); + }, "name", { value: "UpdateClient" }); + + /** + * Calls UpdateClient. + * @function updateClient + * @memberof ibc.core.client.v1.Msg + * @instance + * @param {ibc.core.client.v1.IMsgUpdateClient} request MsgUpdateClient message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.client.v1.Msg#upgradeClient}. + * @memberof ibc.core.client.v1.Msg + * @typedef UpgradeClientCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.client.v1.IMsgUpgradeClientResponse} [response] MsgUpgradeClientResponse + */ + + /** + * Calls UpgradeClient. + * @function upgradeClient + * @memberof ibc.core.client.v1.Msg + * @instance + * @param {ibc.core.client.v1.IMsgUpgradeClient} request MsgUpgradeClient message or plain object + * @param {ibc.core.client.v1.Msg.UpgradeClientCallback} callback Node-style callback called with the error, if any, and MsgUpgradeClientResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.upgradeClient = function upgradeClient(request, callback) { + return this.rpcCall(upgradeClient, $root.ibc.core.client.v1.MsgUpgradeClient, $root.ibc.core.client.v1.MsgUpgradeClientResponse, request, callback); + }, "name", { value: "UpgradeClient" }); + + /** + * Calls UpgradeClient. + * @function upgradeClient + * @memberof ibc.core.client.v1.Msg + * @instance + * @param {ibc.core.client.v1.IMsgUpgradeClient} request MsgUpgradeClient message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link ibc.core.client.v1.Msg#submitMisbehaviour}. + * @memberof ibc.core.client.v1.Msg + * @typedef SubmitMisbehaviourCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviourResponse} [response] MsgSubmitMisbehaviourResponse + */ + + /** + * Calls SubmitMisbehaviour. + * @function submitMisbehaviour + * @memberof ibc.core.client.v1.Msg + * @instance + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviour} request MsgSubmitMisbehaviour message or plain object + * @param {ibc.core.client.v1.Msg.SubmitMisbehaviourCallback} callback Node-style callback called with the error, if any, and MsgSubmitMisbehaviourResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Msg.prototype.submitMisbehaviour = function submitMisbehaviour(request, callback) { + return this.rpcCall(submitMisbehaviour, $root.ibc.core.client.v1.MsgSubmitMisbehaviour, $root.ibc.core.client.v1.MsgSubmitMisbehaviourResponse, request, callback); + }, "name", { value: "SubmitMisbehaviour" }); + + /** + * Calls SubmitMisbehaviour. + * @function submitMisbehaviour + * @memberof ibc.core.client.v1.Msg + * @instance + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviour} request MsgSubmitMisbehaviour message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Msg; + })(v1.Msg || {}); + + v1.MsgCreateClient = (function(MsgCreateClient) { + + /** + * Properties of a MsgCreateClient. + * @memberof ibc.core.client.v1 + * @interface IMsgCreateClient + * @property {google.protobuf.IAny|null} [clientState] MsgCreateClient clientState + * @property {google.protobuf.IAny|null} [consensusState] MsgCreateClient consensusState + * @property {string|null} [signer] MsgCreateClient signer + */ + + /** + * Constructs a new MsgCreateClient. + * @memberof ibc.core.client.v1 + * @classdesc Represents a MsgCreateClient. + * @implements IMsgCreateClient + * @constructor + * @param {ibc.core.client.v1.IMsgCreateClient=} [properties] Properties to set + */ + function MsgCreateClient(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgCreateClient clientState. + * @member {google.protobuf.IAny|null|undefined} clientState + * @memberof ibc.core.client.v1.MsgCreateClient + * @instance + */ + MsgCreateClient.prototype.clientState = null; + + /** + * MsgCreateClient consensusState. + * @member {google.protobuf.IAny|null|undefined} consensusState + * @memberof ibc.core.client.v1.MsgCreateClient + * @instance + */ + MsgCreateClient.prototype.consensusState = null; + + /** + * MsgCreateClient signer. + * @member {string} signer + * @memberof ibc.core.client.v1.MsgCreateClient + * @instance + */ + MsgCreateClient.prototype.signer = ""; + + /** + * Creates a new MsgCreateClient instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.MsgCreateClient + * @static + * @param {ibc.core.client.v1.IMsgCreateClient=} [properties] Properties to set + * @returns {ibc.core.client.v1.MsgCreateClient} MsgCreateClient instance + */ + MsgCreateClient.create = function create(properties) { + return new MsgCreateClient(properties); + }; + + /** + * Encodes the specified MsgCreateClient message. Does not implicitly {@link ibc.core.client.v1.MsgCreateClient.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.MsgCreateClient + * @static + * @param {ibc.core.client.v1.IMsgCreateClient} message MsgCreateClient message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateClient.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientState != null && Object.hasOwnProperty.call(message, "clientState")) + $root.google.protobuf.Any.encode(message.clientState, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.consensusState != null && Object.hasOwnProperty.call(message, "consensusState")) + $root.google.protobuf.Any.encode(message.consensusState, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.signer); + return writer; + }; + + /** + * Encodes the specified MsgCreateClient message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgCreateClient.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.MsgCreateClient + * @static + * @param {ibc.core.client.v1.IMsgCreateClient} message MsgCreateClient message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateClient.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgCreateClient message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.MsgCreateClient + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.MsgCreateClient} MsgCreateClient + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateClient.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgCreateClient(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientState = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 2: + message.consensusState = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgCreateClient message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.MsgCreateClient + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.MsgCreateClient} MsgCreateClient + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateClient.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgCreateClient message. + * @function verify + * @memberof ibc.core.client.v1.MsgCreateClient + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgCreateClient.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientState != null && message.hasOwnProperty("clientState")) { + let error = $root.google.protobuf.Any.verify(message.clientState); + if (error) + return "clientState." + error; + } + if (message.consensusState != null && message.hasOwnProperty("consensusState")) { + let error = $root.google.protobuf.Any.verify(message.consensusState); + if (error) + return "consensusState." + error; + } + if (message.signer != null && message.hasOwnProperty("signer")) + if (!$util.isString(message.signer)) + return "signer: string expected"; + return null; + }; + + /** + * Creates a MsgCreateClient message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.MsgCreateClient + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.MsgCreateClient} MsgCreateClient + */ + MsgCreateClient.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.MsgCreateClient) + return object; + let message = new $root.ibc.core.client.v1.MsgCreateClient(); + if (object.clientState != null) { + if (typeof object.clientState !== "object") + throw TypeError(".ibc.core.client.v1.MsgCreateClient.clientState: object expected"); + message.clientState = $root.google.protobuf.Any.fromObject(object.clientState); + } + if (object.consensusState != null) { + if (typeof object.consensusState !== "object") + throw TypeError(".ibc.core.client.v1.MsgCreateClient.consensusState: object expected"); + message.consensusState = $root.google.protobuf.Any.fromObject(object.consensusState); + } + if (object.signer != null) + message.signer = String(object.signer); + return message; + }; + + /** + * Creates a plain object from a MsgCreateClient message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.MsgCreateClient + * @static + * @param {ibc.core.client.v1.MsgCreateClient} message MsgCreateClient + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgCreateClient.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.clientState = null; + object.consensusState = null; + object.signer = ""; + } + if (message.clientState != null && message.hasOwnProperty("clientState")) + object.clientState = $root.google.protobuf.Any.toObject(message.clientState, options); + if (message.consensusState != null && message.hasOwnProperty("consensusState")) + object.consensusState = $root.google.protobuf.Any.toObject(message.consensusState, options); + if (message.signer != null && message.hasOwnProperty("signer")) + object.signer = message.signer; + return object; + }; + + /** + * Converts this MsgCreateClient to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.MsgCreateClient + * @instance + * @returns {Object.} JSON object + */ + MsgCreateClient.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgCreateClient; + })(v1.MsgCreateClient || {}); + + v1.MsgCreateClientResponse = (function(MsgCreateClientResponse) { + + /** + * Properties of a MsgCreateClientResponse. + * @memberof ibc.core.client.v1 + * @interface IMsgCreateClientResponse + */ + + /** + * Constructs a new MsgCreateClientResponse. + * @memberof ibc.core.client.v1 + * @classdesc Represents a MsgCreateClientResponse. + * @implements IMsgCreateClientResponse + * @constructor + * @param {ibc.core.client.v1.IMsgCreateClientResponse=} [properties] Properties to set + */ + function MsgCreateClientResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgCreateClientResponse instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.MsgCreateClientResponse + * @static + * @param {ibc.core.client.v1.IMsgCreateClientResponse=} [properties] Properties to set + * @returns {ibc.core.client.v1.MsgCreateClientResponse} MsgCreateClientResponse instance + */ + MsgCreateClientResponse.create = function create(properties) { + return new MsgCreateClientResponse(properties); + }; + + /** + * Encodes the specified MsgCreateClientResponse message. Does not implicitly {@link ibc.core.client.v1.MsgCreateClientResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.MsgCreateClientResponse + * @static + * @param {ibc.core.client.v1.IMsgCreateClientResponse} message MsgCreateClientResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateClientResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgCreateClientResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgCreateClientResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.MsgCreateClientResponse + * @static + * @param {ibc.core.client.v1.IMsgCreateClientResponse} message MsgCreateClientResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgCreateClientResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgCreateClientResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.MsgCreateClientResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.MsgCreateClientResponse} MsgCreateClientResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateClientResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgCreateClientResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgCreateClientResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.MsgCreateClientResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.MsgCreateClientResponse} MsgCreateClientResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgCreateClientResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgCreateClientResponse message. + * @function verify + * @memberof ibc.core.client.v1.MsgCreateClientResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgCreateClientResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgCreateClientResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.MsgCreateClientResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.MsgCreateClientResponse} MsgCreateClientResponse + */ + MsgCreateClientResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.MsgCreateClientResponse) + return object; + return new $root.ibc.core.client.v1.MsgCreateClientResponse(); + }; + + /** + * Creates a plain object from a MsgCreateClientResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.MsgCreateClientResponse + * @static + * @param {ibc.core.client.v1.MsgCreateClientResponse} message MsgCreateClientResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgCreateClientResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgCreateClientResponse to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.MsgCreateClientResponse + * @instance + * @returns {Object.} JSON object + */ + MsgCreateClientResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgCreateClientResponse; + })(v1.MsgCreateClientResponse || {}); + + v1.MsgUpdateClient = (function(MsgUpdateClient) { + + /** + * Properties of a MsgUpdateClient. + * @memberof ibc.core.client.v1 + * @interface IMsgUpdateClient + * @property {string|null} [clientId] MsgUpdateClient clientId + * @property {google.protobuf.IAny|null} [header] MsgUpdateClient header + * @property {string|null} [signer] MsgUpdateClient signer + */ + + /** + * Constructs a new MsgUpdateClient. + * @memberof ibc.core.client.v1 + * @classdesc Represents a MsgUpdateClient. + * @implements IMsgUpdateClient + * @constructor + * @param {ibc.core.client.v1.IMsgUpdateClient=} [properties] Properties to set + */ + function MsgUpdateClient(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgUpdateClient clientId. + * @member {string} clientId + * @memberof ibc.core.client.v1.MsgUpdateClient + * @instance + */ + MsgUpdateClient.prototype.clientId = ""; + + /** + * MsgUpdateClient header. + * @member {google.protobuf.IAny|null|undefined} header + * @memberof ibc.core.client.v1.MsgUpdateClient + * @instance + */ + MsgUpdateClient.prototype.header = null; + + /** + * MsgUpdateClient signer. + * @member {string} signer + * @memberof ibc.core.client.v1.MsgUpdateClient + * @instance + */ + MsgUpdateClient.prototype.signer = ""; + + /** + * Creates a new MsgUpdateClient instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.MsgUpdateClient + * @static + * @param {ibc.core.client.v1.IMsgUpdateClient=} [properties] Properties to set + * @returns {ibc.core.client.v1.MsgUpdateClient} MsgUpdateClient instance + */ + MsgUpdateClient.create = function create(properties) { + return new MsgUpdateClient(properties); + }; + + /** + * Encodes the specified MsgUpdateClient message. Does not implicitly {@link ibc.core.client.v1.MsgUpdateClient.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.MsgUpdateClient + * @static + * @param {ibc.core.client.v1.IMsgUpdateClient} message MsgUpdateClient message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUpdateClient.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + $root.google.protobuf.Any.encode(message.header, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.signer); + return writer; + }; + + /** + * Encodes the specified MsgUpdateClient message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgUpdateClient.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.MsgUpdateClient + * @static + * @param {ibc.core.client.v1.IMsgUpdateClient} message MsgUpdateClient message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUpdateClient.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgUpdateClient message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.MsgUpdateClient + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.MsgUpdateClient} MsgUpdateClient + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUpdateClient.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgUpdateClient(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.header = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgUpdateClient message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.MsgUpdateClient + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.MsgUpdateClient} MsgUpdateClient + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUpdateClient.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgUpdateClient message. + * @function verify + * @memberof ibc.core.client.v1.MsgUpdateClient + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgUpdateClient.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.header != null && message.hasOwnProperty("header")) { + let error = $root.google.protobuf.Any.verify(message.header); + if (error) + return "header." + error; + } + if (message.signer != null && message.hasOwnProperty("signer")) + if (!$util.isString(message.signer)) + return "signer: string expected"; + return null; + }; + + /** + * Creates a MsgUpdateClient message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.MsgUpdateClient + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.MsgUpdateClient} MsgUpdateClient + */ + MsgUpdateClient.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.MsgUpdateClient) + return object; + let message = new $root.ibc.core.client.v1.MsgUpdateClient(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.header != null) { + if (typeof object.header !== "object") + throw TypeError(".ibc.core.client.v1.MsgUpdateClient.header: object expected"); + message.header = $root.google.protobuf.Any.fromObject(object.header); + } + if (object.signer != null) + message.signer = String(object.signer); + return message; + }; + + /** + * Creates a plain object from a MsgUpdateClient message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.MsgUpdateClient + * @static + * @param {ibc.core.client.v1.MsgUpdateClient} message MsgUpdateClient + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgUpdateClient.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.clientId = ""; + object.header = null; + object.signer = ""; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.header != null && message.hasOwnProperty("header")) + object.header = $root.google.protobuf.Any.toObject(message.header, options); + if (message.signer != null && message.hasOwnProperty("signer")) + object.signer = message.signer; + return object; + }; + + /** + * Converts this MsgUpdateClient to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.MsgUpdateClient + * @instance + * @returns {Object.} JSON object + */ + MsgUpdateClient.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgUpdateClient; + })(v1.MsgUpdateClient || {}); + + v1.MsgUpdateClientResponse = (function(MsgUpdateClientResponse) { + + /** + * Properties of a MsgUpdateClientResponse. + * @memberof ibc.core.client.v1 + * @interface IMsgUpdateClientResponse + */ + + /** + * Constructs a new MsgUpdateClientResponse. + * @memberof ibc.core.client.v1 + * @classdesc Represents a MsgUpdateClientResponse. + * @implements IMsgUpdateClientResponse + * @constructor + * @param {ibc.core.client.v1.IMsgUpdateClientResponse=} [properties] Properties to set + */ + function MsgUpdateClientResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgUpdateClientResponse instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.MsgUpdateClientResponse + * @static + * @param {ibc.core.client.v1.IMsgUpdateClientResponse=} [properties] Properties to set + * @returns {ibc.core.client.v1.MsgUpdateClientResponse} MsgUpdateClientResponse instance + */ + MsgUpdateClientResponse.create = function create(properties) { + return new MsgUpdateClientResponse(properties); + }; + + /** + * Encodes the specified MsgUpdateClientResponse message. Does not implicitly {@link ibc.core.client.v1.MsgUpdateClientResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.MsgUpdateClientResponse + * @static + * @param {ibc.core.client.v1.IMsgUpdateClientResponse} message MsgUpdateClientResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUpdateClientResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgUpdateClientResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgUpdateClientResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.MsgUpdateClientResponse + * @static + * @param {ibc.core.client.v1.IMsgUpdateClientResponse} message MsgUpdateClientResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUpdateClientResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgUpdateClientResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.MsgUpdateClientResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.MsgUpdateClientResponse} MsgUpdateClientResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUpdateClientResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgUpdateClientResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgUpdateClientResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.MsgUpdateClientResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.MsgUpdateClientResponse} MsgUpdateClientResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUpdateClientResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgUpdateClientResponse message. + * @function verify + * @memberof ibc.core.client.v1.MsgUpdateClientResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgUpdateClientResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgUpdateClientResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.MsgUpdateClientResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.MsgUpdateClientResponse} MsgUpdateClientResponse + */ + MsgUpdateClientResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.MsgUpdateClientResponse) + return object; + return new $root.ibc.core.client.v1.MsgUpdateClientResponse(); + }; + + /** + * Creates a plain object from a MsgUpdateClientResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.MsgUpdateClientResponse + * @static + * @param {ibc.core.client.v1.MsgUpdateClientResponse} message MsgUpdateClientResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgUpdateClientResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgUpdateClientResponse to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.MsgUpdateClientResponse + * @instance + * @returns {Object.} JSON object + */ + MsgUpdateClientResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgUpdateClientResponse; + })(v1.MsgUpdateClientResponse || {}); + + v1.MsgUpgradeClient = (function(MsgUpgradeClient) { + + /** + * Properties of a MsgUpgradeClient. + * @memberof ibc.core.client.v1 + * @interface IMsgUpgradeClient + * @property {string|null} [clientId] MsgUpgradeClient clientId + * @property {google.protobuf.IAny|null} [clientState] MsgUpgradeClient clientState + * @property {google.protobuf.IAny|null} [consensusState] MsgUpgradeClient consensusState + * @property {Uint8Array|null} [proofUpgradeClient] MsgUpgradeClient proofUpgradeClient + * @property {Uint8Array|null} [proofUpgradeConsensusState] MsgUpgradeClient proofUpgradeConsensusState + * @property {string|null} [signer] MsgUpgradeClient signer + */ + + /** + * Constructs a new MsgUpgradeClient. + * @memberof ibc.core.client.v1 + * @classdesc Represents a MsgUpgradeClient. + * @implements IMsgUpgradeClient + * @constructor + * @param {ibc.core.client.v1.IMsgUpgradeClient=} [properties] Properties to set + */ + function MsgUpgradeClient(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgUpgradeClient clientId. + * @member {string} clientId + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @instance + */ + MsgUpgradeClient.prototype.clientId = ""; + + /** + * MsgUpgradeClient clientState. + * @member {google.protobuf.IAny|null|undefined} clientState + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @instance + */ + MsgUpgradeClient.prototype.clientState = null; + + /** + * MsgUpgradeClient consensusState. + * @member {google.protobuf.IAny|null|undefined} consensusState + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @instance + */ + MsgUpgradeClient.prototype.consensusState = null; + + /** + * MsgUpgradeClient proofUpgradeClient. + * @member {Uint8Array} proofUpgradeClient + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @instance + */ + MsgUpgradeClient.prototype.proofUpgradeClient = $util.newBuffer([]); + + /** + * MsgUpgradeClient proofUpgradeConsensusState. + * @member {Uint8Array} proofUpgradeConsensusState + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @instance + */ + MsgUpgradeClient.prototype.proofUpgradeConsensusState = $util.newBuffer([]); + + /** + * MsgUpgradeClient signer. + * @member {string} signer + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @instance + */ + MsgUpgradeClient.prototype.signer = ""; + + /** + * Creates a new MsgUpgradeClient instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @static + * @param {ibc.core.client.v1.IMsgUpgradeClient=} [properties] Properties to set + * @returns {ibc.core.client.v1.MsgUpgradeClient} MsgUpgradeClient instance + */ + MsgUpgradeClient.create = function create(properties) { + return new MsgUpgradeClient(properties); + }; + + /** + * Encodes the specified MsgUpgradeClient message. Does not implicitly {@link ibc.core.client.v1.MsgUpgradeClient.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @static + * @param {ibc.core.client.v1.IMsgUpgradeClient} message MsgUpgradeClient message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUpgradeClient.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.clientState != null && Object.hasOwnProperty.call(message, "clientState")) + $root.google.protobuf.Any.encode(message.clientState, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.consensusState != null && Object.hasOwnProperty.call(message, "consensusState")) + $root.google.protobuf.Any.encode(message.consensusState, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.proofUpgradeClient != null && Object.hasOwnProperty.call(message, "proofUpgradeClient")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.proofUpgradeClient); + if (message.proofUpgradeConsensusState != null && Object.hasOwnProperty.call(message, "proofUpgradeConsensusState")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.proofUpgradeConsensusState); + if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.signer); + return writer; + }; + + /** + * Encodes the specified MsgUpgradeClient message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgUpgradeClient.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @static + * @param {ibc.core.client.v1.IMsgUpgradeClient} message MsgUpgradeClient message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUpgradeClient.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgUpgradeClient message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.MsgUpgradeClient} MsgUpgradeClient + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUpgradeClient.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgUpgradeClient(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.clientState = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 3: + message.consensusState = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 4: + message.proofUpgradeClient = reader.bytes(); + break; + case 5: + message.proofUpgradeConsensusState = reader.bytes(); + break; + case 6: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgUpgradeClient message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.MsgUpgradeClient} MsgUpgradeClient + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUpgradeClient.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgUpgradeClient message. + * @function verify + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgUpgradeClient.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.clientState != null && message.hasOwnProperty("clientState")) { + let error = $root.google.protobuf.Any.verify(message.clientState); + if (error) + return "clientState." + error; + } + if (message.consensusState != null && message.hasOwnProperty("consensusState")) { + let error = $root.google.protobuf.Any.verify(message.consensusState); + if (error) + return "consensusState." + error; + } + if (message.proofUpgradeClient != null && message.hasOwnProperty("proofUpgradeClient")) + if (!(message.proofUpgradeClient && typeof message.proofUpgradeClient.length === "number" || $util.isString(message.proofUpgradeClient))) + return "proofUpgradeClient: buffer expected"; + if (message.proofUpgradeConsensusState != null && message.hasOwnProperty("proofUpgradeConsensusState")) + if (!(message.proofUpgradeConsensusState && typeof message.proofUpgradeConsensusState.length === "number" || $util.isString(message.proofUpgradeConsensusState))) + return "proofUpgradeConsensusState: buffer expected"; + if (message.signer != null && message.hasOwnProperty("signer")) + if (!$util.isString(message.signer)) + return "signer: string expected"; + return null; + }; + + /** + * Creates a MsgUpgradeClient message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.MsgUpgradeClient} MsgUpgradeClient + */ + MsgUpgradeClient.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.MsgUpgradeClient) + return object; + let message = new $root.ibc.core.client.v1.MsgUpgradeClient(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.clientState != null) { + if (typeof object.clientState !== "object") + throw TypeError(".ibc.core.client.v1.MsgUpgradeClient.clientState: object expected"); + message.clientState = $root.google.protobuf.Any.fromObject(object.clientState); + } + if (object.consensusState != null) { + if (typeof object.consensusState !== "object") + throw TypeError(".ibc.core.client.v1.MsgUpgradeClient.consensusState: object expected"); + message.consensusState = $root.google.protobuf.Any.fromObject(object.consensusState); + } + if (object.proofUpgradeClient != null) + if (typeof object.proofUpgradeClient === "string") + $util.base64.decode(object.proofUpgradeClient, message.proofUpgradeClient = $util.newBuffer($util.base64.length(object.proofUpgradeClient)), 0); + else if (object.proofUpgradeClient.length) + message.proofUpgradeClient = object.proofUpgradeClient; + if (object.proofUpgradeConsensusState != null) + if (typeof object.proofUpgradeConsensusState === "string") + $util.base64.decode(object.proofUpgradeConsensusState, message.proofUpgradeConsensusState = $util.newBuffer($util.base64.length(object.proofUpgradeConsensusState)), 0); + else if (object.proofUpgradeConsensusState.length) + message.proofUpgradeConsensusState = object.proofUpgradeConsensusState; + if (object.signer != null) + message.signer = String(object.signer); + return message; + }; + + /** + * Creates a plain object from a MsgUpgradeClient message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @static + * @param {ibc.core.client.v1.MsgUpgradeClient} message MsgUpgradeClient + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgUpgradeClient.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.clientId = ""; + object.clientState = null; + object.consensusState = null; + if (options.bytes === String) + object.proofUpgradeClient = ""; + else { + object.proofUpgradeClient = []; + if (options.bytes !== Array) + object.proofUpgradeClient = $util.newBuffer(object.proofUpgradeClient); + } + if (options.bytes === String) + object.proofUpgradeConsensusState = ""; + else { + object.proofUpgradeConsensusState = []; + if (options.bytes !== Array) + object.proofUpgradeConsensusState = $util.newBuffer(object.proofUpgradeConsensusState); + } + object.signer = ""; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.clientState != null && message.hasOwnProperty("clientState")) + object.clientState = $root.google.protobuf.Any.toObject(message.clientState, options); + if (message.consensusState != null && message.hasOwnProperty("consensusState")) + object.consensusState = $root.google.protobuf.Any.toObject(message.consensusState, options); + if (message.proofUpgradeClient != null && message.hasOwnProperty("proofUpgradeClient")) + object.proofUpgradeClient = options.bytes === String ? $util.base64.encode(message.proofUpgradeClient, 0, message.proofUpgradeClient.length) : options.bytes === Array ? Array.prototype.slice.call(message.proofUpgradeClient) : message.proofUpgradeClient; + if (message.proofUpgradeConsensusState != null && message.hasOwnProperty("proofUpgradeConsensusState")) + object.proofUpgradeConsensusState = options.bytes === String ? $util.base64.encode(message.proofUpgradeConsensusState, 0, message.proofUpgradeConsensusState.length) : options.bytes === Array ? Array.prototype.slice.call(message.proofUpgradeConsensusState) : message.proofUpgradeConsensusState; + if (message.signer != null && message.hasOwnProperty("signer")) + object.signer = message.signer; + return object; + }; + + /** + * Converts this MsgUpgradeClient to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.MsgUpgradeClient + * @instance + * @returns {Object.} JSON object + */ + MsgUpgradeClient.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgUpgradeClient; + })(v1.MsgUpgradeClient || {}); + + v1.MsgUpgradeClientResponse = (function(MsgUpgradeClientResponse) { + + /** + * Properties of a MsgUpgradeClientResponse. + * @memberof ibc.core.client.v1 + * @interface IMsgUpgradeClientResponse + */ + + /** + * Constructs a new MsgUpgradeClientResponse. + * @memberof ibc.core.client.v1 + * @classdesc Represents a MsgUpgradeClientResponse. + * @implements IMsgUpgradeClientResponse + * @constructor + * @param {ibc.core.client.v1.IMsgUpgradeClientResponse=} [properties] Properties to set + */ + function MsgUpgradeClientResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgUpgradeClientResponse instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.MsgUpgradeClientResponse + * @static + * @param {ibc.core.client.v1.IMsgUpgradeClientResponse=} [properties] Properties to set + * @returns {ibc.core.client.v1.MsgUpgradeClientResponse} MsgUpgradeClientResponse instance + */ + MsgUpgradeClientResponse.create = function create(properties) { + return new MsgUpgradeClientResponse(properties); + }; + + /** + * Encodes the specified MsgUpgradeClientResponse message. Does not implicitly {@link ibc.core.client.v1.MsgUpgradeClientResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.MsgUpgradeClientResponse + * @static + * @param {ibc.core.client.v1.IMsgUpgradeClientResponse} message MsgUpgradeClientResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUpgradeClientResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgUpgradeClientResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgUpgradeClientResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.MsgUpgradeClientResponse + * @static + * @param {ibc.core.client.v1.IMsgUpgradeClientResponse} message MsgUpgradeClientResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgUpgradeClientResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgUpgradeClientResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.MsgUpgradeClientResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.MsgUpgradeClientResponse} MsgUpgradeClientResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUpgradeClientResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgUpgradeClientResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgUpgradeClientResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.MsgUpgradeClientResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.MsgUpgradeClientResponse} MsgUpgradeClientResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgUpgradeClientResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgUpgradeClientResponse message. + * @function verify + * @memberof ibc.core.client.v1.MsgUpgradeClientResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgUpgradeClientResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgUpgradeClientResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.MsgUpgradeClientResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.MsgUpgradeClientResponse} MsgUpgradeClientResponse + */ + MsgUpgradeClientResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.MsgUpgradeClientResponse) + return object; + return new $root.ibc.core.client.v1.MsgUpgradeClientResponse(); + }; + + /** + * Creates a plain object from a MsgUpgradeClientResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.MsgUpgradeClientResponse + * @static + * @param {ibc.core.client.v1.MsgUpgradeClientResponse} message MsgUpgradeClientResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgUpgradeClientResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgUpgradeClientResponse to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.MsgUpgradeClientResponse + * @instance + * @returns {Object.} JSON object + */ + MsgUpgradeClientResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgUpgradeClientResponse; + })(v1.MsgUpgradeClientResponse || {}); + + v1.MsgSubmitMisbehaviour = (function(MsgSubmitMisbehaviour) { + + /** + * Properties of a MsgSubmitMisbehaviour. + * @memberof ibc.core.client.v1 + * @interface IMsgSubmitMisbehaviour + * @property {string|null} [clientId] MsgSubmitMisbehaviour clientId + * @property {google.protobuf.IAny|null} [misbehaviour] MsgSubmitMisbehaviour misbehaviour + * @property {string|null} [signer] MsgSubmitMisbehaviour signer + */ + + /** + * Constructs a new MsgSubmitMisbehaviour. + * @memberof ibc.core.client.v1 + * @classdesc Represents a MsgSubmitMisbehaviour. + * @implements IMsgSubmitMisbehaviour + * @constructor + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviour=} [properties] Properties to set + */ + function MsgSubmitMisbehaviour(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgSubmitMisbehaviour clientId. + * @member {string} clientId + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @instance + */ + MsgSubmitMisbehaviour.prototype.clientId = ""; + + /** + * MsgSubmitMisbehaviour misbehaviour. + * @member {google.protobuf.IAny|null|undefined} misbehaviour + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @instance + */ + MsgSubmitMisbehaviour.prototype.misbehaviour = null; + + /** + * MsgSubmitMisbehaviour signer. + * @member {string} signer + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @instance + */ + MsgSubmitMisbehaviour.prototype.signer = ""; + + /** + * Creates a new MsgSubmitMisbehaviour instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @static + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviour=} [properties] Properties to set + * @returns {ibc.core.client.v1.MsgSubmitMisbehaviour} MsgSubmitMisbehaviour instance + */ + MsgSubmitMisbehaviour.create = function create(properties) { + return new MsgSubmitMisbehaviour(properties); + }; + + /** + * Encodes the specified MsgSubmitMisbehaviour message. Does not implicitly {@link ibc.core.client.v1.MsgSubmitMisbehaviour.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @static + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviour} message MsgSubmitMisbehaviour message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitMisbehaviour.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.misbehaviour != null && Object.hasOwnProperty.call(message, "misbehaviour")) + $root.google.protobuf.Any.encode(message.misbehaviour, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.signer); + return writer; + }; + + /** + * Encodes the specified MsgSubmitMisbehaviour message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgSubmitMisbehaviour.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @static + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviour} message MsgSubmitMisbehaviour message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitMisbehaviour.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgSubmitMisbehaviour message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.MsgSubmitMisbehaviour} MsgSubmitMisbehaviour + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitMisbehaviour.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgSubmitMisbehaviour(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.misbehaviour = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgSubmitMisbehaviour message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.MsgSubmitMisbehaviour} MsgSubmitMisbehaviour + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitMisbehaviour.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgSubmitMisbehaviour message. + * @function verify + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgSubmitMisbehaviour.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.misbehaviour != null && message.hasOwnProperty("misbehaviour")) { + let error = $root.google.protobuf.Any.verify(message.misbehaviour); + if (error) + return "misbehaviour." + error; + } + if (message.signer != null && message.hasOwnProperty("signer")) + if (!$util.isString(message.signer)) + return "signer: string expected"; + return null; + }; + + /** + * Creates a MsgSubmitMisbehaviour message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.MsgSubmitMisbehaviour} MsgSubmitMisbehaviour + */ + MsgSubmitMisbehaviour.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.MsgSubmitMisbehaviour) + return object; + let message = new $root.ibc.core.client.v1.MsgSubmitMisbehaviour(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.misbehaviour != null) { + if (typeof object.misbehaviour !== "object") + throw TypeError(".ibc.core.client.v1.MsgSubmitMisbehaviour.misbehaviour: object expected"); + message.misbehaviour = $root.google.protobuf.Any.fromObject(object.misbehaviour); + } + if (object.signer != null) + message.signer = String(object.signer); + return message; + }; + + /** + * Creates a plain object from a MsgSubmitMisbehaviour message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @static + * @param {ibc.core.client.v1.MsgSubmitMisbehaviour} message MsgSubmitMisbehaviour + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSubmitMisbehaviour.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.clientId = ""; + object.misbehaviour = null; + object.signer = ""; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.misbehaviour != null && message.hasOwnProperty("misbehaviour")) + object.misbehaviour = $root.google.protobuf.Any.toObject(message.misbehaviour, options); + if (message.signer != null && message.hasOwnProperty("signer")) + object.signer = message.signer; + return object; + }; + + /** + * Converts this MsgSubmitMisbehaviour to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour + * @instance + * @returns {Object.} JSON object + */ + MsgSubmitMisbehaviour.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgSubmitMisbehaviour; + })(v1.MsgSubmitMisbehaviour || {}); + + v1.MsgSubmitMisbehaviourResponse = (function(MsgSubmitMisbehaviourResponse) { + + /** + * Properties of a MsgSubmitMisbehaviourResponse. + * @memberof ibc.core.client.v1 + * @interface IMsgSubmitMisbehaviourResponse + */ + + /** + * Constructs a new MsgSubmitMisbehaviourResponse. + * @memberof ibc.core.client.v1 + * @classdesc Represents a MsgSubmitMisbehaviourResponse. + * @implements IMsgSubmitMisbehaviourResponse + * @constructor + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviourResponse=} [properties] Properties to set + */ + function MsgSubmitMisbehaviourResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MsgSubmitMisbehaviourResponse instance using the specified properties. + * @function create + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse + * @static + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviourResponse=} [properties] Properties to set + * @returns {ibc.core.client.v1.MsgSubmitMisbehaviourResponse} MsgSubmitMisbehaviourResponse instance + */ + MsgSubmitMisbehaviourResponse.create = function create(properties) { + return new MsgSubmitMisbehaviourResponse(properties); + }; + + /** + * Encodes the specified MsgSubmitMisbehaviourResponse message. Does not implicitly {@link ibc.core.client.v1.MsgSubmitMisbehaviourResponse.verify|verify} messages. + * @function encode + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse + * @static + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviourResponse} message MsgSubmitMisbehaviourResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitMisbehaviourResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MsgSubmitMisbehaviourResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgSubmitMisbehaviourResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse + * @static + * @param {ibc.core.client.v1.IMsgSubmitMisbehaviourResponse} message MsgSubmitMisbehaviourResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSubmitMisbehaviourResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgSubmitMisbehaviourResponse message from the specified reader or buffer. + * @function decode + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ibc.core.client.v1.MsgSubmitMisbehaviourResponse} MsgSubmitMisbehaviourResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitMisbehaviourResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgSubmitMisbehaviourResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgSubmitMisbehaviourResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ibc.core.client.v1.MsgSubmitMisbehaviourResponse} MsgSubmitMisbehaviourResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSubmitMisbehaviourResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgSubmitMisbehaviourResponse message. + * @function verify + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgSubmitMisbehaviourResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MsgSubmitMisbehaviourResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse + * @static + * @param {Object.} object Plain object + * @returns {ibc.core.client.v1.MsgSubmitMisbehaviourResponse} MsgSubmitMisbehaviourResponse + */ + MsgSubmitMisbehaviourResponse.fromObject = function fromObject(object) { + if (object instanceof $root.ibc.core.client.v1.MsgSubmitMisbehaviourResponse) + return object; + return new $root.ibc.core.client.v1.MsgSubmitMisbehaviourResponse(); + }; + + /** + * Creates a plain object from a MsgSubmitMisbehaviourResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse + * @static + * @param {ibc.core.client.v1.MsgSubmitMisbehaviourResponse} message MsgSubmitMisbehaviourResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSubmitMisbehaviourResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MsgSubmitMisbehaviourResponse to JSON. + * @function toJSON + * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse + * @instance + * @returns {Object.} JSON object + */ + MsgSubmitMisbehaviourResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgSubmitMisbehaviourResponse; + })(v1.MsgSubmitMisbehaviourResponse || {}); + + return v1; + })(client.v1 || {}); + + return client; + })(core.client || {}); + + return core; + })(ibc.core || {}); + + return ibc; +})($root.ibc || {}); + +/** + * Namespace cosmos. + * @exports cosmos + * @namespace + */ + +export const cosmos = $root.cosmos = ((cosmos) => { + + /** + * Namespace base. + * @memberof cosmos + * @namespace + */ + + cosmos.base = (function(base) { + + /** + * Namespace v1beta1. + * @memberof cosmos.base + * @namespace + */ + + base.v1beta1 = (function(v1beta1) { + + v1beta1.Coin = (function(Coin) { + + /** + * Properties of a Coin. + * @memberof cosmos.base.v1beta1 + * @interface ICoin + * @property {string|null} [denom] Coin denom + * @property {string|null} [amount] Coin amount + */ + + /** + * Constructs a new Coin. + * @memberof cosmos.base.v1beta1 + * @classdesc Represents a Coin. + * @implements ICoin + * @constructor + * @param {cosmos.base.v1beta1.ICoin=} [properties] Properties to set + */ + function Coin(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Coin denom. + * @member {string} denom + * @memberof cosmos.base.v1beta1.Coin + * @instance + */ + Coin.prototype.denom = ""; + + /** + * Coin amount. + * @member {string} amount + * @memberof cosmos.base.v1beta1.Coin + * @instance + */ + Coin.prototype.amount = ""; + + /** + * Creates a new Coin instance using the specified properties. + * @function create + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {cosmos.base.v1beta1.ICoin=} [properties] Properties to set + * @returns {cosmos.base.v1beta1.Coin} Coin instance + */ + Coin.create = function create(properties) { + return new Coin(properties); + }; + + /** + * Encodes the specified Coin message. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. + * @function encode + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {cosmos.base.v1beta1.ICoin} message Coin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Coin.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.amount); + return writer; + }; + + /** + * Encodes the specified Coin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {cosmos.base.v1beta1.ICoin} message Coin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Coin.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Coin message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.v1beta1.Coin} Coin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Coin.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.Coin(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Coin message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.v1beta1.Coin} Coin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Coin.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Coin message. + * @function verify + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Coin.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.denom != null && message.hasOwnProperty("denom")) + if (!$util.isString(message.denom)) + return "denom: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) + if (!$util.isString(message.amount)) + return "amount: string expected"; + return null; + }; + + /** + * Creates a Coin message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.v1beta1.Coin} Coin + */ + Coin.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.v1beta1.Coin) + return object; + let message = new $root.cosmos.base.v1beta1.Coin(); + if (object.denom != null) + message.denom = String(object.denom); + if (object.amount != null) + message.amount = String(object.amount); + return message; + }; + + /** + * Creates a plain object from a Coin message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {cosmos.base.v1beta1.Coin} message Coin + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Coin.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.denom = ""; + object.amount = ""; + } + if (message.denom != null && message.hasOwnProperty("denom")) + object.denom = message.denom; + if (message.amount != null && message.hasOwnProperty("amount")) + object.amount = message.amount; + return object; + }; + + /** + * Converts this Coin to JSON. + * @function toJSON + * @memberof cosmos.base.v1beta1.Coin + * @instance + * @returns {Object.} JSON object + */ + Coin.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Coin; + })(v1beta1.Coin || {}); + + v1beta1.DecCoin = (function(DecCoin) { + + /** + * Properties of a DecCoin. + * @memberof cosmos.base.v1beta1 + * @interface IDecCoin + * @property {string|null} [denom] DecCoin denom + * @property {string|null} [amount] DecCoin amount + */ + + /** + * Constructs a new DecCoin. + * @memberof cosmos.base.v1beta1 + * @classdesc Represents a DecCoin. + * @implements IDecCoin + * @constructor + * @param {cosmos.base.v1beta1.IDecCoin=} [properties] Properties to set + */ + function DecCoin(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DecCoin denom. + * @member {string} denom + * @memberof cosmos.base.v1beta1.DecCoin + * @instance + */ + DecCoin.prototype.denom = ""; + + /** + * DecCoin amount. + * @member {string} amount + * @memberof cosmos.base.v1beta1.DecCoin + * @instance + */ + DecCoin.prototype.amount = ""; + + /** + * Creates a new DecCoin instance using the specified properties. + * @function create + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {cosmos.base.v1beta1.IDecCoin=} [properties] Properties to set + * @returns {cosmos.base.v1beta1.DecCoin} DecCoin instance + */ + DecCoin.create = function create(properties) { + return new DecCoin(properties); + }; + + /** + * Encodes the specified DecCoin message. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. + * @function encode + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {cosmos.base.v1beta1.IDecCoin} message DecCoin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecCoin.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.amount); + return writer; + }; + + /** + * Encodes the specified DecCoin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {cosmos.base.v1beta1.IDecCoin} message DecCoin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecCoin.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DecCoin message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.v1beta1.DecCoin} DecCoin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecCoin.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.DecCoin(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DecCoin message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.v1beta1.DecCoin} DecCoin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecCoin.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DecCoin message. + * @function verify + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DecCoin.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.denom != null && message.hasOwnProperty("denom")) + if (!$util.isString(message.denom)) + return "denom: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) + if (!$util.isString(message.amount)) + return "amount: string expected"; + return null; + }; + + /** + * Creates a DecCoin message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.v1beta1.DecCoin} DecCoin + */ + DecCoin.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.v1beta1.DecCoin) + return object; + let message = new $root.cosmos.base.v1beta1.DecCoin(); + if (object.denom != null) + message.denom = String(object.denom); + if (object.amount != null) + message.amount = String(object.amount); + return message; + }; + + /** + * Creates a plain object from a DecCoin message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {cosmos.base.v1beta1.DecCoin} message DecCoin + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DecCoin.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.denom = ""; + object.amount = ""; + } + if (message.denom != null && message.hasOwnProperty("denom")) + object.denom = message.denom; + if (message.amount != null && message.hasOwnProperty("amount")) + object.amount = message.amount; + return object; + }; + + /** + * Converts this DecCoin to JSON. + * @function toJSON + * @memberof cosmos.base.v1beta1.DecCoin + * @instance + * @returns {Object.} JSON object + */ + DecCoin.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DecCoin; + })(v1beta1.DecCoin || {}); + + v1beta1.IntProto = (function(IntProto) { + + /** + * Properties of an IntProto. + * @memberof cosmos.base.v1beta1 + * @interface IIntProto + * @property {string|null} [int] IntProto int + */ + + /** + * Constructs a new IntProto. + * @memberof cosmos.base.v1beta1 + * @classdesc Represents an IntProto. + * @implements IIntProto + * @constructor + * @param {cosmos.base.v1beta1.IIntProto=} [properties] Properties to set + */ + function IntProto(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IntProto int. + * @member {string} int + * @memberof cosmos.base.v1beta1.IntProto + * @instance + */ + IntProto.prototype.int = ""; + + /** + * Creates a new IntProto instance using the specified properties. + * @function create + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {cosmos.base.v1beta1.IIntProto=} [properties] Properties to set + * @returns {cosmos.base.v1beta1.IntProto} IntProto instance + */ + IntProto.create = function create(properties) { + return new IntProto(properties); + }; + + /** + * Encodes the specified IntProto message. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. + * @function encode + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {cosmos.base.v1beta1.IIntProto} message IntProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.int != null && Object.hasOwnProperty.call(message, "int")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.int); + return writer; + }; + + /** + * Encodes the specified IntProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {cosmos.base.v1beta1.IIntProto} message IntProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IntProto message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.v1beta1.IntProto} IntProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.IntProto(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.int = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IntProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.v1beta1.IntProto} IntProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntProto message. + * @function verify + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.int != null && message.hasOwnProperty("int")) + if (!$util.isString(message.int)) + return "int: string expected"; + return null; + }; + + /** + * Creates an IntProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.v1beta1.IntProto} IntProto + */ + IntProto.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.v1beta1.IntProto) + return object; + let message = new $root.cosmos.base.v1beta1.IntProto(); + if (object.int != null) + message.int = String(object.int); + return message; + }; + + /** + * Creates a plain object from an IntProto message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {cosmos.base.v1beta1.IntProto} message IntProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.int = ""; + if (message.int != null && message.hasOwnProperty("int")) + object.int = message.int; + return object; + }; + + /** + * Converts this IntProto to JSON. + * @function toJSON + * @memberof cosmos.base.v1beta1.IntProto + * @instance + * @returns {Object.} JSON object + */ + IntProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IntProto; + })(v1beta1.IntProto || {}); + + v1beta1.DecProto = (function(DecProto) { + + /** + * Properties of a DecProto. + * @memberof cosmos.base.v1beta1 + * @interface IDecProto + * @property {string|null} [dec] DecProto dec + */ + + /** + * Constructs a new DecProto. + * @memberof cosmos.base.v1beta1 + * @classdesc Represents a DecProto. + * @implements IDecProto + * @constructor + * @param {cosmos.base.v1beta1.IDecProto=} [properties] Properties to set + */ + function DecProto(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DecProto dec. + * @member {string} dec + * @memberof cosmos.base.v1beta1.DecProto + * @instance + */ + DecProto.prototype.dec = ""; + + /** + * Creates a new DecProto instance using the specified properties. + * @function create + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {cosmos.base.v1beta1.IDecProto=} [properties] Properties to set + * @returns {cosmos.base.v1beta1.DecProto} DecProto instance + */ + DecProto.create = function create(properties) { + return new DecProto(properties); + }; + + /** + * Encodes the specified DecProto message. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. + * @function encode + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {cosmos.base.v1beta1.IDecProto} message DecProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dec != null && Object.hasOwnProperty.call(message, "dec")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dec); + return writer; + }; + + /** + * Encodes the specified DecProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {cosmos.base.v1beta1.IDecProto} message DecProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DecProto message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.v1beta1.DecProto} DecProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.DecProto(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dec = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DecProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.v1beta1.DecProto} DecProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DecProto message. + * @function verify + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DecProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dec != null && message.hasOwnProperty("dec")) + if (!$util.isString(message.dec)) + return "dec: string expected"; + return null; + }; + + /** + * Creates a DecProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.v1beta1.DecProto} DecProto + */ + DecProto.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.v1beta1.DecProto) + return object; + let message = new $root.cosmos.base.v1beta1.DecProto(); + if (object.dec != null) + message.dec = String(object.dec); + return message; + }; + + /** + * Creates a plain object from a DecProto message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {cosmos.base.v1beta1.DecProto} message DecProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DecProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.dec = ""; + if (message.dec != null && message.hasOwnProperty("dec")) + object.dec = message.dec; + return object; + }; + + /** + * Converts this DecProto to JSON. + * @function toJSON + * @memberof cosmos.base.v1beta1.DecProto + * @instance + * @returns {Object.} JSON object + */ + DecProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DecProto; + })(v1beta1.DecProto || {}); + + return v1beta1; + })(base.v1beta1 || {}); + + /** + * Namespace query. + * @memberof cosmos.base + * @namespace + */ + + base.query = (function(query) { + + /** + * Namespace v1beta1. + * @memberof cosmos.base.query + * @namespace + */ + + query.v1beta1 = (function(v1beta1) { + + v1beta1.PageRequest = (function(PageRequest) { + + /** + * Properties of a PageRequest. + * @memberof cosmos.base.query.v1beta1 + * @interface IPageRequest + * @property {Uint8Array|null} [key] PageRequest key + * @property {number|Long|null} [offset] PageRequest offset + * @property {number|Long|null} [limit] PageRequest limit + * @property {boolean|null} [countTotal] PageRequest countTotal + */ + + /** + * Constructs a new PageRequest. + * @memberof cosmos.base.query.v1beta1 + * @classdesc Represents a PageRequest. + * @implements IPageRequest + * @constructor + * @param {cosmos.base.query.v1beta1.IPageRequest=} [properties] Properties to set + */ + function PageRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PageRequest key. + * @member {Uint8Array} key + * @memberof cosmos.base.query.v1beta1.PageRequest + * @instance + */ + PageRequest.prototype.key = $util.newBuffer([]); + + /** + * PageRequest offset. + * @member {number|Long} offset + * @memberof cosmos.base.query.v1beta1.PageRequest + * @instance + */ + PageRequest.prototype.offset = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * PageRequest limit. + * @member {number|Long} limit + * @memberof cosmos.base.query.v1beta1.PageRequest + * @instance + */ + PageRequest.prototype.limit = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * PageRequest countTotal. + * @member {boolean} countTotal + * @memberof cosmos.base.query.v1beta1.PageRequest + * @instance + */ + PageRequest.prototype.countTotal = false; + + /** + * Creates a new PageRequest instance using the specified properties. + * @function create + * @memberof cosmos.base.query.v1beta1.PageRequest + * @static + * @param {cosmos.base.query.v1beta1.IPageRequest=} [properties] Properties to set + * @returns {cosmos.base.query.v1beta1.PageRequest} PageRequest instance + */ + PageRequest.create = function create(properties) { + return new PageRequest(properties); + }; + + /** + * Encodes the specified PageRequest message. Does not implicitly {@link cosmos.base.query.v1beta1.PageRequest.verify|verify} messages. + * @function encode + * @memberof cosmos.base.query.v1beta1.PageRequest + * @static + * @param {cosmos.base.query.v1beta1.IPageRequest} message PageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.offset); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.limit); + if (message.countTotal != null && Object.hasOwnProperty.call(message, "countTotal")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.countTotal); + return writer; + }; + + /** + * Encodes the specified PageRequest message, length delimited. Does not implicitly {@link cosmos.base.query.v1beta1.PageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.query.v1beta1.PageRequest + * @static + * @param {cosmos.base.query.v1beta1.IPageRequest} message PageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PageRequest message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.query.v1beta1.PageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.query.v1beta1.PageRequest} PageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PageRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.query.v1beta1.PageRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.offset = reader.uint64(); + break; + case 3: + message.limit = reader.uint64(); + break; + case 4: + message.countTotal = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.query.v1beta1.PageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.query.v1beta1.PageRequest} PageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PageRequest message. + * @function verify + * @memberof cosmos.base.query.v1beta1.PageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + if (message.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset) && !(message.offset && $util.isInteger(message.offset.low) && $util.isInteger(message.offset.high))) + return "offset: integer|Long expected"; + if (message.limit != null && message.hasOwnProperty("limit")) + if (!$util.isInteger(message.limit) && !(message.limit && $util.isInteger(message.limit.low) && $util.isInteger(message.limit.high))) + return "limit: integer|Long expected"; + if (message.countTotal != null && message.hasOwnProperty("countTotal")) + if (typeof message.countTotal !== "boolean") + return "countTotal: boolean expected"; + return null; + }; + + /** + * Creates a PageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.query.v1beta1.PageRequest + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.query.v1beta1.PageRequest} PageRequest + */ + PageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.query.v1beta1.PageRequest) + return object; + let message = new $root.cosmos.base.query.v1beta1.PageRequest(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length) + message.key = object.key; + if (object.offset != null) + if ($util.Long) + (message.offset = $util.Long.fromValue(object.offset)).unsigned = true; + else if (typeof object.offset === "string") + message.offset = parseInt(object.offset, 10); + else if (typeof object.offset === "number") + message.offset = object.offset; + else if (typeof object.offset === "object") + message.offset = new $util.LongBits(object.offset.low >>> 0, object.offset.high >>> 0).toNumber(true); + if (object.limit != null) + if ($util.Long) + (message.limit = $util.Long.fromValue(object.limit)).unsigned = true; + else if (typeof object.limit === "string") + message.limit = parseInt(object.limit, 10); + else if (typeof object.limit === "number") + message.limit = object.limit; + else if (typeof object.limit === "object") + message.limit = new $util.LongBits(object.limit.low >>> 0, object.limit.high >>> 0).toNumber(true); + if (object.countTotal != null) + message.countTotal = Boolean(object.countTotal); + return message; + }; + + /** + * Creates a plain object from a PageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.query.v1beta1.PageRequest + * @static + * @param {cosmos.base.query.v1beta1.PageRequest} message PageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.offset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.offset = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.limit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.limit = options.longs === String ? "0" : 0; + object.countTotal = false; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.offset != null && message.hasOwnProperty("offset")) + if (typeof message.offset === "number") + object.offset = options.longs === String ? String(message.offset) : message.offset; + else + object.offset = options.longs === String ? $util.Long.prototype.toString.call(message.offset) : options.longs === Number ? new $util.LongBits(message.offset.low >>> 0, message.offset.high >>> 0).toNumber(true) : message.offset; + if (message.limit != null && message.hasOwnProperty("limit")) + if (typeof message.limit === "number") + object.limit = options.longs === String ? String(message.limit) : message.limit; + else + object.limit = options.longs === String ? $util.Long.prototype.toString.call(message.limit) : options.longs === Number ? new $util.LongBits(message.limit.low >>> 0, message.limit.high >>> 0).toNumber(true) : message.limit; + if (message.countTotal != null && message.hasOwnProperty("countTotal")) + object.countTotal = message.countTotal; + return object; + }; + + /** + * Converts this PageRequest to JSON. + * @function toJSON + * @memberof cosmos.base.query.v1beta1.PageRequest + * @instance + * @returns {Object.} JSON object + */ + PageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PageRequest; + })(v1beta1.PageRequest || {}); + + v1beta1.PageResponse = (function(PageResponse) { + + /** + * Properties of a PageResponse. + * @memberof cosmos.base.query.v1beta1 + * @interface IPageResponse + * @property {Uint8Array|null} [nextKey] PageResponse nextKey + * @property {number|Long|null} [total] PageResponse total + */ + + /** + * Constructs a new PageResponse. + * @memberof cosmos.base.query.v1beta1 + * @classdesc Represents a PageResponse. + * @implements IPageResponse + * @constructor + * @param {cosmos.base.query.v1beta1.IPageResponse=} [properties] Properties to set + */ + function PageResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PageResponse nextKey. + * @member {Uint8Array} nextKey + * @memberof cosmos.base.query.v1beta1.PageResponse + * @instance + */ + PageResponse.prototype.nextKey = $util.newBuffer([]); + + /** + * PageResponse total. + * @member {number|Long} total + * @memberof cosmos.base.query.v1beta1.PageResponse + * @instance + */ + PageResponse.prototype.total = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PageResponse instance using the specified properties. + * @function create + * @memberof cosmos.base.query.v1beta1.PageResponse + * @static + * @param {cosmos.base.query.v1beta1.IPageResponse=} [properties] Properties to set + * @returns {cosmos.base.query.v1beta1.PageResponse} PageResponse instance + */ + PageResponse.create = function create(properties) { + return new PageResponse(properties); + }; + + /** + * Encodes the specified PageResponse message. Does not implicitly {@link cosmos.base.query.v1beta1.PageResponse.verify|verify} messages. + * @function encode + * @memberof cosmos.base.query.v1beta1.PageResponse + * @static + * @param {cosmos.base.query.v1beta1.IPageResponse} message PageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PageResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nextKey != null && Object.hasOwnProperty.call(message, "nextKey")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.nextKey); + if (message.total != null && Object.hasOwnProperty.call(message, "total")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.total); + return writer; + }; + + /** + * Encodes the specified PageResponse message, length delimited. Does not implicitly {@link cosmos.base.query.v1beta1.PageResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.query.v1beta1.PageResponse + * @static + * @param {cosmos.base.query.v1beta1.IPageResponse} message PageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PageResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PageResponse message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.query.v1beta1.PageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.query.v1beta1.PageResponse} PageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PageResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.query.v1beta1.PageResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nextKey = reader.bytes(); + break; + case 2: + message.total = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PageResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.query.v1beta1.PageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.query.v1beta1.PageResponse} PageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PageResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PageResponse message. + * @function verify + * @memberof cosmos.base.query.v1beta1.PageResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PageResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nextKey != null && message.hasOwnProperty("nextKey")) + if (!(message.nextKey && typeof message.nextKey.length === "number" || $util.isString(message.nextKey))) + return "nextKey: buffer expected"; + if (message.total != null && message.hasOwnProperty("total")) + if (!$util.isInteger(message.total) && !(message.total && $util.isInteger(message.total.low) && $util.isInteger(message.total.high))) + return "total: integer|Long expected"; + return null; + }; + + /** + * Creates a PageResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.query.v1beta1.PageResponse + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.query.v1beta1.PageResponse} PageResponse + */ + PageResponse.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.query.v1beta1.PageResponse) + return object; + let message = new $root.cosmos.base.query.v1beta1.PageResponse(); + if (object.nextKey != null) + if (typeof object.nextKey === "string") + $util.base64.decode(object.nextKey, message.nextKey = $util.newBuffer($util.base64.length(object.nextKey)), 0); + else if (object.nextKey.length) + message.nextKey = object.nextKey; + if (object.total != null) + if ($util.Long) + (message.total = $util.Long.fromValue(object.total)).unsigned = true; + else if (typeof object.total === "string") + message.total = parseInt(object.total, 10); + else if (typeof object.total === "number") + message.total = object.total; + else if (typeof object.total === "object") + message.total = new $util.LongBits(object.total.low >>> 0, object.total.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a PageResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.query.v1beta1.PageResponse + * @static + * @param {cosmos.base.query.v1beta1.PageResponse} message PageResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PageResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if (options.bytes === String) + object.nextKey = ""; + else { + object.nextKey = []; + if (options.bytes !== Array) + object.nextKey = $util.newBuffer(object.nextKey); + } + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.total = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.total = options.longs === String ? "0" : 0; + } + if (message.nextKey != null && message.hasOwnProperty("nextKey")) + object.nextKey = options.bytes === String ? $util.base64.encode(message.nextKey, 0, message.nextKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.nextKey) : message.nextKey; + if (message.total != null && message.hasOwnProperty("total")) + if (typeof message.total === "number") + object.total = options.longs === String ? String(message.total) : message.total; + else + object.total = options.longs === String ? $util.Long.prototype.toString.call(message.total) : options.longs === Number ? new $util.LongBits(message.total.low >>> 0, message.total.high >>> 0).toNumber(true) : message.total; + return object; + }; + + /** + * Converts this PageResponse to JSON. + * @function toJSON + * @memberof cosmos.base.query.v1beta1.PageResponse + * @instance + * @returns {Object.} JSON object + */ + PageResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PageResponse; + })(v1beta1.PageResponse || {}); + + return v1beta1; + })(query.v1beta1 || {}); + + return query; + })(base.query || {}); + + return base; + })(cosmos.base || {}); + + return cosmos; +})($root.cosmos || {}); + +/** + * Namespace google. + * @exports google + * @namespace + */ + +export const google = $root.google = ((google) => { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + + google.protobuf = (function(protobuf) { + + protobuf.Any = (function(Any) { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type_url = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + let message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Any; + })(protobuf.Any || {}); + + return protobuf; + })(google.protobuf || {}); + + return google; +})($root.google || {}); + +export { $root as default }; diff --git a/src/libs/msg.js b/src/libs/msg.js new file mode 100644 index 00000000..63849e80 --- /dev/null +++ b/src/libs/msg.js @@ -0,0 +1,270 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +export const protobufPackage = "osmosis.gamm.v1beta1"; +const baseSwapAmountInRoute = { poolId: Long.UZERO, tokenOutDenom: "" }; +export const SwapAmountInRoute = { + encode(message, writer = _m0.Writer.create()) { + if (!message.poolId.isZero()) { + writer.uint32(8).uint64(message.poolId); + } + if (message.tokenOutDenom !== "") { + writer.uint32(18).string(message.tokenOutDenom); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = Object.assign({}, baseSwapAmountInRoute); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.poolId = reader.uint64(); + break; + case 2: + message.tokenOutDenom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object) { + const message = Object.assign({}, baseSwapAmountInRoute); + if (object.poolId !== undefined && object.poolId !== null) { + message.poolId = Long.fromString(object.poolId); + } + else { + message.poolId = Long.UZERO; + } + if (object.tokenOutDenom !== undefined && object.tokenOutDenom !== null) { + message.tokenOutDenom = String(object.tokenOutDenom); + } + else { + message.tokenOutDenom = ""; + } + return message; + }, + toJSON(message) { + const obj = {}; + message.poolId !== undefined && + (obj.poolId = (message.poolId || Long.UZERO).toString()); + message.tokenOutDenom !== undefined && + (obj.tokenOutDenom = message.tokenOutDenom); + return obj; + }, + fromPartial(object) { + const message = Object.assign({}, baseSwapAmountInRoute); + if (object.poolId !== undefined && object.poolId !== null) { + message.poolId = object.poolId; + } + else { + message.poolId = Long.UZERO; + } + if (object.tokenOutDenom !== undefined && object.tokenOutDenom !== null) { + message.tokenOutDenom = object.tokenOutDenom; + } + else { + message.tokenOutDenom = ""; + } + return message; + }, +}; +const baseCoin = { denom: "", amount: "" }; +export const Coin = { + encode(message, writer = _m0.Writer.create()) { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = Object.assign({}, baseCoin); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object) { + const message = Object.assign({}, baseCoin); + if (object.denom !== undefined && object.denom !== null) { + message.denom = String(object.denom); + } + else { + message.denom = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = String(object.amount); + } + else { + message.amount = ""; + } + return message; + }, + toJSON(message) { + const obj = {}; + message.denom !== undefined && (obj.denom = message.denom); + message.amount !== undefined && (obj.amount = message.amount); + return obj; + }, + fromPartial(object) { + const message = Object.assign({}, baseCoin); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + else { + message.denom = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + else { + message.amount = ""; + } + return message; + }, +}; +const baseMsgSwapExactAmountIn = { sender: "", tokenOutMinAmount: "" }; +export const MsgSwapExactAmountIn = { + encode(message, writer = _m0.Writer.create()) { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + for (const v of message.routes) { + SwapAmountInRoute.encode(v, writer.uint32(18).fork()).ldelim(); + } + if (message.tokenIn !== undefined) { + Coin.encode(message.tokenIn, writer.uint32(26).fork()).ldelim(); + } + if (message.tokenOutMinAmount !== "") { + writer.uint32(34).string(message.tokenOutMinAmount); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = Object.assign({}, baseMsgSwapExactAmountIn); + message.routes = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.routes.push(SwapAmountInRoute.decode(reader, reader.uint32())); + break; + case 3: + message.tokenIn = Coin.decode(reader, reader.uint32()); + break; + case 4: + message.tokenOutMinAmount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object) { + const message = Object.assign({}, baseMsgSwapExactAmountIn); + message.routes = []; + if (object.sender !== undefined && object.sender !== null) { + message.sender = String(object.sender); + } + else { + message.sender = ""; + } + if (object.routes !== undefined && object.routes !== null) { + for (const e of object.routes) { + message.routes.push(SwapAmountInRoute.fromJSON(e)); + } + } + if (object.tokenIn !== undefined && object.tokenIn !== null) { + message.tokenIn = Coin.fromJSON(object.tokenIn); + } + else { + message.tokenIn = undefined; + } + if (object.tokenOutMinAmount !== undefined && + object.tokenOutMinAmount !== null) { + message.tokenOutMinAmount = String(object.tokenOutMinAmount); + } + else { + message.tokenOutMinAmount = ""; + } + return message; + }, + toJSON(message) { + const obj = {}; + message.sender !== undefined && (obj.sender = message.sender); + if (message.routes) { + obj.routes = message.routes.map((e) => e ? SwapAmountInRoute.toJSON(e) : undefined); + } + else { + obj.routes = []; + } + message.tokenIn !== undefined && + (obj.tokenIn = message.tokenIn + ? Coin.toJSON(message.tokenIn) + : undefined); + message.tokenOutMinAmount !== undefined && + (obj.tokenOutMinAmount = message.tokenOutMinAmount); + return obj; + }, + fromPartial(object) { + const message = Object.assign({}, baseMsgSwapExactAmountIn); + message.routes = []; + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + else { + message.sender = ""; + } + if (object.routes !== undefined && object.routes !== null) { + for (const e of object.routes) { + message.routes.push(SwapAmountInRoute.fromPartial(e)); + } + } + if (object.tokenIn !== undefined && object.tokenIn !== null) { + message.tokenIn = Coin.fromPartial(object.tokenIn); + } + else { + message.tokenIn = undefined; + } + if (object.tokenOutMinAmount !== undefined && + object.tokenOutMinAmount !== null) { + message.tokenOutMinAmount = object.tokenOutMinAmount; + } + else { + message.tokenOutMinAmount = ""; + } + return message; + }, +}; +if (_m0.util.Long !== Long) { + _m0.util.Long = Long; + _m0.configure(); +} \ No newline at end of file diff --git a/src/views/OsmosisTrade.vue b/src/views/OsmosisTrade.vue index 843197f9..6b16436b 100644 --- a/src/views/OsmosisTrade.vue +++ b/src/views/OsmosisTrade.vue @@ -246,7 +246,7 @@ export default { } }) }).catch(e => { - this.error = `This feature is not avalable in your country. 这个功能尚未对你的国家开放。${e}` + this.error = `This feature is not avalable in your country. \n这个功能尚未对你的国家开放。${e}` }) }, }, diff --git a/src/views/components/KlineTrade/DepositeWindow.vue b/src/views/components/KlineTrade/DepositeWindow.vue index 62084d3d..e166279c 100644 --- a/src/views/components/KlineTrade/DepositeWindow.vue +++ b/src/views/components/KlineTrade/DepositeWindow.vue @@ -244,6 +244,7 @@ import { import ToastificationContent from '@core/components/toastification/ToastificationContent.vue' import { coin } from '@cosmjs/amino' import { getChainConfigForSymbol } from '@/libs/osmos' +import dayjs from 'dayjs' export default { name: 'TransforDialogue', @@ -412,6 +413,7 @@ export default { this.error = 'You have to select a destination' return } + const timeout = dayjs().add(4, 'hour') const txMsgs = [ { typeUrl: '/ibc.applications.transfer.v1.MsgTransfer', @@ -421,10 +423,28 @@ export default { token: coin(Number(getUnitAmount(this.amount, this.denomTrace.base_denom)), this.denomTrace.base_denom), sender: this.address, receiver: this.recipient, - timeoutHeight: this.timeoutHeight, - // timeoutTimestamp: '0', + // timeoutHeight: { + // revisionNumber: '0', + // revisionHeight: '0', + // }, + timeoutTimestamp: String(timeout.utc().valueOf() * 1000000), }, }, + // { + // type: 'cosmos-sdk/MsgTransfer', + // value: { + // source_port: this.destination.port_id, + // source_channel: this.destination.channel_id, + // token: coin(Number(getUnitAmount(this.amount, this.denomTrace.base_denom)), this.denomTrace.base_denom), + // sender: this.address, + // receiver: this.recipient, + // timeout_height: { + // revision_number: String(this.timeoutHeight.revision_number), + // revision_height: String(200 + parseInt(this.timeoutHeight.revision_height, 10)), + // }, + // timeout_timestamp: '0', + // }, + // }, ] const txFee = { @@ -443,8 +463,6 @@ export default { chainId: this.chainId, } - console.log(txMsgs, signerData, txFee) - sign( this.wallet, this.chainId, diff --git a/src/views/components/KlineTrade/PlaceForm.vue b/src/views/components/KlineTrade/PlaceForm.vue index d869658a..b87586ac 100644 --- a/src/views/components/KlineTrade/PlaceForm.vue +++ b/src/views/components/KlineTrade/PlaceForm.vue @@ -10,7 +10,7 @@ {{ available }} {{ type === 0 ? target: base }} @@ -192,13 +192,17 @@
Note
- If the execution price exceeds the {{ slippage * 100 }}% slippage protection, your order will be automatically cancelled + Trading is not available. will open soon. +
+ If the execution price exceeds the {{ slippage * 100 }}% slippage protection, your order will be automatically cancelled +
@@ -214,9 +218,9 @@ import { BFormInput, BButton, BAlert, BFormGroup, BInputGroup, BInputGroupAppend, BFormRadio, BFormRadioGroup, BCard, BPopover, } from 'bootstrap-vue' -import FeatherIcon from '@/@core/components/feather-icon/FeatherIcon.vue' +import FeatherIcon from '@core/components/feather-icon/FeatherIcon.vue' import { - formatTokenAmount, getLocalAccounts, percent, sign, + formatTokenAmount, getLocalAccounts, percent, setLocalTxHistory, sign, } from '@/libs/data' import { getPairName } from '@/libs/osmos' import ToastificationContent from '@core/components/toastification/ToastificationContent.vue' @@ -355,7 +359,7 @@ export default { const { denom } = this.pool.poolAssets[this.type === 0 ? 1 : 0].token const txMsgs = [ { - type: 'osmosis/gamm/swap-exact-amount-in', + type: '/osmosis.gamm.v1beta1.MsgSwapExactAmountIn', value: { sender: this.address, routes: [ @@ -400,8 +404,6 @@ export default { chainId: this.chainId, } - console.log('trade: ', this.wallet, this.chainId, this.address, txMsgs, txFee, signerData) - sign( this.wallet, this.chainId, @@ -411,20 +413,19 @@ export default { 'Sent Via https://ping.pub', signerData, ).then(bodyBytes => { - console.log('signed:', bodyBytes) - // this.$http.broadcastTx(bodyBytes).then(res => { - // setLocalTxHistory({ op: 'swap', hash: res.tx_response.txhash, time: new Date() }) - // this.$toast({ - // component: ToastificationContent, - // props: { - // title: 'Transaction sent!', - // icon: 'EditIcon', - // variant: 'success', - // }, - // }) - // }).catch(e => { - // this.error = e - // }) + this.$http.broadcastTx(bodyBytes).then(res => { + setLocalTxHistory({ op: 'swap', hash: res.tx_response.txhash, time: new Date() }) + this.$toast({ + component: ToastificationContent, + props: { + title: 'Transaction sent!', + icon: 'EditIcon', + variant: 'success', + }, + }) + }).catch(e => { + this.error = e + }) }).catch(e => { this.error = e this.dismissCountDown = this.dismissSecs diff --git a/yarn.lock b/yarn.lock index 313d4ae7..0c086f3f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -251,7 +251,7 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.14.5", "@babel/parser@^7.14.6", "@babel/parser@^7.14.7", "@babel/parser@^7.7.0": +"@babel/parser@^7.14.5", "@babel/parser@^7.14.6", "@babel/parser@^7.14.7", "@babel/parser@^7.7.0", "@babel/parser@^7.9.4": version "7.14.7" resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.14.7.tgz" integrity sha512-X67Z5y+VBJuHB/RjwECp8kSl5uYi0BvRbNeWqkaJCVh+LiTPl19WBUfG627psSgp9rSf6ojuXghQM3ha6qHHdA== @@ -864,20 +864,13 @@ "@babel/types" "^7.4.4" esutils "^2.0.2" -"@babel/runtime@^7.11.0", "@babel/runtime@^7.11.2", "@babel/runtime@^7.8.4": +"@babel/runtime@^7.11.0", "@babel/runtime@^7.11.2", "@babel/runtime@^7.13.10", "@babel/runtime@^7.8.4": version "7.14.6" resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.14.6.tgz" integrity sha512-/PCB2uJ7oM44tz8YhC4Z/6PeOKXp4K588f+5M3clr1M4zbqztlo0XEfJ2LEzj/FgwfgGcIdl8n7YYjTCI0BYwg== dependencies: regenerator-runtime "^0.13.4" -"@babel/runtime@^7.13.10": - version "7.16.3" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.16.3.tgz#b86f0db02a04187a3c17caa77de69840165d42d5" - integrity sha512-WBwekcqacdY2e9AF/Q7WLFUWmdJGJTkbjqTjoMDgXkVZ3ZRUvOPsLb5KdwISoQVsbP+DQzVZW4Zhci0DvpbNTQ== - dependencies: - regenerator-runtime "^0.13.4" - "@babel/template@^7.0.0", "@babel/template@^7.14.5": version "7.14.5" resolved "https://registry.npmjs.org/@babel/template/-/template-7.14.5.tgz" @@ -932,34 +925,24 @@ ripemd160 "^2.0.2" sha.js "^2.4.11" -"@cosmjs/amino@0.26.0": - version "0.26.0" - resolved "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.26.0.tgz" - integrity sha512-CDGCdGYsxrJxhiI57e7no25LPuzKQOe4DdsJQyLrOzAnFnGHYJvPh0NAX4eEh3dOfwJCwMNnA1w79JNm0lzhOA== +"@cosmjs/amino@0.26.5", "@cosmjs/amino@^0.26.5": + version "0.26.5" + resolved "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.26.5.tgz" + integrity sha512-RFf9P1eb7O60JEWaZ5jbQA0wVbwU4SiBJINEjZkhkB1vUrAxCkfSHBZdJrVg8+IIRSWxPUUVr8PMuIyWlORV3A== dependencies: - "@cosmjs/crypto" "0.26.0" - "@cosmjs/encoding" "0.26.0" - "@cosmjs/math" "0.26.0" - "@cosmjs/utils" "0.26.0" + "@cosmjs/crypto" "0.26.5" + "@cosmjs/encoding" "0.26.5" + "@cosmjs/math" "0.26.5" + "@cosmjs/utils" "0.26.5" -"@cosmjs/amino@0.26.1", "@cosmjs/amino@^0.26.0": - version "0.26.1" - resolved "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.26.1.tgz" - integrity sha512-8jcEwsLrLW2ltJdNQzdbx+g6Ii9lgG3j7hqaSatnqJE+8OyUjjLH1beigrpz9PhRF3qzQS8WFweTNkkTgNEcSA== +"@cosmjs/crypto@0.26.5", "@cosmjs/crypto@^0.26.5": + version "0.26.5" + resolved "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.26.5.tgz" + integrity sha512-ab7+qR/gdRi/DIdOLrjyimRdyD/2K/JdpRaFY1bl6Drr3ktVjDQrGsv53THvHONy33yCwD+YS+328ayQRv/pQA== dependencies: - "@cosmjs/crypto" "0.26.1" - "@cosmjs/encoding" "0.26.1" - "@cosmjs/math" "0.26.1" - "@cosmjs/utils" "0.26.1" - -"@cosmjs/crypto@0.26.0": - version "0.26.0" - resolved "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.26.0.tgz" - integrity sha512-/36R7BzBNag1QRA2tpOrnr7x02B/YuaCgXKmKGLNd1+62Ud6aKkORyZMDvEt65SKoLhbDUzvNpSHAUjMsUbDfg== - dependencies: - "@cosmjs/encoding" "0.26.0" - "@cosmjs/math" "0.26.0" - "@cosmjs/utils" "0.26.0" + "@cosmjs/encoding" "0.26.5" + "@cosmjs/math" "0.26.5" + "@cosmjs/utils" "0.26.5" bip39 "^3.0.2" bn.js "^4.11.8" elliptic "^6.5.3" @@ -968,171 +951,122 @@ ripemd160 "^2.0.2" sha.js "^2.4.11" -"@cosmjs/crypto@0.26.1", "@cosmjs/crypto@^0.26.0": - version "0.26.1" - resolved "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.26.1.tgz" - integrity sha512-KzX++HMvCYjekdYr6vRRfJmAzJvdB10nRSyudzirn4/055yKh9oKk/wgjq9QGOIrMzEZNoQJNE0RndbS3nRccA== - dependencies: - "@cosmjs/encoding" "0.26.1" - "@cosmjs/math" "0.26.1" - "@cosmjs/utils" "0.26.1" - bip39 "^3.0.2" - bn.js "^4.11.8" - elliptic "^6.5.3" - js-sha3 "^0.8.0" - libsodium-wrappers "^0.7.6" - ripemd160 "^2.0.2" - sha.js "^2.4.11" - -"@cosmjs/encoding@0.26.0": - version "0.26.0" - resolved "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.26.0.tgz" - integrity sha512-ctw6cBDsQSd0OJFWEwU6fJYrAXf63JNhOS3mjawo/hRyEFpVSBSEKEHvfICPc+4dT40v9L3eYEr8LXDYxat4AA== +"@cosmjs/encoding@0.26.5", "@cosmjs/encoding@^0.26.5": + version "0.26.5" + resolved "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.26.5.tgz" + integrity sha512-lkw2mLvDZJqVCOZCBqdMzoGUtC4CN7c4+WMCGKDej3TpC0khsv7KZ1eFcsnN6EuZwHyGH67uyyjrs5x0ah9rYg== dependencies: base64-js "^1.3.0" bech32 "^1.1.4" readonly-date "^1.0.0" -"@cosmjs/encoding@0.26.1", "@cosmjs/encoding@^0.26.0": - version "0.26.1" - resolved "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.26.1.tgz" - integrity sha512-wDFRvSQrTVIX7k4dPPSS/NmaytTU8ludDXi06TsaqVrgL/OR1hcGEkHhoKjodhZ2NS4gLvncI8XagV3SFySGhA== +"@cosmjs/json-rpc@0.26.5": + version "0.26.5" + resolved "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.26.5.tgz" + integrity sha512-SFGm5MlY54v3I26hXThwVteh91U+/DKS+KGqFL5lPLHZ2EHxggASqhKMiTJBMJVUDWvnmv1ikjFndkWNhpTPNw== dependencies: - base64-js "^1.3.0" - bech32 "^1.1.4" - readonly-date "^1.0.0" - -"@cosmjs/json-rpc@0.26.0": - version "0.26.0" - resolved "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.26.0.tgz" - integrity sha512-Jc+O0fDZjb8bxKSwH8SG9lJxV/y6lN4bYhiUqHNU6AUDUD9wzVr1mPgMudCJQ1DkQrgz8dQg2cDwgFp6eN428g== - dependencies: - "@cosmjs/stream" "0.26.0" + "@cosmjs/stream" "0.26.5" xstream "^11.14.0" -"@cosmjs/launchpad@^0.26.0": - version "0.26.1" - resolved "https://registry.npmjs.org/@cosmjs/launchpad/-/launchpad-0.26.1.tgz" - integrity sha512-RCwBRbIBAJa3AsjLTjGHHUWmq1eIoAIinQLz0BJ1FF9FI1WuAjlwr/m9KRGhoNZvMeEzAtQvxNFxFzL+BOotEQ== +"@cosmjs/launchpad@^0.26.5": + version "0.26.5" + resolved "https://registry.npmjs.org/@cosmjs/launchpad/-/launchpad-0.26.5.tgz" + integrity sha512-V+9bLlvlybm9TeqXAoD10KxFHK5exoUYHIoKdj03g78E2oOn82bLRMNs9ti5UtWWOzIe9suyv5/OvunTSlvA7Q== dependencies: - "@cosmjs/amino" "0.26.1" - "@cosmjs/crypto" "0.26.1" - "@cosmjs/encoding" "0.26.1" - "@cosmjs/math" "0.26.1" - "@cosmjs/utils" "0.26.1" + "@cosmjs/amino" "0.26.5" + "@cosmjs/crypto" "0.26.5" + "@cosmjs/encoding" "0.26.5" + "@cosmjs/math" "0.26.5" + "@cosmjs/utils" "0.26.5" axios "^0.21.2" fast-deep-equal "^3.1.3" -"@cosmjs/ledger-amino@^0.26.0": - version "0.26.1" - resolved "https://registry.npmjs.org/@cosmjs/ledger-amino/-/ledger-amino-0.26.1.tgz" - integrity sha512-A0hnujAhezAkIAc+NCQurN8si16Ub211AVTZvO6xQXCk8/3XRkub7YAvctxyQfM9fOb/a2mGGPGk6dne51tpBA== +"@cosmjs/ledger-amino@^0.26.5": + version "0.26.5" + resolved "https://registry.npmjs.org/@cosmjs/ledger-amino/-/ledger-amino-0.26.5.tgz" + integrity sha512-UY3OsohGamLXp1P3M7hIW/Wk7Jj04xfFipyw+n4JQ0KSFrniju5idM89kqLELTimXptdI15TaivfHb4MJqfh7g== dependencies: - "@cosmjs/amino" "0.26.1" - "@cosmjs/crypto" "0.26.1" - "@cosmjs/encoding" "0.26.1" - "@cosmjs/math" "0.26.1" - "@cosmjs/utils" "0.26.1" + "@cosmjs/amino" "0.26.5" + "@cosmjs/crypto" "0.26.5" + "@cosmjs/encoding" "0.26.5" + "@cosmjs/math" "0.26.5" + "@cosmjs/utils" "0.26.5" ledger-cosmos-js "^2.1.8" semver "^7.3.2" -"@cosmjs/math@0.26.0": - version "0.26.0" - resolved "https://registry.npmjs.org/@cosmjs/math/-/math-0.26.0.tgz" - integrity sha512-wfzdK/PnEnIA+CXM6VCyUr2daiEMvaF/iBaK3YCpkbXLfHUXQB+7bNh1HAHgJmp+PaYn3MhgBTnQbsmMsE3cKw== +"@cosmjs/math@0.26.5", "@cosmjs/math@^0.26.5": + version "0.26.5" + resolved "https://registry.npmjs.org/@cosmjs/math/-/math-0.26.5.tgz" + integrity sha512-1G7NgLJ35g4jUupvyu7Igtgu/fj2NmgpOofpNk1JqIwMXrm3Tx7lOWbxJq8Wrjj2EoH7FNytSO1dXNGeK15UJw== dependencies: bn.js "^4.11.8" -"@cosmjs/math@0.26.1", "@cosmjs/math@^0.26.0": - version "0.26.1" - resolved "https://registry.npmjs.org/@cosmjs/math/-/math-0.26.1.tgz" - integrity sha512-FvCpguKswL2PYsONXHDzbcaq1gFQteFUz2w7DasVXvVlnzStDS8ePz8k36psNQ1efyX6oF62ZqMizxOZgCW33A== +"@cosmjs/proto-signing@0.26.5", "@cosmjs/proto-signing@^0.26.5": + version "0.26.5" + resolved "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.26.5.tgz" + integrity sha512-F94Uh+PX9nF5zGzUHMdEGgys+YCOudaWQehiHBfOjbHUIv0khufcRXs3l9/5dKzizz9ouQ5DHQAiWq/nYKZKqA== dependencies: - bn.js "^4.11.8" - -"@cosmjs/proto-signing@0.26.0": - version "0.26.0" - resolved "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.26.0.tgz" - integrity sha512-hNiebrGiDCf3tq6SMHtrf4Qhd8Fn4Z868mWJrbIxamR3EsGuAPb5fKFWYEmpS8IXDfD6qRkO845oMAfnmh5Oxg== - dependencies: - "@cosmjs/amino" "0.26.0" - "@cosmjs/crypto" "0.26.0" - "@cosmjs/math" "0.26.0" + "@cosmjs/amino" "0.26.5" + "@cosmjs/crypto" "0.26.5" + "@cosmjs/math" "0.26.5" cosmjs-types "^0.2.0" long "^4.0.0" protobufjs "~6.10.2" -"@cosmjs/proto-signing@^0.26.0": - version "0.26.1" - resolved "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.26.1.tgz" - integrity sha512-R6vHulxH5njTru9Ezr8k5+u6fBzenNRE3EbQtbVreL++TLV/jKu0Vl2CFz89X8su7BqWZImqzE9+BAesLUKVfw== +"@cosmjs/socket@0.26.5": + version "0.26.5" + resolved "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.26.5.tgz" + integrity sha512-kBpXw9wuNHkO1AGuKgDA4/DOA+jZ6Lt0GVJVJIJ6bfjGbsewsNVocktAiH+1dGb47xXg2oH7OwGJL+B/PB3qPQ== dependencies: - "@cosmjs/amino" "0.26.1" - "@cosmjs/crypto" "0.26.1" - "@cosmjs/math" "0.26.1" - cosmjs-types "^0.2.0" - long "^4.0.0" - protobufjs "~6.10.2" - -"@cosmjs/socket@0.26.0": - version "0.26.0" - resolved "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.26.0.tgz" - integrity sha512-eLGRWDpu7ywHEAvO5B5+75pP8xT5yta4OP/nvMYa4zMtwQgLxZQsGlzQhfeIclB/G57zrupgHECtQFGIttbZPg== - dependencies: - "@cosmjs/stream" "0.26.0" + "@cosmjs/stream" "0.26.5" isomorphic-ws "^4.0.1" ws "^7" xstream "^11.14.0" -"@cosmjs/stargate@0.26.0": - version "0.26.0" - resolved "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.26.0.tgz" - integrity sha512-+60Mbu5Y3x+vDRGfs9DgyQYx7QqKXQ7t4dH8Y0JIs+4Gn38WbrcAHaqcT58K/sQHSZPueRsBGkZTZdQkJII2zw== +"@cosmjs/stargate@0.26.5": + version "0.26.5" + resolved "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.26.5.tgz" + integrity sha512-rnRptbn01zXAa29272XZgxvH6zemPAvlE9/qGouRXpUm3ilHU+PscAq2k1pD17qtOKWRBLY2+x4feXYHwJg9VA== dependencies: "@confio/ics23" "^0.6.3" - "@cosmjs/amino" "0.26.0" - "@cosmjs/encoding" "0.26.0" - "@cosmjs/math" "0.26.0" - "@cosmjs/proto-signing" "0.26.0" - "@cosmjs/stream" "0.26.0" - "@cosmjs/tendermint-rpc" "0.26.0" - "@cosmjs/utils" "0.26.0" + "@cosmjs/amino" "0.26.5" + "@cosmjs/encoding" "0.26.5" + "@cosmjs/math" "0.26.5" + "@cosmjs/proto-signing" "0.26.5" + "@cosmjs/stream" "0.26.5" + "@cosmjs/tendermint-rpc" "0.26.5" + "@cosmjs/utils" "0.26.5" cosmjs-types "^0.2.0" long "^4.0.0" protobufjs "~6.10.2" xstream "^11.14.0" -"@cosmjs/stream@0.26.0": - version "0.26.0" - resolved "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.26.0.tgz" - integrity sha512-TaB8aXj5vskllj39fFTlsJviqm+bZjrV6JzBneJMjV0ltuXEaocKo4x+EOe68ZLjF6+lK4XUu1g2rP1iAPdmAQ== +"@cosmjs/stream@0.26.5": + version "0.26.5" + resolved "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.26.5.tgz" + integrity sha512-CIr/8bkRlLl36LAtbapsKxA7cMVhmPPWTihAcXgBXik1FM/0XCVNETPTQ64HX47eNQuP5AhWwaMoO553Sf9T2w== dependencies: xstream "^11.14.0" -"@cosmjs/tendermint-rpc@0.26.0": - version "0.26.0" - resolved "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.26.0.tgz" - integrity sha512-PQbDLerUGAm8GwRiobVfdy7SM5nI9PzFQVDYOAnwwDME0kDsLGy83e7QNTG2DE1G+8861z9CXne5qz+54NbKwQ== +"@cosmjs/tendermint-rpc@0.26.5": + version "0.26.5" + resolved "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.26.5.tgz" + integrity sha512-bBcFgpTHEP15m8n/bG3cx/LO110sScpEvYvurZDewfy7MW8WETF6sYZaPCGfVDGWde1EPjFLwKKxQ1Da/XoK0A== dependencies: - "@cosmjs/crypto" "0.26.0" - "@cosmjs/encoding" "0.26.0" - "@cosmjs/json-rpc" "0.26.0" - "@cosmjs/math" "0.26.0" - "@cosmjs/socket" "0.26.0" - "@cosmjs/stream" "0.26.0" - axios "^0.21.1" + "@cosmjs/crypto" "0.26.5" + "@cosmjs/encoding" "0.26.5" + "@cosmjs/json-rpc" "0.26.5" + "@cosmjs/math" "0.26.5" + "@cosmjs/socket" "0.26.5" + "@cosmjs/stream" "0.26.5" + axios "^0.21.2" readonly-date "^1.0.0" xstream "^11.14.0" -"@cosmjs/utils@0.26.0": - version "0.26.0" - resolved "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.26.0.tgz" - integrity sha512-InTQ3P1noUR0U5zJs8ssqnToIGH2NKbFb+hS5wmYGLB0XRdlNk0UGcb9pjbAzaWRQPWxTd08YQvXg6IK/WE4fA== - -"@cosmjs/utils@0.26.1": - version "0.26.1" - resolved "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.26.1.tgz" - integrity sha512-E7sYhHfcq2V4oB504FNSt8nx6QInTea1KZT5FrtyqONmgQwccfTv5+E2PuRbQs91i56YzHORHuP57rhV7NPn3g== +"@cosmjs/utils@0.26.5": + version "0.26.5" + resolved "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.26.5.tgz" + integrity sha512-VB4Z7lEIXA36q0RON15KexzEosToUtdDyMv7UXSBHSl4mLG/fIZgBIpBEYsaPZ1kh43xyINeKQJiGCp2z5rI+g== "@cosmostation/cosmosjs@^0.10.6": version "0.10.8" @@ -1627,7 +1561,7 @@ dependencies: "@types/node" "*" -"@types/long@^4.0.1": +"@types/long@^4.0.0", "@types/long@^4.0.1": version "4.0.1" resolved "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz" integrity sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w== @@ -1662,6 +1596,11 @@ resolved "https://registry.npmjs.org/@types/node/-/node-11.11.6.tgz" integrity sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ== +"@types/node@^10.1.0": + version "10.17.60" + resolved "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz" + integrity sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw== + "@types/node@^13.7.0": version "13.13.52" resolved "https://registry.npmjs.org/@types/node/-/node-13.13.52.tgz" @@ -2013,9 +1952,9 @@ prettier "^1.18.2" "@vue/composition-api@^1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@vue/composition-api/-/composition-api-1.4.0.tgz#784450d0da1ecfd82f4094053ca593849cbd2e37" - integrity sha512-fanqJw1cqhkfS1dcpFY52CeR0aWDBr7ub/0ObPWqMnNPdRsMi1gX04Q3aLeRtJEuVeCFewNbqvkPskkSPTVaXQ== + version "1.4.1" + resolved "https://registry.npmjs.org/@vue/composition-api/-/composition-api-1.4.1.tgz" + integrity sha512-ZTat9ru/rwecveRnFzlO2mduOBpGfnBdXn+WtBcFLV9UsL/D+6nX47RWuLiVdNxNDX0qphGZRC+JDjwt+YTnRA== dependencies: tslib "^2.3.1" @@ -2224,6 +2163,13 @@ accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.7: mime-types "~2.1.24" negotiator "0.6.2" +acorn-jsx@^3.0.0: + version "3.0.1" + resolved "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz" + integrity sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s= + dependencies: + acorn "^3.0.4" + acorn-jsx@^5.2.0, acorn-jsx@^5.3.1: version "5.3.2" resolved "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz" @@ -2234,6 +2180,16 @@ acorn-walk@^7.1.1: resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz" integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== +acorn@^3.0.4: + version "3.3.0" + resolved "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz" + integrity sha1-ReN/s56No/JbruP/U2niu18iAXo= + +acorn@^5.5.0: + version "5.7.4" + resolved "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz" + integrity sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg== + acorn@^6.4.1: version "6.4.2" resolved "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz" @@ -2491,7 +2447,7 @@ array.prototype.flat@^1.2.4: arrayslicer@^1.2.3: version "1.2.3" - resolved "https://registry.yarnpkg.com/arrayslicer/-/arrayslicer-1.2.3.tgz#21a4903102a9aba7d8a73c44bf57f3e28c560136" + resolved "https://registry.npmjs.org/arrayslicer/-/arrayslicer-1.2.3.tgz" integrity sha1-IaSQMQKpq6fYpzxEv1fz4oxWATY= asn1.js@^5.2.0: @@ -2592,7 +2548,7 @@ axios-mock-adapter@1.19.0: fast-deep-equal "^3.1.3" is-buffer "^2.0.3" -axios@0.21.1, axios@^0.21.1: +axios@0.21.1: version "0.21.1" resolved "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz" integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA== @@ -2897,7 +2853,7 @@ bl@^4.0.3, bl@^4.1.0: inherits "^2.0.4" readable-stream "^3.4.0" -bluebird@^3.1.1, bluebird@^3.5.5: +bluebird@^3.1.1, bluebird@^3.5.5, bluebird@^3.7.2: version "3.7.2" resolved "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== @@ -3364,6 +3320,13 @@ caseless@~0.12.0: resolved "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= +catharsis@^0.9.0: + version "0.9.0" + resolved "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz" + integrity sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A== + dependencies: + lodash "^4.17.15" + caw@^2.0.0, caw@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/caw/-/caw-2.0.1.tgz" @@ -4775,6 +4738,11 @@ entities@^2.0.0: resolved "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz" integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A== +entities@~2.0.0: + version "2.0.3" + resolved "https://registry.npmjs.org/entities/-/entities-2.0.3.tgz" + integrity sha512-MyoZ0jgnLvB2X3Lg5HqpFmn1kybDiIfEQmKzTb5apr51Rb+T3KdmMiqa70T+bhGnyv7bQ6WMj2QMHpGMmlrUYQ== + errno@^0.1.3, errno@~0.1.7: version "0.1.8" resolved "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz" @@ -4847,6 +4815,23 @@ escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= +escape-string-regexp@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz" + integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== + +escodegen@^1.9.1: + version "1.14.3" + resolved "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz" + integrity sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw== + dependencies: + esprima "^4.0.1" + estraverse "^4.2.0" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.6.1" + eslint-config-airbnb-base@^14.0.0: version "14.2.1" resolved "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.1.tgz" @@ -5018,6 +5003,14 @@ eslint@6.8.0: text-table "^0.2.0" v8-compile-cache "^2.0.3" +espree@^3.5.4: + version "3.5.4" + resolved "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz" + integrity sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A== + dependencies: + acorn "^5.5.0" + acorn-jsx "^3.0.0" + "espree@^6.0.0 || ^7.2.0": version "7.3.1" resolved "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz" @@ -5036,7 +5029,7 @@ espree@^6.1.2, espree@^6.2.1: acorn-jsx "^5.2.0" eslint-visitor-keys "^1.1.0" -esprima@^4.0.0: +esprima@^4.0.0, esprima@^4.0.1: version "4.0.1" resolved "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== @@ -5055,7 +5048,7 @@ esrecurse@^4.1.0, esrecurse@^4.3.0: dependencies: estraverse "^5.2.0" -estraverse@^4.1.1: +estraverse@^4.1.1, estraverse@^4.2.0: version "4.3.0" resolved "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz" integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== @@ -5982,7 +5975,7 @@ got@^9.6.0: to-readable-stream "^1.0.0" url-parse-lax "^3.0.0" -graceful-fs@^4.1.10, graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.6: +graceful-fs@^4.1.10, graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0, graceful-fs@^4.2.6: version "4.2.6" resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz" integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ== @@ -5997,12 +5990,12 @@ gzip-size@^5.0.0: hammerjs@^2.0.8: version "2.0.8" - resolved "https://registry.yarnpkg.com/hammerjs/-/hammerjs-2.0.8.tgz#04ef77862cff2bb79d30f7692095930222bf60f1" + resolved "https://registry.npmjs.org/hammerjs/-/hammerjs-2.0.8.tgz" integrity sha1-BO93hiz/K7edMPdpIJWTAiK/YPE= hamsterjs@^1.1.3: version "1.1.3" - resolved "https://registry.yarnpkg.com/hamsterjs/-/hamsterjs-1.1.3.tgz#4adc6b9100a3fcc7c65fc391debb249901a50df6" + resolved "https://registry.npmjs.org/hamsterjs/-/hamsterjs-1.1.3.tgz" integrity sha512-q4XBr7hnxx1WyZA8mpVDuZVa1YXaR0WZaFSBxnj8hUXltuqXJOt5yuWYkAbMXsj+q0REDUO990+/TuxEadXFyg== handle-thing@^2.0.0: @@ -7076,11 +7069,38 @@ js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" +js2xmlparser@^4.0.1: + version "4.0.2" + resolved "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.2.tgz" + integrity sha512-6n4D8gLlLf1n5mNLQPRfViYzu9RATblzPEtm1SthMX1Pjao0r9YI9nw7ZIfRxQMERS87mcswrg+r/OYrPRX6jA== + dependencies: + xmlcreate "^2.0.4" + jsbn@~0.1.0: version "0.1.1" resolved "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz" integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= +jsdoc@^3.4.2: + version "3.6.7" + resolved "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.7.tgz" + integrity sha512-sxKt7h0vzCd+3Y81Ey2qinupL6DpRSZJclS04ugHDNmRUXGzqicMJ6iwayhSA0S0DwwX30c5ozyUthr1QKF6uw== + dependencies: + "@babel/parser" "^7.9.4" + bluebird "^3.7.2" + catharsis "^0.9.0" + escape-string-regexp "^2.0.0" + js2xmlparser "^4.0.1" + klaw "^3.0.0" + markdown-it "^10.0.0" + markdown-it-anchor "^5.2.7" + marked "^2.0.3" + mkdirp "^1.0.4" + requizzle "^0.2.3" + strip-json-comments "^3.1.0" + taffydb "2.6.2" + underscore "~1.13.1" + jsesc@^2.5.1: version "2.5.2" resolved "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz" @@ -7251,6 +7271,13 @@ kind-of@^6.0.0, kind-of@^6.0.2: resolved "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== +klaw@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz" + integrity sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g== + dependencies: + graceful-fs "^4.1.9" + klona@^2.0.4: version "2.0.4" resolved "https://registry.npmjs.org/klona/-/klona-2.0.4.tgz" @@ -7318,6 +7345,13 @@ lines-and-columns@^1.1.6: resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz" integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= +linkify-it@^2.0.0: + version "2.2.0" + resolved "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz" + integrity sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw== + dependencies: + uc.micro "^1.0.1" + load-json-file@^1.0.0: version "1.1.0" resolved "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz" @@ -7550,7 +7584,7 @@ lru-cache@^6.0.0: lz-string@^1.4.4: version "1.4.4" - resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.4.4.tgz#c0d8eaf36059f705796e1e344811cf4c498d3a26" + resolved "https://registry.npmjs.org/lz-string/-/lz-string-1.4.4.tgz" integrity sha1-wNjq82BZ9wV5bh40SBHPTEmNOiY= make-dir@^1.0.0, make-dir@^1.2.0: @@ -7592,6 +7626,27 @@ map-visit@^1.0.0: dependencies: object-visit "^1.0.0" +markdown-it-anchor@^5.2.7: + version "5.3.0" + resolved "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-5.3.0.tgz" + integrity sha512-/V1MnLL/rgJ3jkMWo84UR+K+jF1cxNG1a+KwqeXqTIJ+jtA8aWSHuigx8lTzauiIjBDbwF3NcWQMotd0Dm39jA== + +markdown-it@^10.0.0: + version "10.0.0" + resolved "https://registry.npmjs.org/markdown-it/-/markdown-it-10.0.0.tgz" + integrity sha512-YWOP1j7UbDNz+TumYP1kpwnP0aEa711cJjrAQrzd0UXlbJfc5aAq0F/PZHjiioqDC1NKgvIMX+o+9Bk7yuM2dg== + dependencies: + argparse "^1.0.7" + entities "~2.0.0" + linkify-it "^2.0.0" + mdurl "^1.0.1" + uc.micro "^1.0.5" + +marked@^2.0.3: + version "2.1.3" + resolved "https://registry.npmjs.org/marked/-/marked-2.1.3.tgz" + integrity sha512-/Q+7MGzaETqifOMWYEA7HVMaZb4XbcRfaOzcSsHZEith83KGlvaSG33u0SKu89Mj5h+T8V2hM+8O45Qc5XTgwA== + md5.js@^1.3.4: version "1.3.5" resolved "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz" @@ -7611,6 +7666,11 @@ mdn-data@2.0.4: resolved "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.4.tgz" integrity sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA== +mdurl@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz" + integrity sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4= + media-typer@0.3.0: version "0.3.0" resolved "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz" @@ -7847,6 +7907,11 @@ mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.5, mkdirp@~0.5.1: dependencies: minimist "^1.2.5" +mkdirp@^1.0.4: + version "1.0.4" + resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz" + integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== + moment@^2.10.2, moment@^2.29.1: version "2.29.1" resolved "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz" @@ -8302,7 +8367,7 @@ opn@^5.5.0: dependencies: is-wsl "^1.1.0" -optionator@^0.8.3: +optionator@^0.8.1, optionator@^0.8.3: version "0.8.3" resolved "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz" integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== @@ -8368,7 +8433,7 @@ os-filter-obj@^2.0.0: dependencies: arch "^2.1.0" -os-tmpdir@~1.0.2: +os-tmpdir@~1.0.1, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz" integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= @@ -9244,6 +9309,41 @@ proto-list@~1.2.1: resolved "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz" integrity sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk= +protobufjs-cli-dbx@^7.0.7: + version "7.0.7" + resolved "https://registry.npmjs.org/protobufjs-cli-dbx/-/protobufjs-cli-dbx-7.0.7.tgz" + integrity sha512-lP9nIEfV1fw1SjRBS5qpLEbBkImHHgtrYXzqX6s6Hn7hcuTDFwCXEy6Tzz4sAh4IgCKcjDT8ZK7AluerVHaGHQ== + dependencies: + chalk "^2.4.1" + escodegen "^1.9.1" + espree "^3.5.4" + estraverse "^4.2.0" + glob "^7.1.2" + jsdoc "^3.4.2" + minimist "^1.2.0" + semver "^5.5.0" + tmp "0.0.31" + uglify-js "^3.3.25" + +protobufjs-dbx@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/protobufjs-dbx/-/protobufjs-dbx-7.0.0.tgz" + integrity sha512-y4ECgn5J39e4RqlbyQhwJF72nLuyY9JhkhnfTRr03/bx0aonZ/VfDSxrXls8RxLup7Hk2rx/fandTmtYO6XGZQ== + dependencies: + "@protobufjs/aspromise" "^1.1.2" + "@protobufjs/base64" "^1.1.2" + "@protobufjs/codegen" "^2.0.4" + "@protobufjs/eventemitter" "^1.1.0" + "@protobufjs/fetch" "^1.1.0" + "@protobufjs/float" "^1.0.2" + "@protobufjs/inquire" "^1.1.0" + "@protobufjs/path" "^1.1.2" + "@protobufjs/pool" "^1.1.0" + "@protobufjs/utf8" "^1.1.0" + "@types/long" "^4.0.0" + "@types/node" "^10.1.0" + long "^4.0.0" + protobufjs@^6.10.2, protobufjs@^6.8.8, protobufjs@~6.10.2: version "6.10.2" resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-6.10.2.tgz" @@ -9743,6 +9843,13 @@ requires-port@^1.0.0: resolved "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz" integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= +requizzle@^0.2.3: + version "0.2.3" + resolved "https://registry.npmjs.org/requizzle/-/requizzle-0.2.3.tgz" + integrity sha512-YanoyJjykPxGHii0fZP0uUPEXpvqfBDxWV7s6GKAiiOsiqhX6vHNyW3Qzdmqp/iq/ExbhaGbVrjB4ruEVSM4GQ== + dependencies: + lodash "^4.17.14" + resize-detector@^0.1.10: version "0.1.10" resolved "https://registry.npmjs.org/resize-detector/-/resize-detector-0.1.10.tgz" @@ -10657,7 +10764,7 @@ strip-json-comments@^2.0.0, strip-json-comments@~2.0.1: resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz" integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= -strip-json-comments@^3.0.1: +strip-json-comments@^3.0.1, strip-json-comments@^3.1.0: version "3.1.1" resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== @@ -10819,6 +10926,11 @@ table@^5.2.3: slice-ansi "^2.1.0" string-width "^3.0.0" +taffydb@2.6.2: + version "2.6.2" + resolved "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz" + integrity sha1-fLy2S1oUG2ou/CxdLGe04VCyomg= + tapable@^0.1.8: version "0.1.10" resolved "https://registry.npmjs.org/tapable/-/tapable-0.1.10.tgz" @@ -10979,6 +11091,13 @@ tiny-secp256k1@^1.0.0, tiny-secp256k1@^1.1.3: elliptic "^6.4.0" nan "^2.13.2" +tmp@0.0.31: + version "0.0.31" + resolved "https://registry.npmjs.org/tmp/-/tmp-0.0.31.tgz" + integrity sha1-jzirlDjhcxXl29izZX6L+yd65Kc= + dependencies: + os-tmpdir "~1.0.1" + tmp@^0.0.33: version "0.0.33" resolved "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz" @@ -11066,7 +11185,7 @@ tough-cookie@~2.5.0: trading-vue-js@^1.0.2: version "1.0.2" - resolved "https://registry.yarnpkg.com/trading-vue-js/-/trading-vue-js-1.0.2.tgz#cdc29dda457a72db13123c0b21514ee8eae51c24" + resolved "https://registry.npmjs.org/trading-vue-js/-/trading-vue-js-1.0.2.tgz" integrity sha512-RObZR4OF5rtdgh/CyyRv0soPxlVlwHudlpAziOeQeOeId4j/2RcGUSp4/lKwzYo8b51tnAiRnMtDS+ZSmg208g== dependencies: "@babel/runtime" "^7.13.10" @@ -11115,7 +11234,7 @@ tslib@^1.9.0: tslib@^2.3.1: version "2.3.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01" + resolved "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz" integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== tty-browserify@0.0.0: @@ -11187,7 +11306,12 @@ typeforce@^1.11.3, typeforce@^1.11.5: resolved "https://registry.npmjs.org/typeforce/-/typeforce-1.18.0.tgz" integrity sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g== -uglify-js@3.4.x: +uc.micro@^1.0.1, uc.micro@^1.0.5: + version "1.0.6" + resolved "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz" + integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA== + +uglify-js@3.4.x, uglify-js@^3.3.25: version "3.4.10" resolved "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.10.tgz" integrity sha512-Y2VsbPVs0FIshJztycsO2SfPk7/KAF/T72qzv9u5EpQ4kB2hQoHlhNQTsNyy6ul7lQtqJN/AoWeS23OzEiEFxw== @@ -11213,6 +11337,11 @@ unbzip2-stream@^1.0.9: buffer "^5.2.1" through "^2.3.8" +underscore@~1.13.1: + version "1.13.1" + resolved "https://registry.npmjs.org/underscore/-/underscore-1.13.1.tgz" + integrity sha512-hzSoAVtJF+3ZtiFX0VgfFPHEDRm7Y/QPjGyNo4TVdnDTdft3tr8hEkD25a1jC+TjTuE7tkHGKkhwCgs9dgBB2g== + unicode-canonical-property-names-ecmascript@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz" @@ -12088,15 +12217,20 @@ ws@^6.0.0, ws@^6.2.1: async-limiter "~1.0.0" ws@^7: - version "7.5.5" - resolved "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz" - integrity sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w== + version "7.5.6" + resolved "https://registry.npmjs.org/ws/-/ws-7.5.6.tgz" + integrity sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA== xdg-basedir@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz" integrity sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q== +xmlcreate@^2.0.4: + version "2.0.4" + resolved "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.4.tgz" + integrity sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg== + xstream@^11.14.0: version "11.14.0" resolved "https://registry.npmjs.org/xstream/-/xstream-11.14.0.tgz"